Skip to content

Instantly share code, notes, and snippets.

@dylanbstorey
Last active May 28, 2017 19:32
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 dylanbstorey/b5a5dbcff070e9533f377ae605298a46 to your computer and use it in GitHub Desktop.
Save dylanbstorey/b5a5dbcff070e9533f377ae605298a46 to your computer and use it in GitHub Desktop.
2017-02-09-Doit_for_automating_tasks
with open('Hello.txt','w') as f:
f.write('Hello World!')
import glob
def task_ingest():
file_deps = glob.glob('data/*.in')
for f in file_deps:
yield{
'name' : 'ingest_{}'.format(f),
'actions' :['python Ingestor.py {}'.format(f)],
'file_dep': [f],
'targets' :['{}.out'.format(f)]
}
import sys
import time
time.sleep(1)
with open('{}.out'.format(sys.argv[1]),'w') as f:
f.write('yay')
Should I Say it?
def task_hello_world():
return{
'actions' :['python HelloWorld.py'],
'file_dep':['ShouldISayHello'],
'targets' :['Hello.txt']
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment