Skip to content

Instantly share code, notes, and snippets.

@yichao0319
Last active June 27, 2016 08:34
Show Gist options
  • Save yichao0319/fec6adef3e3f1f621b07f5b836778c12 to your computer and use it in GitHub Desktop.
Save yichao0319/fec6adef3e3f1f621b07f5b836778c12 to your computer and use it in GitHub Desktop.
python:new
#!/usr/bin/env python
######################################
##
## Yi-Chao Chen @ UT Austin
##
## - Input
##
## - Output
##
## - Example
## python
##
######################################
import os, sys, math, random, re
from os import listdir
# import list_data
## =====================
## DEBUG
## =====================
DEBUG0 = 0
DEBUG1 = 1
DEBUG2 = 1
DEBUG3 = 1
DEBUG4 = 1
## =====================
## Constant
## =====================
input_dir = ""
output_dir = ""
## =====================
## Variables
## =====================
## =====================
## Check Input Parameters
## =====================
if len(sys.argv) != 2:
print "[FORMAT] PARAM1"
exit()
PARAM1 = sys.argv[1]
## =====================
## FUNC:
## =====================
def FUNC1(filename):
f = open(filename, 'r')
for line in f:
line = line.strip()
cols = line.split(',')
m = re.match('(\d{4})(\d{2})(\d{2})', line)
if m is not None:
return m.groups()
else:
return None
f.close()
return
## =====================
## Main
## =====================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment