Python
Python is an interpreted high-level general-purpose programming language. Its design philosophy emphasizes code readability with its use of significant indentation. Its language constructs as well as its object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.
The standard prrogramming language for data science and for us especially:
- machine learning, deep-learning using tensorflow or pytorch)
- audio analysis and manipulation using librosa
Also used to interface with 3d software such as poser 3d/blender and audacity and Libre Office.
Statements and control flow[edit]
Python's Statement include (among others):
- The Assignment (computer science)|assignment statement, using a single equals sign
=. - The
if-then-else|ifstatement, which conditionally executes a block of code, along withelseandelif(a contraction of else-if).
- The
Foreach#Python|for]]statement, which iterates over an iterable object, capturing each element to a local variable for use by the attached block.
- The
While loop#Python|while]]statement, which executes a block of code as long as its condition is true.
- The
Exception handling syntax#Python|try]]statement, which allows exceptions raised in its attached code block to be caught and handled byexceptclauses; it also ensures that clean-up code in afinallyblock will always be run regardless of how the block exits.
- The
raisestatement, used to raise a specified exception or re-raise a caught exception.
- The
classstatement, which executes a block of code and attaches its local namespace to a class (computer science)|class, for use in object-oriented programming. - The
defstatement, which defines a function or method.
- The
dispose pattern#Language constructs|withstatement, which encloses a code block within a context manager (for example, acquiring a lock before the block of code is run and releasing the lock afterwards, or opening a file and then closing it), allowing resource-acquisition-is-initialization (RAII)-like behavior and replaces a common try/finally idiom.[1] - The
breakstatement, exits from a loop. - The
continuestatement, skips this iteration and continues with the next item. - The
delstatement, removes a variable, which means the reference from the name to the value is deleted and trying to use that variable will cause an error. A deleted variable can be reassigned. - The
passstatement, which serves as a NOP. It is syntactically needed to create an empty code block. - The
assertion (programming)|assertstatement, used during debugging to check for conditions that should apply. - The
yieldstatement, which returns a value from a generator (computer programming)#Python|generator function andyieldis also an operator. This form is used to implement coroutines. - The
returnstatement, used to return a value from a function. - The
include directive|importstatement, which is used to import modules whose functions or variables can be used in the current program.
- ↑ "Highlights: Python 2.5". Python.org. Archived from the original on 4 August 2019. Retrieved 20 March 2018.