#🔒 brand new
152 messages · Page 1 of 1 (latest)
@full kestrel
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
i might be able to help you here over chat, but i don't do any voice or video calls of any kind
im fne to try but i dont know many terms or really how to describe what is going on
can you show the code that you are trying to run?
ok one moment
or you could even post a screenshot to begin with in this instance (normally we prefer code to be posted as text, but when there is problems with how to run things a screenshot of what you are trying to do can sometimes be more helpful)
first = input("First: ")
second = input("Second: ")
sum = int(first) + int(second)
print(sum)
Hey @full kestrel!
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
im watching a video by programmng with mosh and ths is the exact code he inputs but when i click run i get an error msg ill get the ss now
the code looks correct to me
is there somethng wrong on the ss
the code is correct
this is my very frst input and as im struggling to grasp it i hope i can contnue today before bed and not have to walk away for now
It's looking for an interpreter in a different folder than your current project
how do i fix. in kindergarten terms plz lol
"PycharmMiscProject" vs "Pycharm_New world"
Personally, I would not recommend using pycharm to begin with. It's a bit bloated for a beginner imo
bloated? meaning too much?
i opened a youtube video and did what he said to get my frst taste about an hour ago
Yeah, it does a lot behind the scenes, making it you don't understand what's going on
@full kestrel have you moved or renamed the directory for the project?
Also, if that's the first code they show, they already do something which is quite bad (overwrite sum function), so I wouldn't put too much faith into it
vscode is the best
no dea what that means
I can hop in a call if ya want and help you set up
Gimme a few mins tho if you want that
Have you installed Python at all?
But yes, if PcCamel can help interactively that would be quicker.
hit your inbox
yes and im on pycharm via the video im mmicng
@full kestrel
You opened powershell and typed python --version right? What does it show?
Okay good, so python is installed correctly
Somewhere on your PC make a folder called something like "Code"
exit ps?
Yes
code" created
And make a new folder in there called something like first_project
done
Open vscode and select that folder:
done
Not like that, you just opened powershell separately again
Click in vscode (make the window active), and then press ctrl + `
or
Again send a ss if you did that pls
Okay nice, you might want to make vscode fullscreen, it's pretty cramped right now
At the bottom you now see a terminal has hopened
This is basically also powershell
You can type python --version to try it out
Same result
For every python project, you want to make a virtual environment. You can do this with the following command:
python -m venv ./.venv
This makes a folder in your current directory (./) called .venv
That e book you sent is free on oceanofpdf
The book is free anyways. It's nice if you have an ereader, but you can view the entire book on https://automatetheboringstuff.com/
A Page in : Automate the Boring Stuff with Python
Is there a new folder now in the directory?
Weird when I clicked it said 2 different prices. I didn't scroll any either
Better to send a ss, difficult to see when you make a pic
Yeah perfect, so there is a .venv folder now. This folder will also contain python.exe
Now press ctrl + shift + p and type the following:
Click on the Python: select interpreter
Send me a ss of what it shows
Oh hmm, one sec
On the left, click the 4 squares
Then look up "Python"
Install that one
Alright, now go back to your files
And try this again
See the bottom one? That's in the .venv folder we just created
Select that one
Then make a new file in the folder called "tmp1.py` f.e.
(right click in the file explorer)
SS when done pls
i have to as i know nothing rn lol
Alright, type the following code:
print("Hello world!")
Then click on the run button:
And ss when done
Coolio, it works
So that's how you run a .py file.
Next time you want to continue coding you:
- open vscode
- open the folder
And then you are able to run code with the run button
i greatly appriciate your patence and clarity sir
Sure nws.
There's one more thing
In tutorials you will also find them wanting you to run python in "interactive" or "shell" mode
In the terminal section you can click on the + to open a new terminal
You will see it will add another terminal in the list on the right
And then simply type python
ss when done
If it works, you should see >> and you can type f.e. 1 + 2 then enter, and it will show 3
sweet got it
You were able to type the 1 + 2?
Cool
when you type python in powershell, it opens python in interactive mode
If you see >> you are in "Python interactive" mode
You can type exit() to go back to powershell terminal
So you now know how to run python in two ways:
1) Interactive mode: open a terminal -> type python
2)run a python file: Create a .py file, click the run button (triangle)
That's it
Whatever book you use, they will use one of the two modes to run their code in whatever IDE they use (PyCharm, Vscode, w/e), and you can do that too now.
awesome. so now im back to the vdeos and book?
Jup. I would really recommend following a structured course like automate the boring stuff or some other course
Videos are nice for passive learning, but stuff won't stick when you watch someone else program
I know, because I've tried 😛
on it🫡
It's a noob trap
im the same way. thats why i was doing the same he was in the vdeo to follow along rather than try and retain
very grateful sir
no, it's not free, if you find it there it is an illegal copy of the book
no, it's not, it's only free in the html version on the authors own site, otherwise people needs to buy it if they want to keep things legal
it's better than not following along, but just following along isn't enough to really learn properly
if you want to learn for real you need to modify the code from the tutorial and learn what happens when you change the code in different ways, experiment with things, don't worry if you break it, then you get the chance to learn how to fix it and you'll learn much more from it
Your screen is small or your UI is just super large???
@full kestrel the more code you write yourself without just retyping what someone else has written is what is really valuable
because programming is about problem solving and how to break down big problems to smaller and smaller problems until you can solve each one by themselves and then put everything together again
and don't use AI while you still learning, if you outsource the thinking you will not learn how to do it yourself
Idk it's on a pc
I completely agree
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.