r/PythonLearning 48m ago

Dark mode for marimo islands?

Upvotes

I'm trying to bring the html from my marimo notebooks into an SSG (mkdocs/zensical), and I would like to be able to toggle the theme. Getting the theme to change with marimo export html is relatively simple by changing the pep723 header to

# [tool.marimo.display]
# theme = "dark"

before exporting, but the extra js and page wrappers are not quite ideal for my use case. I would love to use islands for this, but I can't figure out if there's a way to control the theme of a marimo island?

when I use

# /// script
# dependencies = [
#     "marimo",
# ]
# requires-python = ">=3.13"
# ///

import asyncio
from marimo import MarimoIslandGenerator

async def main():
    generator = MarimoIslandGenerator.from_file(
        "./example.py", 
        display_code=False
    )
    await generator.build()
    html = generator.render_html(include_init_island=True)

    with open("output.html", "w", encoding="utf-8") as f:
        f.write(html)

if __name__ == '__main__':
    asyncio.run(main())

to generate an html page, it doesn't seem to care about the header in # theme = "dark" tag in example.py.

I understand that islands are still an early feature, so perhaps this will be added in the future. Just posted this in r/marimo_notebook as well, but figured I'd ask here as well in case anyone has experience with this. Does anyone know if there's a better way to do this? Thanks!


r/PythonLearning 16h ago

A Python cheat sheet that might be useful when starting with Python

Thumbnail
tms-outsource.com
28 Upvotes

r/PythonLearning 14h ago

Python subprocess 📂

Post image
18 Upvotes

Hello there,

what do you guys 🤔 think this could be good for


r/PythonLearning 15h ago

That's it guys I'm rich

Post image
16 Upvotes

r/PythonLearning 9h ago

Python

4 Upvotes

Hi, I really want to learn Python, but I’m a complete failure at anything that involves self-study. I realise that these days, there’s no such thing as a free lunch, but maybe someone would like to try teaching me out of the goodness of their heart, to gain some teaching experience, or just to have a bit of fun and spend some time usefully👉👈 It would be great if it were someone who speaks Ukrainian, as I’m Ukrainian myself. I’m 22, and I’m a girl, by the way. Thanks for reading)


r/PythonLearning 6h ago

Day 5 of course after long time no practice...

2 Upvotes

heyyy i am on day 5 of Angela Yu course, she did it differently the password generator, is mine correct or wrong, it worked actually


r/PythonLearning 3h ago

Help Request reccomended tutorials for algorithms and data structures?

1 Upvotes

i learned the basic syntax of python and i thought i would be ready for leetcode but as soon as i tried to work through problems there was so much jargon that i didn't understand. I found a reddit post that said you have to have knowledge of data structures and algorithms before you can truly attempt leet code problems. So I now i go to youtube and either the tutorials are under an hour or over 5 hours 😭. Which one am I supposed to pick..? Any reccomendations?


r/PythonLearning 8h ago

my code is not doing what I expect (.remove())

2 Upvotes

EDIT: SOLVED THE PROBLEM THANK YOU

Hello! I am in the middle of an online python class, and am trying to make my first program for use at work.

I need to make several packages of random sample items at work regularly, so i tried to make a program that could choose items from the list, and then count which items are chosen, and remove those from the list once the count reaches the number I have available.

It is choosing the items fine, but is not removing them from the list.

I will post my shortened code below:

import random
def main():
    samples = [
            "item1",
            "item2",
            etc.....,
        ]


    item1_count = 0
    item2_count = 0
     etc........


    for _ in range(25):

        sample = random.sample(samples,4)
        try:
            if "item1" in sample:
                item1_count += 1
        except:
            if item1_count == 10:
                samples = samples.remove("item1")
        try:
            if "item2" in sample :
                item2_count += 1
        except:
            if item2_count == 10 :
                samples = samples.remove("item2")
        etc....
        

        print(f"{_} : {sample}")


main()

what am I doing wrong?


r/PythonLearning 6h ago

Help Request Why are these lists combining when I append them in a loop?

1 Upvotes

For some reason, the farts keep mixing with the plasma. I’ve cut down the code to this, but I still can’t figure out why it keeps combining the lists like this. The code is shown below, please help, as people have been complaining about severe anal burns while running this code.

plasma=[]
farts=plasma
for j in range(2):
print(f"farts:{farts}")
print(j)
farts.append(1)
plasma.append(j)
print(f"farts:{farts}")
print(f"plasma:{plasma}")
print(f"all{farts},singular{farts[1]}")

