#๐ Pycharm users only please
85 messages ยท Page 1 of 1 (latest)
@chrome crescent
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 need to add a txt file to get with open ('common.txt', 'r') as f: and idk how to place a file in the directory I am new to both coding and pycharm so please be nice ๐
so let me just quickly explain what pycharm is
python files are like word documents
you can open word files in microsoft word
but you can also open it, in say, libreoffice
or google docs
does that make sense?
the same thing applies to python files, you can open them in pycharm, or vscode, or sublime text
a little I mean I am still new to both but I try to copy from videos and learn step by step what each code do or for what it written for
but that does not change the functionality of the code
the word document is still going to contain the same text whether you open it in word, or google sheets, or libreoffice
does that make sense so far?
a little
essentially, your question is not related to pycharm
this would make sense as a question even if someone uses vscode
i just wanted to quickly clarify that first
how are you running your python code file in pycharm? with the "play" button?
so why I get this error? with open ('common.txt', 'r') as f:
~~~~~^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'common.txt'
hold on
do you understand what this error means?
FileNotFoundError: [Errno 2] No such file or directory: 'common.txt'
not really could you explain it for me?
There is "No such file or directory: 'common.txt'"
so how do I fix it?
make common.txt
I need the common.txt to be here? (in ss)
it would depend on how you are running your python file
which is why i asked ^
oh and how do I find out?
how are you running the file?
the script? sorry I am a little slow ๐ญ
what is the action that you performed that led to this error message being produced?
it can be a mouse click
what button did you press
I don't really remember but I just wrote it
you wrote the code in the file, right?
no, in the python thing in pycharm
I accidently deleted it wait a sec
are you there?
yeah sorry I rewrote the script now I just need to open the txt file and that it will show in the side bar so the error won't appear I think?
now I get two different errors the first one is this "line 19
if length > 8:
^^"
the second is this "IndentationError: expected an indented block after 'with' statement on line 17"
do you mind if i ask what video are you following along to?
I will send the link
Today we build a simple tool that helps us to evaluate the strength of our passwords.
โพโพโพโพโพโพโพโพโพโพโพโพโพโพโพโพโพ
๐ Programming Books & Merch ๐
๐ The Python Bible Book: https://www.neuralnine.com/books/
๐ป The Algorithm Bible Book: https://www.neuralnine.com/books/
๐ Programming Merch: https://www.neuralnin...
(I just use it to learn nothing else)
uh
it not good video right?
Here are the top free resources we recommend for people who are new to programming:
- Automate the Boring Stuff โ an online book (also available to purchase as a physical book)
- Harvardโs CS50P course โ video lectures (slides and notes provided) with exercises
- Python Programming MOOC 2026 course โ text-based lessons with exercises
- Corey Schafer's YouTube playlist
For a full, curated list of educational resources we recommend, please see our resources page!
i think it would be better for you to understand the basic syntax first before heading into a project like that
in python, indentation matters
if x > 5:
print("x is more than 5")
this is part of the fundamentals that is quite important for you to get right
I tried learning python on my own and it wasn't the greatest experience and dropped it after a week and I am scared it would happen again since I am serious about it ๐
I can personally vouch for CS50P in this list of reccos
do you want to give it a try first?
there are quite a lot of articles and tutorials online, some of them good, some of them bad
Sure, I just want to understand better and to succesfuly learn something on my own.
i typically dont ask learners to use pycharm
its venv-first paradigm is very good for professional use
but i can imagine it being quite confusing to start off with it
you can just click into the link in the embed
and where do I click?
if you click on Visual Studio Code, it brings you to a codespace where you can write code and run it online
you can start the course by reading the welcome note and the recommendations below like "How to take this course"
what now?
you can create a new python file and start writing code
but I want to learn how to code
you will want to follow the instructions here
so this is where you learn? https://www.youtube.com/playlist?list=PLhQjrBD2T3817j24-GogXmWqO5Q5vYy0V
This is CS50P, CS50's Introduction to Programming with Python. Register for free at https://cs50.edx.org/python. Slides and source code at https://cs50.harva...
delirium
please take a look at these and follow along
you will need to read text to learn how to code
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.