Skip to content

Instantly share code, notes, and snippets.

@jorisroovers
Created September 20, 2013 08:13
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 jorisroovers/6634623 to your computer and use it in GitHub Desktop.
Save jorisroovers/6634623 to your computer and use it in GitHub Desktop.
Python Basics
f = open('myfile','w')
f.write('hi there\n') # python will convert \n to os.linesep
f.close()
filename = raw_input()
filename = raw_input("Please enter filename")
import re
regex = re.compile("(([0-9a-f]*-?)+)/pid$")
m = regex.search(pidfile)
if m:
m.group(0) # complete match
m.group(1) # first group in parentheses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment