Python: Difference between revisions

From Wiki RB4
Line 13: Line 13:
==Frameworks==
==Frameworks==
===Flask===
===Flask===
Flask is a micro web framework written in Python. To enable to run a flask application as a 'normal' python app with  
Flask is a micro web framework written in Python. Flask is using a template engine called Jinja.
 
To enable to run a flask application as a 'normal' python app with  
  python <FILE>
  python <FILE>
add to end of file
add to end of file

Revision as of 15:06, 14 September 2021

Resources

Language

Python, named after the British comedy group Monty Python, is a high-level, interpreted, interactive, and object-oriented programming language.

Comment

# ... till end of line

__main__

The __name__ variable (two underscores before and after) is a special Python variable. It gets its value depending on how we execute the containing script. When you run your script, the __name__ variable equals __main__. When you import the containing script, it will contain the name of the script.

Frameworks

Flask

Flask is a micro web framework written in Python. Flask is using a template engine called Jinja.

To enable to run a flask application as a 'normal' python app with

python <FILE>

add to end of file

if __name__ == '__main__':
 app.run()

Operation

Comannd Line

python -V // prints version
python
>>> <COMMAND>

Installation