[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Ok, so i've been trying to learn python by myself but times
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 9
Thread images: 3
File: what-the-fuck-am-i-reading.jpg (83 KB, 552x395) Image search: [Google]
what-the-fuck-am-i-reading.jpg
83 KB, 552x395
Ok, so i've been trying to learn python by myself but times after times i still find myself stuck at the same point where i started and i realize i was running in circles.
Apparently i'm dumber than i thought but the "just practice and you'll eventually learn" doesn't work with me, i've read here about the core philosophy of coding "if you're not solving amazing problems you will just test your patience and ability to memorize" which i somewhat agree with, but coming to down to earth problems is that i haven't found a book or a guide that meets my needs, for example, the teachers i have in uni are fucking tools and are useless at best, i still fail to comprehend how the compiler manages the instructions, how the hierarchy of the commands works, where i can find a comprehensive list of the python syntax and how to develop the mindset to translate a problem from human language in code (eg. transform all the colors in a given picture into a red scale, i have no fucking idea how to approach it in the first place, how should i organize the code and so on).
Please answer to this bottle in the sea, send help.
>>
>>54597515
>how to develop the mindset to translate a problem from human language in code
Figure out in plain english what you need to do to solve your problem. e.g I need to iterate over every pixel and then find the rgb for each pixel. I need to then 0 out the green and blue values.

>I have no fucking idea how to approach it in the first place
Figure out these steps one step at a time then look up how to do each of them individually until you understand it.

>how should i organize the code and so on).
Get your program working first then worry about refactoring it.

It's all about reading and practice.
>>
>>54597515

>>54597610
This here op, programming is just a fancy way of writing the instructions to do something.
>>
i know, i'll give you a simple example so you can maybe understand how and where i'm stuck on

#converts the 3 rgb values into grayscale and returns sum
def togray(r,g,b):
sum=(r+g+b)/3
return sum
#selects a file from the hard disk
new_file= pickAFile()
#creates an image new_pic and assigns it the file of new_file
new_pic= makePicture(new_file)
#show(new_pic)
dick= togray(100,120,110)
print dick
#for cycle that inserts in a silt every pixel of the selected image
pixel_list=[]
for pixel in getPixels(new_pic):
sum_pixel= togray(getRed(pixel),getGreen(pixel),getBlue(pixel))
pixel_list=pixel_list+[sum_pixel]
#i have to create an ampty canvas (makepicture) after that do the same so it writes from the list to the new image
#from now on: shit
makePicture(changed_pic)
for


i've made this with the help of an older student and you need to know that isn't actually python since we're requested to use a cancerous jython environment called jes with pre-built in functions, but the point is: i don't know the syntax to write my thoughts into code, and wherever i search i find lackluster and badly organized guides, i have even looked in the official python website but i feel like things are hanged in the air without seeing the start or the end of the central idea
>>
>>54597515
>the teachers i have in uni are fucking tools and are useless at best
>>54597893
>i've made this with the help of an older student

Perhaps programming isn't for you. It doesn't sound like you have the right mind for it or enjoy it.
>>
>>54598028
humans weren't supposed to be 12.000 meters from the ground as well, look how we fucked up...
>>
File: path to success.jpg (356 KB, 500x667) Image search: [Google]
path to success.jpg
356 KB, 500x667
>>54597515

Wow, buddy, that's a lot of problems there..

>the teachers i have in uni are fucking tools and are useless at best

They give you an introduction, they are not there to spoon feed you.

>i still fail to comprehend how the compiler manages the instructions

1) from up to down, from left to right
2) code within a function gets finished before the code after the function

>how the hierarchy of the commands works

what are you trying to say here?

>where i can find a comprehensive list of the python syntax

That's the wrong way to do it. Would you learn spanish by learning all the words at teh same time? You want some basic statements and add new statements every now and then when you meet them. But for a start:
>https://learnxinyminutes.com/docs/python3/


>how to develop the mindset to translate a problem from human language in code (eg. transform all the colors in a given picture into a red scale, i have no fucking idea how to approach)

Of course you have no idea.. That's why its called "learning".

But you are talking about two seperate skills here:

-To break a problem down into tasks
-To programm those tasks


For example:
"transform all the colors in a given picture into a red scale"

Now think about the problem steps-by-step:
-"transform all the colors in a given picture"
OK, how do pictures work in Python?
How do you open them?
How do you manipulate them?

-"into a red scale"
OK, what is a red scale?
What is the formula for transforming the color into red-scale?

So let's start at the beginning:
1) Google "python image manipulation" and look at some sites. Take the solution that looks easy.

2) Copy the code and change some things - wow you can load, edit and safe a picture!

3) Google "colors to red scale".

..and so on.


Especially as a beginner you want to read other people's code A LOT. Imagine learning spanish: you learn by listening, by reapeting what others do.
>>
You're trying to learn too many things at once. You should start with making small programs that solve simple problems before you move on to graphics. An example of a simple problem is the fox, goose, and the bag of beans puzzle.
>>
>>54597515
practice is a meme.
youll practice the same thing over and over again.
what you want to do is come up with software you, yourself, actually want to use.
youll then start to instinctively look up how stuff you want to do works, how to implement it and how to make it better.

making something you want to actually use is way better than just practicing shit over and over.

if you want to work in the industry its also way better to have smaller complete projects rather than shit that can be looked up on google.

if you dont know how hash or stack data strucktures work but you demonstrate an ability to learn and can actually realize shit you are already employable and ahead of many cs grads. even if you have less knowlege in total. the fact that you already made something goes a long way.
Thread replies: 9
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.