Please help here: python <==> COM

M

mep

Hi,all
I'm scripting flashget (A download management tool,
http://www.amazesoft.com/) using
python win32 extension, opening a downloading dialog.
The following pythong code NOT work:
====CODE BEGIN====
#!/usr/bin/env python
# -*- coding: cp936 -*-

import win32com.client

flashget = win32com.client.Dispatch('JetCar.Netscape')
params = ('http://test.com/1',
'http://test.com/2',
'http://test.com/3',
'http://test.com/4',
'http://test.com/5')

flashget.AddUrlList(params)
====CODE END====

It complaints the following:
File "<COMObject JetCar.Netscape>", line 2, in AddUrlList
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None,
None, 0, -2146828283), None)

But the following VBS code does the tricky:
====CODE BEGIN====
Dim params(4)
set flashget=CreateObject("JetCar.Netscape")

params(0) = "http://test.com/1"
params(1) = "http://test.com/2"
params(2) = "http://test.com/3"
params(3) = "http://test.com/4"
params(4) = "http://test.com/5"

flashget.AddUrlList params
====CODE END====

Any hints?
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top