5 Respostas
+ 2
You need to create a .bat file that has your program and then a pause in it.
You can look up how to do this, I know it is covered in Automate the Boring Stuff with Python which is free online.
+ 1
It sounds like you are running this on your local machine and it opens in a command line window?
If this is the case instead running it with the Python IDLE. This is probably the best way to play around with Python programs
(easy way, assuming windows - right click the file, 'edit with IDLE' then in there you can run (f5 iirc))
+ 1
When the program has no more code to execute it will close, so you need to ensure it ends when the user wants it to. A simple way would be to put the code in a loop so the user can keep doing inputs until they type 'exit' or something. What you probably have is a simple script that executes some lines of code then closes, when you run it as a .py file.
0
that's right. but, what if I want to publish my program? then It should run without IDLE.
0
Thank you guys.