set
list tuple set set()
Sets methods .intersection() .union() .difference()
set sets methods .add() .update() .remove() .discard()
list comprehension lists
generators generator list next()
list list
list list
1 -
1 -
class class attributes Class methods class 1. Created a class in a saved script; 2. Launched the script in the shell;
class class attributes Class methods class I can access attributes of my class by using the proper syntax.
attributes
function class
class self.year None
__str__ special function
__str__ special function
special function __dict__
special functions object.__str__( self ) object.__repr__( self ) object.__dict__( self ) object.__bytes__( self ) object.__del__( self ) object.__format__( self ) object.__hash__( self ) special functions
exceptions
handle exception try-except
handle exceptions
Lambdas functions anonymous functions Lambdas function lambda function
Lambdas attributes functions
Map function list
lists list
lists list list sum len
lists list list sum len list comprehension
for map sum len
for list comprehension map • • • for while • • • • • • • As little as possible
Filter function filter function numbers_list lambda function module operator x%2
filter list strings
libraries Python other Anaconda Python tcl/tk pip Python
> pip --version libraries > pip 18.1 > pip install matplotlib > # to install something other tcl/tk > py -2 – m pip install matplotlib pip > # … selecting the right version of Py > pip install --upgrade matplotlib > # to install and upgrade something
libraries other tcl/tk tcl/tk pip pip
tcl/tk pip
Python Python
> virtualenv – p /usr/bin/python3.6 « my_project » $ virtualenv – p /usr/bin/python3.6 « my_project » > ‘ path/to/env/Script/ activate ’ $ source ‘ path/to/env/bin/ activate ’ (my_project) C://path/to/env > (my_project) user@localhost:~ $ … do things in the environment … … do things in the environment … (my_project) C://path/to/env > deactivate (my_project) user@localhost:~ $ deactivate > $ py -3 -m venv «my_project»
… …
Repository Working copy
Git
$ git config --global user.name "[my username]" $ git config --global user.email "[my email address]"
$ git init # I initialized my folder as a local repository $ git clone git://github.com/link_to_project.git # I copy inside my local repository a perfect copy of the remote repository … hours of work on the code … $ git add . # my code is now in the staging area ready to be confirmed and committed into my local repository $ git commit - m ‘ Added support to X functionality ‘ # I committed my code to the local repository $ git push origin master # I uploaded the content of my local repository to the remote repository
git init git clone [url] git add [file] git add . git commit – m "[message]" git push [alias] [branch] git pull
61 61
Recommend
More recommend