OT: Variant name spellings (Re: how to "free" an object/var ?)

2007-02-01 Thread greg
Steven D'Aprano wrote: > > Ste_ph_en??? I knew someone once who referred to the two ways of spelling Ste{v,ph}en as the "dry way" and the "wet way"... > It's not like I spell my name with four M's and a silent Q like the famous > author Farles Wickens *wink* Or Mr. Luxury-Yacht, which as we all

Re: division by 7 efficiently ???

2007-02-01 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Paul McGuire wrote: > On Jan 31, 11:36 pm, "Paddy" <[EMAIL PROTECTED]> wrote: >> On Feb 1, 2:42 am, [EMAIL PROTECTED] wrote: >> >> > How to divide a number by 7 efficiently without using - or / operator. >> > We can use the bit operators. I was thinking about bit shift oper

Re: how to "free" an object/var ?

2007-02-01 Thread Erik Max Francis
Steven D'Aprano wrote: > Ste_ph_en??? > > I know the ph-form of the name is marginally more popular, but dammit my > name is right there just two lines above where Paddy started typing, how > hard is it to get it right? > > It's not like I spell my name with four M's and a silent Q like the famo

Re: Any python scripts to do parallel downloading?

2007-02-01 Thread Jan Danielsson
Jean-Paul Calderone wrote: [---] >> Software is hard. > > But I absolutely agree with this point, anyway :) Software is _crazy_ > hard. I merely dispute the claim that threads are somehow _easier_. :) Threads aren't easier. Nor are they harder. They are just different. I used to be heavily i

how do I pipe two processes?

2007-02-01 Thread Bilgehan . Balban
Hi, I want to pipe output of process A to B, and read output of B from python. On Unix if I do the following: child_out, child_in = popen2("program_a | program_b") line = child_out.readline() I get "IOError: bad file descriptor" from Python, and broken pipe error from program_b. How do I do this

retrbinary ! how does it work ?

2007-02-01 Thread [EMAIL PROTECTED]
Hello dear community ! I'm a bit ashamed to ask such an easy question, but I didn't find my answer on previous posts. I'd like to copy files with FTP protocol in a subdirectory. So far, my code look like that : import ftplib session = ftplib.FTP('222.33.44.55','usr','pwd') session.cwd('/')

Re: division by 7 efficiently ???

2007-02-01 Thread BJörn Lindqvist
This is maybe not so efficient :) but it implements integer division by 7 for positive integers without - and /. def div2(num): return num >> 1 def div4(num): return num >> 2 def div8(num): return num >> 3 def mul2(num): return num << 1 def mul4(num): return num << 2 def m

Re: retrbinary ! how does it work ?

2007-02-01 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hello dear community ! > > I'm a bit ashamed to ask such an easy question, but I didn't find my > answer on previous posts. > I'd like to copy files with FTP protocol in a subdirectory. > So far, my code look like that : > > import ftplib > session = ftplib.FTP('22

Re: retrbinary ! how does it work ?

2007-02-01 Thread Gabriel Genellina
En Thu, 01 Feb 2007 06:17:34 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > I'd like to copy files with FTP protocol in a subdirectory. > So far, my code look like that : > > import ftplib > session = ftplib.FTP('222.33.44.55','usr','pwd') > session.cwd('/') > files = session.n

Re: Can I import a file without file extension .py?

2007-02-01 Thread Dustan
On Feb 1, 12:51 am, "Jia Lu" <[EMAIL PROTECTED]> wrote: > > def make_module_from_file(module_name, file_name): > > """ Make a new module object from the code in specified file """ > > > from types import ModuleType > > module = ModuleType(module_name) > > > modul

stlib name clash when using python as ASP language

2007-02-01 Thread Joost
Hi guys, I have couple of simple python based active server pages that make use of httplib2 which uses gzip.py. IIS, however, also has a gzip.dll located at the iis/inetsrv path. When using ASP the iis/inetsrv path is placed as the first item in sys.path. Consequently importing httplib2 will caus

Re: "Correct" db adapter

2007-02-01 Thread king kikapu
Ok, i see.. Thanks a lot all of you for the help. I know from my Win/.Net/Sql Server expertise that odbc put a layer in the mix. That's why, for example, in .Net we have a native SqlClient data provider that talks to Sql Server directly. But one of the reasons that i started learning Python, is t

Re: retrbinary ! how does it work ?

