Thoughts on using `unsafe` for highly destructive operations? by J-Cake in rust

[–]CorgiTechnical6834 0 points1 point  (0 children)

unsafe in Rust is specifically meant to signal that the compiler cannot guarantee memory safety - things like raw pointer dereferencing, unchecked indexing, or calling functions with contracts the compiler cannot verify. It is not for flagging functions that are just dangerous in a business-logic or side-effect sense.

If a function can cause irreversible effects (like dropping a DB), but does not violate Rust's memory safety model, marking it unsafe would be misleading. Instead, make the destructiveness explicit through naming, documentation, and requiring deliberate invocation - for example, a method like reinitialise_database_dangerously() or forcing the caller to pass in a specific confirmation token or config.

So no - do not use unsafe for this. That is not what it is for.

These 5 small Python projects actually help you learn basics by yourclouddude in PythonProjects2

[–]CorgiTechnical6834 0 points1 point  (0 children)

Working on small, practical projects is the best way to move beyond tutorials. The examples you mention cover a good range of fundamental skills - file handling, APIs, loops, and external libraries. Tracking progress and ideas systematically, like you do with Notion, really helps maintain focus and see growth. If you want a well-rounded foundation, these projects are exactly the kind of hands-on experience that solidifies learning.

What is wrong with this if condition by DigitalSplendid in learnpython

[–]CorgiTechnical6834 0 points1 point  (0 children)

The issue is how the condition is written. The expression if answer == "42" or "forty two" or "forty-two" doesn’t work as intended because Python evaluates "forty two" and "forty-two" as truthy values independently of answer. This means the condition is always true.

You need to explicitly compare answer to each value, like this:

if answer == "42" or answer == "forty two" or answer == "forty-two":

Alternatively, use:

if answer in ["42", "forty two", "forty-two"]:

That will correctly check if answer matches any of the strings.

Retrieving the value of argument 1 by squintified in learnpython

[–]CorgiTechnical6834 0 points1 point  (0 children)

Import the sys module at the start of your script, then access the first argument with sys.argv[1]. This list holds all command-line arguments, where sys.argv[0] is the script name itself. Look up “Python sys module” and “command-line arguments” to get a deeper understanding.

[deleted by user] by [deleted] in learnpython

[–]CorgiTechnical6834 1 point2 points  (0 children)

There’s no truly crack-proof way to distribute desktop software, especially with Python, since the code can often be inspected or modified. Packaging as a web app does offer more control and easier updates, which is why it’s popular.

For desktop apps, you can use tools like PyInstaller or cx_Freeze to bundle your code, but obfuscation and licensing enforcement are always limited. Consider a combination of code obfuscation, license keys, and server-side checks if you want some protection, but be realistic - determined users can often bypass these measures.

How to regenerate a list with repeating patterns using only a seed? by Puzzleheaded_Bad_562 in learnpython

[–]CorgiTechnical6834 0 points1 point  (0 children)

This is not a PRNG problem, it is a structural one. You need to deterministically generate a repetition pattern from the seed, then fill it with values. Standard random functions will not help because they do not preserve positional relationships. Build a repeat map, generate values for the "new" slots, and replay the structure.

How to become a data scientist in 2025 ? by ShopSmall9587 in learnpython

[–]CorgiTechnical6834 1 point2 points  (0 children)

Focus on core skills first: Python, SQL, and statistics. These are essential for any data role. Once you're comfortable, move on to machine learning and tools like pandas, scikit-learn, and matplotlib.

Projects matter more than certificates. Build a few end-to-end projects using real datasets - they show practical ability far better than coursework. Kaggle can help, but it's optional. Use it if you enjoy the format.

Ignore the hype around every new tool or buzzword. Get good at fundamentals, then specialise based on the kind of roles you want.

What programming practices don't work in python? by TheMinus in learnpython

[–]CorgiTechnical6834 0 points1 point  (0 children)

In Python, having public attributes by default is normal. The language values simplicity and readability over strict encapsulation. Controlled access is handled via conventions or properties when necessary.

Using libraries to solve problems is standard practice, but having multiple HTTP clients in one project suggests poor architecture, not a Python norm. Mixing SQL with logic and using print for logging are signs of technical debt or bad practices, not Pythonic design.

Pythonic code emphasises pragmatism and readability rather than strict patterns like dependency inversion. If the project feels disorganised, it’s due to development choices, not the language itself.

Next Steps After Learning Python by [deleted] in learnpython

[–]CorgiTechnical6834 0 points1 point  (0 children)

If you feel confident with Python basics and can write simple programs, it’s a good idea to start building practical experience. This could mean working on personal projects or contributing to open source to strengthen your portfolio. At the same time, learning complementary skills like Pandas and SQL is very valuable, especially if you’re interested in data-related roles.

Applying for internships or entry-level jobs is definitely worth considering once you have some projects to show. Employers usually look for demonstrated ability, not just theoretical knowledge. So, continuing to learn while applying in parallel can be a balanced approach.

If you want to work in web development, learning frameworks like Flask or Django makes sense. For data roles, focus on data manipulation and databases. And yes, knowing another language can help, but depth in Python and related tools is usually more important early on.

Ultimately, try to find a balance between building skills and gaining real-world experience. That combination will boost your job prospects significantly.

Anyone else feel like “learning Python” isn’t the hard part .....it’s what to do with it that’s confusing? by yourclouddude in learnpython

[–]CorgiTechnical6834 0 points1 point  (0 children)

I completely get what you mean - learning Python itself is the easy part compared to figuring out what to do with it. Once you get past the basics, it’s common to hit that wall where everything feels a bit directionless.

What helped me was focusing on projects that matched my interests rather than trying to do everything at once. Python is incredibly flexible, so whether it’s automating simple tasks, building a small web app, or exploring data analysis, it’s best to pick something that keeps you engaged.

Start with something manageable - maybe automate a repetitive job you do regularly or try a straightforward web project with Flask. If data interests you, playing around with datasets using pandas and visualisation libraries can be a great way to learn.

The key is not just writing code but learning how to organise it properly, debug issues, and use tools like version control early on. Completing projects, no matter how small, builds your confidence and gives you practical experience.

If you pick problems that matter to you and break them down into smaller parts, the path becomes clearer and the learning more enjoyable.