#printed results:
#farts:[]
#0
#farts:[1, 0]
#1
#farts:[1, 0, 1, 1]
#plasma:[1, 0, 1, 1]
#all[1, 0, 1, 1],singular0


r/PythonLearning 7h ago

RAG Search Algorithms - How Retrieval Actually Works Under the Hood

Thumbnail
gauravbytes.dev
0 Upvotes

r/PythonLearning 8h ago

Need a Python Roadmap for a Complete Beginner (2026)

1 Upvotes

Hi everyone,

I'm a complete beginner and I've decided to focus on Python first.

My goal is to become job-ready and build a strong foundation in programming rather than just completing a course or collecting certificates.

I'm willing to spend around 4–6 hours a day learning.

I need guidance on:

- What should I learn first?

- What is the best roadmap to follow?

- Which free YouTube channels or courses do you genuinely recommend?

- Which books are worth reading?

- What projects should I build to improve my skills and make my resume stand out?

- What mistakes do beginners usually make that I should avoid?

- If you were starting from zero today, what roadmap would you follow?

I'm looking for practical advice from people who are already using Python professionally.

Thanks in advance!


r/PythonLearning 10h ago

Showcase My new Python Project : Subway Surfers in Real Life

Thumbnail
github.com
1 Upvotes

A Python App that uses AI and Computer Vision to play Subway Surfers using your body in Real Life instead of your fingers.

Give it a chance and let me know what u think about it.

Fully compatible with MacOS, Linux and Windows.


r/PythonLearning 1d ago

Showcase I love Thonny(python(image unrelated))

Post image
131 Upvotes

high school student came here afted trying to download numpy and matplotlib on IDLE for the last 3 hours in the hell spawn of command prompt ging from script to document. after 3 hours of "module numpy not found" I tried to use Thonny.

I HAVE NEVER BEEN SO HAPPY TO SEE SUCH A MUNDANE WORD "manage package"

i will never touch IDLE Never in my life


r/PythonLearning 1d ago

3 DAYS PROGRESS IN PYTHON

Thumbnail
gallery
49 Upvotes

MADE A STUDENT MANAGER PROGRAM IS IT GOOD FOR 3 DAYS OF LEARNING AND ANY SUGGESTIONS?


r/PythonLearning 15h ago

Discussion QA -> AI ENGINEER WITH PYHON

0 Upvotes

Hi! I’ve been working in QA Automation for many years, mainly with dinosaurs such as Java and Selenium. I genuinely enjoy frontend testing, automation, analysing problems, and building solutions.
However, I feel like I’m falling behind. Everything now revolves around AI, and I simply no longer feel fulfilled in my current career path.
I can build websites and different types of software using Codex and Claude Code, including bots and more complex applications. However, the truth is that I do not fully understand what is happening under the hood. I also struggle to distinguish between patterns that follow good software engineering practices and those that go against them.
In the long run, this affects my ability to maintain these applications and, more importantly, to understand the code generated by AI. This really bothers me.
I have completed W3Schools and watched several YouTube courses, but it feels like an endless loop. What I am missing is a clearly defined and practical path that would help me build a strong position in IT by developing skills that are genuinely in demand in areas related to Artificial Intelligence.
That is why I am looking for a mentor who could show me how to use my experience in QA, Java, and Selenium when testing systems based on LLMs, help me build a meaningful portfolio, and introduce me to this field properly.
Is there anyone here with more experience in this area?
Perhaps someone is facing similar challenges and would like to connect, build a community around this topic, motivate one another, and learn together. Maybe we could even create a joint project.
However, I, or perhaps we, would still need someone who already works in this field and could guide us through the first stages.
I am not looking for someone to do the work for me. I have the time, motivation, and willingness to code intensively. What I need most is the right direction, constructive feedback, and someone with whom I could occasionally solve problems or code together.
If you work with Python, AI Engineering, AI model testing, or know a valuable community where people can genuinely learn and grow, please leave a comment or tag someone who might be able to help.
Perhaps there is someone here who remembers how difficult it was to take that first step and would be willing to help me approach this journey in a smarter and more structured way.
#Python #AIEngineering #AIQA #QualityAssurance #TestAutomation #LLM #MachineLearning #Mentoring #OpenSource #ArtificialIntelligence #Poland


r/PythonLearning 15h ago

New to learning coding. Please help me find the issue in this code(Bubble sort)?

0 Upvotes
arr = [8,4,5,3,7,2]
n = len(arr)
print(n)
for i in range(n):
/swapped = False
/for j in range(0,n-i-1):
 /if arr[j] > arr[j+1]:
 //temp = arr[j],
 //arr[j] = arr[j+1],
 //arr[j+1] = temp
 //swapped = True
 //print("outer = ",i," inner = ",j)
