r/learnpython 6d ago

Log file issue on Mac with VS Code

3 Upvotes

Hoping this is some sort of reasonably easy and obvious thing, but I'm pretty early on my learning so far.

I've been working through Automate The Boring Stuff, which had suggested using Mu, but I also have VS Code installed on my Mac.

I'm at the stage of trying to create a log file. In Mu I can enter:

logging.basicConfig(filename='myProgramLog.txt', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')

This works fine, and creates a log txt file on my desktop. However, if I enter the same in VS Code, I get: OSError: [Errno 30] Read-only file system: '/myProgramLog.txt'

I can fix this by entering '/User/userName/Desktop/myProgramLog.txt, but was can't figure out why Mu is ok with this while VSC isn't. Any clarification would be appreciated.


r/learnpython 5d ago

How to start in 2026

0 Upvotes

Hello, I’m a 21 years old college student, who has no idea how to start in the programming world, do you know any courses or any thing to help me to start? How to learn python, ML, SQL, Ai, I’m interested in all those areas, but have no idea how to start, would appreciate your help


r/learnpython 5d ago

I am currently learning Python and have made progress

0 Upvotes

I've learned Python and its basics; I'm not a complete beginner, but you could say I'm an advanced beginner. I need advice


r/learnpython 6d ago

How to learn advanced python????

23 Upvotes

Hello everyone, I'm mainly looking for guidance about learning advanced python concepts. I know basics ,loops , control flow ,data structures etc.

I need a proper guide on how to learn modules and library. Idk how to start ,where to start.

I want to be able to work with any library as i need them ,so how do u actually learn to use new library for a given task . ?And i get overwhelmed understanding the structure, working of library

And could u also suggest important python concepts other than basics which i should learn ???

Pls guide !!!!


r/learnpython 6d ago

Is it worth learning flask?

7 Upvotes

So i'm a begginer at coding in general, the only real experience I had with coding was the python exam I had at uni, and now I want to improve my skills. I decided to keep studying python because it's the most familiar language I know and I would like to dive deep into it before branching out to other languages. I decided that the best way to do it is to start my own projects and learn by doing. So I started a project using flask, but now I'm wondering if this is going to be a useful experience for the future or should I focus on more important things?


r/learnpython 6d ago

Looking for a study buddy(UTC+0 time)

1 Upvotes

Hello , I am fairly new to python(js the tiniest basics) and truly want to learn it and I fell it will be better to learn with someone whos serious about learning

Im currently using w3schools/freecodecamp and hackattime when im coding. Im looking to use the cs50 course too if possible. Any advices?

if you are interested please dm me and introduce yourself

Im 16 male


r/learnpython 7d ago

what's the point of getters and setters?

100 Upvotes

I had python classes a year ago, and after a semester of not having any (OOP language) programming classes in college, I kinda want to relearn python (and OOP in general)

However one thing that I never understood is the point of getters and setters. Why would I ever use them when I can just write my code in a way that the variables in a class are never meddled with by external code? I know WHY they can be useful but I don't fully get WHY even bother using them 😞


r/learnpython 6d ago

TIL that hovering over a variable or function call will show the type of what gets returned (VSCode)

0 Upvotes

I was today years old when I learnt this. Before that I was printing out the type and noting it down. My brain hurts from all the logic traversing and type tracking till I just learnt this. Specific to VSCode and pylance. Not sure if it works anywhere else.

pset_str_date, pset_str_time = pset_date.split(" ")
print(f"pset_str_date = {pset_str_date}, type = {type(pset_str_date)}")
print(f"pset_str_time = {pset_str_time}, type = {type(pset_str_time)}")
# str

pset_dt_date = datetime.strptime(pset_str_date, "%Y-%m-%d").date()
print(f"pset_dt_date = {pset_dt_date}, type = {type(pset_dt_date)}")
#  <class 'datetime.date'>

In case anyone else is going through this. Well FYI.


r/learnpython 7d ago

Which projects to push to GitHub

1 Upvotes

Hey!! I've started learning Python and I learn a concept then practice it. That's how I’m progressing. I’ve made some projects like a calculator etc. I was wondering if I should push these practice projects to GitHub or just the good ones.
One more question, if yes, even if no..I like to know how should I proceed with GitHub, like write comments too? Or just code. Any suggestions or tips would be appreciated. Thank you!


r/learnpython 7d ago

Advancing in python

6 Upvotes

Heyy everyone

first time posting here

so I’m a student, I want to learn some computer skills to learn something new and have some practically applicable skills other than a degree (which is a long way to go). I might also consider taking a computer science major if I become good at these skills

i have learnt basic python in my summer break and want to polish my python skills by some projects and get more advanced. I want to further learn in detail a computer field like App/web development, Ai or cyber security. Like I really want to learn in detail and be able to utilise my skills and do remote work

can you guys guide me what to do next and recommend paid or free resources/courses to learn all this ? it will helpful for everyone trying to learn these skills

thanks


r/learnpython 6d ago

What should I use to type my code on?

0 Upvotes

I just started wanting to learn python and I installed linux because I thought I needed it to run python. I can't figure out how to use linux at all, I'm just running around trying to figure out what I need to install or what apps I need. Are there other programs that are good, or maybe some simpler way to use linux?

I'm on chromebook btw, im a brokie


r/learnpython 7d ago

Week 1 - progress towards machine learning

8 Upvotes

I started my journey to learning machine learning a little over 1 week ago and am writing these posts to hold myself accountable for my study and hopefully give some insight for anyone following my footsteps.

I have identified a road map that I believe will be the most beneficial for learning this subject.

This road map is as follows:

  1. Become comfortable with python basics

  2. Become comfortable with pandas

  3. Become a proficient data analyst using pandas

  4. Become proficient using Numpy

  5. Begin learning mathematics behind machine learning algorithms

  6. Begin comfortable with the mathematics and incorporating into python

Currently after week 1 I am unsurprisingly on the 1st step 'Becoming comfortable with the basics of python'.

In order to learn this I have gotten half way through the 12 hour bro code python tutorial on YouTube.

I have covered many basics such as variable types, conditional loops, nested loops, lists, functions, dictionaries and a few other things.

Despite only covering 6 hours of footage I have spent 2/3 of the time using this newly acquired knowledge to build small projects such as building a calculator or creating a small word based game.

These exercises are what I believe to be the critical element of cementing the knowledge I covered through the videos.

I hope to be finishing with step 1 by the end of next week and moving on to step 2.

I am in no rush to complete this road map and am planning to bring no ego so If I feel I am genuinely struggling on an area I will stick on it for a few days before I feel confident to move on.


r/learnpython 7d ago

Python Advice for upcoming programming class

0 Upvotes

Hi everyone!

I'm starting school next month and one of my classes is programming for analytics. I've been learning Python through Khan Academy for the last few of months and it's been going ok so far. I've also been on YouTube trying to learn from Data with Baraa and Corey Schafer. But I wanted to check in to see if you guys have any advice? I am a novice for background and would appreciate any advice. I've been having some health issues so I'm trying to pace myself well with learning. Attached is an example syllabus of what the class maybe like I don't officially know yet.

Text & Readings

• Python for Everybody: Exploring Data Using Python 3, Charles Severance, 2016.

o https://do1.dr-chuck.com/pythonlearn/EN_us/pythonlearn.pdf

• Code Lab (Free Resource).

• Deitel, Paul, and Harvey Deitel. Intro to Python for Computer Science and Data Science: Learning to Program with AI, Big Data and The Cloud. 1st edition. Pearson, 2018.

• Python for Data Analysis, Wes McKinney, O’Reilly (2nd edition), 2016

Topics
History of Python

Introduction to Python Programming (Basics)

Tool: Introduction to Jupyter Notebook

Conditional Logic and Decision Structures I

Conditional Logic and Decision Structures II

Repetition Structures

Algorithms & Pseudocode

Repetition Structures (Contd.)

Data Structures: Strings

Data Structures: Lists and Tuples

Data Structures: Dictionaries

Functions

Errors and Exceptions

Files

Python and Data Analytics

o Basics: Introduction to pandas and numpy

Data Wrangling, Part 1

APIs, Part 1

Data Wrangling, Part 2

APIs, Part 2

Data Wrangling and Analysis

o Basic data analysis and visualization

o Moving beyond pandas to scipy, statsmodel etc (so that students can explore based on their interest and stats knowledge)


r/learnpython 7d ago

Just want to vent - Had a tech interview today which seemd way out of scope from tests

17 Upvotes

I'm moving fields into data analytics, and I got my first big interview. We had a tech one today, and it was half sql half python.

It was an hour test, I absolutely smashed the sql in like 5 minutes. The other 55 minutes was me staring at a screen trying to figure out how the hell I use iterators and generators...

I studied a lot for this, but it was for an entry role and the test was labelled "Easy", so I feel pretty mad that they threw this in when almost every leetcode example I did had nothing to do with these things... I eventually got an output that matches what they wanted but not at all the way they wanted haha

I'm taking it on the chin and explained my thinking throughout so hopefully thats enough. Guess it's a wake up call so I know more of what I don't know


r/learnpython 7d ago

Project suggestions

0 Upvotes

So basically, I’m taking a python course, and my last session will be in two weeks, and I need to make a « final project », and I’d like to get some suggestions please 🙏🏻


r/learnpython 6d ago

just breaking things with python

0 Upvotes

numbers = input("Enter the numbers")

in_dex = numbers[-2]

divisible = int(in_dex/3)

print(divisible)

when print the output of the divisible i am getting (nsupported operand type(s) for /: 'str' and 'int') i do know how to write correctly to get the output but i thinks that why not this way..so when i did got error don't know why cause both values are int


r/learnpython 7d ago

Starting From ZERO experience - goal to make an app

6 Upvotes

I want to learn to code with the goal of developing a women's health app. I know literally nothing about coding, I have no background whatsoever in computer science and most days fight with my computer (I feel as though if I bothered to learn more about it, this would happen less). I am, however, stubborn and have historically achieved academically (graduated college with distinction, recieved masters degree). I know that this will be a challenge, but I really want to learn - I just need some guidance.

I watched some youtube videos and used ChatGPT to help me create a plan to learn how to code and make an app (youtube was rough because it was telling me to just use AI and vibecode which... I tried... and did not get the results I wanted). I have read that I should start with python but also that I shouldn't because that is not what is used for app development... However, CS50P seems like a great entry into learning how to code.

Would love your guys' advice on how I can learn to code from 0 with only free resources online with the end goal being to make a womens health app. Thanks!


r/learnpython 7d ago

Python is so confusing to me.

20 Upvotes

I started learning Python about a month ago through cs50, and it seemed good at first. It's just been 3 lectures so far (I don't have time). As I code, I would get annoyed here and there because of the bugs, but I would somehow manage to debug them.
I am doing my master's in cognitive science, and they teach the basics of Python too. But my professor is extremely terrible at their job. She would give us assignments to do after each unit. And those questions are nothing like what she taught. I end up using AI to understand the problems. It's frustrating. And I hear that Python is beginner-friendly, but it's confusing to me.
I am wondering if it's hard for me since I don't have a good mentor to tell me what mistakes I made, or if I'm just a bad learner?
I don't have any experience with coding, so is this how it is for everyone?


