whats and whys for - vilniuspyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf ·...
TRANSCRIPT
![Page 1: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/1.jpg)
Whats and whys for
beginnersby Justas Trimailovas @ VilniusPy
github.com/trimailov [email protected]
![Page 2: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/2.jpg)
Myself and Python
learnt basics of C from university,programming seemed arduous
![Page 3: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/3.jpg)
Myself and Python
2 years ago discovered Python through Udacity’s MOOC
and I loved it!
![Page 4: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/4.jpg)
Myself and Python
little by little advancing through Python, Linux and growing interest in various technologies
![Page 5: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/5.jpg)
About this talk
“5 WTFs in Python”
![Page 6: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/6.jpg)
About this talk
answer questions raised by novices in Python (or in programming in general)
![Page 7: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/7.jpg)
About this talk
answer questions raised by novices in Python (or in programming in general)
novice me
![Page 8: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/8.jpg)
About this talk
answer questions raised by novices in Python (or in programming in general)
novice me
*questions are not in any particular order
![Page 9: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/9.jpg)
About this talk
things you can learn from a lazy guy, so you can improve yourself little faster
![Page 10: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/10.jpg)
Not in this talk
Python 101
How to setup your machine for Python development
vim, emacs, Sublime Text, PyCharm is best Python IDE
![Page 11: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/11.jpg)
Not in this talk
Python 101
How to setup your machine for Python development
vim, emacs, Sublime Text, PyCharm is best Python IDE
![Page 12: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/12.jpg)
Not in this talk
Python 101
How to setup your machine for Python development
vim, emacs, Sublime Text, PyCharm is best Python IDE
![Page 13: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/13.jpg)
Not in this talk
Python 101
How to setup your machine for Python development
vim, emacs, Sublime Text, PyCharm is best Python IDE
![Page 14: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/14.jpg)
Not in this talk
Python 101
How to setup your machine for Python development
vim, emacs, Sublime Text, PyCharm is best Python IDE
Though you can freely ask about all that later
![Page 15: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/15.jpg)
How can software have so many files?
![Page 16: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/16.jpg)
> tree . . └── first ├── baz.py ├── functions │ ├── __init__.py │ └── bar.py └── other_functions ├── __init__.py └── biz.py
WHAT?! empty?!
![Page 17: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/17.jpg)
> cat first/functions/bar.py def drink_beer(where): print(“fun @ %s” % where)
> cat first/baz.py
from functions import bar
bar.drink_beer(where=“snekutis”)
![Page 18: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/18.jpg)
What is self?
![Page 19: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/19.jpg)
class Character: def __init__(self, int=1, chr=1, str=1): self.int = int # intelligence self.chr = chr # charisma self.str = str # strength
def learn(self): self.int += 1
def socialize(self): self.chr += 1
def train(self): self.str += 1
![Page 20: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/20.jpg)
class Character: def __init__(self, int=1, chr=1, str=1): self.int = int # intelligence self.chr = chr # charisma self.str = str # strength
def learn(self): self.int += 1
def socialize(self): self.chr += 1
def train(self): self.str += 1
def get_self(self): print(self)
![Page 21: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/21.jpg)
>>> knight = Character() >>> knight.get_self() >>> <Character object at 0x106160a20>
self is an instance of a class
![Page 22: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/22.jpg)
Method
class Character: .. def learn(self): self.int += 1 ..
Function
.. def learn(character): character.int += 1 ..
![Page 23: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/23.jpg)
Instance of a method of is passed automatically, but not received
![Page 24: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/24.jpg)
Received
class Character: .. def learn(self): self.int += 1 ..
Passed
knight.learn()
Instance of a method of is passed automatically, but not received
![Page 25: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/25.jpg)
Received
class Character: .. def learn(self): self.int += 1 ..
Passed
knight.learn()
Instance of a method of is passed automatically, but not received
![Page 26: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/26.jpg)
Why so many __underscores__?
![Page 27: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/27.jpg)
It’s a Python convention used for builtin attributes and to avoid namespace conflicts
![Page 28: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/28.jpg)
More conventions exist
_internal_use
__very_private -> _classname__very_private
![Page 29: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/29.jpg)
>>> dir(knight) ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__',
'__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'chr', 'int', 'learn', 'socialize', 'str', 'train']
![Page 30: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/30.jpg)
__call__ - method called on instance call __new__ - method called on instance creation (before __init__) __init__ - method for object initialization __dict__ - get attribute:value dictionary __doc__ - return docstring __eq__ - describes ‘==‘ operator __lt__ - describes ‘<‘ operator, etc.
https://docs.python.org/3.4/reference/datamodel.html
![Page 31: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/31.jpg)
What is super?
![Page 32: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/32.jpg)
class Knight(Character): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs)
self.race = “Human”
![Page 33: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/33.jpg)
Character: __init__, learn, socialize, train
Knight: __init__, learn, socialize, train
If super() would not have been used, child class would have overriden it’s parent’s __init__ method.
Then initialized Knight would have race, but no int, str or chr.
![Page 34: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/34.jpg)
super() let’s us call same method from parent class. This way we can very flexibly extend classes.
Character: __init__, learn, socialize, train
Knight: __init__, learn, socialize, train
super()
*Python allows multiple inheritance, same principles apply, though some cases can be trickier. Reading about Python’s Method Resolution Order (MRO) is a must.
![Page 35: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/35.jpg)
But what is this magic with *args and **kwargs?
![Page 36: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/36.jpg)
But what is this magic with *args and **kwargs?
*in my head it sounds like arcs and quarks
![Page 37: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/37.jpg)
* - unwraps positional arguments ** - unwraps keyword arguments
![Page 38: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/38.jpg)
* - unwraps positional arguments ** - unwraps keyword arguments
You can name them what ever you like, e.g. *arcs, **quarks. Though *a, **kw and similar are usual.
![Page 39: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/39.jpg)
Basically what it means, you can let function to accept arbitrary arguments
![Page 40: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/40.jpg)
class Knight(Character): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs)
self.race = “Human”
baby_knight_params = {‘int’: 0, ‘chr’: 5, ‘str’: 15}
knight = Knight(**baby_knight_params)
![Page 41: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/41.jpg)
class Character: def __init__(self, *args, **kwargs): .. self.hp = kwargs.get(“hp”, 50)
![Page 42: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/42.jpg)
def ugly_function(*args, **kwargs): do_ugly_stuff_with(args, kwargs)
def get_ugly_params(): random_args = call_api() sorted_args = sort_args(random_args)
params_as_dict = call_dict_api() ugly_function(*sorted_args, **params_as_dict)
When you’re lazy, as *args and **kwargs are just shorter
![Page 43: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/43.jpg)
What is yield?
![Page 44: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/44.jpg)
yield returns a generator object
![Page 45: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/45.jpg)
Function
def simple(): l = [] for i in range(5): l.append(i) return i
Generator
def simple(): for i in range(5): yield i
![Page 46: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/46.jpg)
Function
def simple(): l = [] for i in range(5): l.append(i) return i
Generator
def simple(): for i in range(5): yield i
Saves memory Lazy evaluation
Could be endless (RNG) generator.__next__()
![Page 47: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/47.jpg)
Tips and tricks
![Page 48: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/48.jpg)
What this code does?
class Knight(Character): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs)
self.race = “Human”
![Page 49: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/49.jpg)
Answer: good editor and ctags
good editor - can read tags files or generate them. By using shortcut, we can jump to class/method definition
ctags - software which indexes your code
![Page 50: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/50.jpg)
Bonus answer: ag, ack, grep
>>> ag ‘class Character’
![Page 51: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/51.jpg)
What this code does at runtime?
Answer: pdb and ipdb
import ipdb; ipdb.set_trace() or
import pdb; pdb.set_trace()
![Page 52: Whats and whys for - VilniusPyvilniuspy.lt/slides/whats_and_whys_for_python_beginners_justas.pdf · vim, emacs, Sublime Text, PyCharm is best Python IDE. Not in this talk Python 101](https://reader035.vdocuments.site/reader035/viewer/2022063016/5fd73e5993281a1daa11f3db/html5/thumbnails/52.jpg)
Conclusions and recomendations
Hold your horses: read manuals, documentations, sources
Python and brief C knowledge let’s me appreciate and enjoy programming
Try to understand how things work in general way, no need to guess
Low level knowledge helps