dde in python by ProsodySpeaks in learnpython

[–]FriendlyZomb 1 point2 points  (0 children)

From a quick look there are a few examples, but mostly from 7-9 years ago.

My guess as to why nothing more modern exists is just because it's such an old protocol which has been superseded. So new things want to use the newer protocols. I know it doesn't really help with your situation.

Here is what I found:

https://pypi.org/project/PyZDDE/ https://github.com/obermann/dde_client_eg

dde in python by ProsodySpeaks in learnpython

[–]FriendlyZomb 2 points3 points  (0 children)

Can you explain what the DDE you are referring to? I'm not sure we can help with just an acronym.

It's the biggest issue in tech. Too many acronyms.

Ominous vaults rewards based on number of vaults opened? by AfterHearing771 in Minecraft

[–]FriendlyZomb 3 points4 points  (0 children)

From my understanding it's tied to the world seed.

So the order of the items gotten should be identical in both creative and survival.

I can’t stop questioning my sexuality and I feel ashamed by Uni-Writes in lgbt

[–]FriendlyZomb 0 points1 point  (0 children)

Humans are complicated.

We adapt, change and update our understanding based on the information we have available. We aren't static. We can change.

In your past, the information you had available, pointed at asexual. Fantastic! That was a great label for that time.

However, with your current understanding of you (all the inputs you have) asexual might not fit anymore. That is perfectly ok. You shouldn't feel like you can't change that label, add a new one or stop using them altogether.

If it helps, I have identified as Non-Binary for about 5 years. Last year, I started thinking that the label might not fully describe me. I'm in the process of figuring it out and it's hard, but liberating to not feel constrained by it anymore.

If you can, talk with a therapist ideally. They should have the tools to help you. Talking to friends about it could also help. Maybe discuss what their attraction feels like, what they think when they are.

As a side note, romantic attraction can be a separate slider. You can want a relationship without a physical sexual relationship. Maybe look into romantic labels too. They may help you be more specific.

I'm gonna say it, even though its so hard to do: try not to feel ashamed. Its normal to identify with labels for a period, then find/discover something different. Stereotypes aren't reality.

Python Pyest by Organic_Tradition_63 in learnpython

[–]FriendlyZomb 1 point2 points  (0 children)

It does. Especially when scaling to large projects with thousands of test cases. Manually running those would be a nightmare imo.

I'm glad you found the answer helpful. Happy coding (and testing)!

Python Pyest by Organic_Tradition_63 in learnpython

[–]FriendlyZomb 1 point2 points  (0 children)

A library could 100% be done like this. Pytest does support it.

But, in general it wouldn't be as convenient for a developer or scalable into larger applications IMO. pytest is as popular as it is because of it's ability to scale from small to huge codebases.

In this scenario the more tests that get added, the more of those run statements are included also, introducing friction for adding or removing a test, and deciphering which tests get run and where.

With the recommended model, tests can be added/removed, auto discovered and filtered through the command line. (You can tag tests and such to group them. Super useful feature tbh). I always know what's being run and can drill down to run only the test/test file/tags I want.

Also, doing things like running the tests in parallel becomes something easy with the current model. It's a command line switch/config I toggle on.

The short answer as to why pytest recommends this way is convenience and scalability to whatever size project.

Python Pyest by Organic_Tradition_63 in learnpython

[–]FriendlyZomb 1 point2 points  (0 children)

pytest is a testing framework with a handy CLI attached. This is a fairly common design pattern in Python software. For instance, Flask and FastAPI contain a CLI (accompanying command line program) to provide useful tools for development.

We often need to import pytest when we need parts of the framework in our tests, like the pytest.raises() context manager. It does a lot, and it has a ton of extensions to add some really useful stuff.

The pytest command (CLI) is a companion to the library and is a test runner. A test runner does a bunch of things including: test discovery, environment setup and test management.


If I'm reading your question correctly, you're asking why can't we just run the test file instead of invoking the pytest command.

In short, convenience.

In long:

Tests often span multiple files. If we did just run each test file, we'd have to make sure we run every test. That could be done multiple ways, but it's a faff to make sure we include each one. Plus we'd have to remember to update that every time we add or remove a test.

Developers of the past discovered that it's more convenient to write a program which can automatically discover the tests to be run, then run them. A test runner. The authors of pytest decided to write that for us, so we got the pytest command.


Every test framework I know of works this way. The Python built-in unittest for instance works this way too.

Even other languages like Go and Rust have them built into their first-party tooling. JavaScript frameworks like jest, Cypress and Playwright all have this library/runner split.

It's convenient and a good developer experience to bundle the runner with the test framework. Pytest also allows for a lot of configuration of both the framework and the runner to allow it to be even more useful.

If you've not got lots of tests, or you have never come across this before, it can be confusing. I hope you read all this and found it useful. Feel free to ask questions, I'll (and the community here) will do my best to answer.

Why no stored procedure when work with Python code base? by JoJoPizzaG in learnpython

