Python Tutorial

If you want to use this repository and learn python then start reading:

and

The other .py extension files you see in this repository is jus an examples, they are scripts which you can use as you wish. We use here python upper 3.. version

  • Cheats:

Creation of virtual environments is done by executing the command venv:

python3 -m venv /path/to/new/virtual/environment

For Windows users: c:>python -m venv c:\path\to\myenv

To activate go to last directory and type command: Scripts\activate To deactiavte just type: deactivate

Second env I used is a pipenv

to get it u can simply type: pip install pipenv
to create environment type: pipenv install
if it doesn't react use this one: python -m pipenv
to activate type: pipenv shell
to exit press: CRT + D
to remove pipenv type: pipenv --rm

Another way

  1. Set a virtual environment with virtualenvwrapper
    command: mkvirtualenv Project_Name
    Anything we install now will be specific to this project, and available to the projects we connect to this environment.
  2. Set Project Directory
    To bind our virtualenv with our current working directory we simply enter:
    command: setprojectdir . (notice there is a full stop mark)
  1. Deactivate
    To move onto something else in the command line type ‘deactivate’ to deactivate your environment.
    command: deactivate
    Notice how the parenthesis disappear.
  2. Workon
    Open up the command prompt and type ‘workon Project_Name’ to activate the environment and move into your root project folder
    command: workon Project_Name

Note: If you already have something running on port 8000, you can choose another port by running the server command followed by an alternative port number, e.g. python3 -m http.server 7800 (Python 3.x) or python -m SimpleHTTPServer 7800 (Python 2.x). You can then access your content at localhost:7800.

Demo

Sorry for a little bit mess, but I hadn't got time yet to make it more friendly.

Feel free to contribute

Python