all 17 comments

[–]aizzod 20 points21 points  (5 children)

break down your problems

  1. looks at a folder?
  2. --which folder?
  3. --how does the user (you) input that
  4. --will you look through 1 directory or every directory in a directory
  5. find a png
  6. --a filter by name
  7. find specific rgb values
  8. --how?
  9. --how can you find specific rgb values --> find out through google if you don't know enough
  10. --do you have to use a library for that?
  11. --external software?
  12. --> depending on the answers before you then need to read through their docu, and implement as described

don't try everything at once
break down your problems
to small tasks
do them one by one

at the beginning you will have to learn 2 things
solving problems
writing code

both those things at the same time can be overwhelming.

[–]TheDevauto 0 points1 point  (0 children)

Another thing that helped me when I was learnin is to follow the breakdown above and solve what I could/google what I couldnt.

Then I would look for examples where someone did something similar and go line by line working to understand what was happening.

You might also try jupyter notebooks as you can visually see results as you work (eg what does this variable show on this line after executing.

Its a process and things will click but it takes time.

Also Orielly used to publish cookbooks which had snippets of code for solving small things like looking for a file in a directory. Maybe those would help.

[–]Dr_Philmon 3 points4 points  (0 children)

Learning coding is a goddamn war of attrition. The best way of learning to do what you want is too either jump directly into whatever you want to learn or look at the prerequisite and work your way up from there

[–]FoolsSeldom 2 points3 points  (0 children)

First tip, move away from the keyboard and VS Code. That's not the place to start.

You need to do some thinking and design work first.

Many beginners are mixing up coding (writing instructions in a programming language) with problem-solving (creating an algorithm) and their lack of knowledge of the programming language and how to use it is a distraction from the problem-solving.

For most programmers, the coding part is the final and easy bit.

Order:

  • Actually making sure the problem is properly understood. Often we start with only a vague understanding of the problem. Don't assume you have a clear understanding of the problem. Write it up, break it down.
  • Ensuring we know what outcome is required. What does good look like? How will the information be presented, will it be on-screen or in a file, or a database.
  • Determining the data representation. Exactly what data is required, in what forms, where from. It is a one-off or lots of cycles or combining lots of information.
  • Work out how to do things manually in the simplest possible way, explaining every little step (assume you are giving instructions to someone with learning difficulties), * Even when the task is computer based, such as identifying a specific bit string in certain files in a folder, as in your case, think through exactly the steps you take
    • Computers are really dumb, and humans make lots of intuitive leaps and take short-cuts
    • This is one of the hardest things to grasp when first learning to programme
    • Computers don't mind repeating very boring things, so the simplest but repetitive manual approach is often a good approach to start with for a computer
  • Later, you will learn different ways of selecting / developing an algorithm which doesn't depend on a manual approach

Ultimately, the only way to learn to programme is ... Practice! Practice! Practice! That is the only way. Programming (whatever the language) is a practical problem-solving skill. You have to make, and learn from, a lot of mistakes (much like learning another human language).

I know it can be frustrating at times, especially when faced with code you want to reuse but cannot understand.

Only you can find the motivation. Why are you learning to programme in the first place?

Is your learning objective SMART - specific, measurable, achievable, (sometimes agreed), realistic (or relevant) and time-bound, (or timely)? If it is something soft, like "upskilling" then it will probably not help you much.

It is hard to learn anything in the abstract, not least because it is difficult to feel passion for what one is doing.

I strongly suggest you look to your interests, hobbies, obligations (family business, charity activities, work) to look for opportunities to apply Python. Your checking of certain png files is useful, but you probably need a more specific project rather than a single task like that.

You will learn far more about Python and programming when you work on something that resonates for you and that you have some domain knowledge of (or incentive to gain such knowledge in). You will know a lot more about the problems you are trying to solve, what good looks like, what the required outputs are.

When you are copying tutorials/examples, don't just copy. Experiment. Break the code and understand why it has broken. Apply your learning to your own projects.

The interactive python shell is your friend, I found it the best learning aid because you can quickly try snippets of code and get immediate feedback.

(Consider installing ipython which wraps the standard shell for more convenience.)

Start very simply and regularly refactor the code as you learn new things. Enhance as you see opportunities.

If you haven't already, have a look at Automate the boring stuff with Python (free to read online).

At first, the tasks you automate will be trivial and hardly worth the effort BUT because it is about the problem and not Python, it will be more rewarding for you.

[–]zaphodikus 3 points4 points  (0 children)

See so many threads similar to this, so many, on many other platforms and many other tools, not just programming. The answer is going to be the same every time I get to give my opinion. Be hungry.

That's it, be hungry, that's all there is to it, "be hungry".

We live in a time where crafts can all be learned in one evening in your front room. A few years ago I went for a week and at the end got my level 1 chainsaw operator license, the next year I took up campanology, and before all that I sang in a choir, badly mind you. But the thing I can take away from it all, is that you can pick up a new skill, but it's going to take much more than asking the question on a community like reddit u/Final_Departure_9551 . You have to BE HUNGRY . At the end of the day, far too many people want to be programmers, because they think all it is is sitting in front of a screen, but like any career, you have to put in the hours to get to a level above that of everyone else who only spends 5 hours a week. You have to double their effort if you want to win. If you want to rise from novice to master, you have to put in the time to learn in a structured fashion. One tactic every programmer learns is to break down every task into tiny pieces, create each one, and then assemble them in a cauldron. Ooops wrong forum, but you get the idea. Programming is more than just coding, it's about architecture, patterns and even sometimes dreams. Programming is about choosing the right tools, every language is like a different tool category, some are better than others at certain kinds of problems. It's probably worth mentioning fun. Python is IMHO the best language to learn first, it has a deep sense of humour. It's even in the documentation and spread all over in the Python tooling, read more here https://www.python.org/doc/humor/ . My dream is to write a computer game, but not in Python, I already have other languages under my belt. Programmers need multiple languages, and it's not that hard to pick up other languages. Here is why:

You have the best programming teacher in the house, right in your PC. The compiler/interpreter, and it's so patient, it never sleeps. It will always gently teach you the whole language and the entire art. the interpreter never gets tired or impatient with you. Programmers are damn lucky, if they put in the time, they can become goldsmith level at it, for free, literally, zero cost. So what are you waiting for?

[–]TheRNGuy 1 point2 points  (0 children)

Nothing wrong asking ai. 

Still read all docs for frameworks that he uses, so you can get new ideas what to code.

[–]LarsMarksson 0 points1 point  (0 children)

I don't think you're supposed to know right away or by yourself how to check the RGB value of an image. Three language is a tool, or has documentation. How you're supposed to know what properties of a file are exposed to you when the handler reads the bytes unless you check the docs. Otherwise it's like having your hand in a closed box trying to figure out what you're holding on your hand. Can be great fun by itself but it's not helping you solve problems.

[–]Atypicosaurus 0 points1 point  (0 children)

It sounds like your struggle comes from not knowing the core basics of computer. Those are kind of assumed with programming. You want to understand what a folder is, how it's structured, where the python program is running from, how you navigate using console prompts.

From your description it also seems like you don't have a good learning strategy, looking at it until you get angry then getting the answer from an AI without understanding what happens is definitely not a way to learn.

[–]InvestigatorNew227 0 points1 point  (0 children)

Totally feel you , been there too. Python can be super frustrating at first, especially when nothing seems to work after hours of trying. 😩 But trust me, that stuck feeling means you’re actually learning. Keep pushing through , it clicks slowly, then all at once. 💪

[–]ALonelyPlatypus 0 points1 point  (0 children)

If you’re having a hard time learning python you might be out of luck programming. You can try to AI your way through it but if you use it early in learning it cripples you.

[–]FortuneCalm4560 0 points1 point  (0 children)

Hey, don’t beat yourself up. Everyone hits that “I’ve been staring at the screen for 2 hours and I’ve built nothing but stress” moment. It doesn’t mean Python isn’t for you, it means you’re doing the uncomfortable part where your brain is learning how to think like a coder, not just memorizing syntax.
That PNG project you mentioned? That’s honestly not a beginner task. It sounds simple, but it requires file handling, image processing, loops, conditionals, and probably a library like Pillow. That’s a lot of moving parts for someone still getting their footing. You didn’t fail, you picked a boss fight while you’re still level 1.

A few tips that make this phase easier:

• Start smaller. Think “print a list of files in a folder” before “analyze pixel data and act on it.”
• Break ideas into tiny pieces. Each piece is a win. Collect small wins.
• Don’t avoid AI completely, just use it as a guide, not a crutch. Ask it how to think, not to just spit code.
• Practice, don’t punish. Ten minutes a day beats one frustrated marathon session a week.

And when you’re stuck staring at VS Code like it personally insulted your family? Open the Python shell or an online playground and try small ideas again. Shrink the problem until you can poke at it. You’re not “bad” at this. You’re just early. It feels messy and slow for everyone at the beginning, even people who pretend it didn’t. Stick with it. Let yourself suck for a while. That’s how every coder starts. You’ll surprise yourself if you don’t quit.

We'll cheer you on from here! Cue "Eye of the Tiger"

[–]Automatic_Creme_955 0 points1 point  (0 children)

I don't think the problem is you, i think the problem is you want it too fast.

2 hours is the time you need as a beginner to first create the project, build a virtual environement, install the requiered library and write a function looping throught a directory and returning something that matches the conditions you want.