2007-02-01 Thread [EMAIL PROTECTED]
Thanks a lot Diez and Gabriel. It works perfectly ! Have a nice day Yvan -- http://mail.python.org/mailman/listinfo/python-list

SWIG overhead

2007-02-01 Thread Bart Ogryczak
Hi, I´m looking for some benchmarks comparing SWIG generated modules with modules made directly with C/Python API. Just how much overhead does SWIG give? Doing profile of my code I see, that it spends quiet some time in functions like _swig_setattr_nondinamic, _swig_setattr, _swig_getattr. -- htt

Help me with this!!!

2007-02-01 Thread TOXiC
Hi all, I've this code: regex = re.compile(r"(?si)(\x8B\xF0\x85\xF6)(?P.*) (\xC6\x44\x24)",re.IGNORECASE) file = open(fileName, "rb") for line in file: if (match): print line file.close() It search a text inside that hex value. It works perfecly on a txt fi

Re: SWIG overhead

2007-02-01 Thread Roman Yakovenko
On 1 Feb 2007 02:21:35 -0800, Bart Ogryczak <[EMAIL PROTECTED]> wrote: > Hi, > I´m looking for some benchmarks comparing SWIG generated modules with > modules made directly with C/Python API. Just how much overhead does > SWIG give? Doing profile of my code I see, that it spends quiet some > time i

Re: pil, histogram, mask

2007-02-01 Thread bearophileHUGS
Daniel Nogradi > I don't need the histogram really, only the mean color > value, but as far as I can see the 'mean' attribute only applies to an > image and a mask can not be specified. You can slice parts of the image, and then use the ImageStat.Stat(im).mean On it. Bye, bearophile -- http://m

Re: SWIG overhead

2007-02-01 Thread Phil Thompson
On Thursday 01 February 2007 10:21 am, Bart Ogryczak wrote: > Hi, > I´m looking for some benchmarks comparing SWIG generated modules with > modules made directly with C/Python API. Just how much overhead does > SWIG give? Doing profile of my code I see, that it spends quiet some > time in functions

Play UK Lotto + Euromillions fo FREE

2007-02-01 Thread Play UK lotto + Euromillions For FREE
Play the UK lotto + Euromillions for free. see www.carlnalex.pwp.blueonder.co.uk -- http://mail.python.org/mailman/listinfo/python-list

ZSI and WSDL schema

2007-02-01 Thread Grzegorz Smith
Hi all. I have problem with ZSI and WSDL schema.I generate from WSDL by wsdl2py client method for webservice. I made soap call and something goes wrong. Doeas anyone know hot to create some server code by ZSI from WSDL?? I just suspectes that my return data from webservice is in incorrect envelope

Re: how do I pipe two processes?

2007-02-01 Thread Michele Simionato
On Feb 1, 10:12 am, [EMAIL PROTECTED] wrote: > Hi, I want to pipe output of process A to B, and read output of B from > python. On Unix if I do the following: > > child_out, child_in = popen2("program_a | program_b") > > line = child_out.readline() > > I get "IOError: bad file descriptor" from Pyth

Re: ctypes error on exit of win32 application

2007-02-01 Thread Rubic
On Jan 31, 8:49 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Maybe process_record expects some minimum buffer size? The cpp example > uses char record[100], but you are allocating only a few bytes with the > string "My Record" No, I've already tried padding record out to the full size. Bu

Re: SWIG overhead

2007-02-01 Thread Bart Ogryczak
On Feb 1, 12:12 pm, Phil Thompson <[EMAIL PROTECTED]> wrote: > On Thursday 01 February 2007 10:21 am, Bart Ogryczak wrote: > > > Hi, > > I´m looking for some benchmarks comparing SWIG generated modules with > > modules made directly with C/Python API. Just how much overhead does > > SWIG give? Doin

Re: ZSI and WSDL schema

2007-02-01 Thread Simon Brunning
On 1 Feb 2007 03:14:14 -0800, Grzegorz Smith <[EMAIL PROTECTED]> wrote: > Hi all. I have problem with ZSI and WSDL schema.I generate from WSDL > by wsdl2py client method for webservice. I made soap call and > something goes wrong. It might help if you were a little more specific. -- Cheers, Simo

Re: SWIG overhead

