Announcing IronPython 2.6 CTP for .NET 4.0 Beta 2

2009-10-22 Thread Dino Viehland
Hello Python Community, We're quite pleased to announce the release of IronPython 2.6 CTP for .NET 4.0 Beta 2.  This is our third preview of IronPython running under the Dynamic Language Runtime that is built directly into a .NET 4.0 release!  As before, this release allows you to use

Re: a splitting headache

2009-10-22 Thread rurpy
On 10/21/2009 11:47 PM, Carl Banks wrote: On Oct 21, 12:46 pm, David C Ullrich dullr...@sprynet.com wrote: On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: On Oct 20, 1:51 pm, David C Ullrich dullr...@sprynet.com wrote: I'm not saying either behaviour is wrong, it's just not obvious

Re: equivalent to globals(), locals() for nonlocal variables?

2009-10-22 Thread Gabriel Genellina
En Wed, 21 Oct 2009 16:06:31 -0300, geremy condra debat...@gmail.com escribió: I decided to play around with nonlocal declarations today, and was somewhat surprised when a call to nonlocals() resulted in 'nonlocals is not defined'. Is there an a standard equivalent to globals() or locals()

Re: Cpython optimization

2009-10-22 Thread Olof Bjarnason
2009/10/22 John Yeung gallium.arsen...@gmail.com On Oct 22, 12:28 am, John Nagle na...@animats.com wrote: The Shed Skin people would welcome some help. http://shed-skin.blogspot.com/ People? It's one guy. It apparently started out as a Master's thesis as well. ;) I am a

Re: a splitting headache

2009-10-22 Thread Mensanator
On Oct 21, 11:21�pm, John Yeung gallium.arsen...@gmail.com wrote: On Oct 21, 5:43�pm, Mensanator mensana...@aol.com wrote: '01110'.split('0') ['', '1', '', '', '', '11', ''] is a perfect example. It shows the empty strings generated from the leading and trailing delimiters, and

Re: md5 strange error

2009-10-22 Thread Steven D'Aprano
On Wed, 21 Oct 2009 01:11:29 -0700, catalinf...@gmail.com wrote: I have this error , what happen ? Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) [GCC 4.3.2 20080917 (Red Hat 4.3.2-4)] on linux2 Type help, copyright, credits or license for more information. import md5 pass = md5.new()

Re: Optimal Character recognition using python

2009-10-22 Thread Steven D'Aprano
On Wed, 21 Oct 2009 07:07:54 -0700, pytart wrote: Hello , I have a project to develop a basic character recognition module in python using backpropagation and artificial neural networks. I would be very helpful if u cud give me some helpful links for the project. Oh that's hilarious.

Re: a splitting headache

2009-10-22 Thread Mensanator
On Oct 22, 1:13�am, ru...@yahoo.com wrote: On 10/21/2009 11:47 PM, Carl Banks wrote: On Oct 21, 12:46 pm, David C Ullrich dullr...@sprynet.com wrote: On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: On Oct 20, 1:51 pm, David C Ullrich dullr...@sprynet.com wrote: I'm not saying

Re: Optimal Character recognition using python

2009-10-22 Thread Murtaza Gheewala
That was harsh, Steven. Well, to answer your question pytart, do a quick search here: http://groups.google.com/group/comp.lang.python/topics?pli=1 and/or here: http://aspn.activestate.com/ASPN/Mail/Browse/Threaded/python-list as I'm pretty sure someone has already asked this question that has got

Mixing different interpreters in the same program

2009-10-22 Thread Jaime Buelta
Hello: I keep thinking from some time ago in how to conect two or more Python interpreters. This began as interest in calling Java code from C program, which was solved (at the time) using an intermediate file. But having CPython and Jython, I think it would be great to call a function from,

Re: How to write a facebook client?

2009-10-22 Thread holmes86
On Oct 22, 10:42 am, geremy condra debat...@gmail.com wrote: On Wed, Oct 21, 2009 at 9:45 PM, holmes86 holme...@gmail.com wrote: Hi,everyone I'm a python newbie,and I want to write a facebook client.But I don't know how to do it.Meanwhile I have any write web experience,so I also don't

Re: unittest wart/bug for assertNotEqual

2009-10-22 Thread Gabriel Genellina
En Tue, 20 Oct 2009 19:57:19 -0300, Ethan Furman et...@stoneleaf.us escribió: Steven D'Aprano wrote: On Tue, 20 Oct 2009 14:45:49 -0700, Zac Burns wrote: My preference would be that failIfEqual checks both != and ==. This is practical, and would benefit almost all use cases. If != isn't not

