#πŸ”’ Learning python(properly)

59 messages Β· Page 1 of 1 (latest)

safe basin
#

So I've been on this server for a long long time and I've seen people asking and suggesting a lot of things. Every time I visit a help channel, I see new stuff from ML, discord bot, CV and whatnot. I had a few projects like python sql, discord bot, ML but I don't feel like I know the language. I see a lot of people suggesting a lot of things in the help channel and though I don't understand the entire thing, I get the gist of what the code would do. I am looking for help here to learn the language better, to write optimal codes, write python like python and not Java/C methodology.

I can elaborate further up next.

hallow harnessBOT
#

@safe basin

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

safe basin
#

I want to learn python and work on it as it is supposed to do.
I don't want to write

for i in range(len(x)):
    print(x[i])

but

print(i for i in x)

(This code may be wrong but I hope you get an idea what I'm looking to learn)

#

So should I start with reading documentations, or doing projects of some kind, or anything else?

#

I kinda wanna master this language but let's be practical it's not possible for me, atleast not in next 5 years.

#

Any common topics apart from ML, CV that I should look out for a good resume, and maybe a respectable developer job?

#

Any help and suggestions are welcomed, let me know what I should do to learn python better. I have no worries starting from scratch if it means learning it better.

formal wadi
#

i mean python has a huge amout of libraries. and then there are also third party libraries which are common to use

#

things like

  • io
  • shelve/pickle
  • json
  • sys
  • os
  • time
  • random
  • treading
  • multiprocessing
  • numpy
  • sympy
  • pandas
#

may also be good to know

#

and then it depends what you want to do? GUI? Web?

safe basin
safe basin
formal wadi
#

i find tkinter ugly. PyQt looks nice.

safe basin
#

What about object oriented side? Classes and stuff?

formal wadi
formal wadi
safe basin
formal wadi
#

but yes you should know classes, methods, etc

#

like also all loops, control sturctures and datastructures

#

list, dict, deque, heap, tuple, set

safe basin
formal wadi
#

much of the pythonic comes with comprehension i guess

#

also look exactly at what the difference between a statement and a expression is an where you can use expressions

#

probably start playing around with the fancy features to internalize them

#

use everything in code

#

think of fun little programms and then use heaviliy the things you do not know

safe basin
formal wadi
#

i do not know how it is intended. you could use a book and follow the order of the book. or you pick a topic that interests you and do research for that and use it in programs

#

there is also sequence unpacking and dictionary unpacking which can be used for pythonic coding

forest halo
#

Fluent Python by Luciano Ramalho is great if you want to learn some Pythonic Python.
some topics in it may be advanced. feel free to read it in whatever order interests you.

formal wadi
#

understand what an iterable is, that everything is an object and as i told what an expression is and where is can be used does also help

safe basin
#

Yeah, I'm fascinated by the indexing and unpacking of iterables and other objects. It's very lenient and better than C, no shame in it in C//

safe basin
formal wadi
#

then start to put expression in places where you earlier just put a scalar value

#

use dicts

#

but get the basics done before you focus on fancy things

safe basin
safe basin
formal wadi
#

do it step by step not everything at all. that overwhelms you

#

pick you a thing you want to learn about and do it. also yes the python docs are also very good and can help

#

try to rewrite things

#

think how you could do it better

safe basin
# formal wadi do it step by step not everything at all. that overwhelms you

Yeah I'll do it step by step, but for that I should know what I have to do, and I don't.
So I need someone to tell me what to do to make the code more fancy (pythonic)
There will be a lot of instances where I won't be able to do so, but if I atleast could do it for common syntaxes, it would be a great thing to me

formal wadi
#

try to force you to use the new things until it is normal to you

#

e.g. comprehensions are fancy

#

try to use comprehensions as much as possible

#

(but when they get too long use loops)

forest halo
safe basin
safe basin
forest halo
#

I understand. just try it every once in a while, because peer feedback is valuable when you're trying to learn what's considered natural in a language.

safe basin
#

I believe that's all for now. That's a lot for you time you guys.
Please DM me anything you want to suggest for me to do. I'll gladly look into it and try it if possible. I want to be a great python developer one day😁
Thanks a lot @formal wadi @forest halo

#

!close

hallow harnessBOT
#
Python help channel closed with !close

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.