Py File Runner

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-32
You 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')'.

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

Thank you. did just that.

Working with Python files on the Mac is a breeze, especially given some of the built-in functionality. As such, there are two ways to run a Python script on macOS: through the Python Launcher app and the more common Terminal execution. Run Python on Windows. To run Python programs on windows, there are a few steps you need to do. Save your code with the.py extension. Lets call it hello.py. Open a command prompt, by pressing start, run and type “cmd” (in the text field) and press OK. Go to the directory of your Python file with the cd command.

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: Users username AppData Local Programs Python Python36-32. Converting the Python Script into.exe file. With the help of the.exe file, the program developed can be run on a system without the need for an IDE shell. Step 1: Use the command: pip install pyinstaller, type it in command prompt. Step 2: Open directory where the respective.py file is located.


Possibly Related Threads…
ThreadAuthorRepliesViewsLast Post
Using a .bat file to execute simple anaconda commands in Windows 10gacg101,168Nov-30-2020, 03:24 PM
Last Post: gacg1
opening a file from a windows desktop folder- error opening fileCharan00711,612Dec-06-2018, 11:50 AM
Last Post: buran
python 2.7 access denied when writing a file to Windowskavise28,925Feb-13-2018, 08:30 PM
Last Post: kavise
Python 3.x Windows 7 registry file associations brokenpixhellmann23,565Sep-12-2017, 09:14 PM
Last Post: Larz60+
File access confusion python windowsPickyBiker02,423May-08-2017, 05:36 PM
Last Post: PickyBiker
Get File Ownership under Windowsnewatpython611,759Mar-24-2017, 01:18 PM
Last Post: sparkz_alot
Windows: Put File automatically under Cursor for Drag & Dropsym12,181Jan-13-2017, 04:55 PM
Last Post: Larz60+
Users browsing this thread: 1 Guest(s)

Run your python (.py) source file using F5 or F6!

Python runner fileFile
  • Atom Text Editor (nightly or latest stable release)
  • Python 2 and/or 3
  • Add Python (and any other interpreters) to the PATH environment variable.
  • Using python
    • Almost the same console with python IDLE, which provides syntax error and runtime error messages.
  • CodeBlocks debug console style
    • Shows return value and execution time
      • It is a rough time based on real time rather than CPU kernel / user time
  • Cross Platform Compatible

    • Runs on Windows, Mac OS X, and Linux
  • True Arbitrary Execution

    • Global python is the default interpreter
    • Execute using any interpreter
    • Pass options to the given interpreter
    • Pass arguments to the program to be executed
  • Python 2 and 3

    • Note: If you have problems executing, you can install a global version of latest python2.7.x (even if you have python3.x.x installed). Please report any python3 issues if you want to avoid installing a global python2 version.

This project has been documented in a fair amount of detail over time. This documentation can be found in the Wiki.

Everyone should take the time to reveiw the Wiki README at the bare minimum. It details an overview on how to handle issues, use different versions, and includes links to primary sections of the Wiki.

Everyone should also take the time to review the Wiki section How do I use atom-python-run?. It covers everything from installation, to configuration, logging, and much more. You just might be surprised by what you can do with atom-python-run.

MacPostFactor v2.0This version is huge! It features many improvements everywhere! Macpostfactor

You should have the basics after having covered both the README and How Do I use atom-python-run? sections. Most FAQ's can be resolved by simply reading them. The guides provided should allow us to help you with what ever issue you're facing.

File

NOTE: Be sure to read the Wiki and the Wiki README before reporting an issue or making a pull request. A lot of time has been put in to it to help you the user (or dev) get started and on your way.

  • Before newing an issue, check to see if someone else is experiencing any related issues.
  • Check to see if any issues that were closed resemble your issue and re-open it addressing that you're experiencing a similar issue.
  • Provide details about your issue, such as errors and/or logs.
  • Provide reproduction steps (we can't help you if we don't know how to reproduce the error!).

If you're a developer and are interested in this project you can find this repos API's in the Wiki. More specifically, you'll want to take a look at How does the cp module work? and How does the terminal.js module work? sections of the Wiki.

You can also just read the key source files

Py File Runner Online

  • cp (cp is written in python)
  • New an issue if you have any idea of new features.

Py File Runner Download

This is a package for Atom