Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type "copyright", "credits" or "license()" for more information. **************************************************************** Personal firewall software may warn about the connection IDLE makes to its subprocess using this computer's internal loopback interface. This connection is not visible on any external interface and no data is sent to or received from the Internet. **************************************************************** IDLE 2.6.5 ==== No Subprocess ==== >>> import hello >>> import hello1 Traceback (most recent call last): File "", line 1, in import hello1 ImportError: No module named hello1 >>> import hello >>> import hello >>> import hello >>> reload(hello) Traceback (most recent call last): File "", line 1, in reload(hello) File "/home/mvoorhie/Documents/hello.py", line 2 print "Hello, world" ^ IndentationError: unexpected indent >>> hello.hello() Hello, world >>> reload(hello) >>> help(hello) Help on module hello: NAME hello FILE /home/mvoorhie/Documents/hello.py FUNCTIONS hello() Print hello >>> reload(hello) >>> help(hello) Help on module hello: NAME hello - This is my module FILE /home/mvoorhie/Documents/hello.py FUNCTIONS hello() Print hello >>> import stats >>> x = range(15) >>> x [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] >>> stats.mean(x) >>> reload(stats) >>> stats.mean(x) 7.0 >>> mvoorhie@virgil:~/Projects/Courses/PracticalBioinformatics/python/python$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> help(__builtins__) >>> help(__builtins__.sum) >>> import math >>> help(math) >>> help("math") >>> a = "math") File "", line 1 a = "math") ^ SyntaxError: invalid syntax >>> a = "math" >>> help(a) >>> help("hello world") no Python documentation found for 'hello world' >>> help("hello world".__class__) >>> "hello world".__class__ >>> help("hello world".__class__) >>> import Sequence >>> a = Sequence() Traceback (most recent call last): File "", line 1, in TypeError: 'module' object is not callable >>> a = Sequence.ProteinSequence() Traceback (most rec"", line 1, in TypeError: __init__() takes exactly 2 arguments (1 given) >>> a = Sequence.ProteinSequence("AGGCHA") >>> help(a) >>> math.sqrt(25) 5.0 >>> from math import sqrt >>> sqrt(25) 5.0 >>> dir() ['Sequence', '__builtins__', '__doc__', '__name__', '__package__', 'a', 'math', 'sqrt'] >>> dir(math) ['__doc__', '__name__', '__package__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'e', 'exp', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'hypot', 'isinf', 'isnan', 'ldexp', 'log', 'log10', 'log1p', 'modf', 'pi', 'pow', 'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc'] >>> 5/0 Traceback (most recent call last): File "", line 1, in ZeroDivisionError: integer division or modulo by zero >>> a = 3 >>> b = 0 >>> try: ... c = a/b ... except ZeroDivisionError: ... c = 0 ... >>> c 0 >>> try: ... c = a/b ... print "I got here" ... except: ... c = 0 ... print "Nope, I didn't get there" ... Nope, I didn't get there >>> mvoorhie@virgil:~/Projects/Courses/PracticalBioinformatics/python$ cd data/ mvoorhie@virgil:~/Projects/Courses/PracticalBioinformatics/python/data$ ls supp2data.csv supp2data.png supp2data.tdt mvoorhie@virgil:~/Projects/Courses/PracticalBioinformatics/python/data$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> png = open("supp2data.png") >>> png.read(1) '\x89' >>> png.read(1) 'P' >>> png.read(1) 'N' >>> png.read(1) 'G' >>> png.read(1) '\r' >>> png.read(1) '\n' >>> png.read(50) '\x1a\n\x00\x00\x00\rIHDR\x00\x00\x03\x18\x00\x00\x02X\x08\x02\x00\x00\x00n0\xd7\xeb\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\tpHYs\x00\x00' >>> txt = open("supp2data.csv") >>> txt.read(1) 'O' >>> txt.read(1) 'R' >>> txt.read(1) 'F' >>> txt.read(1) ',' >>> txt.read(1) 'N' >>> txt.read(1) 'A' >>> txt.read(1) 'M' >>> txt.read(1) 'E' >>> txt.read(1) ',' >>> txt.read(1) 'a' >>> txt.read(1) 'l' >>> txt.readline() 'pha 0,alpha 7,alpha 14,alpha 21,alpha 28,alpha 35,alpha 42,alpha 49,alpha 56,alpha 63,alpha 70,alpha 77,alpha 84,alpha 91,alpha 98,alpha 105,alpha 112,alpha 119,Elu 0,Elu 30,Elu 60,Elu 90,Elu 120,Elu 150,Elu 180,Elu 210,Elu 240,Elu 270,Elu 300,Elu 330,Elu 360,Elu 390,cdc15 10,cdc15 30,cdc15 50,cdc15 70,cdc15 90,cdc15 110,cdc15 130,cdc15 150,cdc15 170,cdc15 190,cdc15 210,cdc15 230,cdc15 250,cdc15 270,cdc15 290,spo 0,spo 2,spo 5,spo 7,s90 9,spo 11,spo5 2,spo5 7,spo5 11,spo- early,spo- mid,heat 0,heat 10,heat 20,heat 40,heat 80,heat 160,dtt 15,dtt 30,dtt 60,dtt 120,cold 0,cold 20,cold 40,cold 160,diau a,diau b,diau c,diau d,diau e,diau f,diau g\r\n' >>> txt.readline() 'YBR166C,TYR1 TYROSINE BIOSYNTHESIS PREPHENATE DEHYDROGENASE (NADP+,0.33,-0.17,0.04,-0.07,-0.09,-0.12,-0.03,-0.2,-0.06,-0.06,-0.14,-0.18,-0.06,-0.25,0.06,-0.12,0.25,0.43,0.21,-0.04,-0.15,-0.04,0.21,-0.14,-0.03,-0.07,-0.36,-0.14,-0.42,-0.34,-0.23,-0.17,0.23,0.3,0.41,-0.07,-0.23,-0.12,0.16,0.74,0.14,-0.49,-0.32,0.19,0.23,0.24,0.28,1.13,-0.12,0.1,,0.66,0.62,0.08,0.62,0.43,0.5,-0.25,-0.51,-0.67,0.21,-0.74,-0.36,-0.01,0.38,0.15,-0.22,-0.09,0.33,0.08,0.39,-0.17,0.23,0.2,0.2,-0.17,-0.69,0.14,-0.27\r\n' >>> txt = open("supp2data.csv") >>> txt.readline() 'ORF,NAME,alpha 0,alpha 7,alpha 14,alpha 21,alpha 28,alpha 35,alpha 42,alpha 49,alpha 56,alpha 63,alpha 70,alpha 77,alpha 84,alpha 91,alpha 98,alpha 105,alpha 112,alpha 119,Elu 0,Elu 30,Elu 60,Elu 90,Elu 120,Elu 150,Elu 180,Elu 210,Elu 240,Elu 270,Elu 300,Elu 330,Elu 360,Elu 390,cdc15 10,cdc15 30,cdc15 50,cdc15 70,cdc15 90,cdc15 110,cdc15 130,cdc15 150,cdc15 170,cdc15 190,cdc15 210,cdc15 230,cdc15 250,cdc15 270,cdc15 290,spo 0,spo 2,spo 5,spo 7,spo 9,spo 11,spo5 2,spo5 7,spo5 11,spo- early,spo- mid,heat 0,heat 10,heat 20,heat 40,heat 80,heat 160,dtt 15,dtt 30,dtt 60,dtt 120,cold 0,cold 20,cold 40,cold 160,diau a,diau b,diau c,diau d,diau e,diau f,diau g\r\n' >>> txt.readline() 'YBR166C,TYR1 TYROSINE BIOSYNTHESIS PREPHENATE DEHYDROGENASE (NADP+,0.33,-0.17,0.04,-0.07,-0.09,-0.12,-0.03,-0.2,-0.06,-0.06,-0.14,-0.18,-0.06,-0.25,0.06,-0.12,0.25,0.43,0.21,-0.04,-0.15,-0.04,0.21,-0.14,-0.03,-0.07,-0.36,-0.14,-0.42,-0.34,-0.23,-0.17,0.23,0.3,0.41,-0.07,-0.23,-0.12,0.16,0.74,0.14,-0.49,-0.32,0.19,0.23,0.24,0.28,1.13,-0.12,0.1,,0.66,0.62,0.08,0.62,0.43,0.5,-0.25,-0.51,-0.67,0.21,-0.74,-0.36,-0.01,0.38,0.15,-0.22,-0.09,0.33,0.08,0.39,-0.17,0.23,0.2,0.2,-0.17,-0.69,0.14,-0.27\r\n' >>>