Giter Club home page Giter Club logo

learn-python-the-hard-way's Introduction

Learn Python - The Hard Way

Overview

Set of simple programs written during learning basics of Python language based on Learn Python - The Hard Way course. All tasks can be found in exercises directory. In the same directory, we can found another README.md file including list of all tasks. Moreover, this README.md file includes important and essential information concerning programming in Python. You can also read a short article about this project on my blog.

Contents

Requirements

  • Windows, Linux or Mac OS X
  • Python 2.7
  • Pip (Python Package Manager)

Installing Python

Executing Python scripts from terminal

  • on Linux: Most of the Linux distributions should have enabled Python by default, so simply open terminal and type python to see if everything works.
  • on Windows: add /PythonXX (e.g. C:/Python27) into Path environmental variable. Location of the Python directory depends on your configuration. Next, re-run terminal window and type python
  • in order to check installed version of the Python, type: python --version
  • in order to exit python console type exit()

Pip

Pip is a Python Package Manager.

Installing Pip on Windows

  1. Download: https://bootstrap.pypa.io/get-pip.py script
  2. Execute: python get-pip.py
  3. pip.exe and easy_install.exe files now should be located at: /PythonXX/Scripts (e.g. C:/Python27/Scripts)
  4. Add /PythonXX/Scripts (e.g. C:/Python27/Scripts) directory into Path environmental variable.
  5. Re-run terminal window
  6. Type pip, to check if package manager works
  7. You can type pip --version, in order to check version of the pip

Installing Pip on Linux

  1. Open terminal
  2. Type sudo apt-get install python-pip

Installing Pip on macOS

  1. Open terminal
  2. Type brew install python3

This command will install python and pip.

Using Pip

  • In order to install desired package just type pip install desired_package (e.g. pip install Flask)
  • If you are working on Linux, type sudo pip install desired_package (e.g. sudo pip install Flask)
  • Index of available packages can be found at: https://pypi.python.org/pypi/
  • List of installed packages can be displayed with pip freeze command.

Unit Testing

  • UT in Python can be done with nose. Install it via pip with the following command: sudo pip install nose
  • UT can be also created with unittest package provided with Python.

Virtualenv

virtualenv is a tool to create isolated Python environments.

More information:

Pipenv

pipenv is Python Development Workflow for Humans.

It automatically creates and manages a virtualenv for your projects, as well as adds/removes packages from your Pipfile as you install/uninstall packages.

More information:

Pyenv

pyenv is a simple Python version management.

Scripts on Linux

If we want to create a Python script for Linux, we should set the following header:

#!/usr/bin/python -u

# your Python script code goes here...

After that when our script was saved in script.py file, we can execute our script as follows:

./script.py

Style Guide for Python Code

PEP 0008 is a current Style Guide for Python Code.

link: https://www.python.org/dev/peps/pep-0008/

code style: https://docs.python-guide.org/writing/style/

Static Code Analysis

Development Environments

Python web frameworks

Web servers

Useful Python libraries

Tools written in Python

Collections of tools written in Python

Resources

Videos

Books

License

MIT

learn-python-the-hard-way's People

Contributors

kieranjol avatar pwittchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.