Python Forum
SyntaxError when trying to execute code on Windows
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SyntaxError when trying to execute code on Windows
#1
I'm a brand new baby when it comes to programming. just want to run simple hello world doc from a different directory in Windows native Dos

Error:
SyntaxError: unexpected character after line continuation character >>> Users\fredt\OneDrive\Documents\ hello.py File "<stdin>", line 1 Users\fredt\OneDrive\Documents\hello.py
^

its simple I know I'm starting to feel like if I were to catch fire I'd burn really slowly..PLZ HELP
Reply
#2
It looks like you're trying to run that from inside the Python shell. That's wrong. At the Windows prompt, you should be running python <path to script>.
Reply
#3
have a look at https://python-forum.io/Thread-How-to-Ex...ython-code
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Error on import: SyntaxError: source code string cannot contain null bytes kirkwilliams2049 7 6,645 Aug-03-2023, 06:00 PM
Last Post: Gribouillis
  Can a program execute code in iPython shell and get result? deanhystad 3 1,725 Jun-17-2022, 03:45 AM
Last Post: Larz60+
  How to Translate a python code written in Mac-OS to Windows? alexanderDennisEnviro500 2 2,688 Jul-31-2021, 08:36 AM
Last Post: Gribouillis
Sad SyntaxError: from simple python example file from mind-monitor code (muse 2) warmcupoftea 4 2,814 Jul-16-2021, 02:51 PM
Last Post: warmcupoftea
  Using a .bat file to execute simple anaconda commands in Windows 10 gacg1 0 4,670 Nov-30-2020, 03:24 PM
Last Post: gacg1
  "SyntaxError: invalid syntax" running code in Doing Math With Python b saucerdesigner 2 2,723 Nov-03-2020, 04:23 PM
Last Post: saucerdesigner
  [split] SyntaxError when trying to execute code on Windows nehaya 2 1,987 Aug-04-2020, 11:18 AM
Last Post: nehaya
  How to execute code WHILE a function runs t4keheart 4 2,654 Jan-27-2020, 01:47 PM
Last Post: t4keheart
  How to execute Python code leemao 2 2,150 Dec-21-2019, 02:35 PM
Last Post: leemao
  Help to reduce time to execute the code prakash52kar 1 2,220 Oct-14-2019, 10:56 AM
Last Post: scidam

Forum Jump:

User Panel Messages

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