set
play

set list tuple set set() Sets methods .intersection() - PowerPoint PPT Presentation

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 -


  1. set

  2. list tuple set set()

  3. Sets methods .intersection() .union() .difference()

  4. set sets methods .add() .update() .remove() .discard()

  5. list comprehension lists

  6. generators generator list next()

  7. list list

  8. list list

  9. 1 -

  10. 1 -

  11. class class attributes Class methods class 1. Created a class in a saved script; 2. Launched the script in the shell;

  12. class class attributes Class methods class I can access attributes of my class by using the proper syntax.

  13. attributes

  14. function class

  15. class self.year None

  16. __str__ special function

  17. __str__ special function

  18. special function __dict__

  19. 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

  20. exceptions

  21. handle exception try-except

  22. handle exceptions

  23. Lambdas functions anonymous functions Lambdas function lambda function

  24. Lambdas attributes functions

  25. Map function list

  26. lists list

  27. lists list list sum len

  28. lists list list sum len list comprehension

  29. for map sum len

  30. for list comprehension map • • • for while • • • • • • • As little as possible

  31. Filter function filter function numbers_list lambda function module operator x%2

  32. filter list strings

  33. libraries Python other Anaconda Python tcl/tk pip Python

  34. > 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

  35. libraries other tcl/tk tcl/tk pip pip

  36. tcl/tk pip

  37. Python Python

  38. > 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»

  39. … …

  40. Repository Working copy

  41. Git

  42. $ git config --global user.name "[my username]" $ git config --global user.email "[my email address]"

  43. $ 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

  44. git init git clone [url] git add [file] git add . git commit – m "[message]" git push [alias] [branch] git pull

  45. 61 61

Recommend


More recommend