Created
November 13, 2015 16:27
-
-
Save kapare/6969b2a58b7855a0b2f3 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 ipython | |
nb=0 | |
nb+=1 | |
print nb | |
!pwd | |
!ls | |
def Test(test): | |
global nb | |
nb+=1 | |
print nb | |
print "Test()" | |
!pwd | |
!ls | |
nb+=1 | |
print nb | |
!pwd | |
!ls | |
try: | |
Test() | |
except: | |
print "except" | |
nb+=1 | |
print nb | |
!pwd | |
!ls | |
class ObjectTest(): | |
def __init__(self): | |
global nb | |
nb+=1 | |
print nb | |
print "__init__()" | |
!pwd | |
!ls | |
ObjectTest() | |
someText="test1" | |
nb+=1 | |
print nb | |
!pwd | |
!ls | |
someStringWithBackslash="test \ | |
test2 \ | |
test3" | |
nb+=1 | |
print nb | |
!pwd | |
!ls | |
Test("test \ | |
test2 \ | |
test3") | |
nb+=1 | |
print nb | |
!pwd | |
!ls | |
Test(test="test \ | |
test2 \ | |
test3") | |
nb+=1 | |
print nb | |
!pwd | |
!ls | |
import argparse | |
# Parse arguments options | |
commandParser = argparse.ArgumentParser(description="Here are the options to configure the script.", | |
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | |
nb+=1 | |
print "",nb | |
!pwd | |
commandParser.add_argument("-o", | |
"--otest", | |
dest="otest", | |
metavar="otest", | |
default="test", | |
help="bla bla.") | |
nb+=1 | |
print "",nb | |
!pwd | |
commandParser.add_argument("-a", | |
"--atest", | |
dest="atest", | |
metavar="atest", | |
default="test", | |
help="bla \ | |
bla.") | |
nb+=1 | |
print "",nb | |
!pwd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ipython --version
4.0.0
ipython IPythonTest.py
File "", line 92
!pwd
^