Skip to content
Sign upLog in
Profile icon

Zakariya Khan

@donkeyhouse
Repls
Community
donkeyhouse
donkeyhouse
shared a Post
3 years ago
Can you get user input without needing to click enter in python?
I want to get user input(specifically float input) without needing to click enter. This is in python. Thx.
ArjunSS1
ArjunSS1
So in oython there is this module that reads the last key pressed from the python stdin import readchar key = readchar.readkey() Which will give the last key pressed3 years ago
KeaganLandfried
KeaganLandfried
Not using the basic python API in the console, which I assume you are using.3 years ago
donkeyhouse
donkeyhouse
shared a Post
3 years ago
Sorry if I sound stupid. I am very new to python and very bad. I just want to make a regular button that will do something if clicked. Like make a var
ChezCoder
ChezCoder
You do sound stupid and you are very bad. You can use tkinter, otherwise it's physically impossible. DUD. You can use HTML.3 years ago
Geocube101
Geocube101
You can use tkinter If you want to use tkinter in repl.it, you must also use the python with tkinter repl3 years ago
donkeyhouse
donkeyhouse
shared a Post
3 years ago
What I mean is like cookie clicker. When you click the cookie it's like a button and it adds one to your score. Also, is there a way to make it bounce
AlexanderTarn
AlexanderTarn
It depends on what you are using to make the image (turtle, tkinter, etc.) but the best way to do it is by first making the image, and then when the mouse is clicked over the result it will return the coordinates, if the coordinates are in the image then do whatever like cookie += 13 years ago
Nemoiscool
Nemoiscool
You can add a div with a background image inside the button, then give the button a style of no background color, no border, etc. However, this is not how I would do it. I would recommend skipping the button all together, just use a document.querySelector to get a div, which div has a background image. Then add a document.addEventListener("click",yourFunction()).3 years ago
donkeyhouse
donkeyhouse
shared a Post
3 years ago
I just want a history just in case I make a mistake or something.
SixBeeps
SixBeeps
Yup. image3 years ago