2007-02-01 Thread Diez B. Roggisch
> Yeah, found that one googling around. But I haven´t fund anything more > up to date. I imagine, that the performance of all of these wrappers > has been improved since then. But the performance of Python/C API > would too? > Anyways, it´s not about exact number, it´s more about taking decision >

Re: Python module for the IPod shuffle ...

2007-02-01 Thread Simon Brunning
On 1/31/07, Analog Kid <[EMAIL PROTECTED]> wrote: > Hi all: > Im looking for a python module thatll let me do simple reads/writes from and > to an iPod shuffle similar to iTunes ... I read about the gPod module ... > but Im not sure whether it will work in Windows ... This any good?

Re: "Correct" db adapter

2007-02-01 Thread Peter Decker
On 1 Feb 2007 02:13:01 -0800, king kikapu <[EMAIL PROTECTED]> wrote: > But one of the reasons that i started learning Python, is to NOT to be > tied-up again with ANY company or specific product again (i had enough > MS addiction over these years...). So, based on this direction, i am > using pyo

Tkinter Scrolling

2007-02-01 Thread D
I'm sure this is a simple question to the Tkinter experts - I have a very basic Tkinter application that consists of 1 master window and buttons within that window. My problem is that, I need to be able to scroll (up and down) when I get to the point that the buttons go off the screen. What's the

Re: Any python scripts to do parallel downloading?

2007-02-01 Thread Jean-Paul Calderone
On 31 Jan 2007 22:02:36 -0800, Michele Simionato <[EMAIL PROTECTED]> wrote: >On Jan 31, 8:31 pm, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> >wrote: >> >> Well, since it will be io based, why not use threads? They are easy to >> use and it would do the job just fine. Then leverage some other >> tec

Re: Help me with this!!!

2007-02-01 Thread Peter Otten
TOXiC wrote: > Hi all, I've this code: No you don't. > regex = re.compile(r"(?si)(\x8B\xF0\x85\xF6)(?P.*) > (\xC6\x44\x24)",re.IGNORECASE) > file = open(fileName, "rb") > for line in file: > if (match): > print line > file.close() > > It search a text in

Re: how do I pipe two processes?

2007-02-01 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Hi, I want to pipe output of process A to B, and read output of B from > python. On Unix if I do the following: > > child_out, child_in = popen2("program_a | program_b") > > line = child_out.readline() > > I get "IOError: bad file descriptor" from Python, and broken p

Re: ZSI and WSDL schema

2007-02-01 Thread Grzegorz Smith
Ok here goes a detail: I call two methods by soap. The response of that methods is described by xml. Here is first request: (method name QuickSearch, one parameter called name) So here go 1 response (part of the wsdl):

Re: division by 7 efficiently ???

2007-02-01 Thread Nicko
On Feb 1, 3:13 am, [EMAIL PROTECTED] wrote: > Its not an homework. I appeared for EA sports interview last month. I > was asked this question and I got it wrong. I have already fidlled > around with the answer but I don't know the correct reasoning behind > it. In that case, observer that a/b == a

newbie question: nested archives and zipfile

2007-02-01 Thread gilbeert
I sorry, but I'm not very familiar with Python. Please, help to solve my problem with reading file from "nested" zip archive. There is an ear_file.ear and inside this file there is a war_file.war and inside this file there is a jar_file.jar. I have to read content of a file (my_file.txt) from insid

Re: Any python scripts to do parallel downloading?

2007-02-01 Thread Michele Simionato
On Feb 1, 1:43 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On 31 Jan 2007 22:02:36 -0800, Michele Simionato <[EMAIL PROTECTED]> wrote: > >Another thing I miss is a facility to run an iterator in the Tkinter > >mainloop: since Tkinter is not thread-safe, > >writing a multiple-download progr

Re: newbie question: nested archives and zipfile

2007-02-01 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > I sorry, but I'm not very familiar with Python. > Please, help to solve my problem with reading file from "nested" zip > archive. > There is an ear_file.ear and inside this file there is a war_file.war > and inside this file there is a jar_file.jar. > I have to read cont

Inconsistent list/pointer problem

2007-02-01 Thread Doug Stell
I am having a problem with the corruption of a list. It occurs only the first time that I call a function and never happens on subsequent calls. Any suggestions would be appreciated. I call the function, passing in a list as the input data. The function must manipulate and operate on a copy of tha

Re: Inconsistent list/pointer problem

2007-02-01 Thread bearophileHUGS
Doug Stell: The standard module copy has deepcopy, it's slow but it may be a simple solution to your problem. A better solution is to look where data is changed and fix that. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Inconsistent list/pointer problem

