Re: The dimensions of a tuple

2008-01-25 Thread bg_ie
On 25 Jan, 12:03, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 25, 9:26 pm, [EMAIL PROTECTED] wrote: > > > Hi, > > > I wish to pass an argument to a function which will inset rows in a > > db. I wish to have the follow possibilities - > > > ("one","two") > > (("one","two"),("three","four")) > >

The dimensions of a tuple

2008-01-25 Thread bg_ie
Hi, I wish to pass an argument to a function which will inset rows in a db. I wish to have the follow possibilities - ("one","two") (("one","two"),("three","four")) The first possibility would mean that one row is added with "one and "two" being its column values. The second possibility means th

Re: Connecting to Sql Server from Python

2008-01-24 Thread bg_ie
On 24 Jan, 17:16, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Jan 24, 9:44 am, [EMAIL PROTECTED] wrote: > > > > > > > Hi, > > > I have an sql server from which I'd like to read and write to. The > > connection string is as follows - > > > "Data Source=localhost\SQLExpress;Initial Catalog=Test;Int

Connecting to Sql Server from Python

2008-01-24 Thread bg_ie
Hi, I have an sql server from which I'd like to read and write to. The connection string is as follows - "Data Source=localhost\SQLExpress;Initial Catalog=Test;Integrated Security=True;Pooling=False" Other properties as they appear in Visual Studio 2005 include - Data Provider: .NET Framework D

Launching a wx GUI from within our python framework

2008-01-07 Thread bg_ie
Hi, At my work we have a framework writen in python which allows us to test our equipment. This framework is quite large and uses a Singelton called frameworkExec which we pass around between objects in order to share functionailty. For example, frameWorkExec stores an instance of the BatteryManag

An Object's Type

2007-12-05 Thread bg_ie
Hi, Is it possible to find out if an object is of a certain type or of a type derived from this type? Thanks, Barry -- http://mail.python.org/mailman/listinfo/python-list

Enum class with ToString functionality

2007-09-10 Thread bg_ie
Hi, I have the following class - class TestOutcomes: PASSED = 0 FAILED = 1 ABORTED = 2 plus the following code - testResult = TestOutcomes.PASSED testResultAsString if testResult == TestOutcomes.PASSED: testResultAsString = "Passed" elif testResult == TestOutcomes.FAILED :

Re: Python Path Dictionary

2007-08-22 Thread bg_ie
On 21 Aug, 21:45, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 8/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > On 21 Aug, 17:42, Gary Herron <[EMAIL PROTECTED]> wrote: > > > [EMAIL PROTECTED] wrote: > > > > Hi, > > > > > Do the Python Paths come in the form of a dictionary whe

File handle not being released by close

2007-07-30 Thread bg_ie
Hi, I'm in the process of writing some code and noticed a strange problem while doing so. I'm working with PythonWin 210 built for Python 2.5. I noticed the problem for the last py file processed by this script, where the concerned tmp file is only actually written to when PythonWin is closed. In

Re: Dictionary of Dictionaries

2007-03-05 Thread bg_ie
On 5 Mar, 11:45, "Amit Khemka" <[EMAIL PROTECTED]> wrote: > On 5 Mar 2007 02:22:24 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I have the following - > > > messagesReceived = dict.fromkeys(("one","two"), {}) > > This will create a dictionary "messagesReceived", with all the

Dictionary of Dictionaries

