Simply replace the Terminal command with the one from the preceding article by copying it into the Terminal window. El capitan dmg to bootable usb converter.
Answer: Search on py2exe, a utility for doing just that. Be warned though, that it just takes the whole of the Python interpreter and stuffs it inside the EXE in such a way that it runs your code on Windows (and only Windows). Run Hello World. It's simple to run hello.py with Python. Just click the Run Python File in Terminal play button in the top-right side of the editor. The button opens a terminal panel in which your Python interpreter is automatically activated, then runs python3 hello.py (macOS/Linux). Atom-python-run package. Run your python (.py) source file using F5 or F6! Prerequisite; Features; Compatability; Documentation; Issues; Development; Prerequisite. Atom Text Editor (nightly or latest stable release) Python 2 and/or 3; Add Python (and any other interpreters) to the PATH environment variable. Create another python file with the IDLE editor or any text editor, save the python file as listfilepath.py, it is saved in the same directory with listfile.py. When you run listfilepath.py, it will first print out each command-line argument when you invoke it and then show all the file or folder’s absolute path in the folder that you.
Sep-14-2017, 01:17 PM (This post was last modified: Sep-14-2017, 08:46 PM by metulburr.) Hello, so I just installed python and I wanted to test the program and stuff. so I made a simple test file, hello.py which has its own folder on my desktop 'print('Hello')'. My Python was installed automatically (didn't know how to change directory during installation) here : C:UsersusernameAppDataLocalProgramsPythonPython36-32 and i ticked the box which said to add to PATH. running the interpreter is fine. everything seems good to go. I gather that to run the file in the command line I should just : hello.py or something which I did. I tried C:Usersusername > hello.py C:Usersusername > python hello.py C:Usersusername > python then the python interpreter then hello.py obviously its not working, as in error of no file name or something along those lines, because of the file directory bit. so where should i place the .py file? or is there something completely wrong with the setup altogether? Thanks in advance! Sep-14-2017, 02:23 PM Quote:This is the correct method. You should either get an error message or the script hello.py runs. adding to the PATH should fix this; but you can try troubleshooting by putting the file hello.py in the directory C:UsersusernameAppDataLocalProgramsPythonPython36-32 I havent used Windows in an eternity so i forgot how they do it. Recommended Tutorials: BBcode, Forum Rules and Instructions, How to ask smart questions, the Basics, Classes, Python Gotchas Sep-14-2017, 02:30 PM (Sep-14-2017, 01:17 PM)aidanikuz Wrote: My Python was installed automatically (didn't know how to change directory during installation) here : C:UsersusernameAppDataLocalProgramsPythonPython36-32You can look at this for a better path Python 3.6 and pip installation under Windows, part-2. (Sep-14-2017, 01:17 PM)aidanikuz Wrote: so where should i place the .py file?It's up to as long as python are in environment variable Path. Make a folder eg C:my_py where you can have most of your files.Sep-14-2017, 02:35 PM (Sep-14-2017, 01:17 PM)aidanikuz Wrote: so I made a simple test file, hello.py which has its own folder on my desktop 'print('Hello')'. You didn't say what the folder name was on your desktop, so we'll just call it 'folder'. From the command prompt you need to change directory to that directory. cd C:Usersyour_nameDesktopfolder From there, you can just type 'hello.py'. To save yourself some typing, you could create a directory under the main 'C' directory, call it, say 'Python', the you just have to type cd c:python If it ain't broke, I just haven't gotten to it yet. OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian 'Stretch' Python 3.6.5, IDE: PyCharm 2018 Community Edition Sep-19-2017, 02:33 PM (Sep-14-2017, 02:35 PM)sparkz_alot Wrote:(Sep-14-2017, 01:17 PM)aidanikuz Wrote: so I made a simple test file, hello.py which has its own folder on my desktop 'print('Hello')'. Thank you. did just that. |
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Using a .bat file to execute simple anaconda commands in Windows 10 | gacg1 | 0 | 1,168 | Nov-30-2020, 03:24 PM Last Post: gacg1 | |
opening a file from a windows desktop folder- error opening file | Charan007 | 1 | 1,612 | Dec-06-2018, 11:50 AM Last Post: buran | |
python 2.7 access denied when writing a file to Windows | kavise | 2 | 8,925 | Feb-13-2018, 08:30 PM Last Post: kavise | |
Python 3.x Windows 7 registry file associations broken | pixhellmann | 2 | 3,565 | Sep-12-2017, 09:14 PM Last Post: Larz60+ | |
File access confusion python windows | PickyBiker | 0 | 2,423 | May-08-2017, 05:36 PM Last Post: PickyBiker | |
Get File Ownership under Windows | newatpython | 6 | 11,759 | Mar-24-2017, 01:18 PM Last Post: sparkz_alot | |
Windows: Put File automatically under Cursor for Drag & Drop | sym | 1 | 2,181 | Jan-13-2017, 04:55 PM Last Post: Larz60+ |