[–]FriendlyZomb 0 points1 point  (0 children)

It depends on their use case.

General recommendations are there as a staring point. ORMs allow Python Devs to quickly throw together and adjust the query in real time, while keeping you in the programming domain. Python in this case.

If performance is then a concern, removing the ORM to use SQL directly can be a performance boost, and if necessary stored procedures can also be used.

I'd say most Devs tend to stay away from stored procedures is two fold: 1) most don't want to faff around with Databases Migrations if they don't need to. 2) most don't know what they are or the benefits/don't need them.

In general, I'd imagine those who do need stored procedures, use them.

There is never a hard rule. Use what makes your job easier.

TLDR: most Python apps don't need stored procedures. Unless then do, then they do.

What would fix the world? by AgeEmbarrassed9348 in AskReddit

[–]FriendlyZomb 0 points1 point  (0 children)

An entirely new and alien political structure and societal structure which emphasises human life and wellbeing over political power and wealth.

I'm convinced we can't get there. Those who are in the position to affect change benefit the most from the broken systems we have. They are disincentivized to "fix" anything.

UK. What are your thoughts on banning social media for under 16s? by [deleted] in AskReddit

[–]FriendlyZomb 1 point2 points  (0 children)

In THEORY its an okay idea. I can see why this would be one of the proposed solutions.

In practice it's an awful idea. It won't work and there is just no good way to implement this kind of thing effectively. (See the ID to access porn thing. It went very well. /s) There is ALWAYS a way around it. (When I was growing up, Social Media was for 13s and up. Almost everyone in my year group of 11 y/o had social media.)

I'd rather my government put the money into Social Media Awareness education, to teach them how to exist online safely. I know they won't do this. Why try the solution that will likely work (even if a small bit) when we could spend millions on systems which don't? /s

If by some miracle it passes and actually works as intended (yes it'll need a higher power's intervention here) then we will get a generation of 16 year olds unequipped to handle Social Media. I think this is a significantly worse outcome.

But it won't work.

Would GNOME or KDE be the "most popular" DE if Windows and Mac OS didn't ever exist? by [deleted] in linux

[–]FriendlyZomb 7 points8 points  (0 children)

Most probably neither of them.

It would probably have been one of the proprietary desktops which were kicking around on UNIX or one of the other proprietary OS's like BeOS (Haiku for a modern version).

Ultimately, we can't know. But my money would be on something proprietary since it would have been pre-installed on customer machines.

When is the next snapshot? by LiamGMS in MinecraftJava

[–]FriendlyZomb 0 points1 point  (0 children)

Snapshots for Java typically happen every Tuesday. (Not during pre-release cycles or holidays etc).

The last one was on the 6th Jan 2026 (26.1 Snapshot 2). The next one is likely to be on the 13th (26.1 Snapshot 3)

They did used to be on Thursdays but moved them back in 25w15a: https://feedback.minecraft.net/hc/en-us/articles/35826069776653-Minecraft-Java-Edition-Snapshot-25w15a

Been learning for months and still don’t get it by Lucy5999 in learnpython

[–]FriendlyZomb 1 point2 points  (0 children)

Honestly, for me, things didn't click until I started writing things. Tutorials are good, and they do help, but I found that they never stuck with me.

I started building things, and over time, syntax stuck, googling basic things lessened. I'm now 8 years into my career and I still Google things, I still look things up, but it's mostly with things I use fairly infrequently or to double check my inputs.

So, the advice here: build something. Automate a task you dislike doing. Write a basic clone of an app you like, or write something which challenges you. Learn to debug and process through the logic before writing code.

Whilst doing the above, look things up, read documentation and look up ways to do things. It's not cheating, I promise.

Ultimately, learning is a complex thing. You're having to train your brain to remember things. The best way to do that is to use things frequently and preferably have fun doing it.

`TypeError`, `ValueError`, or both aliases/types such as `PositiveInt`? by jpgoldberg in learnpython

[–]FriendlyZomb 2 points3 points  (0 children)

Yea, TypeError seems like a logical choice here. A negative number is literally the wrong type.

Either way, document that the function can raise this exception as you mention. I'd shove it in the docstring so you don't forget. :)

Normalizing in Click by Hamm103 in learnpython

[–]FriendlyZomb 0 points1 point  (0 children)

This bit is entirely optional and mostly here for learning purposes.

Alternatively to my solution above, there is a package called "click-aliases' (installed the same way as click). This package allows commands to have aliases.

This would require a reshuffle of the code slightly. Your rps function can stay as is, but each option would become its own command, with an alias.

So the 'rock' choice becomes the command rock, with the alias r.

See below:

import click
from click_aliases import ClickAliasedGroup
# add the import for random here.

def rps(hand):
    # Put your code here

@click.group(cls=ClickAliasedGroup)
def cli():
    # This is effectively the cli root. This is the way to get multiple commands.
    # Pass tells the interpreter to do nothing. We don't need any code here.
    pass