2007-03-05 Thread bg_ie
Hi, I have the following - messagesReceived = dict.fromkeys(("one","two"), {}) messagesReceived['one']['123'] = 1 messagesReceived['two']['121'] = 2 messagesReceived['two']['124'] = 4 This gives: {'two': {'121': 2, '123': 1, '124': 4}, 'one': {'121': 2, '123': 1

Building a dictionary from a tuple of variable length

2007-03-05 Thread bg_ie
Hi, I have the following tuple - t = ("one","two") And I can build a dictionary from it as follows - d = dict(zip(t,(False,False))) But what if my tuple was - t = ("one","two","three") then I'd have to use - d = dict(zip(t,(False,False,False))) Therefore, how do I build the tuple of Falses

Copy a module build to another machine

2007-02-26 Thread bg_ie
Hi, I have downloaded the source for PyXML-0.8.4, which has no binaries available for Python 2.5. Therefore I built it myself doing something like this - python2.5 setup.py build python2.5 setup.py install having installed cygwin (with gcc). Now lets say I'd like to install PyXML-0.8.4 on a numb

Finding non ascii characters in a set of files

2007-02-23 Thread bg_ie
Hi, I'm updating my program to Python 2.5, but I keep running into encoding problems. I have no ecodings defined at the start of any of my scripts. What I'd like to do is scan a directory and list all the files in it that contain a non ascii character. How would I go about doing this? Thanks, Ba

Finding a tuple in a tuple

2007-02-22 Thread bg_ie
Hi, Lists say I have the following tuple - t1 = ("ONE","THREE","SIX") and then the following tuples - t2 = ("ONE","TWO","THREE") t3 = ("TWO","FOUR","FIVE","SIX") t4 = ("TWO",) t5 = ("TWO","FIVE") What I want to do is return true if any member of tuple t1 is found in the remaining tuples. T

Building Python Pagage for Newer Python Version

2007-02-19 Thread bg_ie
Hi, I have just downloaded the source for PyXML-0.8.4, which I would like to build for Python 2.5. How exactly do I go about doing this? Thanks for your help, Barry. -- http://mail.python.org/mailman/listinfo/python-list

Getting a class name from within main

2007-02-07 Thread bg_ie
Hi, Lets say I have the following class - class MyClass: def __init__(self): print (__name__.split("."))[-1] if __name__ == '__main__': MyClassName = "MyClass" I can print the name of the class from within the class scope as seen above in the init, but is there a

COM makepy util finds multiple versions of my COM object

2007-02-02 Thread bg_ie
Hi, I have a problem where an earlier version of my Com object is being used by makepy for early binding. In makepy I see - MyCom (1.0) MyCom (1.0) MyCom (2.0) I created version 2 of my Com object hoping that this would solve the problem but makepy is still using an earlier version. I can solve

Re: Why do I have to call del explicitly for com objects?

2007-01-19 Thread bg_ie
Gabriel Genellina skrev: > <[EMAIL PROTECTED]> escribió en el mensaje > news:[EMAIL PROTECTED] > > > I'm creating objects in my python script belonging to a COM object > > which I dispatch using win32com.client.DispatchEx. Hence, dllhost.dll > > is the concerned process. The problem is that the o

Why do I have to call del explicitly for com objects?

2007-01-19 Thread bg_ie
Hi, I'm creating objects in my python script belonging to a COM object which I dispatch using win32com.client.DispatchEx. Hence, dllhost.dll is the concerned process. The problem is that the objects destructor within the com object is not called if the object lives past a certain number of seconds

Establishing if an Object is Defined

2007-01-10 Thread bg_ie
Hi, The following code works - one = 1 if one == 1: ok = 1 print ok but this does not, without exception - one = 2 if one == 1: ok = 1 print ok How do I establish before printing ok if it actually exists so as to avoid this exception? Thanks for your help, Barry. -- http://mail.python.

A simple array in Python

2007-01-09 Thread bg_ie
Hi, I have the following enum - class State: Fire = 0 Water = 1 Earth = 2 And I want a variable which holds a value for each of these states, something like - myState1[State.Fire] = 10 myState1[State.Earth] = 4 myState2[State.Fire] = 20 myState2[State.Earth] = 24 How d

Re: Python Wrapper for C# Com Object

2007-01-04 Thread bg_ie
Thomas Heller skrev: > [EMAIL PROTECTED] schrieb: > > [EMAIL PROTECTED] skrev: > > > >> Hi, > >> > >> I wish to write a Python wrapper for my C# COM object but am unsure > >> where to start. I have a dll and a tlb file, and I can use this object > >> in C via the following code - > >> > >> // Con

Re: Python Wrapper for C# Com Object

2006-12-29 Thread bg_ie
[EMAIL PROTECTED] skrev: > [EMAIL PROTECTED] skrev: > > > Hi, > > > > I wish to write a Python wrapper for my C# COM object but am unsure > > where to start. I have a dll and a tlb file, and I can use this object > > in C via the following code - > > > > // ConsolApp.cpp : Defines the entry point

Re: Python Wrapper for C# Com Object

2006-12-28 Thread bg_ie
[EMAIL PROTECTED] skrev: > Hi, > > I wish to write a Python wrapper for my C# COM object but am unsure > where to start. I have a dll and a tlb file, and I can use this object > in C via the following code - > > // ConsolApp.cpp : Defines the entry point for the console application. > // > #inclu

Python Wrapper for C# Com Object

2006-12-28 Thread bg_ie
Hi, I wish to write a Python wrapper for my C# COM object but am unsure where to start. I have a dll and a tlb file, and I can use this object in C via the following code - // ConsolApp.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "windows.h" #include

Newbie: Installing packages on windows

2006-12-11 Thread bg_ie
Hi, I'm reading the python tutorials on docs.python.org, but I'm still not sure how install a package. I have downloaded pylint in zip form from www.logilab.org, but I'm unsure what to do with it. The file I wish to test (i.e. the file I have writen myself) is located in C:\Python25\ Hope you can