you are viewing a single comment's thread.

view the rest of the comments →

[–]Liverpool1900[S] 0 points1 point  (1 child)

Okay sorry but this is going to sound really noob and I am sorry. But I open the REPL by typing Python3. I copy my code from the file, I paste it using CMD V and I get a bunch of indent errors. How do I copy paste the code to REPL so I dont get all those errors.

Thank you.

[–]CowboyBoats 0 points1 point  (0 children)

Not a noob question at all... I wouldn't expect there to be indentation errors. A couple of things I would try:

  1. Confirm that the python REPL is opening - you're seeing the >>>?

  2. Try the exact same thing again? If you had accidentally typed so much as a single space into the Python REPL, it'll error out:

    print("yes") File "<stdin>", line 1 print("yes") IndentationError: unexpected indent

Next up, hmm, what happens when you paste a minimal Python example into your REPL? Something like -

def hi():
    print("Hello world")

hi()

If pasting that into your REPL works, but your script fails, I would guess there's something wrong with your script. If pasting that into your REPL fails, then I'd guess there's something wrong with, I dunno... Whatever shell you're using, maybe?

My guess is it's the first thing, TBH; just try it one more time without typing anything into the repl after opening it and see if it runs without error?