2007-02-01 Thread Richard Brodie
"Doug Stell" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I call the function, passing in a list as the input data. The function > must manipulate and operate on a copy of that list's data, without > altering the list in the calling routine. Then you will want to make a copy: l

Python design project

2007-02-01 Thread solrick51
Dear community, I dont really know if this is the right way to do, otherwise my excuses for that. I'm a Dutch student, and graduating this year on my graphic design study. For my graduating study, I want to do some Python work and i'm lokking for a partner wich can help/ cooperate me in programmi

Re: Help me with this!!!

2007-02-01 Thread TOXiC
Peter Otten ha scritto: > TOXiC wrote: > > > Hi all, I've this code: > > No you don't. > ! > > regex = re.compile(r"(?si)(\x8B\xF0\x85\xF6)(?P.*) > > (\xC6\x44\x24)",re.IGNORECASE) > > file = open(fileName, "rb") > > for line in file: > > if (match): > >

Re: Help me with this!!!

2007-02-01 Thread Paul McGuire
On Feb 1, 4:21 am, "TOXiC" <[EMAIL PROTECTED]> wrote: > Hi all, I've this code: > > regex = re.compile(r"(?si)(\x8B\xF0\x85\xF6)(?P.*) > (\xC6\x44\x24)",re.IGNORECASE) > file = open(fileName, "rb") > for line in file: > if (match): > print line > file.close()

ANN: Pyrex 0.9.5.1a

2007-02-01 Thread greg
Pyrex 0.9.5.1a is now available: http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ This is a glitch-fix nanorelease to correct a problem with the setup.py file. The list of packages to install is now calculate dynamically, so that it will work with or without the testing files. What is Pyr

Re: The reliability of python threads

2007-02-01 Thread Steve Holden
Carl J. Van Arsdall wrote: > Steve Holden wrote: >> [snip] >> >> Are you using memory with built-in error detection and correction? >> >> > You mean in the hardware? I'm not really sure, I'd assume so but is > there any way I can check on this? If the hardware isn't doing that, is > there an

Re: Random passwords generation (Python vs Perl) =)

2007-02-01 Thread Magnus Lycka
NoName wrote: > Perl: > @char=("A".."Z","a".."z",0..9); > do{print join("",@char[map{rand @char}(1..8)])}while(<>); If you generate passwords like that to normal computer users, you'll end up with a lot of "my password doesn't work" tickets. You should skip the symbols that are easy to mistake for

Re: Any python scripts to do parallel downloading?

2007-02-01 Thread Carl Banks
On Jan 31, 3:37 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On 31 Jan 2007 12:24:21 -0800, Carl Banks <[EMAIL PROTECTED]> wrote: > > >Michele Simionato wrote: > >> On Jan 31, 5:23 pm, "Frank Potter" <[EMAIL PROTECTED]> wrote: > >> > I want to find a multithreaded downloading lib in python,

Re: Any python scripts to do parallel downloading?

2007-02-01 Thread Jean-Paul Calderone
On 1 Feb 2007 06:14:40 -0800, Carl Banks <[EMAIL PROTECTED]> wrote: >On Jan 31, 3:37 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> On 31 Jan 2007 12:24:21 -0800, Carl Banks <[EMAIL PROTECTED]> wrote: >> >> >Michele Simionato wrote: >> >> On Jan 31, 5:23 pm, "Frank Potter" <[EMAIL PROTECTED]

Re: Inconsistent list/pointer problem

2007-02-01 Thread Bruno Desthuilliers
Doug Stell a écrit : > I am having a problem with the corruption of a list. It occurs only > the first time that I call a function and never happens on subsequent > calls. Any suggestions would be appreciated. > > I call the function, passing in a list as the input data. The function > must manipu

Re: SWIG overhead

2007-02-01 Thread Bart Ogryczak
On Feb 1, 12:48 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Yeah, found that one googling around. But I haven´t fund anything more > > up to date. I imagine, that the performance of all of these wrappers > > has been improved since then. But the performance of Python/C API > > would too?

Re: Any python scripts to do parallel downloading?

2007-02-01 Thread Carl Banks
On Feb 1, 9:20 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On 1 Feb 2007 06:14:40 -0800, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > >On Jan 31, 3:37 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > >> On 31 Jan 2007 12:24:21 -0800, Carl Banks <[EMAIL PROTECTED]> wrote: > > >> >Miche

