BillW Posted March 2, 2016 Share Posted March 2, 2016 I have a set of menu commands and tools that I have written in python with all the code for each contained within the respective Script Editor window ie no external code import/modules etc. I thought I would try and encrypt (ie PC ctrl+alt+shift with capslock set) a simple menu command "Test menu" containing code vs.AlrtDialog('Menu command') I get an error "Test menu.xml" not found. I understand from previous posts that the xml must exist if the form Common/__init__.py Common/Vector.py Common/Utilities.py Common/ObjsType.py MyDialog.py MainProgram.py but if I have no external files ie code is totally encapsulated. what do I put in the xml file?? see attached Thanks Quote Link to comment
Dieter @ DWorks Posted March 3, 2016 Share Posted March 3, 2016 Just no file references, you will have: I have the same situation. Quote Link to comment
Dieter @ DWorks Posted March 3, 2016 Share Posted March 3, 2016 Just no file references, you will have: I have the same situation. Quote Link to comment
Patrick Winkler Posted April 27, 2016 Share Posted April 27, 2016 In my case the modules are in a folder (no package) named code. The folder lies in the same directory like the vms. I tried: code/main.py code/vw_lib.py and code/main.py code/vw_lib.py Both xmls didn't work - no error shows up. Quote Link to comment
JBenghiat Posted May 3, 2016 Share Posted May 3, 2016 Your top attempt is correct, but with one exception. In python, having includes in a directory organizes them into a package -- they way they are packaged with "code/," you would call include code.main.py For this to work, you would need a (potentially) blank file in code names "__init__.py" and to include than in your package xml. Alternatively, as you indicate you aren't organizing into packages, you need VW to strip "code/" from the included file names. You can do this with the Path attribute, so in your case: Note, the attribute names are case sensitive. -Josh Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.