Skip to content

Instantly share code, notes, and snippets.

@fd0
Created November 4, 2013 18:26
Show Gist options
  • Save fd0/7307043 to your computer and use it in GitHub Desktop.
Save fd0/7307043 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import os.path
dir = os.path.dirname(__file__)
db = os.path.join(dir, 'foobar.sqlite')
print __file__
print dir
print db
@fd0
Copy link
Author

fd0 commented Nov 4, 2013

$ python2.7 /tmp/foo.py
/tmp/foo.py
/tmp
/tmp/foobar.sqlite

$ cd /tmp
$ python2.7 ./foo.py  
./foo.py        
.
./foobar.sqlite

usw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment