Last active
August 29, 2015 14:14
-
-
Save efloehr/33cf64dc6c074aac1204 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
for argument in sys.argv: | |
if argument == '-v': | |
print sys.version | |
if argument == '-p': | |
print sys.platform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These are the files created and commands run during my presentation at the | |
January 2015 meeting of the Central Ohio Python Users Group. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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