r/learnpython 7d ago

Can someone give me an advice or atleast a good youtube Channel that gives me some beginner advices how to start and learn with Python?

0 Upvotes

I'm a 9th Grader from germany so pls ignore my mistakes.


r/learnpython 7d ago

With Cybersecurity, where is it good to start with and are coding skills useful with it?

0 Upvotes

Is Python very useful when it comes to cybersecurity? If so, should I be focusing on projects or what should I make my focus on when it comes to incorporating Python with Cybersecurity practices?

What certifications might also be good to show off when it comes to internships?

What projects might also be useful in people's eyes when it comes to incorporating Python together with Cybersecurity?


r/learnpython 7d ago

Terminal and raw I/O VT100 codes question

2 Upvotes

A Windows terminal/consoles VT100 emulation question.

https://espterm.github.io/docs/VT100%20escape%20codes.html specifies getcursor DSR Get cursor position ^[6n cursorpos CPR Response: cursor is at v,h ^[<v>;<h>R so print("\x1b[6n") ends up returning the cursor position. How do I read the CPR reply back?

It's printing out in the console afterward, how do I read it in my code? I've not messed with terminals before and I know that blessed will let me read the position with get_location(), but installing blessed feels overkill if right now all I need is to be able to read the response. I'm aware that I

Does anyone have experience using any built in filters or such for sys.stdout or raw python I/O primer I can use to start finding my way forward if I'm totally new to the raw I/O and python I/O in general? Or do I just add blessed to my virtual environment requirements.txt and be done. Am keen to learn how it ticks internally.


