python - Run shell command in pdb mode -


i want run cd , ls in python debugger. try use !ls get

*** nameerror: name 'ls' not defined

there lot of informations in almighty google.

though should use os module:

from os import listdir os.listdir("/path/to/your/folder") 

or if want more advanced stuff start new processes or catch outputs etc. need have on subprocess module.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -