Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
python [2019/07/31 16:46] – [Printing] rpjdaypython [2020/06/17 14:40] (current) rpjday
Line 6: Line 6:
  
 ... coming ... ... coming ...
 +
 +===== Internal links =====
 +
 +  * [[Python_file_hierarchy]]
  
 ===== Packages ===== ===== Packages =====
Line 16: Line 20:
 $ $
 </code> </code>
 +
 +===== Online tutorial =====
 +
 +==== 3 ====
 +
 +  * string operations
 +  * string slices
 +
 +==== 4 ====
 +
 +  * "else" clause on loop constructs
 +  * range() function is an "iterable"
 +  * keyword arguments
 +  * lambda expressions
 +  * docstrings
 +  * function annotation(???)
 +
 +==== 5 Data structures ====
 +
 +  * lists
 +  * "import collections" (deque)
 +  * list comprehensions
 +  * set
 +  * dictionary
 +    * key can be any immutable type
 +    * "list(d)" returns list of keys
 +  * "enumerate()" routine for any sequence
 +  * "zip()" to iterate over two sequences simultaneously
 +
 +===== TOPICS =====
 +
 +  * string method join()
 +  * data types, numbers, literals
 +  * "_" as last value interactively
 +  * single and double quoted strings identical effectively
 +  * raw strings
 +  * "iterable" objects ("for" is an "iterator")
 +    * list(range(1,10))
 +    * tuple(range(1,10))
 +  * loops and trailing "else" construct
  
 ===== STUFF ===== ===== STUFF =====
  
   * ''%%>>> quit()%%''   * ''%%>>> quit()%%''
 +  * PEP-8
 +  * function annotations
  
 ===== Basics ===== ===== Basics =====
Line 53: Line 99:
  
 Raw strings: r"blah blah" Raw strings: r"blah blah"
 +
 +<code>
 +print("""\
 +Usage: thingy [OPTIONS]
 +     -h                        Display this usage message
 +     -H hostname               Hostname to connect to
 +""")
 +</code>
  
  
      
  
  • python.1564591618.txt.gz
  • Last modified: 2019/07/31 16:46
  • by rpjday