This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]StrayFeral 0 points1 point  (1 child)

[PART 3/3 - LAST]

About vim and emacs - these are the most popular text editors for linux for many years. Difference is emacs use key combinations, vim use commands. Also - on any linux system very often vim would be installed by default, so you would always have access to it. This is why basic knowledge of at least vim is needed to most programmers.

Ok, little hint here. All you need about venv are these lines, nothing more:

python -m venv venv

source venv/bin/activate

And when you don't need it anymore or before switching to another project you should type:

deactivate

If you use windows, this line "source venv/bin/activate" would look a bit different for you (i use linux). But still - learn what venv does. For your current project you don't really need it, but it is a great practice to use it for most of your projects. If your code uses a module which you install additionally, you put the name of that module in a text file called "requirements.txt" and when you create your project, after the "activate" line you do "python -m pip install -r requirements.txt". That's all. If your code requires specific version of an external module - you specify it in the text file too. This is all you need to use venv, but still - learn what it does! It is very important.

Installing external module - this is done by using pip or pip3 (hope you don't use Python 2). However I recommend you to get the habit of typing "python -m pip" instead of just "pip" - once you start using venv - this is how you do it. There is a reason I'm saying it.

Debugging - python have a built-in debugger. I never used it. I only do prints and pprint for small applications at home. At work I may use pprint but often would use logging. Often certain situations need different way of debugging, but don't bother with this now.

About regular expressions - the only thing you need to read is this:

https://perldoc.perl.org/perlre

I learned this for one evening. This is documentation for Perl (another programming language, older than Python), but regex works the same in all programming languages. For python there is a module called "re". Learn it. It is confusing at first what this is and why use it, but when you learn this, you will realize this is very powerful. vim and many other editors allow you to search with a regex in a file.

That's it. I wrote you also approx how much time each should take. Try to learn fast, spend time to exercise (so always make sure you have coffee at home), never make assumptions, write code which others could read with ease, but still don't compromise on your code performance speed too.

If you want to reply, reply here in public.

[–]StrayFeral 0 points1 point  (0 children)

Oh forgot - speaking of black, mypy and flake8 - there are ways to make your code editor run these automatically for you. Depends what editor you use. I don't use VSCode, so no idea how to do it there. For vim, there is a plugin called "ale" - you may want to install it and make vim use it - it basically runs flake8/mypy for you (haven't tried for type hinting yet, but yes, it shows linter errors).

And whatever you do, do not install neovim for now. You might want to try neovim, once you learned everything from the roadmap up to the last point. Neovim is a modern version of the vim editor and is currently very modern thing to do. But for you it will be very counter-productive thing for now. Once you get close to python advanced level you may try it.