Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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