Problem saving changes in MoinMoin pages

2007-02-01 Thread Daniel Klein
[I'm having some difficulty contacting 'real' MoinMoin support channels so I am posting this question here. Hope that's ok.] I have a pressing need to get a wiki up and running in a fairly short timeframe. I did some investigations and the Python MoinMoin wiki seemed to be the best choice for me b

Re: Any python scripts to do parallel downloading?

2007-02-01 Thread Jean-Paul Calderone
On 1 Feb 2007 06:41:56 -0800, Carl Banks <[EMAIL PROTECTED]> wrote: >On Feb 1, 9:20 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> On 1 Feb 2007 06:14:40 -0800, Carl Banks <[EMAIL PROTECTED]> wrote: >> >> >> >> >On Jan 31, 3:37 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> >> On 31 J

Re: SWIG overhead

2007-02-01 Thread Diez B. Roggisch
Bart Ogryczak wrote: > On Feb 1, 12:48 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> > Yeah, found that one googling around. But I haven´t fund anything more >> > up to date. I imagine, that the performance of all of these wrappers >> > has been improved since then. But the performance of P

Ubunu - Linux - Unicode - encoding

2007-02-01 Thread Franz Steinhaeusler
Hello NG, a little longer question, I'm working on our project DrPython and try fix bugs in Linux, (on windows, it works very good now with latin-1 encoding). On Windows, it works good now, using setappdefaultencoding and the right encoding for open with styled text control with the right encodin

Re: Any python scripts to do parallel downloading?

2007-02-01 Thread Carl Banks
On Feb 1, 12:40 am, "Michele Simionato" <[EMAIL PROTECTED]> wrote: > On Jan 31, 9:24 pm, "Carl Banks" <[EMAIL PROTECTED]> wrote: > > > Well, of all the things you can use threads for, this is probably the > > simplest, so I don't see any reason to prefer asynchronous method > > unless you're used t

Re: SWIG overhead

2007-02-01 Thread Chris Mellon
On 2/1/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Bart Ogryczak wrote: > > > On Feb 1, 12:48 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> > Yeah, found that one googling around. But I haven´t fund anything more > >> > up to date. I imagine, that the performance of all of these wrap

Re: Ubunu - Linux - Unicode - encoding