Re: which dictionary with attribute-style access?

2009-10-22 Thread baloan
On Oct 22, 6:34 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: class AttrDict(dict):      A dict whose items can also be accessed as member variables.      def __init__(self, *args, **kwargs):          dict.__init__(self, *args, **kwargs)          self.__dict__ = self      def

form have 2 iframe.problem to input text in other iframe

2009-10-22 Thread elca
hello, i have some form which split by iframe. subject field is no probelm ,but content field was come from another iframe source.. so i can't input text in content's field.. im using PAMIE and win32com module.. i have to put text in 'contents.contentsValue' here. but i have no luck..anyone can

[OT] Supporting homework (was: Re: Checking a Number for Palindromic Behavior)

2009-10-22 Thread Dieter Maurer
Steven D'Aprano ste...@remove.this.cybersource.com.au writes on 20 Oct 2009 05:35:18 GMT: As far as I'm concerned, asking for help on homework without being honest up-front about it and making an effort first, is cheating by breaking the social contract. Anyone who rewards cheaters by giving

Cpython optimization

2009-10-22 Thread Qrees
Hello As my Master's dissertation I chose Cpython optimization. That's why i'd like to ask what are your suggestions what can be optimized. Well, I know that quite a lot. I've downloaded the source code (I plan to work on Cpython 2.6 and I've downloaded 2.6.3 release). By looking at the code I've

Re: Checking a Number for Palindromic Behavior

2009-10-22 Thread Steven D'Aprano
On Wed, 21 Oct 2009 22:53:29 -0700, rurpy wrote: On 10/21/2009 03:13 PM, Lie Ryan wrote: ru...@yahoo.com wrote: On 10/21/2009 01:40 AM, Lie Ryan wrote: [...] As a metaphor, which one do you think is better in the long term: charities or microcredits? Both of course. Why on earth

Re: Checking a Number for Palindromic Behavior

2009-10-22 Thread rurpy
On 10/21/2009 03:13 PM, Lie Ryan wrote: ru...@yahoo.com wrote: On 10/21/2009 01:40 AM, Lie Ryan wrote: [...] As a metaphor, which one do you think is better in the long term: charities or microcredits? Both of course. Why on earth would anyone think there is a simple, single, best

Re: Checking a Number for Palindromic Behavior

2009-10-22 Thread rurpy
On 10/22/2009 12:35 AM, Steven D'Aprano wrote: On Wed, 21 Oct 2009 22:53:29 -0700, rurpy wrote: On 10/21/2009 03:13 PM, Lie Ryan wrote: ru...@yahoo.com wrote: On 10/21/2009 01:40 AM, Lie Ryan wrote: [...] As a metaphor, which one do you think is better in the long term: charities or

Re: [OT] Supporting homework (was: Re: Checking a Number for Palindromic Behavior)

2009-10-22 Thread Stephen Hansen
On Wed, Oct 21, 2009 at 10:04 PM, Dieter Maurer die...@handshake.de wrote: Steven D'Aprano ste...@remove.this.cybersource.com.au writes on 20 Oct 2009 05:35:18 GMT: As far as I'm concerned, asking for help on homework without being honest up-front about it and making an effort first, is

Re: [OT] Supporting homework (was: Re: Checking a Number for Palindromic Behavior)

2009-10-22 Thread Andre Engels
On Thu, Oct 22, 2009 at 7:04 AM, Dieter Maurer die...@handshake.de wrote: Steven D'Aprano ste...@remove.this.cybersource.com.au writes on 20 Oct 2009 05:35:18 GMT: As far as I'm concerned, asking for help on homework without being honest up-front about it and making an effort first, is

Re: Unicode again ... default codec ...

2009-10-22 Thread Lele Gaifax
Gabriel Genellina gagsl-...@yahoo.com.ar writes: En Wed, 21 Oct 2009 06:24:55 -0300, Lele Gaifax l...@metapensiero.it escribió: Gabriel Genellina gagsl-...@yahoo.com.ar writes: nosetest should do nothing special. You should configure the environment so Python *knows* that your console

Passing values from html to python

2009-10-22 Thread Ahmed Barakat
Hi guys, I am new to python and wed-development, I managed to have some nice example running up till now. I am playing with google app engine, I have this situation: I have a text box in an html page, I want to get the value in it and pass it to the python script to process it I can pass values

Re: PyQt4 - remember widget positions

2009-10-22 Thread nusch
On Oct 22, 4:05 am, TerryP bigboss1...@gmail.com wrote: On Oct 21, 9:04 pm, nusch nusc...@gmail.com wrote: Is there any simple command which allows me to save position of all windows:  QMainWindow, QDialogs and qdockwidgets with their sizes, dock state and positions ? Or do I need to store

Re: Frameworks

2009-10-22 Thread Bruno Desthuilliers
Emmanuel Surleau a écrit : It still manages to retain flexibility, but you're basically stuck with Django's ORM You're by no way stuck with Django's ORM - you are perfectly free not to use it. But then you'll obviously loose quite a lot of useful features and 3rd part apps... You lose most of

Re: subprocess executing shell

2009-10-22 Thread Gabriel Genellina
En Wed, 21 Oct 2009 12:24:37 -0300, Tim Arnold tim.arn...@sas.com escribió: Hi, I'm writing a script to capture a command on the commandline and run it on a remote server. I guess I don't understand subprocess because the code below exec's the user's .cshrc file even though by default

Re: a simple unicode question

2009-10-22 Thread Gabriel Genellina
En Wed, 21 Oct 2009 15:14:32 -0300, ru...@yahoo.com escribió: On Oct 21, 4:59 am, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid wrote: beSTEfar a écrit : (snip) When parsing strings, use Regular Expressions. And now you have _two_ problems g For some simple parsing

Re: PyQt4 - remember widget positions

2009-10-22 Thread Jeremy Sanders
nusch wrote: Is there any simple command which allows me to save position of all windows: QMainWindow, QDialogs and qdockwidgets with their sizes, dock state and positions ? Or do I need to store those values manually, how can I do it fast? You can use saveState() from QMainWindow to save

A new way to configure Python logging

2009-10-22 Thread Vinay Sajip
If you use the logging package but don't like using the ConfigParser-based configuration files which it currently supports, keep reading. I'm proposing to provide a new way to configure logging, using a Python dictionary to hold configuration information. It means that you can convert a text file

Re: a simple unicode question

2009-10-22 Thread Chris Jones
On Wed, Oct 21, 2009 at 12:35:11PM EDT, Nobody wrote: [..] Characters outside the 16-bit range aren't supported on all builds. They won't be supported on most Windows builds, as Windows uses 16-bit Unicode extensively: I knew nothing about UTF-16 friends before this thread. Best part of

Date strftime('%d%m%y') date to be of yesterday

2009-10-22 Thread baboucarr sanneh
Hi all I want to output the date of the with this format strftime('%d%m%y') but the date ie '%d' should be the date of yesterday eg import time strftime('%d%m%y') # something like minus a day.. Thank you..am a newbie to python

Re: Date strftime('%d%m%y') date to be of yesterday

2009-10-22 Thread Tim Golden
baboucarr sanneh wrote: Hi all I want to output the date of the with this format strftime('%d%m%y') but the date ie '%d' should be the date of yesterday eg import time strftime('%d%m%y') # something like minus a day.. Thank you..am a newbie to python code import datetime yesterday =

buggy popup

2009-10-22 Thread Vinay Sagar Prakash
Hi All, Need some idea here: On my windows machine, there is a Java based program that runs all the time. Every now and then, a popup appears out of this program. To close this popup, it requires user to Check the Do-not-show-this-popup check box and then, click on OKAY button. Is there a python

Re: Unicode again ... default codec ...

2009-10-22 Thread Gabriel Genellina
En Thu, 22 Oct 2009 05:25:16 -0300, Lele Gaifax l...@metapensiero.it escribió: Gabriel Genellina gagsl-...@yahoo.com.ar writes: En Wed, 21 Oct 2009 06:24:55 -0300, Lele Gaifax l...@metapensiero.it escribió: Gabriel Genellina gagsl-...@yahoo.com.ar writes: nosetest should do nothing

Re: buggy popup

2009-10-22 Thread Gabriel Genellina
En Thu, 22 Oct 2009 07:14:31 -0300, Vinay Sagar Prakash vinya@gmail.com escribió: On my windows machine, there is a Java based program that runs all the time. Every now and then, a popup appears out of this program. To close this popup, it requires user to Check the

RE: Date strftime('%d%m%y') date to be of yesterday

2009-10-22 Thread baboucarr sanneh
Hi tim, well i tried what your script but i do have an error import datetime yesterday = datetime.date.today () - datetime.timedelta (days=1) print yesterday.strftime (%d%m%y) SyntaxError: invalid syntax (pyshell#2, line 1) when i jus check the variable i.e yesterday i do get the out put

Re: Date strftime('%d%m%y') date to be of yesterday

2009-10-22 Thread Tim Golden
baboucarr sanneh wrote: Hi tim, well i tried what your script but i do have an error import datetime yesterday = datetime.date.today () - datetime.timedelta (days=1) print yesterday.strftime (%d%m%y) SyntaxError: invalid syntax (pyshell#2, line 1) when i jus check the variable i.e yesterday

Re: Passing values from html to python

2009-10-22 Thread Albert Hopkins
On Thu, 2009-10-22 at 10:44 +0200, Ahmed Barakat wrote: Hi guys, I am new to python and wed-development, I managed to have some nice example running up till now. I am playing with google app engine, I have this situation: I have a text box in an html page, I want to get the value in it

RE: Date strftime('%d%m%y') date to be of yesterday

2009-10-22 Thread baboucarr sanneh
Hi tim Thank you very much ...I have got it now..now i can continue with the backup script i want to make $LIM $...@dy Date: Thu, 22 Oct 2009 11:36:50 +0100 From: m...@timgolden.me.uk CC: python-list@python.org Subject: Re: Date strftime('%d%m%y') date to be of yesterday baboucarr

Re: Date strftime('%d%m%y') date to be of yesterday

2009-10-22 Thread Tim Golden
baboucarr sanneh wrote: Hi tim Thank you very much ...I have got it now..now i can continue with the backup script i want to make By the way, the convention on this list is to bottom-post, that is to add your comments / reply to the bottom of the post you're replying to. These things

RE: Date strftime('%d%m%y') date to be of yesterday

2009-10-22 Thread baboucarr sanneh
$LIM $...@dy Date: Thu, 22 Oct 2009 11:51:08 +0100 From: m...@timgolden.me.uk CC: python-list@python.org Subject: Re: Date strftime('%d%m%y') date to be of yesterday baboucarr sanneh wrote: Hi tim Thank you very much ...I have got it now..now i can continue with the

Re-enabling a logger

2009-10-22 Thread jorma kala
Hi, I'm using the logging module. At one point in my code I disable logging like this: logging.disable(logging.INFO) But how can I enable the logging again further on? I've tried the following, which doesn't work for re-enabling the logger: my_logger.setLevel(logging.INFO) I've also tried to

Re: Re-enabling a logger

2009-10-22 Thread Jean-Michel Pichavant
jorma kala wrote: Hi, I'm using the logging module. At one point in my code I disable logging like this: logging.disable(logging.INFO) But how can I enable the logging again further on? I've tried the following, which doesn't work for re-enabling the logger:

Python socket won't connect on Windows

2009-10-22 Thread Florian Berger
Hi, I have an annoying problem connecting to a remote host via the socket module from Python 2.5 / 2.6 on WinXP. :-( Short description - socket.connect((host, port)) times out with socket.error 10060, while other applications on the same box can connect to the remote site

[no subject]

2009-10-22 Thread baboucarr sanneh
Hi guys I want to make a script that can copy files and folders from one location and paste it to another location.. e.g from c:\test to d:\test thanks regrads $LIM $...@dy _ Windows

Re:

2009-10-22 Thread Tim Golden
baboucarr sanneh wrote: I want to make a script that can copy files and folders from one location and paste it to another location.. e.g from c:\test to d:\test Have a look at the shutil module TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Fallen Sword

2009-10-22 Thread Richard Riley
Ben Finney ben+pyt...@benfinney.id.au writes: Richard Riley rileyrg...@gmail.com writes: Ben Finney ben+pyt...@benfinney.id.au writes: Reported to service provider as spam. Please don't reply to SPAM. You just make it visible to those of us with better filters. Hint : spammers do not read

Re: Unicode again ... default codec ...

2009-10-22 Thread Lele Gaifax
Gabriel Genellina gagsl-...@yahoo.com.ar writes: En Thu, 22 Oct 2009 05:25:16 -0300, Lele Gaifax l...@metapensiero.it escribió: Who is the culprit here? unittest, or ultimately, this bug: http://bugs.python.org/issue4947 Thank you. In particular I found

Re: Passing values from html to python

2009-10-22 Thread Richard Brodie
Albert Hopkins mar...@letterboxes.org wrote in message news:mailman.1851.1256208328.2807.python-l...@python.org... On Thu, 2009-10-22 at 10:44 +0200, Ahmed Barakat wrote: Hi guys, I am playing with google app engine, I have this situation: I have a text box in an html page, I want to get

Re: a splitting headache

2009-10-22 Thread David C . Ullrich
On Wed, 21 Oct 2009 22:47:24 -0700 (PDT), Carl Banks pavlovevide...@gmail.com wrote: On Oct 21, 12:46 pm, David C Ullrich dullr...@sprynet.com wrote: On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: On Oct 20, 1:51 pm, David C Ullrich dullr...@sprynet.com wrote: I'm not saying either

Terminating python script easily

2009-10-22 Thread Balban
Hi, I have a python build script that calls various commands, some using os.system(). Often, if I want to terminate the script prematurely, I press ctrl-c, but I have to do this many times before I can kill the script for good. I was wondering is there a way that I define a signal handler and

Re: a splitting headache

2009-10-22 Thread David C . Ullrich
On Wed, 21 Oct 2009 14:43:48 -0700 (PDT), Mensanator mensana...@aol.com wrote: On Oct 21, 2:46 pm, David C Ullrich dullr...@sprynet.com wrote: On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: On Oct 20, 1:51 pm, David C Ullrich dullr...@sprynet.com wrote: On Thu, 15 Oct 2009 18:18:09

Re: Terminating python script easily

2009-10-22 Thread Benjamin Kaplan
On Thu, Oct 22, 2009 at 8:46 AM, Balban bilgehan.bal...@gmail.com wrote: Hi, I have a python build script that calls various commands, some using os.system(). Often, if I want to terminate the script prematurely, I press ctrl-c, but I have to do this many times before I can kill the script

Re: Terminating python script easily

2009-10-22 Thread Jean-Michel Pichavant
Balban wrote: Hi, I have a python build script that calls various commands, some using os.system(). Often, if I want to terminate the script prematurely, I press ctrl-c, but I have to do this many times before I can kill the script for good. I was wondering is there a way that I define a

Re: Terminating python script easily

2009-10-22 Thread Bahadir Balban
On Thu, Oct 22, 2009 at 4:01 PM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Balban wrote: Hi, I have a python build script that calls various commands, some using os.system(). Often, if I want to terminate the script prematurely, I press ctrl-c, but I have to do this many times

Re: a splitting headache

2009-10-22 Thread Mensanator
On Oct 22, 7:47�am, David C. Ullrich dullr...@sprynet.com wrote: On Wed, 21 Oct 2009 14:43:48 -0700 (PDT), Mensanator mensana...@aol.com wrote: On Oct 21, 2:46�pm, David C Ullrich dullr...@sprynet.com wrote: On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: On Oct 20, 1:51�pm,

bad operand type for unary +: tuple

2009-10-22 Thread Frank Millman
Hi all This is just out of curiosity. I have a tuple, and I want to create a new tuple with a new value in the first position, and everything else unchanged. I figured out that this would work - t = ('a', 'b', 'c') t2 = ('x',) + t[1:] t2 ('x', 'b', 'c') Then I thought I would neaten it a

Re: a splitting headache

2009-10-22 Thread David C . Ullrich
On Wed, 21 Oct 2009 14:43:48 -0700 (PDT), Mensanator mensana...@aol.com wrote: On Oct 21, 2:46 pm, David C Ullrich dullr...@sprynet.com wrote: On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: On Oct 20, 1:51 pm, David C Ullrich dullr...@sprynet.com wrote: On Thu, 15 Oct 2009 18:18:09

Re: bad operand type for unary +: tuple

2009-10-22 Thread Diez B. Roggisch
Frank Millman wrote: Hi all This is just out of curiosity. I have a tuple, and I want to create a new tuple with a new value in the first position, and everything else unchanged. I figured out that this would work - t = ('a', 'b', 'c') t2 = ('x',) + t[1:] t2 ('x', 'b', 'c')

Re: unittest wart/bug for assertNotEqual

2009-10-22 Thread Ethan Furman
Gabriel Genellina wrote: En Tue, 20 Oct 2009 19:57:19 -0300, Ethan Furman et...@stoneleaf.us escribió: Steven D'Aprano wrote: On Tue, 20 Oct 2009 14:45:49 -0700, Zac Burns wrote: My preference would be that failIfEqual checks both != and ==. This is practical, and would benefit almost all

attribute access and indirection

2009-10-22 Thread Ethan Furman
Greetings, List! Say I have an old-fashioned dbf style table, with a single name field of 50 characters: names = dbf.Table(':memory:', 'name C(40)') Then I add a bunch of names from who-knows-where: for name in some_iterable(): names.append((name)) Now I want to know how many start

Re: Date strftime('%d%m%y') date to be of yesterday

2009-10-22 Thread D'Arcy J.M. Cain
On Thu, 22 Oct 2009 10:56:07 + baboucarr sanneh sanne...@hotmail.com wrote: By the way, the convention on this list is to bottom-post, okay i got that will be doing so from now on :)thnx Thanks but what the previous poster forgot to mention was that you should also trim the text that

Re: bad operand type for unary +: tuple

2009-10-22 Thread Frank Millman
Diez B. Roggisch wrote: Frank Millman wrote: t = ('a', 'b', 'c') t2 = 'x', + t[1:] Traceback (most recent call last): File stdin, line 1, in module TypeError: bad operand type for unary +: 'tuple' the operator precedence. Sure you want to write (a, -b, c) to form a tuple with a

Re: equivalent to globals(), locals() for nonlocal variables?

2009-10-22 Thread Lie Ryan
geremy condra wrote: I decided to play around with nonlocal declarations today, and was somewhat surprised when a call to nonlocals() resulted in 'nonlocals is not defined'. Is there an a standard equivalent to globals() or locals() for variables in outer nested scopes? Geremy Condra Not that

pyodbc - problem passing None as parameter

2009-10-22 Thread Frank Millman
Hi all I posted the following to the pyodbc google group, but got no reply - it seems a bit quiet there. I hope someone here can help. I am using pyodbc version 2.1.6 on Windows Server 2003, connecting to Sql Server 2005. This works - cur.execute('select ?', None) pyodbc.Cursor object at

Re: Object Relational Mappers are evil (a meditation)

2009-10-22 Thread J Kenneth King
Aaron Watters aaron.watt...@gmail.com writes: On Oct 16, 10:35 am, mario ruggier mario.rugg...@gmail.com wrote: On Oct 5, 4:25 pm, Aaron Watters aaron.watt...@gmail.com wrote: Occasionally I fantasize about making a non-trivial change to one of these programs, but I strongly resist going

Re: pyodbc - problem passing None as parameter

2009-10-22 Thread Tim Golden
Frank Millman wrote: I posted the following to the pyodbc google group, but got no reply - it seems a bit quiet there. I hope someone here can help. I am using pyodbc version 2.1.6 on Windows Server 2003, connecting to Sql Server 2005. This works - cur.execute('select ?', None)

Unloading a module

2009-10-22 Thread lallous
Hello Group, If a reference to an imported module reaches zero will Python cleanup everything related to that module and unload the compiled code, etc, etc...? For example: import sys m = [__import__(str(x)) for x in xrange(1,4)] del sys.modules['1'] del m[0] print m Is module['1'] really

Re: a splitting headache

2009-10-22 Thread John Posner
Carl Banks wrote: snip s.split() and s.split(sep) do different things, and there is no string sep that can make s.split(sep) behave like s.split(). That's not unheard of but it does go against our typical expectations. It would have been a better library design if s.split() and s.split(sep)

Re: Python socket won't connect on Windows

2009-10-22 Thread Grant Edwards
On 2009-10-22, Florian Berger flo...@arcor.de wrote: I think I narrowed it down to the fact that Python 2.x on WinXP won't connect in this setup. Does anyone have a hint what to do? I'd probably fire up Wireshark and capture the network traffic to/from the remote host when the Python app

fastcgi Access Checking

2009-10-22 Thread Robin Becker
I'm trying to do FastCgiAccessChecker with a django project; the base idea is to use the django controlled logins to control access to an apache down load area. My original idea was to make django responsible for the FastCgiAccessChecker script itself since we're running django as an external

Re: Supporting homework (was: Re: Checking a Number for Palindromic Behavior)

2009-10-22 Thread rurpy
On 10/22/2009 02:24 AM, Andre Engels wrote: On Thu, Oct 22, 2009 at 7:04 AM, Dieter Maurer die...@handshake.de wrote: Steven D'Aprano ste...@remove.this.cybersource.com.au writes on 20 Oct 2009 05:35:18 GMT: As far as I'm concerned, asking for help on homework without being honest up-front

Re: a splitting headache

2009-10-22 Thread Mensanator
On Oct 22, 8:17 am, David C. Ullrich dullr...@sprynet.com wrote: On Wed, 21 Oct 2009 14:43:48 -0700 (PDT), Mensanator mensana...@aol.com wrote: On Oct 21, 2:46 pm, David C Ullrich dullr...@sprynet.com wrote: On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: On Oct 20, 1:51 pm,

Re: a splitting headache

2009-10-22 Thread Mensanator
On Oct 22, 10:05 am, John Posner jjpos...@optimum.net wrote: Carl Banks wrote: snip s.split() and s.split(sep) do different things, and there is no string sep that can make s.split(sep) behave like s.split().  That's not unheard of but it does go against our typical expectations.  It

Re: Help with code = Extract numerical value to variable

2009-10-22 Thread Peter Pearson
On Thu, 22 Oct 2009 10:27:57 -0700 (PDT), Steve wrote: I have some data that I'm performing some analysis on. How do I grab the numerical value if it's present and ignore otherwise. So in the following example I would have assign the following values to my var 16 20 2 7 0 In Field6

Re: Help with code = Extract numerical value to variable

2009-10-22 Thread rurpy
On Oct 22, 11:27 am, Steve zerocostprod...@gmail.com wrote: I have some data that I'm performing some analysis on. How do I grab the numerical value if it's present and ignore otherwise. So in the following example I would have assign the following values to my var 16 20 2 7 0 In Field6

Re: Cpython optimization

2009-10-22 Thread Stefan Behnel
Francesco Bochicchio wrote: As a simple and plain python user, I would value a version of cython that can be used to built faster executables out of almost-python code (that is python code with a few additional restructions). Maybe using typing inference to avoid declaring explicitely the

Re: a splitting headache

2009-10-22 Thread rurpy
On 10/22/2009 07:17 AM, David C. Ullrich wrote: On Wed, 21 Oct 2009 14:43:48 -0700 (PDT), Mensanator mensana...@aol.com wrote: On Oct 21, 2:46 pm, David C Ullrich dullr...@sprynet.com wrote: On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: On Oct 20, 1:51 pm, David C Ullrich

Re: subprocess executing shell

2009-10-22 Thread Nobody
On Wed, 21 Oct 2009 11:24:37 -0400, Tim Arnold wrote: Hi, I'm writing a script to capture a command on the commandline and run it on a remote server. I guess I don't understand subprocess because the code below exec's the user's .cshrc file even though by default shell=False in the Popen

Re: a simple unicode question

2009-10-22 Thread rurpy
On 10/22/2009 03:23 AM, Gabriel Genellina wrote: En Wed, 21 Oct 2009 15:14:32 -0300, ru...@yahoo.com escribió: On Oct 21, 4:59 am, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid wrote: beSTEfar a écrit : (snip) When parsing strings, use Regular Expressions. And now you

Re: Cpython optimization

2009-10-22 Thread geremy condra
On Wed, Oct 21, 2009 at 1:28 PM, Qrees qre...@gmail.com wrote: Hello As my Master's dissertation I chose Cpython optimization. That's why i'd like to ask what are your suggestions what can be optimized. Well, I know that quite a lot. I've downloaded the source code (I plan to work on Cpython

unicode and dbf files

2009-10-22 Thread Ethan Furman
Greetings, all! I would like to add unicode support to my dbf project. The dbf header has a one-byte field to hold the encoding of the file. For example, \x03 is code-page 437 MS-DOS. My google-fu is apparently not up to the task of locating a complete resource that has a list of the 256

Re: Python socket won't connect on Windows

2009-10-22 Thread Florian Berger
Hi Grant, thanks for the reply! I'd probably fire up Wireshark and capture the network traffic to/from the remote host when the Python app attempts to connect and when another client connects. Yes, low level traffic analyzing would have been the next logical step. However, mysteriously

Re: Windows file paths, again

2009-10-22 Thread Matt McCredie
Dan Guido dguido at gmail.com writes: Hi Anthony, Thanks for your reply, but I don't think your tests have any control characters in them. Try again with a \v, a \n, or a \x in your input and I think you'll find it doesn't work as expected. -- Dan Guido Why don't you try it

Re: a simple unicode question

2009-10-22 Thread Gabriel Genellina
En Thu, 22 Oct 2009 17:08:21 -0300, ru...@yahoo.com escribió: On 10/22/2009 03:23 AM, Gabriel Genellina wrote: En Wed, 21 Oct 2009 15:14:32 -0300, ru...@yahoo.com escribió: On Oct 21, 4:59 am, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid wrote: beSTEfar a écrit : (snip)

Parsing a large number of parms to a print statement.

2009-10-22 Thread KB
Hi, I have to pass over 150 parameters to a print statement ala: print %s text %s other text %s 150'th unique text %s % (v [0], v[1], ... v[150]) I can't use a for loop like I normally would over the list v due to the different text fragments between each var. Is there a lambda function I

Re: Parsing a large number of parms to a print statement.

2009-10-22 Thread Ethan Furman
KB wrote: Hi, I have to pass over 150 parameters to a print statement ala: print %s text %s other text %s 150'th unique text %s % (v [0], v[1], ... v[150]) I can't use a for loop like I normally would over the list v due to the different text fragments between each var. Is there a lambda

Re:

2009-10-22 Thread John Posner
Mensanator wrote: That's interesting. If string.splitfields(delim) was equivalent to str.split(sep), it would have been useful to add the phrase str.split(sep) is equivalent to the old string.splitfields(delim) which no longer exists. to the docs. That way, a search on splitfields would direct

Re: Parsing a large number of parms to a print statement.

2009-10-22 Thread MRAB
KB wrote: Hi, I have to pass over 150 parameters to a print statement ala: print %s text %s other text %s 150'th unique text %s % (v [0], v[1], ... v[150]) I can't use a for loop like I normally would over the list v due to the different text fragments between each var. Is there a lambda

Re: Parsing a large number of parms to a print statement.

2009-10-22 Thread Benjamin Kaplan
On Thu, Oct 22, 2009 at 5:16 PM, KB ke...@nekotaku.com wrote: Hi, I have to pass over 150 parameters to a print statement ala: print %s text %s other text %s 150'th unique text %s % (v [0], v[1], ... v[150]) I can't use a for loop like I normally would over the list v due to the

Re: Parsing a large number of parms to a print statement.

2009-10-22 Thread Paul Rubin
KB ke...@nekotaku.com writes: I have to pass over 150 parameters to a print statement ala: print %s text %s other text %s 150'th unique text %s % (v [0], v[1], ... v[150]) I can't use a for loop like I normally would over the list v due to the different text fragments between each

Re: a splitting headache

2009-10-22 Thread John Posner
[resend, with Subject line corrected and formatting crud deleted] Mensanator wrote: That's interesting. If string.splitfields(delim) was equivalent to str.split(sep), it would have been useful to add the phrase str.split(sep) is equivalent to the old string.splitfields(delim) which no longer

Re: Parsing a large number of parms to a print statement.

2009-10-22 Thread Andre Engels
On Thu, Oct 22, 2009 at 11:16 PM, KB ke...@nekotaku.com wrote: Hi, I have to pass over 150 parameters to a print statement ala: print %s text %s other text %s 150'th unique text %s % (v [0], v[1], ... v[150]) I can't use a for loop like I normally would over the list v due to the

Please help with regular expression finding multiple floats

2009-10-22 Thread Jeremy
I have text that looks like the following (but all in one string with '\n' separating the lines): 1.E-08 1.58024E-06 0.0048 1.E-07 2.98403E-05 0.0018 1.E-06 8.85470E-06 0.0026 1.E-05 6.08120E-06 0.0032 1.E-03 1.61817E-05 0.0022 1.E+00

Re: Help with code = Extract numerical value to variable

2009-10-22 Thread Steve
If there is a number in the line I want the number otherwise I want a 0 I don't think I can use strip because the lines have no standards Thanks again Steve On Oct 22, 1:53 pm, ru...@yahoo.com wrote: On Oct 22, 11:27 am, Steve zerocostprod...@gmail.com wrote: I have some data that I'm

Re: a splitting headache

2009-10-22 Thread Mensanator
On Oct 22, 4:35 pm, John Posner jjpos...@optimum.net wrote: [resend, with Subject line corrected and formatting crud deleted] Mensanator wrote: That's interesting. If string.splitfields(delim) was equivalent to str.split(sep), it would have been useful to add the phrase str.split(sep) is

Re: Parsing a large number of parms to a print statement.

2009-10-22 Thread KB
Excuse the top-post, but thanks to all, the tuple was the way to go. On Oct 22, 2:16 pm, KB ke...@nekotaku.com wrote: Hi, I have to pass over 150 parameters to a print statement ala: print %s text %s other text %s 150'th unique text %s % (v [0], v[1], ... v[150]) I can't use a for

Re: Please help with regular expression finding multiple floats

2009-10-22 Thread Rhodri James
On Thu, 22 Oct 2009 23:26:01 +0100, Jeremy jlcon...@gmail.com wrote: I have text that looks like the following (but all in one string with '\n' separating the lines): 1.E-08 1.58024E-06 0.0048 [snip] 5.E+00 2.42717E-05 0.0017 total 1.93417E-04 0.0012 I want to

python pyodbc - connect error

2009-10-22 Thread Threader Slash
Hello Everybody... here we go - my question: 1. I am using Eclipse IDE with Python 2.5 and pyodbc25 - winXP; need to read content from a Lotus Notes database, so run some basic query like - SELECT personname FROM tablename. 2. 'import pyodbc' is ok - python see it! 3. But it doesn't connect, when

PySerial

2009-10-22 Thread Ronn Ross
I'm using pySerial to connect to a serial port (rs232) on a windows xp machine. I'm using python interactive interpretor to interact with the device. I type the following: import serial ser = serial.Serial(2) ser.write(command) But this does nothing to the control. I have been able to connect via

  1   2   >