For Mac users, sometimes the default `python` points to Python 2 (which is outdated).
Always use `python3 myscript.py` to be safe.
Also, if you’re tired of typing the full path, check out `alias` in bash to make a shortcut!
---
Oh wow, thanks everyone! Didn’t expect so many helpful replies.
I tried `python3 myscript.py` on my Mac and it worked perfectly. Also, the `input()` trick saved me from the flashing window issue.
One more thing—if I want to pass arguments when I python run a file, how does that work? Like `python script.py arg1 arg2`?
Thanks again! You guys rock.
Always use `python3 myscript.py` to be safe.
Also, if you’re tired of typing the full path, check out `alias` in bash to make a shortcut!
---
Oh wow, thanks everyone! Didn’t expect so many helpful replies.
I tried `python3 myscript.py` on my Mac and it worked perfectly. Also, the `input()` trick saved me from the flashing window issue.
One more thing—if I want to pass arguments when I python run a file, how does that work? Like `python script.py arg1 arg2`?
Thanks again! You guys rock.