2007-02-01 Thread Alan Franzoni
Il Thu, 01 Feb 2007 16:02:52 +0100, Franz Steinhaeusler ha scritto: > The case: > I have a file on a WindowsXP partition which has as contents german > umlauts and the filename itself has umlauts like iÜüäßk.txt Could you please tell us a) which filesystem is that partition using (winxp may be in

Re: Problem saving changes in MoinMoin pages

2007-02-01 Thread skip
Dan> When I edit a page and click 'Save', the next page that displays is Dan> an 'HTTP 500' error. I have to refresh the page to see the changes. ... Dan> I'm currently perusing the source code to see if I can figure it Dan> out, but any pre-help will be gladly accepted. You

Re: urllib2 hangs "forever" where there is no network interface

2007-02-01 Thread John J. Lee
"dumbkiwi" <[EMAIL PROTECTED]> writes: > I have written a script that uses the urllib2 module to download web > pages for parsing. > > If there is no network interface, urllib2 hangs for a very long time > before it raises an exception. I have set the socket timeout with > socket.setdefaulttimeo

Creating a simple arithmetic expressions tree

2007-02-01 Thread Jona
So I'm not sure how to write a code that could create a tree placing data at every node... and then retrieve that information as I go by a node... here is what I have ==CODE=== from itertools import izip class Node: def __init__(self, left, right): self.left = left

Re: Germany issues warrants for 13 American CIA agents

2007-02-01 Thread Richard Charts
On Jan 31, 10:52 pm, "Overlord" <[EMAIL PROTECTED]> wrote: > Fuck the Germans. Didn't we kick their ass a couple times already? > > OL Thank god, I can just get my world news from c.l.p instead of having to find another "news" site. I salute you [EMAIL PROTECTED] -- http://mail.python.org/mailma

Re: Ubunu - Linux - Unicode - encoding

2007-02-01 Thread Paul Boddie
On 1 Feb, 16:02, Franz Steinhaeusler <[EMAIL PROTECTED]> wrote: > > The case: > I have a file on a WindowsXP partition which has as contents german > umlauts and the filename itself has umlauts like iÜüäßk.txt > > If I want to append this file to a list, I get somehow latin-1, cannot > decode 'utf-

Re: Python module for the IPod shuffle ...

2007-02-01 Thread Analog Kid
hi simon: thanks a lot for that resource ... i downloaded it and tried to use it ... but when i try to import pypod, i get an error, which is as follows... ImportError: No module named _gpod I guess I have to do something more than merely putting the two files ( pypod.py and gpod.py) in my site-

Quad Perspective Transformation

2007-02-01 Thread Kamilche
I have a need to tile a bitmap across an arbitrary quadrilateral, and apply perspective to it. The Python Imaging Library (PIL) has an undocumented function that might work, but I can't figure out how to make it work. You're supposed to pass it 8 parameters, a b c d e f g h . What I want is to tak

Question about a single underscore.

2007-02-01 Thread Steven W. Orr
I saw this and tried to use it: --><8--- const.py- class _const: class ConstError(TypeError): pass def __setattr__(self,name,value): if self.__dict__.has_key(name): raise self.ConstError, "Can't rebind const(%s)"%name

how to add class attributes in __new__

2007-02-01 Thread jeremito
I am subclassing the array class and have __new__ to initialize and create my class. In that class I create not only do I create an array object, but I also create some other data in __new__ I want to have access to outside of __new__. I tried self.mydata = mydata but that didn't work. Can som

Re: Help me with this!!!

2007-02-01 Thread Ravi Teja
> > > It search a text inside that hex value. > > > It works perfecly on a txt file but if I open a binary file (.exe,.bin > > > ecc...) with the same value it wont work, why? > > > Please help! > > > Because the pattern isn't in the file, perhaps. > > This pattern IS in the file (I made it and I d

Python SECS-II module

2007-02-01 Thread Laurent . LAFFONT-ST
Hi, I searching for a python module which implements SEMI E-4 / E-5 SECS-II/HSMS communication protocol. Is anyone have informations about this ? Regards, Laurent Laffont < [EMAIL PROTECTED] >-- http://mail.python.org/mailman/listinfo/python-list

Re: Question about a single underscore.

2007-02-01 Thread Paul Rubin
"Steven W. Orr" <[EMAIL PROTECTED]> writes: > --><8--- const.py- > ... > sys.modules[__name__]=_const() __name__ is 'const' since this file is const.py. So you've juset set the const module to actually be a const instance. > 1. Why do I not have to say

LDAP/LDIF Parsing

2007-02-01 Thread Cruelemort
All, I am hoping someone would be able to help me with a problem. I have an LDAP server running on a linux box, this LDAP server contains a telephone list in various groupings, the ldif file of which is - dn: dc=example,dc=com objectClass: top objectClass: dcObject objectClass: organization dc: e

Re: Question about a single underscore.

2007-02-01 Thread Bart Ogryczak
On Feb 1, 5:52 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > I saw this and tried to use it: > > --><8--- const.py- [...] > sys.modules[__name__]=_const() __name__ == 'const', so you´re actually doing const = _const() -- http://mail.python.org/mail

Re: LDAP/LDIF Parsing

2007-02-01 Thread Diez B. Roggisch
> > I was wondering the best way to do this? I have installed and used the > python-ldap libraries and these allow me to access and search the > server, but the searches always return a horrible nesting of lists, > tuples and dictionaries, below is an example of returning just one > record - > >

Re: SWIG overhead

2007-02-01 Thread John Roth
On Feb 1, 3:21 am, "Bart Ogryczak" <[EMAIL PROTECTED]> wrote: > Hi, > I´m looking for some benchmarks comparing SWIG generated modules with > modules made directly with C/Python API. Just how much overhead does > SWIG give? Doing profile of my code I see, that it spends quiet some > time in functio

Re: SWIG overhead

2007-02-01 Thread skip
John> Bottom line: the c-types module was a lot smaller, in Python, and John> completely comprehensible. And while I didn't measure the John> performance, I doubt if it was slower. One advantage SWIG (or Boost.Python) has over ctypes is that it will work with C++. Skip -- http://ma

Re: data design

2007-02-01 Thread Jussi Salmela
James Stroud kirjoitti: > > > > For instance, I have a copy_files section of a configuration. In order > to know what goes with what you have to resort to gymnastics with the > option names > > [copy_files] > files_dir1 = this.file that.file > path_dir1 = /some/path > > files_dir2 = the_othe

Suggestions ?

2007-02-01 Thread Jeff
Greetings, I am new to programming and have heard so much about Python. I have a couple of books on Python and have been to python.org many times. I am faced with a project at work where I need to develop a "searchable" database to include training materials for new hires.This will include

Marangozov's shmmodule (System V shared memory for Python IPC)

2007-02-01 Thread Nikita the Spider
Hi all, In the late 90s Vladimir Marangozov wrote a module that provided an interface to System V shared memory on *nix platforms. I found a copy on the Net, dusted it off, compiled it, plugged a couple of memory leaks, intergrated others' changes, etc. Vlad hasn't posted on Usenet since the su

Heap problems in Mulithreaded Python extension

2007-02-01 Thread Alexander Eisenhuth
Hi, I'm near the ground and need help. I'm building a multithreaded extension with boost.python. python extension - import extension extension.init() ->PyEval_InitThreads(); setup 3 threads (pthrea

Re: Heap problems in Mulithreaded Python extension

2007-02-01 Thread Alexander Eisenhuth
ok, once more my "scheme" python extension - import extension extension.init() ->PyEval_InitThreads(); setup 3 threads (pthreads) and do a lot of things, but no python api c

Re: urllib2 hangs "forever" where there is no network interface

2007-02-01 Thread dumbkiwi
On Feb 2, 5:02 am, [EMAIL PROTECTED] (John J. Lee) wrote: > "dumbkiwi" <[EMAIL PROTECTED]> writes: > > I have written a script that uses the urllib2 module to download web > > pages for parsing. > > > If there is no network interface, urllib2 hangs for a very long time > > before it raises an excep

Re: SWIG overhead

2007-02-01 Thread Roman Yakovenko
On 2/1/07, Chris Mellon <[EMAIL PROTECTED]> wrote: > As I understand it, part of the Boost.Python internals is a C++ > wrapper over the Python C api, That's true. >and there's no separate code generation > phase because it uses template magic to generate the wrappers. Well, actually it depends o

Re: Question about a single underscore.

2007-02-01 Thread Steven W. Orr
On Thursday, Feb 1st 2007 at 09:25 -0800, quoth Bart Ogryczak: =>On Feb 1, 5:52 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: =>> I saw this and tried to use it: =>> =>> --><8--- const.py- =>[...] =>> sys.modules[__name__]=_const() => =>__name__ == 'con

mysqldb duplicate entry error handling

2007-02-01 Thread baur79
Hi guys i try to run this code in loop and to pass even the entry is duplicated def email_insert_in_db(email): sql="INSERT INTO emails (email) values ('%s') "%(email) db=_mysql.connect(host = "localhost", user = db_user, passwd = db_pass, db = db_name) try: db.query(sql) except Inde

Re: mysqldb duplicate entry error handling

2007-02-01 Thread Chris Mellon
On 1 Feb 2007 10:17:31 -0800, baur79 <[EMAIL PROTECTED]> wrote: > Hi guys > > > i try to run this code in loop and to pass even the entry is > duplicated > > def email_insert_in_db(email): > sql="INSERT INTO emails (email) values ('%s') "%(email) > db=_mysql.connect(host = "localhost", user = d

Re: Question about a single underscore.

2007-02-01 Thread Paul Rubin
"Steven W. Orr" <[EMAIL PROTECTED]> writes: > to cause a different instantiation a la > foo = _const() > The goal would be to create different instances of consts. The idea of putting it in sys.modules is so it's visible in all modules. > >>> import const > >>> iii=_const() You need iii =

Re: Question about a single underscore.

2007-02-01 Thread Steven W. Orr
On Thursday, Feb 1st 2007 at 10:36 -0800, quoth Paul Rubin: =>"Steven W. Orr" <[EMAIL PROTECTED]> writes: =>> to cause a different instantiation a la =>> foo = _const() =>> The goal would be to create different instances of consts. => =>The idea of putting it in sys.modules is so it's visible in a

Re: mysqldb duplicate entry error handling

2007-02-01 Thread baur79
now it gives this error except IntegrityError, NameError: NameError: global name 'IntegrityError' is not defined any idea i have python 2.3.2 installed -- http://mail.python.org/mailman/listinfo/python-list

Overloading the tilde operator?

2007-02-01 Thread Chris
I am trying to overload the __invert__ operator (~) such that it can take a second argument, other than self, so that I can express: x ~ y by using: def __invert__(self, other): for example. Is this possible? Thanks in advance, -- http://mail.python.org/mailman/listinfo/python-list

Re: mysqldb duplicate entry error handling

2007-02-01 Thread Chris Mellon
On 1 Feb 2007 10:51:09 -0800, baur79 <[EMAIL PROTECTED]> wrote: > now it gives this error > > except IntegrityError, NameError: > NameError: global name 'IntegrityError' is not defined > > any idea > i have python 2.3.2 installed > IntegrityError will most likely be defined in the namespace of

gdesklets question: import problem

2007-02-01 Thread Flavio
Hi, sorry for posting here, but the forum in the projects page is not working. Maybe there is a gdesklet developer lurking... :-) I cant import anything from a script, it gives me a runtime error. is this a bug or a feature? without being able to import from python standard library or other mo

Re: Question about a single underscore.

2007-02-01 Thread Paul Rubin
"Steven W. Orr" <[EMAIL PROTECTED]> writes: > AttributeError: _const instance has no attribute '_const' > >>> > What am I missing here? (Sorry if it should be obvious) Oh I see. No it's not obvious. module "const" has gotten overwritten by the _const instance. I think that module author was to

Re: Overloading the tilde operator?

2007-02-01 Thread Peter Otten
Chris wrote: > I am trying to overload the __invert__ operator (~) such that > it can take a second argument, other than > self, so that I can express: > > x ~ y > > by using: > > def __invert__(self, other): > > for example. Is this possible? No, you will get a syntax error before python ev

Re: how to make a python windows service know it's own identity

2007-02-01 Thread Larry Bates
Chris Curvey wrote: > Hi all, > > I have used the win32com libraries to set up a service called > MyService under Windows. So far, so good. Now I need to run multiple > copies of the service on the same machine. I also have that working. > For monitoring and logging, I'd like each instance of t

Re: Tkinter Scrolling

2007-02-01 Thread Bob Greschke
On 2007-02-01 05:35:30 -0700, "D" <[EMAIL PROTECTED]> said: > I'm sure this is a simple question to the Tkinter experts - I have a > very basic Tkinter application that consists of 1 master window and > buttons within that window. My problem is that, I need to be able to > scroll (up and down) wh

asyncore DoS vulnerability

2007-02-01 Thread billie
Hi all. I've just terminated a server application using asyncore / asynchat frameworks. I wrote a test script that performs a lot of connections to the server app and I discovered that asyncore (or better, select()) can manage only a limited number of file descriptors (aka simultaneous connections)

Re: how to add class attributes in __new__

2007-02-01 Thread Bruno Desthuilliers
jeremito a écrit : > I am subclassing the array class and have __new__ to initialize and > create my class. In that class I create not only do I create an array > object, but I also create some other data in __new__ I want to have > access to outside of __new__. I tried > > self.mydata = mydata

Re: how to make a python windows service know it's own identity

2007-02-01 Thread Chris Curvey
On Feb 1, 2:10 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > Chris Curvey wrote: > > Hi all, > > > I have used the win32com libraries to set up a service called > > MyService under Windows. So far, so good. Now I need to run multiple > > copies of the service on the same machine. I also have that

Re: Tkinter Scrolling

2007-02-01 Thread D
Bob Greschke wrote: > On 2007-02-01 05:35:30 -0700, "D" <[EMAIL PROTECTED]> said: > > > I'm sure this is a simple question to the Tkinter experts - I have a > > very basic Tkinter application that consists of 1 master window and > > buttons within that window. My problem is that, I need to be abl

Re: how to make a python windows service know it's own identity

2007-02-01 Thread Chris Mellon
On 1 Feb 2007 11:24:13 -0800, Chris Curvey <[EMAIL PROTECTED]> wrote: > On Feb 1, 2:10 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > Chris Curvey wrote: > > > Hi all, > > > > > I have used the win32com libraries to set up a service called > > > MyService under Windows. So far, so good. Now I nee

Sorting a list

2007-02-01 Thread John Salerno
Hi everyone. If I have a list of tuples, and each tuple is in the form: (year, text) as in ('1995', 'This is a citation.') How can I sort the list so that they are in chronological order based on the year? Is there a better way to do this than making a list of tuples? (So far I have a text file

  1   2   3   >