Python Forum
how to run a file in powershell with python
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to run a file in powershell with python
#1
I'm trying to run my hello world in python and im using powershell as my terminal and notepad++ as my register and I keep seeing this error message

Windows PowerShell
Copyright © 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\Home> python ex1.py
C:\Anaconda3\python.exe: can't open file 'ex1.py': [Errno 2] No such file or directory
PS C:\Users\Home> python
Python 3.5.2 |Anaconda 4.1.1 (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ex1.py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'ex1' is not defined
>>> python
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'python' is not defined
>>> cd temp
File "<stdin>", line 1
cd temp
^
SyntaxError: invalid syntax
>>>

can anyone help me with this?
Reply


Messages In This Thread
how to run a file in powershell with python - by RomanEmpire - Jun-26-2017, 02:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  using PowerShell from Python script for mounting shares tester_V 8 541 Mar-12-2024, 06:26 PM
Last Post: tester_V
  PowerShell & Python deep_logic 2 714 Jun-06-2023, 06:34 AM
Last Post: buran
  How to write a part of powershell command as a variable? ilknurg 2 1,127 Jul-26-2022, 11:31 AM
Last Post: ilknurg
Photo Windows 10 PowerShell doesn't work Amy 3 3,928 Apr-27-2021, 01:33 PM
Last Post: jefsummers
  Powershell Session translation to Python; Session code seems to not work Maverick494 1 3,614 Jun-26-2018, 05:16 PM
Last Post: Maverick494
  virtualenv on powershell mcmxl22 3 6,397 Feb-08-2017, 06:29 AM
Last Post: snippsat
  Cant Get Powershell to run a python program from notepad++. Newbie help! Pythonerous 4 8,935 Oct-10-2016, 07:16 PM
Last Post: Pythonerous

Forum Jump:

User Panel Messages

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