Jump to content
Developer Wiki and Function Reference Links ×

Import phyton modules


Recommended Posts

Hello,

I'm trying to use a python (openpyxl) module in one of the VW scripts.

I installed the module as per module author instructions, then I created this script:

------------------------------------------------

from openpyxl import load_workbook

from openpyxl import workbook

from openpyxl import worksheet

wb = load_workbook('mb.xlsm')

print(wb.get_sheet_names())

------------------------------------------------

the script works perfectly when run from command line:

C:\>python test.py

['Objects', 'Fields']

but, when I run it from VW menu element, I get this error message window:

"Script Error"

"Traceback (most recent call last):

File "", line 1, in

ImportError: No module named 'openpyxl'"

I'm sure I'm missing some step but I cannot figure out which one.

--Thanks

Link to comment

I tried some things out, and it seems that importing modules doesn't work with encrypted plug-ins. You will always need to deliver the python scripts and I see now way of protecting the code.

Can someone explain how we can protect our code if we want to write python scripts in VW? Encrypting the plugins with px files worked as they just got included into the plugin itself.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...