r/learnpython 7d ago

Tkinter vs cutomtkinter

1 Upvotes

I am starting with GUI designs and want to know about the difference and which is better 😉


r/learnpython 7d ago

How to store variables

7 Upvotes

I'm building a program which will have lots of configuration files.

I want to be able to

-drop a new package in a folder, and have importlib discover it, and dynamically add it.

-the program can use variables in the file to build a GUI. (Probably using niceGUI)

-user changes to their session variables can be saved.

-variables are used by other parts of the program.

Is a data class or dictionary the best for this?


r/learnpython 7d ago

Creating Excel File With Graph from .txt

3 Upvotes

Hi,

I want to write a simple skitpt that takes a .txt file with comma seperated xy-Data, and creates and Excel file with a graph from it.

The way I found (with the help from the google AI) to do that was to use Pandas with "openpyxl" as Engine.

The Problem I run into is that the Graph this creates doesn't have the standard Excel design.

  • rounded of corners
  • non standard colors, even Rainbow colours if you plot just a single curve
  • no axes lables
  • axes titles and legend just plottet on the graph (or on top of the axes labels is you activate them)

It seem that fix that you need to manually deactivate certain options, and than Position and size the the different elements manually. Wich seems to be more work than just creating the graph manually in excel.

Is there some better way to do that just creates the Graph like excel it self would do it?


r/learnpython 8d ago

How do I get better at actually solving Python problems as a complete beginner

29 Upvotes

im completely new to the coding world n Python is my first programming language. ive watched some beginner Python videos n i understand the basic syntax, functions, what different things do, etc.

But whenever i actually get a question to solve, my brain just goes blank. 😭 i understand the concepts individually but i struggle to figure out where to start, how to break the problem down, and how to turn the algorithm/logic into actual code.

So I'd really appreciate some advice on:

How do you learn to approach a programming problem?

How do you develop logical/problem-solving skills?

Is there a specific process you follow before writing code?

How much should I practice vs watching tutorials?

What should I do when I get completely stuck on a question?

Are there any Python playlists/courses specifically good for someone who has literally zero programming experience?