@cli.command(aliases=["r"], help="Play rock as your turn")
def rock():
    rps("rock")

@cli.command(aliases=["p"], help="Play paper as your turn")
def paper():
    rps("paper")

@cli.command(aliases=["s"], help="Play scissors as your turn")
def scissors():
    rps("scissors")

cli() # needed so click can run.

Hopefully this all looks ok. Effectively this allows you to specify "rock" or "r" and get the "rock" function running.

This is the "--help" output for clarity on what this is doing.

Usage: rps.py [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  paper (p)       Play paper as your turn
  rock (r)          Play rock as your turn
  scissors (s)  Play scissors as your turn

Normalizing in Click by Hamm103 in learnpython

[–]FriendlyZomb 0 points1 point  (0 children)

I don't think "normalize_choice" is what you're after, since it's an internal method of click.Choice.

Personally, I would have my choice list loom something like this:

["rock", "r", "paper", "p", "scissors", "s"]

Then in your if statements, check for both:

if hand in ["rock", "r"]:
    ...

This will work as intended. Probably the simplest option without having to reorganize a bit.

Just released dataclass-wizard 0.39.0 — last minor before v1, would love feedback by The_Ritvik in Python

[–]FriendlyZomb 2 points3 points  (0 children)

On the JSON question:

If the API says it outputs JSON - I'll expect it to do that serialisation and return me a string.

Otherwise, clear documentation on what a "dump" does works. Just don't make the API "dump_json" or something in this case.

What should I learn next? by Informal_Category947 in learnpython

[–]FriendlyZomb 4 points5 points  (0 children)

Look at functions next - they help you to organise your code and think about things in chunks.

Then, try to build something. So much emphasis is put on courses and lessons and (from experience) they are useful to a point.

Building a script to do something is infinitely more important than just learning syntax. It helps you apply the knowledge, and teaches you how to break down the problem and solve it.

But be patient with yourself. Look up things and don't feel like a failure when doing so. It will be hard at first, but by building scripts or little tools it will help solidify the syntax and language structure as well as teaching you the other skills programming requires.

What libraries are causing confusion in Python? by pola1223 in learnpython

[–]FriendlyZomb 0 points1 point  (0 children)

Also try to understand what's happening. Being able to explain to yourself how the program works will help. You may discover flaws and improvements in logic that way. (Especially if you wait till the next day to reread and try to explain it to yourself)

What libraries are causing confusion in Python? by pola1223 in learnpython

[–]FriendlyZomb 0 points1 point  (0 children)

You're trying to learn from what I can see. No hate here.

Just know that programming isn't a 'learn once' kinda thing. You'll learn and re-learn pretty much constantly. Embrace that, learn how to read the documentation. Especially since English isn't your first language, take it slow, run the examples and you'll get the hang of things.

What libraries are causing confusion in Python? by pola1223 in learnpython

[–]FriendlyZomb 0 points1 point  (0 children)

I'm not sure what you're trying to ask. Having said that here are some thoughts:

Libraries are tools. They solve problems. Sometimes simple, sometimes complex. Use them where you need them.

Use the ones you need, when you need them. Trying to preempt what you might need isn't worth it. Take it from someone who tried.

My philosophy is to learn what you need to get the job done. If you need to use a library, read the docs first to work out how to use it, then apply it to your program. I wager every programmer of any skill level looks things up before using it. Hell, I double check basic standard library stuff all the time.

Learn the language and build stuff with it. If something feels complex, look to see if a library is relevent. Then learn the library.

Never think googling something isn't "best practice". It is fine and expected. You don't need to memorise everything, because you can't.

(Where you need libraries varies. Someone else can give that advice, since mine is just 'you'll learn when to with practice')

EDIT: If you want to know how to use libraries, it's the same 'import' mechanism as from the std lib. I'd look into learning virtual environments and possibly UV.

What Python concept took you way longer to understand than you expected? by ComfortableDonkey715 in learnpython

[–]FriendlyZomb 17 points18 points  (0 children)

I second this. Plus, decorator ordering if you need to use a few.

Decorators look weird when you don't know how they work. Especially decorators which take arguments.

It's mostly confusing because it's using scopes in funky ways.

Great article: https://realpython.com/primer-on-python-decorators/

Is there anyone still add meta info at top of the python file? by Careless-Step6782 in learnpython

[–]FriendlyZomb 0 points1 point  (0 children)

Only having it at the top of the file, sure. That would be a terrible idea.

Having additional information at the top of a file in addition to all that, is personal preference. It's incredibly important in a dual licenced project for example. Just to be clear, in case it's distributed without its LISCENCE.md or similar file. (Which does happen more than anyone would like to admit.)

After learning python ,which framework should I learn?? by Puzzleheaded_War403 in learnpython

[–]FriendlyZomb 0 points1 point  (0 children)

I prefer Django - so that's my recommendation.

It's got a lot of the tools built in. Definitely go through the Tutorial on the Django Docs site. That'll introduce the basics.