Answer the question
In order to leave comments, you need to log in
How did you learn python?
For me, the Python programming language is the first, and based on this question. I read Mark Lutz's book "A byte of python" and while reading and at the end of the book there were a couple of tasks, for example, here is one of them: ""Create your own Address Book program that works from the command line and allows you to view, add, change , delete or search for the contact details of your friends. In addition, this information must also be stored on disk for later access. It's a fairly simple task if you think of it in terms we've been going through so far.""
The fact is that for me this is not an easy task at all, I look at the beginning of the code and get very stupid, I feel that I will write this for a week at best. I know that practice is everything, so I'll start trying it on codewars or similar sites, while reading Lutz's book "Learning Python", or "Simple Python: Modern Programming Style" Author Bill Lubanovich.
And actually the question itself. How did your study go? Was one book enough for you to write the program described above? If you already write in python, please write how did you learn it?
Answer the question
In order to leave comments, you need to log in
If you are really just starting out, I really advise Stepik
There, both theory and practice are presented. What does it not accept tasks until you pass all the tests, respectively, a crutch on a crutch will not work, you need to write something that really works
First you need to learn how to formalize the task: imagine what "Contact" is - it's "Last Name, First Name, Middle Name, email, phone", then imagine what saving on disk is - this is some file in which there are a lot of contacts - for example, each line is a separate contact - as a result, the storage format is CSV (comma-separated fields).
You also need to think over all other actions (subtasks of the main task) - somehow describe them in a logical sequence. Then it remains only to write them in the form of code in the required language and it does not matter what it will be called, most likely you will have to adjust the set of actions to the capabilities of the language and its runtime environment.
Then you can already google - "python work with files" or read a specific chapter of help information.
And over time, you will already remember these examples and you will have to google less.
Learning specifically python comes down to memorizing (understanding) examples of solving specific mini-tasks, like working with files, working with databases, working with a network, working with a GUI - it is divided into working with each graphic library of which there are a bunch of GTK, Qt, wX, Tk, Kivy.
I am learning python, my first language. I work with networks, so I started my acquaintance with python from Natasha Samoylenko's excellent book Python for Network Engineers (the book is absolutely free).
How did your study go?
If you already write in python, please write how did you learn it?
Reading the theory, one must always fix it with practice.
I read the chapter many times, I start solving tasks, in the process I always turn to theory, because. remembering everything is impossible. Sometimes I sit all day on the solution of the problem. When solving tasks, I remember the tools (useful functions, modules, methods), the next tasks go faster.
"A byte of python" didn't read. Only "Python for Network Engineers", I mastered the book by about 20%, these are 2 chapters of Python Basics and Code Reuse.
I didn’t solve this problem, but I already roughly understand how to do it:
* for convenient interaction with the script from the command line, use the argparse module
* store data in a database or just in a .txt file, or even save an object (for example, a dictionary of the form:)
{ 'ivan':{'number':'123', 'address':'pushkina'}, 'magomed':{'number':'456', 'address':'lenina'} }
* write functions to view, add, modify, delete or search for contact data that will interact with the data in the database / file / object
It all comes down to remembering python tools (you can often hear from python elders that programming this is knowledge of algorithms, and PL is just a tool, which is of course true, but you also need to remember how to use tools, otherwise it’s permanent Google):
* data types, what they are (changeable ordering, etc.), how to interact with them
* functions
* methods
* operators
* cycles
This is all that I have gone through so far, even with such minimal knowledge, I have made my work easier, automated routine tasks at my work.
If I don’t understand something, I stupidly google, for example, the task: I’m tired of prescribing logins / passwords when entering the switches.
Google, there is usually more information in English: connect to the python switch / connect to switch python
, you learn about the pexpect module, read the documentation, write your script, that's it, now there is a pexpect module in the knowledge box, next time you will solve the problem faster.
This is how I write my bikes, I decided to publish them, you never know who needs it, a bike park: https://github.com/Savamoti/scrips_for_reinventing... I
recommend getting acquainted with PEP8, do not forget to write comments (for the most bad so far) to the code, otherwise, in a month you won’t remember what this function is for, what it expects and what it returns.
I am learning Python for data analysis.
I got acquainted with the basics of the language on the “Data Analyst” course from Yandex Practicum (on their website you can take a free part of the course, it’s just about Python), and to the resulting base I gradually add knowledge from various video courses (a snake wrote a game based on tutorials) and books ( from Lutz, I prefer the book "Learning Python").
In short, read books, go through tutorials, communicate with more experienced guys, read someone else's code, take additional courses, develop your projects and everything will work out! And most importantly - write code, there is no such thing as too much practice! :)
Read Lutz. Enough to get to know. And then it all depends on the tasks. Absolutely everything is impossible to learn.
Therefore, the task arose to work with Excel - I found the necessary module, read its description and wrote what you need.
You need to write a graphical shell - the algorithm is the same. I chose a library, read the description and go ahead.
Дело в том что для меня это совсем не простая задача, смотрю на начало кода и сильно туплю, чувствую что писать буду это в лучшем случае неделю.
I sat on literature for a couple of months and then randomly got into a free python lesson at Avenue school, the teacher seemed intelligent and voila - I'm on the course. And then I am already building up a lot of knowledge on my own. But if she had been fucking all this time, maybe she would have quit already, but it sucked
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question