Code Monkey home page Code Monkey logo

python-examples's Introduction

Python Examples

This repo is to share examples of git workflow, easy Python set-up, test-driven development, and general programming ideas.

Installation

Getting the code

  1. Hit the green "Code" button on this repo.
  2. Choose your preferred option to download the code - Github Desktop would be the easiest and best since it can update over time, but a zip file also works.

Installing an editor

Many editors to choose from but these are popular and work on Windows:

  1. Visual Studio
  2. Atom

Installing Python

  1. Starting from this project folder
  2. Install Python from the Downloads page
  3. This should also install pip - test with command pip
  4. (OPTIONAL) Install venv. Initialize virtual environment folder - python -m venv .venv. Start venv with ./.venv/Scripts/activate.bat. This tool is useful to isolate your project dependencies, but not strictly necessary.
  5. Install the project dependencies with pip install -r requirements.txt

Tests

Run pytest - this will be installed as part of the project dependencies.

The tests can be used to run assertions on any code you've written.

Note that the test files must be named {module}_test.py and the test functions must be called test_{name_of_test} - otherwise pytest can't locate them

Development

New files and tests can be made in the same pattern as the existing ones.

You can also run python files as executables to run the code without a test like so:

python {file_name}.py

Disclaimer - not a Python expert :)

python-examples's People

Contributors

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