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
  How to Translate a python code written in Mac-OS to Windows? alexanderDennisEnviro500 2 304 Jul-31-2021, 08:36 AM
Last Post: Gribouillis
Sad SyntaxError: from simple python example file from mind-monitor code (muse 2) warmcupoftea 4 393 Jul-16-2021, 02:51 PM
Last Post: warmcupoftea
  Using a .bat file to execute simple anaconda commands in Windows 10 gacg1 0 1,151 Nov-30-2020, 03:24 PM
Last Post: gacg1
  "SyntaxError: invalid syntax" running code in Doing Math With Python b saucerdesigner 2 764 Nov-03-2020, 04:23 PM
Last Post: saucerdesigner
  [split] SyntaxError when trying to execute code on Windows nehaya 2 699 Aug-04-2020, 11:18 AM
Last Post: nehaya
  How to execute code WHILE a function runs t4keheart 4 1,042 Jan-27-2020, 01:47 PM
Last Post: t4keheart
  How to execute Python code leemao 2 873 Dec-21-2019, 02:35 PM
Last Post: leemao
  Help to reduce time to execute the code prakash52kar 1 994 Oct-14-2019, 10:56 AM
Last Post: scidam
  Code works in IDLE, appears to work in CMD, but won't produce files in CMD/Windows ChrisPy33 3 1,653 Jun-12-2019, 05:56 AM
Last Post: ChrisPy33
  Why does my code not execute? (def function with 'for in' iteration over a dictionary Placebo 3 1,374 Oct-19-2018, 01:32 PM
Last Post: Placebo

Forum Jump:

User Panel Messages

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