Skip to content

Instantly share code, notes, and snippets.

@Areso
Created January 23, 2017 12:52
Show Gist options
  • Save Areso/df64c12b6dc477246b89118886055991 to your computer and use it in GitHub Desktop.
Save Areso/df64c12b6dc477246b89118886055991 to your computer and use it in GitHub Desktop.
pythonsub
import subprocess
bashCommand = "uptime"
#output = subprocess.check_output(['bash','-c', bashCommand])
subprocess.Popen(bashCommand)
@Areso
Copy link
Author

Areso commented May 23, 2017

grab / peewee/ urlparse / faker / six.moves.http_cookiejar

@Areso
Copy link
Author

Areso commented May 23, 2017

Reserved Words

You cannot use reserved words as variable names / identifiers
and del for is raise assert elif from
lambda return break else global not try class except if or while
continue exec import pass yield def finally in print as with

@Areso
Copy link
Author

Areso commented May 23, 2017

fh = open("romeo.txt", "r")

count = 0
for line in fh:
print(line.strip())
count = count + 1

print (count,"Lines")

@Areso
Copy link
Author

Areso commented May 23, 2017

fh = open("romeo.txt", "r")

count = 0
for line in fh:
print line.strip()
count = count + 1

print count,"Lines"

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