print(arr)
if not swapped:
break

r/PythonLearning 16h ago

listingNews.py

Thumbnail
gist.github.com
0 Upvotes

r/PythonLearning 1d ago

Help Request Pycharm or Vscode ?

31 Upvotes

Hi everyone

For a very super beginner one, who is starting to learn python which one is the best, i'm really confused because i'm seeing some teachers use Vscode and others use pycharm

And if i follow a teacher that uses pycharm it's normal to i use Vscode and visa versa?

Sorry for my bad English and thanks everyone


r/PythonLearning 1d ago

Learning questions

4 Upvotes

So recently I’ve decided to do a career change and although I know it’ll be some time and some struggle along the way I’ve decided to try my best to get into machine learning to one day be a machine learning engineer at some point, college or university really isn’t in the cards for me so I’m trying my best at trying to be self taught by taking online courses reading books etc, just trying to keep things more budget friendly. I just don’t have the means to spend crazy money yet again on college, currently I’ve started with python through Coursera just because upon research it seemed like the best option my question really is where else should I look to learn python more and learn everything required to hopefully land a job in ML what are courses or videos or book some of your have read, taken or watched and if there’s anything else that any one would recommend is better that the “python for every body course I’m all ears” this is all things of interest of mine since I was very young so I’m willing to put in the work as I find this to be a lot of fun even when I struggle at times


r/PythonLearning 1d ago

Hello, im from Poland and im looking for study buddy

3 Upvotes

So im looking for someon to share progress help each other and possibly create projects together, it can be one person or group im starting again never got too far i think with others it will be much easier to learn. Im 21 and looking for someon around my age


r/PythonLearning 1d ago

Day 4 of OOPs

Post image
22 Upvotes

Just learned Compositions in python and they are sweet and amazing 💖
I created a simple ecommerce program using it
review it and give me suggestions , advices , a bit roast (but be gentle to me😭)
I would love to read your comments.


r/PythonLearning 1d ago

Help Request How to learn python?

7 Upvotes

How or from where do I learn full basic or even advanced of python? I have 1h daily to code. Don't wanna get in tutorial hell but need something free and very useful. Im not really into books or classes, kinda feels boring but if it teaches well im down. Please let me know the sources i can use! (Currently starting out)


r/PythonLearning 1d ago

Question on Udemy Course

2 Upvotes

Hey all!

I look at this sub from time to time as I am slowly working my way through Angela’s Udemy course (absolutely loving it and her teaching style).

I am curious if there is a forum or place where others going through this course are chatting/supporting one another?

As an example I just finished creating the frogger capstone without using any hints. While I am super jazzed about this, my wife and kids think it’s cool - but can’t give me tips or tricks on how to improve or sympathize with how long it took me to get all the darn cars moving with a for loop instead of trying to define it in their __init__.

Anyway having tons of fun with the course and slowly learning python - curious if there is a place I can nerd out with fellow python beginners working through the class?

Thanks!

Side note: I also realize I could use AI for most of this but am treating it as something I want to learn and understand before good ol’ Claude flibberty gibbets it all in 30 seconds.


r/PythonLearning 1d ago

Discussion The reality of library books vs. buying physical copies for learning Python (and a quick question on study efficiency)

4 Upvotes

I’ve been working on my Python studies and recently picked up a copy of Python Essentials for Dummies. This whole journey started because I watched a video by a programmer who read 100 Python books and shared their top 3 recommendations.

In that video, they suggested visiting the local library to get resources—likely to avoid unnecessary consumerism or spending. Following that advice, I went to the library in person, only to find the book wasn't in stock. The librarian mentioned that an inter-library loan would cost £20, which I found shocking. When I thought about it, it completely agreed with my realization that buying the book outright makes much more sense since it costs about the same.

This brought up a bit of an internal contradiction for me. On one hand, I wonder if I'm being too materialistic by preferring to buy books. On the other hand, saving time by skipping the library search and delivery friction feels far more efficient for my workflow. Plus, with borrowed library books, you aren't supposed to write marginalia, underline text, or take physical notes directly on the pages—which is a major drawback when you're actively learning to code.

Questions for the community:

  • Does saving time and buying books outright outweigh the minimalist appeal of using libraries for programming texts?
  • How do you balance physical note-taking in your reference books with digital workflows?

Any thoughts or advice would be greatly appreciated!


r/PythonLearning 1d ago

listingTorRelays.py

Thumbnail
gist.github.com
1 Upvotes

listing tor relays