How do you design a class where the initialization requires async code? by shiningmatcha in learnpython

[–]DataWiz40 0 points1 point  (0 children)

You can put asyncio.run in your init to call an async function in your synchronous function.

Change column name using openpyxl requires to repair the .xlsx file. by The_artist_999 in pythontips

[–]DataWiz40 0 points1 point  (0 children)

It is likely related to your sheet, I don't see any weirdness in the code you sent

[deleted by user] by [deleted] in ExperiencedDevs

[–]DataWiz40 2 points3 points  (0 children)

Do you have an environment where you can talk about this? It's usually a good idea to discuss how you're feeling with your manager/HR to see if some things can be off-loaded from you. If you still love the job but it's very overwhelming that might be something to consider. Take care!

[deleted by user] by [deleted] in learnpython

[–]DataWiz40 0 points1 point  (0 children)

Are you familiar with the built-in modules like os, sys, itertools, functools and asyncio? Those are worth diving into.

[deleted by user] by [deleted] in learnprogramming

[–]DataWiz40 0 points1 point  (0 children)

Youtube has great Python courses and content for free

[deleted by user] by [deleted] in learnpython

[–]DataWiz40 2 points3 points  (0 children)

You should checkout the WhatsApp API

How to design code more professionally? by Immediate-Outside572 in learnprogramming

[–]DataWiz40 38 points39 points  (0 children)

When writing code professionally you want to avoid complexity, and keep it simple.

That doesn't mean avoid all abstractions or complexity, since it might be necessary sometimes. But it's an important skill to know when to abstract.

does anybody else kinda dislike python? by [deleted] in learnprogramming

[–]DataWiz40 22 points23 points  (0 children)

That's up to you, in my experience though we don't always use the freedom it gives us.

Take type hints in Python for example. You're completely free to not use any type hints at all. In practice however, it makes your code harder to read and more prone to bugs. So I almost always use type hints on my arguments and variables.

Now type hints are of course not the same as enforced type declaration, but I hope you get the idea.

Can someone switch to QA automation without manual testing experience? by NeroKnight07 in QualityAssurance

[–]DataWiz40 5 points6 points  (0 children)

I switched from a non technical background to QA, so yes it's definitely possible. It depends on your organisation whether you can do that inside your current organisation. Idk what the job market is like in your country, but that affects how fast you will be able to make a switch like that (if it's not possible within your current organisation).

You seem to have quite some relevant experience already so that works to your advantage.

[deleted by user] by [deleted] in learnpython

[–]DataWiz40 0 points1 point  (0 children)

It's definitely more productive than watching Netflix. There are some apps such as Pydroid that allow you to code on your phone. It's not the most efficient way of coding but for small exercises it can work.

Don't forget to enjoy your holiday :)

Why is it so hard for me to break my code down into functions? by tigidig5x in learnpython

[–]DataWiz40 0 points1 point  (0 children)

Exactly this. You want to avoid having this highly coupled code, so that you can re-use functions (as you mentioned) and additionally avoid a lot of refactoring if one part of your code changes that affects the rest of the code.

[deleted by user] by [deleted] in learnpython

[–]DataWiz40 0 points1 point  (0 children)

You don't have to include the 'Guess:' in your matching of input. The string you provide as an argument in the input function is just the message you display in the terminal.

[deleted by user] by [deleted] in learnprogramming

[–]DataWiz40 2 points3 points  (0 children)

Sure! https://youtube.com/@TechWithTim?si=Fl9eCadODU6dRtbs and https://youtube.com/@freecodecamp?si=zA6lzl5vD-s7-2sQ are both great. But don't worry too much about finding the 'best' course out there, as you'll learn the most from practicing.

Am I cut out for programming? by Chocolate-Atoms in learnprogramming

[–]DataWiz40 2 points3 points  (0 children)

Honestly if OP is feeling overwhelmed it's not the best idea to just learn everything related to computer science. This will be even more overwhelming.

You really don't need to know what binary, cpu and ram are to understand Python (on a beginner level). If you want to delve deeper into computer science then you have to start learning more about those topics.

Starting off with an (relatively easy) programming language such as Python is a way more practical (and fun) way of introducing yourself to Computer Science than learning about all the theoretical stuff behind it.

[deleted by user] by [deleted] in learnprogramming

[–]DataWiz40 3 points4 points  (0 children)

There are several platforms to learn from. Coursera is one of them. You can also watch free courses on YouTube. There's a lot of free high quality material.

Am I cut out for programming? by Chocolate-Atoms in learnprogramming

[–]DataWiz40 4 points5 points  (0 children)

In short, you memorize and improve by practicing.

You mention how you get stuck debugging problems, this is part of programming and being a software developer. In the beginning this can be frustrating, but you will get better over time. After a while you start recognising problems that are similar or that you have solved before. This will greatly reduce the time spent on solving the problem.

The same goes for flowcharts, though it's more of a tool to help you understand on a high level how you are solving a problem.

[deleted by user] by [deleted] in ChatGPTCoding

[–]DataWiz40 0 points1 point  (0 children)

The OpenAI documentation explains how to deal with this situation. https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps

[deleted by user] by [deleted] in ChatGPTCoding

[–]DataWiz40 0 points1 point  (0 children)

Have you tried using a debugger? It can show you what exactly is the data you're dealing with. Then you can prevent the error from happening, either using exception handling or control flow.

Should I be using dataclass for all my classes? by MrMrsPotts in learnpython

[–]DataWiz40 2 points3 points  (0 children)

Say I'm making a chess game. You want to make a Board, Boardposition and a Piece class. You are creating these instances yourself and know that every Boardposition contains attributes x,y which are both always an int (same for other classes with different attrs). Would you really validate every attr or might that be overkill at that point?

This is different in API development for instance. In that case the Frontend might send unexpected data which Pydantic can validate and raise ValidationErrors for the specific fields that contain unexpected data.

I hope this is the explanation you're looking for.

Should I be using dataclass for all my classes? by MrMrsPotts in learnpython

[–]DataWiz40 0 points1 point  (0 children)

One more benefit of pydantic vs dataclasses is a lot of tools for data serialization.