If I get a job I'm up for, I'll have to learn python. May as well learn it now. So, one hundred things from python I'll probably want to know
I'll probably regret setting a number. Anyway I'm going to start with maybe 50 and add stuff as needed.
First some things I know already
-
python files usually end with .py
-
python is a dynamically typed interpreted (generally anyway) langage
-
python avoids braces and semicolons and other punctuation, where possible
-
a list in python is a tuple
-
pip installs python packages
-
python uses indentation for scope
-
hash bang for python invocation from the shell #!/usr/bin/env python
-
declarations if a variable (name = value )
-
an integer (number without a decimal place)
-
a floating point number (number with a decimal place)
-
a string (" ", ' ' or """ around the string literal can use the print formatting to alter strings when assigning)
-
an array (a list, declared like list = ['a', 2, 'cee']
-
a character a single char string
-
a hash (dictionary dic = {'a': 1, 'b': 2} )
-
a tuple
-
a constant
-
a class (class)
-
an object
-
an import from a global library (import sys)
-
an import from a local library
-
loop (maybe go over an array)
-
second type of loop (while loop)
-
third type of loop (count loop)
-
subroutine/function (def name(parameters):
-
a static variable
-
a global variable
-
how to open a text file to read it
-
how to open a text file to write it
-
how to declare a package/library
-
how to read a line from STDIN (raw_input(prompt))
-
how to read a line from an opened file
-
how to write a line to STDOUT (print) (note, can use , to chain elements in print, will evalue outside of commas %s for string %d for integer %item for one item or %(value1, value2) for more then one value)
-
how to write a line to an opened file
-
how to close a file
-
how to do regex matching in python
-
how to do substitution in python (a, b) = (b, a)
-
array length (len(arrayname))
-
how to do a single line comment (#)
-
is a multi line comment different, and if so, (how? nope #)
-
how to find out a substring
-
how to search for a character, or a set of characters, in a string
-
how to access an element in an array arrayname[index], can use negative numbers (-1 is end of array, -2 is 1 before end of array)
-
how to sort an array array.sort(function to sort with)
-
how to pull out keys from a dictionary (dict["key"])
-
how to add to a hash (as above)
-
how to delete a key from a hash (del dict["key"] dict.clear() to delete dictionary)
-
how to have multiple scalars (or whatever the equivalent term is) in a hash value, array element, etc.
-
how to do bit level manipulations (is it possible, and how).
-
how to invoke shell commands
-
how to get the output of shell commands, and how to get their exit status
-
forking/threading, or equivalent
-
what is the NULL/undef term
-
what is true (True)
-
what is false (False)
-
Can I define things to be clearer, like in C?
-
how to invoke the debugger
-
How to cast to an integer/float form the opposite (int(float), ?)