469,949 Members | 2,430 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,949 developers. It's quick & easy.

VB to Python

Hi all,

Can someone translate the VB code to Python?

VB code:

Dim chsr as New DriverHelper.Chooser
chsr.DeviceType = "Telescope"
scopeProgID = chsr.Choose(scopeProgID)
Set scope = CreateObject(scopeProgID)
scope.Connected = True

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

Best regards,
Aleksandar
Apr 14 '06 #1
2 1334
Aleksandar Cikota schrieb:
Can someone translate the VB code to Python?

VB code:

Dim chsr as New DriverHelper.Chooser
chsr.DeviceType = "Telescope"
scopeProgID = chsr.Choose(scopeProgID)
Set scope = CreateObject(scopeProgID)
scope.Connected = True


(untested; late binding):

import win32com.client

chsr = win32com.client.Dispatch("DriverHelper.Chooser") #you may have to
choose the ProdID of the class from the registry here

chsr.DeviceType = "Telescope"
scopeProgID = chsr.Choose(scopeProgID)
scope = win32com.client.Dispatch(scopeProgID)
scope.Connected = True
--
Mit freundlichen Grüßen,
Ing. Gregor Horvath, Industrieberatung & Softwareentwicklung
Mobil: +43(0)69910879004
Fax: +43(0)1/25330333931 http://www.gregor-horvath.com


--
Mit freundlichen Grüßen,
Ing. Gregor Horvath, Industrieberatung & Softwareentwicklung
http://www.gregor-horvath.com
Apr 15 '06 #2
Vielen Dank. Es funktioniert.
Mit freundlichen gruessen,
Aleksandar Cikota
"Gregor Horvath" <g.*******@gmx.at> wrote in message
news:e1**********@newsreader1.utanet.at...
Aleksandar Cikota schrieb:
Can someone translate the VB code to Python?

VB code:

Dim chsr as New DriverHelper.Chooser
chsr.DeviceType = "Telescope"
scopeProgID = chsr.Choose(scopeProgID)
Set scope = CreateObject(scopeProgID)
scope.Connected = True


(untested; late binding):

import win32com.client

chsr = win32com.client.Dispatch("DriverHelper.Chooser") #you may have to
choose the ProdID of the class from the registry here

chsr.DeviceType = "Telescope"
scopeProgID = chsr.Choose(scopeProgID)
scope = win32com.client.Dispatch(scopeProgID)
scope.Connected = True
--
Mit freundlichen Grüßen,
Ing. Gregor Horvath, Industrieberatung & Softwareentwicklung
Mobil: +43(0)69910879004
Fax: +43(0)1/25330333931 http://www.gregor-horvath.com


--
Mit freundlichen Grüßen,
Ing. Gregor Horvath, Industrieberatung & Softwareentwicklung
http://www.gregor-horvath.com

Apr 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.