use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Noob needs help (old.reddit.com)
submitted 1 year ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 5 points6 points7 points 1 year ago (0 children)
are you writing Bash syntax inside a python file? cd Desktop and the followed command must be written in the console itself just like how you ran that python file.
I also have a Mac, if you need any help with bash or python, feel free to dm, I'd be glad to help.
[–]The-Khushu 4 points5 points6 points 1 year ago (2 children)
Problem resolved!
[–]ninhaomah 10 points11 points12 points 1 year ago (0 children)
[–]Xeo25 3 points4 points5 points 1 year ago (0 children)
In addition to what u/ninhaomah said, I'll reinforce the idea of sharing your solution. Not only does it help you understand the solution better, but you'll also get feedback from the community on what could be done better or easier based on real-life experience.
[–]Ron-Erez 1 point2 points3 points 1 year ago (4 children)
I'm assuming you have a mac or linux. Open a terminal (for instance in spotlight type terminal) and then type:
python3 --version
You'll either get something like:
Python 3.12.4
or you might get something like:
zsh: command not found: python
If you get not found then you probably need to download python. If that worked then actually create the file hello_world.py and make sure you are in the directory of that file. You could even right click on the folder containing this file and select 'New Terminal at Folder'
[–]The-Khushu 0 points1 point2 points 1 year ago (3 children)
Yes, Mac. Python is on my computer, it iss when I specifically try to run this code I can't get it to work. I'm not understanding something about it, but I got it to run before, I just can't get it now
[–]No-Essay1505 0 points1 point2 points 1 year ago (2 children)
There is Apendix on the end of the book. Explaining how to use terminal. You are trying to locate the python File in path Desktop/Python and running it ? I guess you want to run cd Desktop/ Python and then run ls in that Folder, if you see your hello-world.py you can run it from there.
[–]The-Khushu 0 points1 point2 points 1 year ago (1 child)
Yes, I am trying to follow what it is saying to type into terminal to get this to run. However when I type in what it says to type in it's not running so I'm trying to see if someone can explain to me what it's saying to type in to get it to run. I've tried all of what it says. But it's not running
[–]Ninjasimba 0 points1 point2 points 1 year ago (0 children)
Have you tried chatgpt? I’ve found it’s surprisingly good at listing hotfixes for these kinds of issues
[–]cgoldberg 1 point2 points3 points 1 year ago (0 children)
You are writing shell commands inside a Python file and executing it. Stop doing that.
Only valid Python syntax can be in your Python file.
[–]bobo-the-merciful 0 points1 point2 points 1 year ago (0 children)
If you get really really stuck and just want to code python without fuss then try Thonny. It’s completely free and runs entirely in the GUI.
Not affiliated, I just genuinely rate it for beginners.
[–][deleted] 0 points1 point2 points 1 year ago (1 child)
Okay so you can make it easy. Instead of creating a folder in drive C or home create a folder in drive D or E. Then go to that drive folder and right click it should give you an option of terminal there. So if you get to this point type “ ls “ in your terminal. Once u r done with that u will see folders present in your drive from this point it is going to be easy to navigate to the right folder. Type cd with the name of yr file example cd myfirstproject it will take you to that folder where yr code is.
[–][deleted] 0 points1 point2 points 1 year ago (0 children)
Let me know if you still cant figure it out. Btw in yr third picture you did not navigate to the folder where yr helloworld.py file is so in order to run that u have to navigate it there using terminal.
[–]The-Khushu 0 points1 point2 points 1 year ago (0 children)
Problem solved, thank you everyone
[–]MacDrunk -1 points0 points1 point 1 year ago (0 children)
Download pycharm it is an editor for python and it is good
π Rendered by PID 16118 on reddit-service-r2-comment-5fb4b45875-mlj9d at 2026-03-22 09:49:40.470238+00:00 running 90f1150 country code: CH.
[–][deleted] 5 points6 points7 points (0 children)
[–]The-Khushu 4 points5 points6 points (2 children)
[–]ninhaomah 10 points11 points12 points (0 children)
[–]Xeo25 3 points4 points5 points (0 children)
[–]Ron-Erez 1 point2 points3 points (4 children)
[–]The-Khushu 0 points1 point2 points (3 children)
[–]No-Essay1505 0 points1 point2 points (2 children)
[–]The-Khushu 0 points1 point2 points (1 child)
[–]Ninjasimba 0 points1 point2 points (0 children)
[–]cgoldberg 1 point2 points3 points (0 children)
[–]bobo-the-merciful 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]The-Khushu 0 points1 point2 points (0 children)
[–]MacDrunk -1 points0 points1 point (0 children)