How to find imported modules

J

Johny

My Main program imports several other smaller programs.
for example
Main.py
imports
Program1.py
Program2.py
....
Program50.py

Now I need to find out which of Programs imports a particular module
- module timesocket.py
Is that possible without opening each program?
Thanks
B.
 
K

kyosohma

My Main program imports several other smaller programs.
for example
Main.py
imports
Program1.py
Program2.py
...
Program50.py

Now I need to find out which of Programs imports a particular module
- module timesocket.py
Is that possible without opening each program?
Thanks
B.

It is with grep on *nix, or you could download baregrep for windows,
which is what I use when I need to know this sort of thing.

Mike
 
G

Gabriel Genellina

It is with grep on *nix, or you could download baregrep for windows,
which is what I use when I need to know this sort of thing.

On Windows there is no need to download anything, you can use the findstr
utility:

findstr /R /S /C:"import *timesocket" /C:"from *timesocket *import" *.py
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top