Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
run .py file on Windows
#4
(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:\Users\your_name\Desktop\folder
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
Reply


Messages In This Thread
run .py file on Windows - by aidanikuz - Sep-14-2017, 01:17 PM
RE: Can't run .py file - Windows 8.1 - by metulburr - Sep-14-2017, 02:23 PM
RE: Can't run .py file - Windows 8.1 - by snippsat - Sep-14-2017, 02:30 PM
RE: Can't run .py file - Windows 8.1 - by sparkz_alot - Sep-14-2017, 02:35 PM
RE: Can't run .py file - Windows 8.1 - by aidanikuz - Sep-19-2017, 02:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  batch file for running python scipt in Windows shell MaartenRo 2 2,026 Jan-21-2022, 02:36 PM
Last Post: MaartenRo
  Using a .bat file to execute simple anaconda commands in Windows 10 gacg1 0 4,791 Nov-30-2020, 03:24 PM
Last Post: gacg1
  opening a file from a windows desktop folder- error opening file Charan007 1 3,038 Dec-06-2018, 11:50 AM
Last Post: buran
  python 2.7 access denied when writing a file to Windows kavise 2 11,434 Feb-13-2018, 08:30 PM
Last Post: kavise
  Python 3.x Windows 7 registry file associations broken pixhellmann 2 5,153 Sep-12-2017, 09:14 PM
Last Post: Larz60+
  File access confusion python windows PickyBiker 0 3,422 May-08-2017, 05:36 PM
Last Post: PickyBiker
  Get File Ownership under Windows newatpython 6 16,541 Mar-24-2017, 01:18 PM
Last Post: sparkz_alot
  Windows: Put File automatically under Cursor for Drag & Drop sym 1 3,557 Jan-13-2017, 04:55 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020