Last active
December 28, 2015 20:19
-
-
Save bbot/7556441 to your computer and use it in GitHub Desktop.
Modern computing
This file contains hidden or 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
import os | |
sudoPassword = 'hunter2' | |
foobar = 'you should see this line \\"second\\"' | |
command = 'echo %s %s' % (sudoPassword, foobar) | |
def blah(input): | |
os.system('echo %s|sudo -S %s' % (sudoPassword, command)) | |
blah(1) | |
""" | |
% python foobar.py | |
hunter2 you should see this line "second" | |
"""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 4: This is what you have to do if you want to get a double quote intact through the multiple layers of text parsers between python source and terminal output.