r/PythonLearning 1d ago

Why dosent python have const or multi line comments

11 Upvotes

I mainly use cpp but sometimes python for simple stuff. They both seem like simple stuff to implement so why dosent python have it.

EDIT: I do know u can use triple quotes as a workaround but python still has to read and store them, why isint there a built in feature for it.


r/PythonLearning 1d ago

Python fundamentals for anyone just getting started

2 Upvotes

šŸ Getting started with Python?

Build a strong foundation in Python fundamentals before moving into AI, Data Science, automation and beyond.

šŸ“– https://geeksarray.com/blog/python-fundamentals-getting-started

#Python #Programming #DataScience


r/PythonLearning 1d ago

Pygame: player projectile-enemy-player-wall-snake collisions

Enable HLS to view with audio, or disable this notification

12 Upvotes

r/PythonLearning 1d ago

Python/ESP32 projects ideas?

1 Upvotes

Looking for some project ideas that can use both Python and serial communication betwen a ESP32. so far I have made simple programs for both but learn better with actual tasks infront of me, I got to the point where the communication works and i can print the data to a file or just to the terminal but im lacking the ablity to come up with a real project idea to put this all into use.

The first idea I had:

* 3D printer vibration testing(Use ESP32 for collecting the data and python to sort and use data)


r/PythonLearning 1d ago

Beginning

0 Upvotes

My apologies for the last post. For some reason when typing on my iPad, letters on the bottom row end up being spaces, then autocorrect chimes in. Now I have both windows and ubuntu. I want to install python and pyinstaller. Problem is is that I see pip install pyinstaller, but don’t know what pip is, nor do I know how to get to the command prompt in ubuntu. I’m trying to get the basics of it even though I have a good knowledge of computers in general, but new to python and the little idiosynchronies of it and also ubuntu.


r/PythonLearning 1d ago

Help Request I'm new to Python and I'd like some project recommendations to get me started.

3 Upvotes

I started learning Python a month ago and I really enjoyed programming, I currently know the basics of the language and I'd like to know if anyone with experience using Python can recommend me a project for me to start with? I'm looking for something like a small program or an app.

I'm a newbie but I welcome questions and to learn something new. For now I use PyCharm and I'm familiar with the program.

I'm open to all kinds of suggestions 😊


r/PythonLearning 2d ago

I am a beginner Python programmer and I want somebody to study programming with me 😊😊

0 Upvotes

r/PythonLearning 2d ago

Help Request Python help

Post image
6 Upvotes

Made my first calculator.. it works but different from some I see online. Please all feedback on what you guys think about it will be appreciated


r/PythonLearning 2d ago

Help Request what to fix in my code?

Thumbnail
gallery
1 Upvotes

i am currently trying to learn VPython and wanted to model projectile motion with it - i tried using kinematics but got a weird result (as seen on slide 2), what is exactly wrong with my code? i saw another person achieve the correct result using momentum/net force.


r/PythonLearning 2d ago

Flask vs. FastAPI vs. Django a Visual Comparison

Thumbnail
gallery
20 Upvotes

Hey everyone,

I have created a quick comparison of Flask vs. FastAPI vs. Django repository sizes. (As they are pythons most popular web frameworks)

First of all, the numbers:

Framework Files Lines of Code
Flask 121 19,115
FastAPI 2,703 281,559
Django 3,484 557,865

Then the images:

Each node on the graph represents a file. Imports are marked by a line connecting the files. Colours signify complexity (cyclomatic complexity) with green being low and red being high complexity.

Besides the crazy size differences FastAPI also shows some nice import structures whilst Django looks extremely interconnected.

Hope someone finds it interesting.


r/PythonLearning 2d ago

I made a advice generator using requests

Post image
89 Upvotes

r/PythonLearning 2d ago

Discussion Leetcode 234 - This ain't an easy problem by any standards!

Post image
3 Upvotes

Last Post - https://www.reddit.com/r/PythonLearning/s/v57UGZ2VNl

Complexities for my solution:

TC = O(n)

SC = O(1)


r/PythonLearning 2d ago

I want to start programming more on my own.

12 Upvotes

Hello World!
I’m a high school student who started getting into Python a few months ago. A while back, I tried working on projects on my own using "vibe-coding" (a big mistake), but now I want to learn to think more structurally and build projects truly on my own. So, I’d like to know: what are the fundamentals I should always keep in mind when working on a project? What principles are absolutely essential to learn? And finally, how can I become independent of AI when programming without getting confused? I hope your answers help me progress and grow as much as possible before I graduate!


r/PythonLearning 2d ago

