How to edit a script tool that only has .pyd and .pyc files?

251
4
Jump to solution
12-15-2020 05:09 PM
AllenDailey1
Occasional Contributor

I know this is only tangentially related to ArcGIS, but I thought I'd give this a try and see if anyone could help.  I need to edit a script/tool created by someone who no longer works at my organization.  The tool has a simple GUI that staff use to "promote" a Geocortex site (which contains ArcGIS map services) from our dev server to our prod server.  This basically just involves copying a folder.  We need the tool because staff aren't given direct access to the prod server.  My goal is to simply add the names of our new servers so users can select those.

The folder that contains all the tool's files does not have a .py file.  It only  has lots of .pyd and .pyc and .dll files, plus an .exe which is the GUI.  I have no idea how the previous employee built it.  Those files are not human readable or editable.  Is there any way to edit any of it?

AllenDailey1_0-1608080808715.png

I noticed that the copysites.exe.log file contains text that refers to a file called copysites.py, but that does not exist in the folder or any of the subfolders.

AllenDailey1_1-1608080921302.png

 

Tags (2)
Reply
0 Kudos
2 Solutions

Accepted Solutions
Kara_Shindle
Occasional Contributor III

Looks like he might have used QTCreator or QT Designer to make the GUI part - can you access his computer and see if QT has a recent file that points to a .UI extention?

View solution in original post

Reply
0 Kudos
AllenDailey1
Occasional Contributor

Thank you!  Turns out we were able to find a folder of his backup files, even though we can't access his "real" files, and there was a copy of the script files.  It included a .py file that seems to be the basis for most of the rest of it, so I have been working on editing it.  You were right, he used QT Designer, I discovered, and there were a couple of .ui files in the folder we found; your hints were helpful!  Thanks!

Allen

View solution in original post

Reply
0 Kudos
4 Replies
DanPatterson
MVP Frequent Contributor

pyd  .... like

 C:\install folder\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgisscripting\_arcgisscripting.pyd

which is one of the files when you import arcpy

As for pyc...

compiled - If Python is interpreted, what are .pyc files? - Stack Overflow

An interesting read and there are many links about pyc, pyd etc and whether you can decompile them etc.

In short... not really worth the try on the practical level. 

They are compiled for a reason, one of them being to retain ownership of the code.


... sort of retired...
Reply
0 Kudos
AllenDailey1
Occasional Contributor

Thanks, Dan.  That's good to know about the files being compiled for a reason - makes sense.

Allen

Reply
0 Kudos
Kara_Shindle
Occasional Contributor III

Looks like he might have used QTCreator or QT Designer to make the GUI part - can you access his computer and see if QT has a recent file that points to a .UI extention?

View solution in original post

Reply
0 Kudos
AllenDailey1
Occasional Contributor

Thank you!  Turns out we were able to find a folder of his backup files, even though we can't access his "real" files, and there was a copy of the script files.  It included a .py file that seems to be the basis for most of the rest of it, so I have been working on editing it.  You were right, he used QT Designer, I discovered, and there were a couple of .ui files in the folder we found; your hints were helpful!  Thanks!

Allen

View solution in original post

Reply
0 Kudos