+ 1

Please can you tell me why that code isn't working ?🙏

https://code.sololearn.com/ccLMWJiOK4vB/?ref=app

10th Mar 2022, 11:23 PM
Programer F_K
Programer F_K - avatar
14 Answers
+ 2
Programer F_K Made an html game from your idea with HTML and javascript https://code.sololearn.com/WEmzSzcv4XEU/?ref=app
15th Mar 2022, 6:44 AM
Bob_Li
Bob_Li - avatar
+ 5
The sololearn playground does not support tkinter or other GUIs.
11th Mar 2022, 2:02 AM
Simon Sauter
Simon Sauter - avatar
+ 4
If you are on mobile, you can use pydroid app
11th Mar 2022, 3:30 AM
Sandeep
Sandeep - avatar
+ 3
Programer F_K maybe the reason for the error is the input line. We are taking a input in python but not passing any input because there is no option as only tkinter window is showing in pydroid. I tried replacing the c = input() at line 81 and line 92 with a string "hello", the program gives no error but it also doesn't work?
12th Mar 2022, 3:06 AM
Sandeep
Sandeep - avatar
+ 2
Yes. Not easier, but more versatile, and more portable. Have you ever tried making an exe out of a Python file?😅 But everybody uses a browser.
13th Mar 2022, 1:28 PM
Bob_Li
Bob_Li - avatar
+ 1
Sandeep I write it in pydroid but it doesn't work . It shows EOF :error when reading a line
11th Mar 2022, 1:22 PM
Programer F_K
Programer F_K - avatar
+ 1
Programer F_K In line 107, you are calling the exe_function in command argument. You need to specify the name of the function, it will automatically get called when clicked Instead of: > tkinter.Button(text='jouer', command=exe_function()).pack() Do: > tkinter.Button(text='jouer', command=exe_function).pack()
11th Mar 2022, 2:31 PM
Sandeep
Sandeep - avatar
+ 1
Sandeep I've corrected it but it still shows error when reading a line (about line 81) .
11th Mar 2022, 4:41 PM
Programer F_K
Programer F_K - avatar
+ 1
Sandeep maybe the reason is that the tkinter library doesn't work on pydroid . Anyway , thank you so much 🙏
12th Mar 2022, 6:58 AM
Programer F_K
Programer F_K - avatar
+ 1
Programer F_K Here is a simplifed version of what I think you are making. It was a good tkinter refresher course. Now I know why I decided to learn Html and javascript... Does not work in Sololearn since it is a tkinter code. But I tested it on Pydroid https://code.sololearn.com/cVpDR5fs0tZz/?ref=app
13th Mar 2022, 12:00 PM
Bob_Li
Bob_Li - avatar
+ 1
coding in tkinter requires a different mental model.. you have to think in terms of widgets, their properties and how to pass data into and out of them. The code is still very raw. Almost no error handling, terrible styling, hardcoded variables.... that is for you to work out...
13th Mar 2022, 1:25 PM
Bob_Li
Bob_Li - avatar
+ 1
Bob_Li it's very good . That what I wanted to do too. Thanks
15th Mar 2022, 12:39 PM
Programer F_K
Programer F_K - avatar
0
Bob_Li Yes it works . Thanks.
13th Mar 2022, 1:22 PM
Programer F_K
Programer F_K - avatar
0
Okey . Thanks for you advice . But , is javascript easier than python ? For game devlopment
13th Mar 2022, 1:27 PM
Programer F_K
Programer F_K - avatar