Skip to content

Instantly share code, notes, and snippets.

@donhamiltoniii
Created May 4, 2018 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donhamiltoniii/1f400b61aee6ed3f7e0af824e577f297 to your computer and use it in GitHub Desktop.
Save donhamiltoniii/1f400b61aee6ed3f7e0af824e577f297 to your computer and use it in GitHub Desktop.
Help Max computerize snakes
#! usr/bin/env python3
#This script will compile lifetime rattle profiles of long term snakes and spit out their ID and a list of segment values, newest to oldest
#load required modules
import sys
import os
import re
import argparse
def get_args():
#create an ArgumentParser object ('parser')
parser = argparse.ArgumentParser()
#add required arguments
parser.add_argunent("txt", help="name of the txt, tab delimited, data file")
#parse the arguments
return parser.parse_args()
def parse_file():
#open the txt file
# make the reference to the file a string
complete = open('whatever-file-you-are-parsing.txt', 'r')
print(complete)
def build_lists():
# add anything in here so it closes the function
variableToMakeCompilerHappy = 'Pike Mouth help you.'
def main():
# take out complete
parse_file()
main()
# I made a file named 'whatever-file-you-are-parsing.txt'
# in the project directory
#
# Here's the output I get when I run that:
#
# `<open file 'whatever-file-you-are-parsing.txt', mode 'r' at 0x106ff24b0>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment