Question

Code:

import pdb

def fun():
    i = 100
    pdb.set_trace()

if __name__ == '__main__':
    fun()

Output:

$ python pdb_script.py
--Return--
> /home/h/CARDIO/WorkSpace/PDB/pdb_script.py(7)fun()->None
-> pdb.set_trace()
(Pdb) a
(Pdb) a
(Pdb) 

Shouldn't i be an argument ?

Était-ce utile?

La solution

Why should i be an argument when it is a variable?

(Pdb) whatis i
<type 'int'>

and...

(Pdb) args
(Pdb) 
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top