Python Command Line Args

By | Engineering

Command line arguments are the string of data and flags that are passed into a python script for execution to change behavior. You leverage the built-in sys module to get access to the sys.argv list. python example.py my name is david Number of arguments: 5 Argument List: [‘example.py’, ‘my’, ‘name’, ‘is’, ‘david’] The built-in getopt module can help parse command…

Read More

Python – Docker Container Tutorial

By | Engineering

If you build an API or python job/project that you want to have dockerized, you’ve landed on the right blog post. Start by following the post from earlier on how to create a virtual environment to ensure you are only including the right dependencies for your project and you’ll create an outputted requirements.txt file. Add a “Dockerfile” to your project…

Read More

Python – Virtual Environment Tutorial

By | Engineering

A virtual environment in Python allows you to setup a folder for dependencies that could be used among a few projects (i.e. data science projects that need base conda libraries) or isolated per project to ensure no conflicts. This prevents conflicting having a project that needs library v1.0 and another project needing v2.0. To create a new virtual environment, invoke…

Read More