Author Topic: Distribution of Python Module to use with PyXLL  (Read 1535 times)

bluenemo

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Distribution of Python Module to use with PyXLL
« on: November 11, 2012, 04:02:16 AM »
I wrote a small screen scarping python program (really small, just 10 lines of python code) to pass some dummy website value to excel.

I use Beautiful Soup to do the screen scraping and other 3rd party python libraries as well. Does it mean that if I need to use this small program on another machine. I will need to make available the *whole* python installation (Python of course and all the third party libraries) in that other machine?

Another question, which PyXLL functions I should look into if I want the Python module to pool the website and push the data to Excel automatically?

Thanks in advance for the help.

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 599
  • Karma: +14/-1
    • View Profile
Re: Distribution of Python Module to use with PyXLL
« Reply #1 on: November 11, 2012, 12:07:24 PM »
Hi,

yes, to run Python code on any PC you need to have Python and any dependencies installed - even when running it via PyXLL. You could set the python path to somewhere on a network drive and have your code deployed there, if that helps.

You can write values into Excel using win32com, either from a second thread in Excel using PyXLL or from a second process running on the same PC outside of Excel. The automation examples included with PyXLL show how to write values back to Excel. Another possible option would be to use an Excel RTD function (real time data). The pywin32 package includes an example of how to do that, and if you search this forum for 'RTD' you will find a post with an example of how to write a PyXLL function to get results from an RTD COM object.

Best regards,
Tony