Re: Which way is best to execute a Python script in Excel?

Discussion in 'Python' started by Emile van Sebille, Jul 7, 2012.

  1. On 7/7/2012 2:05 AM Maurizio Spadaccino said...
    > Thanks again Emile, I'll try out some examples. I found this one: http://showmedo.com/videotutorials/video?name=2190050&fromSeriesID=219
    > quite enlightning.
    > One last doubt is: say the python code gets used by more Excel Users (different pc), can I include in some way a dinamic generation of the id in order to allow each pc to register is own COM server or do I have to hard code the id on each machine specifically?
    >


    Here's how to generate an ID, but it's likely not to occur on other
    machines.

    >>> import pythoncom; print pythoncom.CreateGuid()

    {CE571F2A-6BD8-4A8D-9482-4EC02FAC171E}

    There's an interesting perspective on uniqueness of guid's at

    http://betterexplained.com/articles/the-quick-guide-to-guids/

    So, create it once and hardcode it in. If you provide new features in a
    subsequent version you may want to issue a new guid, particularly to
    develop a new version while still running the old on the same machine.

    Each user will then need to have python and pythonwin installed, then
    run your com server to execute the com server registration piece in the
    "if __name__ == '__main__'" part of things.

    Emile
     
    Emile van Sebille, Jul 7, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas Jollans
    Replies:
    0
    Views:
    282
    Thomas Jollans
    Jul 5, 2012
  2. Emile van Sebille
    Replies:
    0
    Views:
    221
    Emile van Sebille
    Jul 5, 2012
  3. Mark Shroyer
    Replies:
    0
    Views:
    318
    Mark Shroyer
    Jul 5, 2012
  4. Terry Reedy
    Replies:
    0
    Views:
    243
    Terry Reedy
    Jul 5, 2012
  5. Karim
    Replies:
    0
    Views:
    160
    Karim
    Jul 6, 2012
Loading...

Share This Page