forked from faturita/python-scientific
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebugsample.py
More file actions
60 lines (31 loc) · 666 Bytes
/
debugsample.py
File metadata and controls
60 lines (31 loc) · 666 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
'''
Using pdb for debugging on python.
Code and tools provided by https://github.com/tpapastylianou
Debugging:
n: next step
s: step in
h: help
'''
a = 3
print('h: help')
print('ll: check sourrounding code.')
print('n: next line')
print('s: step into')
#import pdb_m; pdb_m.pdb.set_trace()
a = a + 3
def callme(b):
b = b + 9
b = b + 2
return b
c = callme(a)
print (id(a))
print (id(c))
print(f'Value of a:{a}')
print(f'Value of c:{c}')
l = [3,2,1]
def addme(thisisalist):
thisisalist.append(9)
return thisisalist
anotherlist = addme(l)
print(id(l), end='') ; print(l)
print(id(anotherlist),end=''); print(l)