[python-win32] Com
DogWalker
forestiero at qwest.net
Sun Dec 14 01:22:14 EST 2003
You should try CInt(Val(txtWage)), etc. "Val" apparently returns a Double.
----- Original Message -----
From: Keith Hickling
To: python-win32 at python.org
Sent: Saturday, December 13, 2003 4:37 PM
Subject: [python-win32] Com
Hi,
I am struggling to pass variables to a Python com server.
If I call the Python class with say
PyList = ComServer.taxcalc(500, 0, 0, 0, 0, "461L", "W", 1)
this works fine and ptyhon will send back the answer as a 3 part list which I can read in VB
As soon as I try to pass the same list but built from text boxes as in
PyList = ComServer.taxcalc(Val(txtWage), Val(txtTotalWage), Val(txtP45Wage), Val(txtTotalTax), Val(txtP45Tax), txtTaxCode,
txtTaxPeriod, Val(txtWeekNumber))
Python throws an error 'invalid lieral for int()'
I have tried to pass the list as a variant list
PyList = ComServer.taxcalc(MyList)
but I get the same error
If I short circuit the function and return the list I can read all the original values.
something is happening with the ptyhon function probably to do with '461L'. I dont understand why I can pass the variables as in
the first example but not the second.
Any ideas.
Martin
------------------------------------------------------------------------------
_______________________________________________
Python-win32 mailing list
Python-win32 at python.org
http://mail.python.org/mailman/listinfo/python-win32
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20031213/89b01be1/attachment.html
More information about the Python-win32
mailing list