VB to Python

A

Aleksandar Cikota

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
 
G

Gregor Horvath

Aleksandar said:
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
 
A

Aleksandar Cikota

Vielen Dank. Es funktioniert.


Mit freundlichen gruessen,
Aleksandar Cikota
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

VB .Net form windowState to keep same 2
.VB converting to C# 0
Need an if statement 8
BSTR 0
New to python 4
Python battle game help 2
Python - limiting input to certain characters 7
Processing in Python help 0

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top