Skip to content

Instantly share code, notes, and snippets.

@kapare
Created November 13, 2015 16:27
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 kapare/6969b2a58b7855a0b2f3 to your computer and use it in GitHub Desktop.
Save kapare/6969b2a58b7855a0b2f3 to your computer and use it in GitHub Desktop.
#!/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
@kapare
Copy link
Author

kapare commented Nov 13, 2015

ipython --version
4.0.0
ipython IPythonTest.py
File "", line 92
!pwd
^

@kapare
Copy link
Author

kapare commented Nov 16, 2015

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