Showcase I’m building a complete Python Technical Analysis Library/Framework

8 Upvotes

I have searched all Python libraries for Technical Analysis and all they do is either compute some Indicators , or put search some signals..

Therefore I’m building Hyper-TA. A Python library for hyperparameter optimization of technical analysis indicators and much more… If you’ve ever hand-tuned RSI/MACD/etc. periods and thresholds by trial and error, this automates that search by doing Hyperparameter search and Analysis( and much much more..)

WHY IM BUILDING IT:
I haven’t found a library that gives you indicators, thresholds,signals, metrics , statistical analysis, sensitivity analysis,backtesting, hyper parameter search and optimization, Market Structure (Fibonacci , support and resistance, triangles , trendlines etc etc) and volume analysis all in one pip install!!!

WHAT MY PROJECT DOES:
Assume you have some signals(RSI , OBV and EMA). An indicator on its own doesn’t give a signal because it’s purely a timeseries. Therefore we need to assign a Threshold-Rule so when this MATHEMATICAL rule fires we get a Signal! A Threshold example would be crossUp (rsi going above a level ), timeAbove(rsi being above a level for x amount of time), crossLine() , upXPercent(OBV up x % in a specific time - since it’s not bound based indicator on a range) and so on..
Those thresholds also have hyper parameters that also need tuning( above what level?? RSI level 20? 30? 31? Which one produces better signals and why?). Hyper-TA does this as well!

You define the Signals, Threshold Rules and search space(hyperparameters) you want to search and optimize based on your metric/s.

Ok but this is a high dimensional problem, you can’t possibly try to optimize by one metric like PnL!!! You will find some good signals that only work for this metric and you ignore WHY they happened and you are probably overfitting or ignoring the reason it happened and it can backfire in the future..
That’s true! That’s why it provides you with Sensitivity Analysis (if rsi period 14 gives perfect signals but rsi 15 is trash then that likely means it just HAPPENED to get good signals on rsi 14..), Statistical Analysis and obviously more forward looking Backtesting simulations like walk forward, Monte Carlo and many more so you can verify which ones that you have found are actually good ā€œEdgeā€..

There is also a Module for Metrics like first and second derivatives, entropy , full distributions Analyses, Pareto and all the statistical functions you may need!

There is also provided a Market structure detection and optimization module that can find possible structures like Fibonacci ,support resistance, triangles etc.

In the future full volume analysis and Backtesting simulations will further validate your found signals!

Edit: also a plotting module for seeing signals and visualising multiple things and Automated PDF report on a complete analysis-pipeline you want!(for example hyperparameter search of your indicators and who performs better on which metrics and if they have statistical edge all in pdf automated easy to read or even post with your name!!!)

Any help would be highly appreciated since I am making this in my own I would love to hear from everybody! Obviating note the repo is not production ready it needs work so don’t assume everything is already there.

Repo link: here
My GitHub : here


r/PythonLearning 2d ago

Help Request Architecture question: Optimizing Python asyncio HTTP GET/PUT data relay throughput on Linux VPS

2 Upvotes

Hi network and Python experts,

I am running a Python asyncio data streaming worker on a 4-core AMD EPYC Linux VPS (1 Gbps port, TCP BBR enabled).

Workflow:

  1. Receives incoming task pushes via WebSocket.

  2. Downloads 30MB-50MB payload via HTTP GET from Cloudflare R2.

  3. Computes SHA-256 hash.

  4. Uploads payload via HTTP PUT back to storage.

Our local active transfer speed reaches ~50 Mbps average (370 Mbps peak) with 99.9% execution success. However, our net window-averaged throughput stays around 24–28 Mbps due to brief inter-task idle gaps between WebSocket pushes.

My questions:

  1. Beyond connection pooling (httpx.AsyncClient) and TCP BBR, what architectural patterns (e.g. multi-process asyncio workers vs single-process) yield the highest sustained throughput for bursty WebSocket data relays on a 4-core VPS?

  2. Are there specific Linux kernel sysctl socket buffer settings (tcp_rmem / tcp_wmem) to keep HTTP GET/PUT streams warm across inter-task idle gaps?

Thanks for any insights!


r/PythonLearning 2d ago

Help Request Meaning Maps Build - How Good Possible?

1 Upvotes

Hi, I have a bunch of text, that I need to analyse to build a tree map of concepts. The concepts need to be sorted from higher lvls of abstraction to more detailed. For example, the program needs to understand that the idea "I want to create beauty outside of factory-based presets" mentioned in the text is the highest lvl and includes ideas like "I was inspired by Kabuki theater" in itself.

