Giter VIP home page Giter VIP logo

py_scripts's Introduction

py_scripts

My collection of tips, snippets and scripts in Python (2.7 and 3.X)

Python IDE/editors

Python on Windows

Python 2.7 and 3.X installed?

If you have both Python 2.7.X and 3.X installed, you might want to create a shortcut to start a custom cmd.exe (Command Line Prompt) that only has Python 2.7 (or 3.X, depending on your needs) in it's path and that way, you don't risk starting the incorrect python-version while you're working on this!

The example below expects having the following tools at the specified directories:

  • Python 2.7: c:\python27\
  • GIT: C:\Program Files\Git\cmd
  • FFmpeg: C:\Program Files\FFmpeg\bin
cmd /k "set PATH=C:\python27\;C:\python27\Scripts\;C:\Program Files\Git\cmd;C:\Program Files\FFmpeg\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\"

Virtual environments

This is a must to know about to ensure that all different Python-projects don't end up installing dependencies that breaks other packages.

venv

Since Python 3.6, Python comes with a lightweight alternative for Virtual Environments called venv
venv โ€” Creation of virtual environments

python3 -m venv .venv

virtualenv

A more functionrich alternative to the builtin venv is virtualenv
To read more details about it, check out Virtualenv docs

After starting cmd.exe using our shortcut we created above, we need to install virtualenv so we can create our virtual environments so we don't end up with mismatching/conflicting versions of python-libraries for different projects.

pip install virtualenv

Then, let's move to our root project-directory where you

cd "X:\MY_WORKING_FOLDER\HERE"

And now we can create our virtual environment:

virtualenv env

When it's done, run this command to put your cmd-window in your new python virtual environment:

env\Scripts\activate.bat

And now we can install any libraries we want for our project using pip, like this:

pip install git+https://github.com/mapillary/Piexif

When you're done working in your virtualenv and want to switch to another one, run this:

deactivate

py_scripts's People

Contributors

flatrick avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.