This is a bit out there but I have a module that I can import, but i dont know where it is, and module.__file__ doesnt work on it.
Im trying to set up VSCode for 3ds Max python development and this one module (pymxs) is somehow hidden somewhere where intellisense or pylint cant see it, so I get errors every time i use it, and autocomplete doesnt work. The code runs just fine though, and i can use inspect.getmembers() on it just fine.
Now what I would be interested in doing is just outputting the whole module in to a text file, so that hopefully intellisense/pylint will be able to read it.
Is that possible?
The file pymxs.py unfortunately doesn't exist, the module only exists at runtime, i.e. when running your script in 3ds max. So at this point there's no existing solution to get autocomplete for pymxs in an external editor.
In the editor inside 3ds max however they have autocomplete these days, so maybe (just maybe) it's possible to create a plugin that communicates with max and retrieves this information during runtime, but no idea where you would even start with that, or if it's even possible.
Another solution could be to create wrapper functions for your most commonly used pymxs functions, and in that way get autocomplete from your wrapper library. Note however that with this approach everything in pymxs might not be possible to add here as it is using runtime information. Let's for example say you run myobject = rt.selection[0] Depending on if myobject becomes a teapot or a box or whatever at runtime, different functions will be available, such as radius and height. If you know what you will get maybe you can cast the output to your wrapper class or something like that.
Extracting an imported python module to a file?