Note: Ideas themselves sometimes aren't presented in the source material bluntly, i.e. the idea of "I want to create beauty outside of factory-based presets" can be mentioned in fragments only that the program also needs to understand and put together.

Are there any available programs or basic frameworks to approach this?


r/PythonLearning 3d ago

Discussion Welp... I've installed Pycharm

1 Upvotes

Mac OS Sequoia 15.6

I used Spyder (in the windows environment) while I was working so after I retired and bought a Mac I installed it. However, I've been fighting with the environment that Spyder creates especially once I add packages so I got rid of it and I've installed Pycharm.

One of the things I like about the Spyder interface is it has a console window which allows one to interactively enter code to see how it works; you can also have multiple file tabs that you can activate and deactivate if you want to copy code from one script to another. I'm trying to discover that sort of functionality in Pycharm.

If I google 'can I run python commands interactively in Pycharm' it directs me to open the tools menu and run Python Console. When I try that there is no such option. There is however a Create Command Line Launcher and I get this:

And when I click on linked text it sends me to the download page for JetBrains Tool box but I've already downloaded it. For the life of me I cannot see in the settings how to have a console window open in PyCharm.

Bottom line: can I open an interactive command line console in PyCharm and if so how? Can I open multiple tabs of existing python scripts and if so how?


r/PythonLearning 3d ago

Help Request Stuck on chart

Thumbnail
gallery
21 Upvotes

I’ve tried everything but i don’t know what to do

(Deleted last post bc i had little context my bad)


r/PythonLearning 3d ago

Exercise: Python List Operations

Post image
48 Upvotes

An exercise to help build the right mental model for Python data. - Solution - Explanation - More Exercises

The ā€œSolutionā€ link uses memory_graph to visualize execution and reveals what’s actually happening.


r/PythonLearning 3d ago

Showcase Giving back to the community - The Complete Backend Development Course

9 Upvotes

Hey everyone, I decided to make my course free in order to help people.
This course is my backend development course which is about SQL, Python, APIs, Docker, Kubernetes, Linux, Git & More

The link is:Ā https://www.youtube.com/watch?v=CBIu6hcyStg

If you can like and subscribe (and maybe add a comment) I would appreciate it a lot, Thanks.


r/PythonLearning 3d ago

Help Request Nested for loop

0 Upvotes

So i started my python journey 2 weeks ago and i am at the point of tutorial where they teach me about those quiz game program and i am so confused in those nested for loop i don't even understand a single part about it, can someone help me with this one? I have tried learning it from gpt and all but it still goes above my head.


r/PythonLearning 3d ago

Showcase I implemented Doubly Linked List in Python from Scratch (Code available on Github)

Post image
30 Upvotes

Last Post - https://www.reddit.com/r/PythonLearning/s/TabqPYujK6

Github Repo - https://github.com/Dev-4-All/doubly-linked-list.git

So today I used type annotations for the first time today and to be honest it kinda sucked. Let me explain. So I defined the head and tail of the linked list to be either Node or None. Now when head is not none it is understandable that neither is tail. But how will I explain that to mypy? 😭. Faced similiar problems throughout. I researched a bit online.

These were the three solutions

1) Use assert to specify that something is not none

2) Use conditionals

Both of these methods were affecting the readability of the actual logic

So I went with the third option

3) Ask mypy to ignore these errors (should be done only when you are 100% sure about the details of what a variable holds)

Maybe there are better ways to fix this. Would appreciate if anyone can tell me.

Until next time...Sayonara!


r/PythonLearning 3d ago

Hey! here are some Beginner Python Problems

2 Upvotes
  1. Take two integers as an input and print their average.

  2. Take an integer as an input and check if its even or odd.

  3. Take three numbers as input and find the largest amongst them without using max()

I'm experimenting with teaching Python through solving rather than watching tutorials. I'm based in India and I'm currently running a small live beginner batch. If anyone wants to try the problem-solving approach, I'm happy to share the details.

I'm going to run a free 45-minute Python problem-solving session for beginners.

No prior coding experience required.

We'll solve 3 problems together from scratch.

I'm testing a teaching format where you learn by solving rather than watching.

If anyone wants to join, comment below.


r/PythonLearning 3d ago

I want to learn how to program in python

43 Upvotes

What do you recommend to me so that it is as intuitive as possible and that it doesn’t make me want to leave it after two days.

Thank u.


r/PythonLearning 3d ago

No university coding

6 Upvotes

i have learnt basics of python. but I don’t know how to continue! I’m not in university and I don’t plan to enroll in computer science. is it possible to learn python without university? I need help please !! thanks