VB to Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aleksandar Cikota

    #1

    VB to Python

    Hi all,

    Can someone translate the VB code to Python?

    VB code:

    Dim chsr as New DriverHelper.Ch ooser
    chsr.DeviceType = "Telescope"
    scopeProgID = chsr.Choose(sco peProgID)
    Set scope = CreateObject(sc opeProgID)
    scope.Connected = True



    For your prompt reply, I say thank you in advance.

    Best regards,
    Aleksandar


  • Gregor Horvath

    #2
    Re: VB to Python

    Aleksandar Cikota schrieb:
    [color=blue]
    > Can someone translate the VB code to Python?
    >
    > VB code:
    >
    > Dim chsr as New DriverHelper.Ch ooser
    > chsr.DeviceType = "Telescope"
    > scopeProgID = chsr.Choose(sco peProgID)
    > Set scope = CreateObject(sc opeProgID)
    > scope.Connected = True
    >[/color]

    (untested; late binding):

    import win32com.client

    chsr = win32com.client .Dispatch("Driv erHelper.Choose r") #you may have to
    choose the ProdID of the class from the registry here

    chsr.DeviceType = "Telescope"
    scopeProgID = chsr.Choose(sco peProgID)
    scope = win32com.client .Dispatch(scope ProgID)
    scope.Connected = True


    --
    Mit freundlichen Grüßen,
    Ing. Gregor Horvath, Industrieberatu ng & Softwareentwick lung
    Mobil: +43(0)699108790 04
    Fax: +43(0)1/25330333931 http://www.gregor-horvath.com




    --
    Mit freundlichen Grüßen,
    Ing. Gregor Horvath, Industrieberatu ng & Softwareentwick lung
    Firma Gregor Horvath, Ing. - Industrieberatung & Softwareentwicklung, Wien, infor:COM, Tryton, ERP, Web, GNU/Linux

    Comment

    • Aleksandar Cikota

      #3
      Re: VB to Python

      Vielen Dank. Es funktioniert.


      Mit freundlichen gruessen,
      Aleksandar Cikota


      "Gregor Horvath" <g.horvath@gmx. at> wrote in message
      news:e1ptt3$4tb $1@newsreader1. utanet.at...[color=blue]
      > Aleksandar Cikota schrieb:
      >[color=green]
      >> Can someone translate the VB code to Python?
      >>
      >> VB code:
      >>
      >> Dim chsr as New DriverHelper.Ch ooser
      >> chsr.DeviceType = "Telescope"
      >> scopeProgID = chsr.Choose(sco peProgID)
      >> Set scope = CreateObject(sc opeProgID)
      >> scope.Connected = True
      >>[/color]
      >
      > (untested; late binding):
      >
      > import win32com.client
      >
      > chsr = win32com.client .Dispatch("Driv erHelper.Choose r") #you may have to
      > choose the ProdID of the class from the registry here
      >
      > chsr.DeviceType = "Telescope"
      > scopeProgID = chsr.Choose(sco peProgID)
      > scope = win32com.client .Dispatch(scope ProgID)
      > scope.Connected = True
      >
      >
      > --
      > Mit freundlichen Grüßen,
      > Ing. Gregor Horvath, Industrieberatu ng & Softwareentwick lung
      > Mobil: +43(0)699108790 04
      > Fax: +43(0)1/25330333931 http://www.gregor-horvath.com
      >
      >
      >
      >
      > --
      > Mit freundlichen Grüßen,
      > Ing. Gregor Horvath, Industrieberatu ng & Softwareentwick lung
      > http://www.gregor-horvath.com[/color]


      Comment

      Working...