Skip to content

Instantly share code, notes, and snippets.

@efloehr
Last active August 29, 2015 14:14
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 efloehr/33cf64dc6c074aac1204 to your computer and use it in GitHub Desktop.
Save efloehr/33cf64dc6c074aac1204 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
for argument in sys.argv:
if argument == '-v':
print sys.version
if argument == '-p':
print sys.platform
#!/usr/bin/env python
import sys
import fileinput
# Find image files sync'ed via: rsync -ai /misc/timelapse/ /mnt/timelapse/
for line in fileinput.input():
if line.startswith('>f') and line.strip().endswith('.jpg'):
print line,
These are the files created and commands run during my presentation at the
January 2015 meeting of the Central Ohio Python Users Group.
[efloehr@tawodi jan2015]$ python
Python 2.7.8 (default, Nov 10 2014, 08:19:18)
[GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> bin(2015) # 2015 is a palindrome in binary!
'0b11111011111'
>>> import sys
>>> sys.ps1 = "What?! " # Change the >>> prompt in the Python shell
What?! sys.ps2 = "And??? " # Change the ... continuation prompt in the Python shell
What?! for char in 'Hello!':
And??? print char
And???
H
e
l
l
o
!
What?!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment