问题
I am new to Atom and coding in general. On my HND I have used Sublime Text 3 so taking a look at Atom. So far, so good. I have decided to start learning Python. I created my first script which just asks a user for their name and age. I have used Pythons input() function to request this information.
I installed the package Script https://atom.io/packages/script 1.1k
This ran the script well but couldn’t deal with the input.
I have also tried a number of other options but havn’t had any success. Any ideas how to build and execute scripts from within Atom. I don’t mind if it just simply saved the script and opened Pythons IDLE at a minimun.
I think I am a long way of from being able to build such a thing.
(maybe sometime in the future)
回答1:
Script Runner can run scripts and supports input, unlike Script. It's the simplest full terminal package that I know of. To run a script, press Alt+X
回答2:
Add Terminal-Plus and run the code with the python name_file.py
command
回答3:
The atom-python-run package gets around the input("") freeze problem by opening a terminal window and running the code in that.
Doing it within Atom has eluded me too, but this works OK.
来源:https://stackoverflow.com/questions/61195589/run-python-input-user-in-atom