Skip to content

Instantly share code, notes, and snippets.

View William-Lake's full-sized avatar

William Lake William-Lake

  • State of Montana
View GitHub Profile
@William-Lake
William-Lake / README.md
Last active December 27, 2018 14:45
*SIMPLE* Python Class Wizard

Create Python Class File

A very basic wizard for creating a python class file.

Getting Started

NOTE: These instructions were written for Linux.

  1. Download the required files.
  2. Make the script executable
@William-Lake
William-Lake / Instructions.adoc
Last active March 7, 2019 17:14
Setting up Windows to use Python Scripts

Setting up Windows to use Python Scripts

  1. Install Python[https://www.python.org/downloads/windows/]

  2. Create a directory to contain your scripts.

  3. Add your created directory to your path.

    1. Start Menu

    2. Type in "environment" and select "Edit Environment variables for your account".

    3. In the upper group titled "User variables for [YOUR NAME]" click the "New…​" button.

    4. Enter your desired variable name (standard is to be in all caps, use underscores instead of spaces, and only letters. E.g. WILLS_PYTHON_SCRIPTS)

    5. Enter the path to your script dir as the Variable Value. Click the "OK" button.

@William-Lake
William-Lake / Instructions.md
Created March 29, 2019 13:06
Running Python unittests with conda environment via cronjob

Instructions

  • Create crontab string via crontab.guru
  • Create a bash script to run your unittests

E.g.

#!/bin/bash

# Not certain this is necessary...
@William-Lake
William-Lake / arg_parser_builder.py
Last active October 27, 2019 13:29
Builds a __main__.py file gathering args via argparse. Covers a *very limited* range of options, primarily the ones I find useful. arg_parser_template.txt needs to be in the same dir as arg_parser_builder.py. Produces a __main__.py file in the same dir when finished.
def gather_input(prompt,empty_ok=False):
user_input = None
while user_input is None:
print(prompt)
user_input = input('?')