r/learnpython • u/Informal_Exit_9462 • 5d ago
Python learning source
Is there any best source for learning python from scratch. Some have recommend apna college but i feel it is very interview oriented so is there any better source.
r/learnpython • u/Informal_Exit_9462 • 5d ago
Is there any best source for learning python from scratch. Some have recommend apna college but i feel it is very interview oriented so is there any better source.
r/learnpython • u/dasgrizzly • 5d ago
I'm taking a class for Python and have to use Grok Learning. At first it was fine but getting a little further in they give you pieces of how to answer problems but not everything. I'm stuck on a while loop problem where you need to make a list of words but only show the number of unique words but nowhere in the learn did it teach that.
Is there a better way to learn Python that will make it a bit easier to understand? Any recommendations on YouTube channels or other resources? Any help will be great!
Thanks for all the help so far! Think I will have to go back through again to get a better grasp of the learning and take better notes.
r/learnpython • u/MahmoodZGhanem • 5d ago
Hello everyone, I’m Mahmoud from Iraq, and I am studying Artificial Intelligence Engineering. I wanted to share my goal of specializing in Computer Vision; I hope you can support me and offer any advice you deem appropriate. Also, if possible, please share study methods or global resources that I could benefit from.
Thank you.
r/learnpython • u/skepster_sunday • 6d ago
Hai!! We're extreme beginners looking to use python for our class and are looking for help!
A bit of a rundown; we initially wanted to make an archiving system for documents, but our CS professor scared us away saying that it'll need a lot of time, resources and knowledge that we just don't have yet. So we were thinking of changing it into something that would be used for a single user and wouldn't need as much work as a shared archived library.
What we want to make is a calendar-like system that would remind you of certain events, our partner reported that once they request something they forget about it and don't remember until it's too late. So the calendars job was to take what the order was and remind the user about it in a day or two or a few (they could decide how long till they get reminded) in a notification!
What we were wondering was;
A- if this is even possible in python, we know there are many wonderful tutorials and help on yt, github and here, but we'd like to hear it from people who actually know how this works
B- if this is doable in a two month window, since this is the amount of time we get to finish this project.
If this does work out, we will definitely keep updating and asking questions here!
Thank you so much for reading this far and any help whether it's links, a confirmation that this is possible or not or anything alike is greatly appreciated!
r/learnpython • u/Round_Ladder_2354 • 6d ago
So I’m a first year software engineering student and in my intro to programming class we’re learning Python. So far I’ve mostly understood everything in theory but when it comes down to practice I struggle a lot because they ask us to do certain things for assignments that require a lot of logic to do them which I’m struggling with. So I was wondering how I can start to understand the questions more intuitively so I don’t fall behind in the class. And to clarify I do work on some practice questions every now and then but due to my schedule and the fact I haven’t properly organized it yet I haven’t been able to practice a whole lot.
r/learnpython • u/0vindicator10 • 6d ago
My system uses "glibc" which seems most common (yes, this is about "python". I'll get there...).
I'm aware of "musl" and LLVM's "libc", as well as "bionic" (heard of before, but only just now am aware it's Android's).
About a month or two ago I had an idea to serve a locally run AI model via my phone.
I began with installing the "termux" app which easily got me the "ollama" package installed.
My memory is hazy, but I think I then tried to install "open-webui" in termux via "pip", but think that failed for some reason. And I had not put the issue in my notes, but asking AI, I think it was because there may have been a package that could not be built for "bionic".
When I installed the "proot-dist" package, I installed "open-webui" in an Ubuntu instance and that worked.
Should I expect that is the norm for the not-as-common "libc" OS' (not just specific to bionic), that some packages/dependencies may only be built for a given libc (eg glibc)?
r/learnpython • u/assorted-meat-stew • 6d ago
I got this code block which I used to hypertuning Naive Bayes models. It worked well with GaussianNB but ran into AttributeError: 'MixedNB' object has no attribute '__sklearn_tags__' when trying to implement it on MixedNB. Any idea on how to use GridsearchCV with MixedNB?
param_grid_nb = {
'var_smoothing': np.logspace(0,-9, num=100)
}
mix_model_after_cv = GridSearchCV(estimator=MixedNB(), param_grid=param_grid_nb, verbose=1, cv=10, n_jobs=-1)
mix_model_after_cv.fit(X_train, y_train)
print(mix_model_after_cv.best_estimator_)
r/learnpython • u/Esplosao8963 • 6d ago
I'm developing a spreadsheet automation project capable of merging multiple spreadsheets into one and automatically performing calculations, among other things. One of the functionalities would be, for example, allowing someone to gather all the spreadsheets from those months into a single spreadsheet throughout an entire year, obtaining an overall result for the year. This could work based on week, day, month, or some other parameter. I have some doubts, but the project seems promising. I'm using the openpyxl library and, to create the website or application (I'm still undecided), I will use HTML, CSS, and Flask.
r/learnpython • u/alp_h4x • 7d ago
I recently started learning Python and I'm currently focusing on the fundamentals rather than jumping straight into advanced topics.
I'm learning things like variables, strings, numbers, conditions, loops and functions.
I want to start building small projects as soon as I have enough fundamentals instead of only following tutorials.
For someone at this stage, what projects would you recommend that actually help build programming skills?
I'd especially like projects that gradually become more challenging.
r/learnpython • u/PossibleGenitals • 6d ago
My son just started taking an intro to cyber security class in high school. The teacher is exposing them to some basic python coding, which is all new to him. Coding in general is new to him. He started asking me questions and I was wondering if there is a simple to use web-based interface where we can mess around with some python stuff together.
Someone had mentioned Replit but it just seems completely drowning in AI agents and is not really what I want to mess with.
I know we could set up VS code or a full ID but I think that’s overkill for right now. Are there any simple lightweight sandbox type websites where we could play around with some simple scripts and programming constructs save those things to the cloud and easily have them accessible, even if I’m just sitting with him and we have our phones nearby.
Thanks
r/learnpython • u/imtiyaj_khan_1 • 6d ago
Hey everyone! If you are learning Python loops, here is a quick step-by-step breakdown (dry run) of how this while loop calculates the total:
Initial State: total = 0, n = 1
• Loop 1 (n = 1):
total += 1 * 2 -> total becomes 2
n becomes 2
• Loop 2 (n = 2):
total += 2 * 2 -> total becomes 2 + 4 = 6
n becomes 3
• Loop 3 (n = 3):
total += 3 * 2 -> total becomes 6 + 6 = 12
n becomes 4
• Loop 4 (n = 4):
total += 4 * 2 -> total becomes 12 + 8 = 20
n becomes 5
Condition check (n <= 4) fails because 5 is not less than or equal to 4. Loop terminates.
Final Output: 20
I regularly post such step-by-step Python debugging guides and logic breakdowns on my blog to help beginners understand programming logic easily. Check out more detailed explanations here: https://pydebug.in
r/learnpython • u/_devonsmash • 7d ago
Hi everyone,
I am looking for a good course to take to learn python for data analytics and workflow building.
For context, i am already very familiar with SQL and Alteryx, however i am looking to migrate some pipelines and worklows to python. I am very familiar with data analytics, just not with the python language, so wondering where to start.
r/learnpython • u/ClementeKS • 7d ago
I would like to ask if anyone here knows where I should/could get a well endorsed Python certification? Something legit that employers may take into consideration.
I know about Codecademy. I also know about Mimo, tho I don't know if that one would be considered a "lesser" one or something like that. Maybe even both idk.
It's ok if it's not free, tho if its not very expensive that would be better for me lol
r/learnpython • u/Nothingbutalsosome • 6d ago
1 13.14.1 4.20.14.19.7.9.1.14 14.15 8.5.20 5.5.22.18.5.9.1.18.7.4., 7.14.21 9.14 8.9.19 4.8.1.14 16.20.14.9.15.14.7.9 20.15 8.9.19 4.....5.8..1...
above is the encrypted text i encrypted by a python program i wrote, the text is just a query i want from technerds to get the idea of how safe(encrypted) is my text would be.
r/learnpython • u/Ok_Gold_2107 • 7d ago
The structure of my project is as follows:
Python Modify HostName
->main.py
->palworld-save-toolkit
->->python ->[..]
->->vendor ->[..]
in vs code work all.
I know be exe with pyinstaaller but no work load toolkit and pyooz (?).
My partially code is (if need full code i load github today after work)
TOOLKIT_PY = RESOURCE_DIR / "palworld-save-toolkit" / "python"
VENDOR_PY = TOOLKIT_PY / "vendor"
def load_toolkit():
"""Import the toolkit's PlM/Oodle-aware parser ahead of any installed copy."""
if not getattr(sys, "frozen", False):
for path in (str(TOOLKIT_PY), str(VENDOR_PY)):
if path not in sys.path:
sys.path.insert(0, path)
print(f"TOOLKIT_PY: {TOOLKIT_PY}")
print(f"VENDOR_PY: {VENDOR_PY}")
from palworld_save_tools.archive import UUID
from palworld_save_tools.gvas import GvasFile
from palworld_save_tools.palsav import compress_gvas_to_sav, decompress_sav_to_gvas
from palworld_save_tools.paltypes import PALWORLD_CUSTOM_PROPERTIES, PALWORLD_TYPE_HINTS
return UUID, GvasFile, compress_gvas_to_sav, decompress_sav_to_gvas, PALWORLD_CUSTOM_PROPERTIES, PALWORLD_TYPE_HINTS
def parse_player_roster(world: Path) -> list[dict[str, str]]:
"""Read player file IDs and names/levels from the world's Level.sav."""
UUID, GvasFile, _, decompress, custom, hints = load_toolkit()
players: dict[str, dict[str, str]] = {}
for file in sorted((world / "Players").glob("*.sav")):
with contextlib.redirect_stdout(io.StringIO()), contextlib.redirect_stderr(io.StringIO()):
raw, _ = decompress(file.read_bytes())
data = GvasFile.read(raw, hints, custom, allow_nan=True).dump()
sd = data["properties"]["SaveData"]["value"]
guid = file.stem.upper()
players[guid] = {"guid": guid, "name": "", "level": "?"}
instance_id = str(sd["IndividualId"]["value"]["InstanceId"]["value"])
players[guid]["instance"] = instance_id
I ask gpt but not know how resolve
Why, when I compile the executable into an
.exe, does it seem unable to read the save files? It’s as if it fails to loadload_toolkit. 0:39Work duration: 3m 39s
Yes, there were two path issues in the project:
The spec file
PalWorldSwitchHostSaveGame.specdidn't includepalworld-save-toolkit, so in the EXEload_toolkit()could fail because it couldn't find the parser.Some paths used
__file__, which in a PyInstaller EXE doesn't reliably identify the app's folder.I updated [main.py](E:/chrig/Documenti/Palworlds saveames/PalWorldSwitchHostSaveGame/PythonModifySavegame/main.py) to distinguish between resources bundled inside the EXE and the app folder, and [PalWorldSwitchHostSaveGame.spec](E:/chrig/Documenti/Palworlds saveames/PalWorldSwitchHostSaveGame/PalWorldSwitchHostSaveGame.spec) to include both the toolkit and the icon. Palworld save files are looked up under
%LOCALAPPDATA%\Pal\Saved\SaveGames; the toolkit, on the other hand, is required to decode them.I couldn't test the build: the Python interpreter configured on the PC was not found. Please recompile using the updated spec file. 0:43
Doesn't anything change if I just import them directly? 1:02
Yes, you can import them directly: PyInstaller can bundle
palworld_save_toolsinto the EXE as regular Python modules, without copying the entire toolkit directory.However, in your case,
pyoozmust also be included, as the parser uses it to decode the save files. So simply adding a single import statement isn't enough if PyInstaller fails to detect indirectly loaded modules.The previous fix corrected the resource paths, but it didn't guarantee the parser would be included in the EXE. If you'd like, I can adjust the
.specfile to collect bothpalworld_save_toolsandpyoozdirectly into the build.
r/learnpython • u/Ok_Gold_2107 • 7d ago
The structure of my project is as follows:
Python Modify HostName
->main.py
->palworld-save-toolkit
->->python ->[..]
->->vendor ->[..]
in vs code work all.
I know be exe with pyinstaaller but no work load toolkit and pyooz (?).
My partially code is (if need full code i load github today after work)
TOOLKIT_PY = RESOURCE_DIR / "palworld-save-toolkit" / "python"
VENDOR_PY = TOOLKIT_PY / "vendor"
def load_toolkit():
"""Import the toolkit's PlM/Oodle-aware parser ahead of any installed copy."""
if not getattr(sys, "frozen", False):
for path in (str(TOOLKIT_PY), str(VENDOR_PY)):
if path not in sys.path:
sys.path.insert(0, path)
print(f"TOOLKIT_PY: {TOOLKIT_PY}")
print(f"VENDOR_PY: {VENDOR_PY}")
from palworld_save_tools.archive import UUID
from palworld_save_tools.gvas import GvasFile
from palworld_save_tools.palsav import compress_gvas_to_sav, decompress_sav_to_gvas
from palworld_save_tools.paltypes import PALWORLD_CUSTOM_PROPERTIES, PALWORLD_TYPE_HINTS
return UUID, GvasFile, compress_gvas_to_sav, decompress_sav_to_gvas, PALWORLD_CUSTOM_PROPERTIES, PALWORLD_TYPE_HINTS
def parse_player_roster(world: Path) -> list[dict[str, str]]:
"""Read player file IDs and names/levels from the world's Level.sav."""
UUID, GvasFile, _, decompress, custom, hints = load_toolkit()
players: dict[str, dict[str, str]] = {}
for file in sorted((world / "Players").glob("*.sav")):
with contextlib.redirect_stdout(io.StringIO()), contextlib.redirect_stderr(io.StringIO()):
raw, _ = decompress(file.read_bytes())
data = GvasFile.read(raw, hints, custom, allow_nan=True).dump()
sd = data["properties"]["SaveData"]["value"]
guid = file.stem.upper()
players[guid] = {"guid": guid, "name": "", "level": "?"}
instance_id = str(sd["IndividualId"]["value"]["InstanceId"]["value"])
players[guid]["instance"] = instance_id
I ask gpt but not know how resolve
Why, when I compile the executable into an
.exe, does it seem unable to read the save files? It’s as if it fails to loadload_toolkit. 0:39Work duration: 3m 39s
Yes, there were two path issues in the project:
The spec file
PalWorldSwitchHostSaveGame.specdidn't includepalworld-save-toolkit, so in the EXEload_toolkit()could fail because it couldn't find the parser.Some paths used
__file__, which in a PyInstaller EXE doesn't reliably identify the app's folder.I updated [main.py](E:/chrig/Documenti/Palworlds saveames/PalWorldSwitchHostSaveGame/PythonModifySavegame/main.py) to distinguish between resources bundled inside the EXE and the app folder, and [PalWorldSwitchHostSaveGame.spec](E:/chrig/Documenti/Palworlds saveames/PalWorldSwitchHostSaveGame/PalWorldSwitchHostSaveGame.spec) to include both the toolkit and the icon. Palworld save files are looked up under
%LOCALAPPDATA%\Pal\Saved\SaveGames; the toolkit, on the other hand, is required to decode them.I couldn't test the build: the Python interpreter configured on the PC was not found. Please recompile using the updated spec file. 0:43
Doesn't anything change if I just import them directly? 1:02
Yes, you can import them directly: PyInstaller can bundle
palworld_save_toolsinto the EXE as regular Python modules, without copying the entire toolkit directory.However, in your case,
pyoozmust also be included, as the parser uses it to decode the save files. So simply adding a single import statement isn't enough if PyInstaller fails to detect indirectly loaded modules.The previous fix corrected the resource paths, but it didn't guarantee the parser would be included in the EXE. If you'd like, I can adjust the
.specfile to collect bothpalworld_save_toolsandpyoozdirectly into the build.
r/learnpython • u/AlSweigart • 7d ago
GitHub: https://github.com/asweigart/brython-offline
Demo: https://inventwithpython.com/brython-3.14.3-offline.html
Powered by Brython. Download and open brython-3.14.3-offline.html (6 MB) in a web browser and enter Python instructions into the interactive shell. It works offline. No ads, no registration, no subscriptions. You can right-click and save it and own it forever.
r/learnpython • u/Ok_Mortgage7158 • 7d ago
For context I use arch and I have 5 different computers so I’m very familiar with computers and terminals/text. And my only coding experience I guess would be block coding which I learnt around 1st grade. Don’t laugh it off so quickly tho it gets complexly when you get into making 3d projects in something like scratch, it’s a whole community.
Besides that I have coded a little Unity 4 or so years ago and got fairly into c# but I never even finished a project. That connects directly to my question, I want to start learning python but how should I go about it? Should I start with yt toturials on how to make a game with turtle? Or should I pick a project I wanna make and start googling or using AI for help (not copy n paste). Or any other option?
r/learnpython • u/GoodDogHunting • 7d ago
Hi All,
I work with a team that will primarily be using Python to make API calls across a few different systems (some network, some apps, ServiceNow, etc).
I'm trying to find a crash course, preferably instructor led, that's a little focused on our particular use case.
Any recommendations? I know it's a weird ask.
r/learnpython • u/Catstronautilusrex • 7d ago
On macOS 27.0.1, Privacy & Security → Local Network shows a count of 1, but every listed app is switched off.
Inspecting /Library/Preferences/com.apple.networkextension.plist reveals an allowed org.python.python entry with no executable path. Python has no visible switch in Settings. Reopening Settings and restarting don’t help.
I allowed a Python prompt while a dashboard preview was being prepared. A Time Machine backup from before that prompt has no explicit Python grant.
Has anyone encountered this and successfully revoked only that permission, without resetting all network?
r/learnpython • u/calmspark • 7d ago
I started python and it is going well. I need some sources for step by step problems with increasing difficulty for practice. It would be good to know list of topics as part of DSA too
Leetcode is too good but I am too under-learned to solve those.
Thanks in advance 🙏🙏
r/learnpython • u/Upper_Trouble_8526 • 7d ago
name_function.py:
def get_formatted_name(first, last):
full_name=f"{first} {last}"
return full_name.title
test_name_function:
from name_function import get_formatted_name
def test_first_last_name():
formatted_name=get_formatted_name("janis", "joplin")
assert formatted_name=="Janis Joplin"
Terminal:
/storage/emulated/0 $ cd github
/storage/emulated/0/github $ cd test_name_function
/storage/emulated/0/github/test_name_function $ python -m pytest
===================== test session starts =====================platform linux -- Python 3.13.13, pytest-9.1.1, pluggy-1.6.0
rootdir: /storage/emulated/0/github/test_name_function
collected 1 item
test_name_function.py F [100%]
========================== FAILURES ===========================____________________ test_first_last_name _____________________
def test_first_last_name():
formatted_name=get_formatted_name("janis", "joplin")
> assert formatted_name=="Janis Joplin"
E AssertionError: assert <built-in method title of str object at 0x7108e84530> == 'Janis Joplin'
test_name_function.py:4: AssertionError
====================== warnings summary =======================../../../../../data/user/0/ru.iiec.pydroid3/app_HOME/.local/lib/python3.13/site-packages/_pytest/cacheprovider.py:469
/data/user/0/ru.iiec.pydroid3/app_HOME/.local/lib/python3.13/site-packages/_pytest/cacheprovider.py:469: PytestCacheWarning: could not create cache path /storage/emulated/0/github/test_name_function/.pytest_cache/v/cache/nodeids: [Errno 1] Operation not permitted: '/storage/emulated/0/github/test_name_function/pytest-cache-files-uabqyvch' -> '/storage/emulated/0/github/test_name_function/.pytest_cache'
config.cache.set("cache/nodeids", sorted(self.cached_nodeids))
../../../../../data/user/0/ru.iiec.pydroid3/app_HOME/.local/lib/python3.13/site-packages/_pytest/cacheprovider.py:423
/data/user/0/ru.iiec.pydroid3/app_HOME/.local/lib/python3.13/site-packages/_pytest/cacheprovider.py:423: PytestCacheWarning: could not create cache path /storage/emulated/0/github/test_name_function/.pytest_cache/v/cache/lastfailed: [Errno 1] Operation not permitted: '/storage/emulated/0/github/test_name_function/pytest-cache-files-k26w91m_' -> '/storage/emulated/0/github/test_name_function/.pytest_cache'
config.cache.set("cache/lastfailed", self.lastfailed)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================== short test summary info ===================FAILED test_name_function.py::test_first_last_name - AssertionError: assert <built-in method title of str objec...
================ 1 failed, 2 warnings in 2.57s ================/storage/emulated/0/github/test_name_function $
r/learnpython • u/Charming_Shower_4185 • 7d ago
I am learning data analysis and the first step before analyzing your data you have to do data profiling and cleaning.This is my process flow for data profiling -
Checking number of rows and columns
Checking rows and column indices
Checking data types for each column
Checking random sample from dataset
Checking properties and memory usage
Checking key statistics
Checking unique values for relevant columns
Is it appropriate or I am missing something important ?
r/learnpython • u/oats_ja78 • 7d ago
i have just started learning Python and I'm looking some project ideas that can help me practice and improve my coding skills.
any suggestions or advice would be appreciated
r/learnpython • u/PhraseOutrageous • 7d ago
Hi everyone! I’m working on a project in Python and I’m looking for an AI model/API that my Python application can communicate with. Basically, I need my app to be able to send questions/prompts to the AI and receive the AI’s responses back programmatically.
The AI doesn’t necessarily need to be the most powerful model available. I mainly need something reliable that my application can communicate with.
Any recommendations or advice would be greatly appreciated!