Re: I want to release the GIL

2008-10-21 Thread Piotr Sobolewski
Thanks for answers. But what about my main question? Is it possible to release GIL without sleeping? I know that in this example situation I can achieve my goals without that - I can just move sleep outside of locked block. But I just want to know it for future - can I just do something like thread

Re: Python syntax question

2008-10-21 Thread Gabriel Genellina
En Mon, 13 Oct 2008 13:50:03 -0300, Daniel <[EMAIL PROTECTED]> escribió: RPyC is use in pyscripter to provide remote debugging. I was having trouble getting the RPyC module working, and the reason is that the RPyC site only provides a download for Python 3 (not sure why, since I suspect that

Re: Abnormal Interpreter Shutdown

2008-10-21 Thread k3xji
I think what I am looking for is SetConsoleCtrlHandler(..) which receives signals for CTRL+C and system shutdown. I don't want to take the power outage into account because as far as I can see there is no portable/simple/reliable way to accomplish that. So, thanks for the tip again. So what is th

Re: I want to release the GIL

2008-10-21 Thread k3xji
See yield() statement. -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonWin --> drwatson

2008-10-21 Thread Gabriel Genellina
En Sat, 18 Oct 2008 18:14:46 -0300, Frank L. Thiel <[EMAIL PROTECTED]> escribió: On 18-Oct-08 16:31, this message was sent by Dennis Lee Bieber: Do you have a version of python 2.6 installed? (I'm surprised the standalone win32 package for Python 2.6 is even available already). Yes,

Re: Python equivalent for C module

2008-10-21 Thread Vinay Sajip
On Oct 20, 9:08 pm, [EMAIL PROTECTED] (Ville M. Vainio) wrote: > Unfortunately these square-wheeled homegrown solutions are easier to > grok than the standardloggingmodule. It seems to target more > "serious" applications at the cost of feeling a bit too clunky for > quick hack jobs. I'm surprised

Re: How to get all variables of some module in that module

2008-10-21 Thread Peter Otten
Alex Gusarov wrote: > Hello, I have a following module and in its end I want to initalize > collection of tables: > > Module: > > from sqlalchemy import * > > metadata = MetaData() > > calendars_table = Table('calendars', metadata, > Column('id', Integer, primary_key=True), > Column('t

Re: multiprocessing: queue.get() blocks even if queue.qsize() != 0

2008-10-21 Thread Antoon Pardon
On 2008-10-15, redbaron <[EMAIL PROTECTED]> wrote: > I run into problem with queue from multiprocessing. Even if I > queue.qsize() != 0 queue.get() still blocks and queue.get_nowait() > raises Emtpy error. > > I'm unable to cut my big part to small test case, because smaller test > case similair to

Re: I want to release the GIL

2008-10-21 Thread Diez B. Roggisch
Piotr Sobolewski schrieb: Thanks for answers. But what about my main question? Is it possible to release GIL without sleeping? I know that in this example situation I can achieve my goals without that - I can just move sleep outside of locked block. But I just want to know it for future - can I j

wxPython, py2exe, UnicodeDecodeError

2008-10-21 Thread artasis
Hello! I've write wizard based on wxPython package and wanted to compile it to exe via py2exe. All works fine, all compile fine, but when I start wizard.exe - my compiled script - I'm getting an error: Traceback (most recent call last): File "init.py", line 484, in File "init.py", line 87, in

Re: indentation

2008-10-21 Thread Bruno Desthuilliers
GHUM a écrit : (snip) Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four

Re: wxPython, py2exe, UnicodeDecodeError

2008-10-21 Thread artasis
UPDATE: Forgot - yes, I'm using cyrillic text in my script, but it all encoded in utf8 -- http://mail.python.org/mailman/listinfo/python-list

Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in

2008-10-21 Thread Gabriel Genellina
En Thu, 16 Oct 2008 00:16:13 -0300, MOS37F MOS37F <[EMAIL PROTECTED]> escribió: import shelve from ShelfFile import ABC from zipfile import ZipFile, ZIP_DEFLATED ShelfFilePath = 'E:\DIR\DIR\DIR\ShelfFile' If you want some kind of answer: - shorten the code to the minimum fragment that stil

sell Air max 90 shoes

2008-10-21 Thread wyy
discount Air max 95 shoes www.yourbestshoes.cn wholesale Air Max 87 shoes discount Air MAX LTD shoes sell Air max 90 shoes discount Air Max 88 shoes www.yourbestshoes.cn discount Air MAX 89 shoes discount Air max tn shoes discount Air Max tn8 shoes discount Air MAX tn9 shoes www.yourbestshoes.c

Nike air force one, air force 1, air force one low cut, air force one

2008-10-21 Thread wyy
shoes on AIR Jordan 1 (paypal payment)(www.yourbestshoes.cn ) AIR Jordan 2 AIR Jordan 3 AIR Jordan 4 AIR Jordan 5 (paypal payment)(www.yourbestshoes.cn ) AIR Jordan 6 Rings AIR Jordan 6 AIR Jordan 7 AIR Jordan 8 AIR Jordan 9 (paypal payment)(www.yourbestshoes.cn ) AIR Jordan 10 AIR Jordan 11 AIR J

Re: multiprocessing: queue.get() blocks even if queue.qsize() != 0

2008-10-21 Thread Paul Rubin
redbaron <[EMAIL PROTECTED]> writes: > while qresult.qsize(): > result = qresult.get() #this code blocks! > doWithResult(result) That is unreliable for the reason Antoon explained, and as is documented in the manual for the Queue module. Write instead something like (untested): whil

Re: wxPython, py2exe, UnicodeDecodeError

2008-10-21 Thread artasis
pardon me for my stupidy, problem was in utf8 encoding. Changing all strings encode to unicode solve that problem -- http://mail.python.org/mailman/listinfo/python-list

Re: pymssql - execute loads all results into memory!

2008-10-21 Thread ChaosKCW
On Oct 20, 3:38 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > Eric Wertman wrote: > >> I am trying to use pymssql, and have an issue where by the execute > >> (not the fetch) is appearing to load all records into memory. > > >> if I execute > > >> con = pymssql.connect(...) > >> cur = con.cursor() >

"Authentication failed" error using paramiko

2008-10-21 Thread sa6113
I am using this code to connect to a windows machine using paramiko, I have installed sshd on the machine and it works properly: sock.connect((hostname, port)) t = paramiko.Transport(sock) event = threading.Event() t.start_client(event) event.wait() if not t.is_active(): pr

Re: indentation

2008-10-21 Thread Marc 'BlackJack' Rintsch
On Tue, 21 Oct 2008 17:41:08 +1300, Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Steven D'Aprano > wrote: > >> Here's Jamie Zawinski: >> http://www.jwz.org/doc/tabs-vs-spaces.html >> >> "On defaultly-configured Unix systems, and on ancient dumb terminals >> and teletypes, the tra

Re: a question about Chinese characters in a Python Program

2008-10-21 Thread John Machin
On Oct 21, 1:45 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > From the Wikipedia page, it appears that you need to convert GB2312 > values to EUC-CN by a relatively straightforward process, and can then > output the resulting byte sequence in an ASCII compatible way, > provided that you filter out a

Re: subprocess.Popen on Windows

2008-10-21 Thread Werner F. Bruhin
Werner F. Bruhin wrote: I am trying to use subprocess - it basically works but. command = 'ping ' + '-n '+ str(count) + ' -l ' + str(size) + ' ' + str(node) print command p = subprocess.Popen(command, stdin=subprocess.PIPE,

Re: better scheduler with correct sleep times

2008-10-21 Thread sokol
On Oct 21, 2:19 am, greg <[EMAIL PROTECTED]> wrote: > sokol wrote: > > What was a surprise to me was that python sched.py makes the same > > mistake as I did in my first version. > > The sched module is *not* designed for multithreading. It > assumes that the thread waiting for events is the only o

Re: I want to release the GIL

2008-10-21 Thread Gabriel Genellina
En Tue, 21 Oct 2008 04:58:00 -0200, Piotr Sobolewski <[EMAIL PROTECTED]> escribió: But what about my main question? Is it possible to release GIL without sleeping? I know that in this example situation I can achieve my goals without that - I can just move sleep outside of locked block. But I j

Re: I want to release the GIL

2008-10-21 Thread Carl Banks
On Oct 21, 1:12 am, Piotr Sobolewski <[EMAIL PROTECTED]> wrote: > Hello, > I have such program: > > import time > import thread > def f(): >     global lock >     while True: >         lock.acquire() >         print thread.get_ident() >         time.sleep(1) >         lock.release() > lock=thread.a

Re: Abnormal Interpreter Shutdown

2008-10-21 Thread Gabriel Genellina
En Tue, 21 Oct 2008 05:07:34 -0200, k3xji <[EMAIL PROTECTED]> escribió: I think what I am looking for is SetConsoleCtrlHandler(..) which receives signals for CTRL+C and system shutdown. I don't want to take the power outage into account because as far as I can see there is no portable/simple/rel

Re: Triple-quoted strings hath not the Python-nature

2008-10-21 Thread Orestis Markou
from textwrap import dedent dedent("""\ this is a multi-line string.""") will do what you want On Tue, Oct 21, 2008 at 9:58 AM, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > If triple-quoted strings had the Python-nature, then they would take > indentation into account. Thus:

Re: PyGUI - Couple of questions - TextField callbacks and drop down list....

2008-10-21 Thread Hugh
On Oct 21, 2:46 am, greg <[EMAIL PROTECTED]> wrote: > Hugh wrote: > > TextField callbacks... I want to be able to generate a callback when a > > textfield is modified. It doesn't appear to have an "action" member... > > I haven't got around to adding any actions to text fields > yet. > > In the mea

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-21 Thread Roel Schroeven
Steven D'Aprano schreef: On Mon, 20 Oct 2008 10:20:06 +, Duncan Booth wrote: Steven D'Aprano <[EMAIL PROTECTED]> wrote: On Sun, 19 Oct 2008 15:40:32 +, Duncan Booth wrote: Steven D'Aprano <[EMAIL PROTECTED]> wrote: In Linux, config files should go into: ~/./ or /etc// In Windows

Re: I want to release the GIL

2008-10-21 Thread Carl Banks
On Oct 21, 5:09 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 21 Oct 2008 04:58:00 -0200, Piotr Sobolewski   > <[EMAIL PROTECTED]> escribió: > > > But what about my main question? Is it possible to release GIL without > > sleeping? I know that in this example situation I can achieve

Re: indentation

2008-10-21 Thread Tim Rowe
2008/10/21 Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]>: > Ever noticed that computer freaks often start counting at 0? ;-) We grow to be like our pets -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: better scheduler with correct sleep times

2008-10-21 Thread Carl Banks
On Oct 21, 4:58 am, sokol <[EMAIL PROTECTED]> wrote: > On Oct 21, 2:19 am, greg <[EMAIL PROTECTED]> wrote: > > > sokol wrote: > > > What was a surprise to me was that python sched.py makes the same > > > mistake as I did in my first version. > > > The sched module is *not* designed for multithreadi

Triple-quoted strings hath not the Python-nature

2008-10-21 Thread Lawrence D'Oliveiro
If triple-quoted strings had the Python-nature, then they would take indentation into account. Thus: """this is a multi-line string.""" would be equivalent to "this\n is a\n multi-line\nstring." and not "this\n is a\n multi-line\nstring." The rule would b

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-21 Thread Laszlo Nagy
However, the normal place to store settings on Windows is in the registry. Which becomes a single point of failure for the whole system. LOL :-) BTW famous big popular programs like firefox and thunderbird will store their configuration data under "Documents and Settings\Application

Scandalous video reason Divorce Madonna and Ricchi

2008-10-21 Thread fernandena
http://www.madonascandal.byethost31.com Madonna page featuring exclusive Madonna videos, Madonna photos, and Madonna news,Madonna videos, Madonna news, Madonna photos, Madonna videos, Madonna gossip. Scandalous video reason end-marriage Madonna and Ricchi -- http://mail.python.org/mailman/listinfo

Re: pymssql - execute loads all results into memory!

2008-10-21 Thread Aspersieman
On Tue, 21 Oct 2008 10:14:56 +0200, ChaosKCW <[EMAIL PROTECTED]> wrote: On Oct 20, 3:38 pm, Tim Golden <[EMAIL PROTECTED]> wrote: Eric Wertman wrote: >> I am trying to use pymssql, and have an issue where by the execute >> (not the fetch) is appearing to load all records into memory. >> if I e

Re: pymssql - execute loads all results into memory!

2008-10-21 Thread Tim Golden
Aspersieman wrote: However, pyODBC doesn't support return variables(parameters) in stored procedures (at least with MS SQL). pymssql is the only db api for python that I've found that can reliably do this. I've tried adodbapi, pyodbc and one or two others (can't think of the names now... :-/).

Re: Python Imaging Library (PIL) question

2008-10-21 Thread Sid
The problem is likely to do with the line picMap = [[0] * width ] * height yeah the problem was with that specific line. The snippet from your link worked by replacing the previous declaration by picMap = [[0] * 3 for x in xrange(height)] Thanks, -Sid -- http://mail.python.org/mailman/listi

Re: I want to release the GIL

2008-10-21 Thread MRAB
On Oct 21, 10:22 am, Carl Banks <[EMAIL PROTECTED]> wrote: > On Oct 21, 5:09 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > En Tue, 21 Oct 2008 04:58:00 -0200, Piotr Sobolewski   > > <[EMAIL PROTECTED]> escribió: > > > > But what about my main question? Is it possible to release GIL wit

How to open a shell prompt from an existing shell prompt

2008-10-21 Thread gaurav kashyap
Dear all, I have a file in which i have written some shell commands to execute. Herein i require to open another shell prompt from this file. or simply i want to open a new shell prompt from an existing shell prompt. How could this be achieved. Thanks -- http://mail.python.org/mailman/listinfo/p

Re: a question about Chinese characters in a Python Program

2008-10-21 Thread Ben Finney
John Machin <[EMAIL PROTECTED]> writes: > I don't understand the point or value of filtering out all byte values > greater than 127 That's only done if the encoding isn't otherwise specified. In which case, ASCII is the documented default encoding. In which case, it *must* be restricted to code p

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-21 Thread Steven D'Aprano
On Tue, 21 Oct 2008 11:32:14 +0200, Laszlo Nagy wrote: > Users who like to go inside "Documents and Settings\Application data" > and delete things without knowing what they do deserve to have a > malfunctioning system for sure. The worst consequence from deleting a settings file should be to reve

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-21 Thread Ross Ridge
Ross Ridge wrote: > However, the normal place to store settings on Windows is in the registry. Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > Which becomes a single point of failure for the whole system. As opposed to the file system being the single point failure?

Re: What was that, what was it?

2008-10-21 Thread Ross Ridge
Aaron Brady wrote: > If Python was a car, I think it would be a hybrid... Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >I hope not. They're only good in the city, a waste of time once you get over >50 km/h. Sounds a lot like Python then, a waste of time if you need to go fast, but good for a l

Re: what's the python for this C statement?

2008-10-21 Thread Hrvoje Niksic
Lie Ryan <[EMAIL PROTECTED]> writes: > On Mon, 20 Oct 2008 12:34:11 +0200, Hrvoje Niksic wrote: > >> Michele <[EMAIL PROTECTED]> writes: >> >>> Hi there, >>> I'm relative new to Python and I discovered that there's one single way >>> to cycle over an integer variable with for: for i in range(0,10

Re: pymssql - execute loads all results into memory!

2008-10-21 Thread Aspersieman
On Tue, 21 Oct 2008 13:06:37 +0200, Tim Golden <[EMAIL PROTECTED]> wrote: Aspersieman wrote: However, pyODBC doesn't support return variables(parameters) in stored procedures (at least with MS SQL). pymssql is the only db api for python that I've found that can reliably do this. I've tried

Re: pymssql - execute loads all results into memory!

2008-10-21 Thread Tim Golden
Aspersieman wrote: [... re output params in pymssql / pyodbc ...] Oh, trust me - I've tried a *LOT*. I aggree, submitting a feature request is a good idea. I think I'll do that. :) Looks like someone already has: http://sourceforge.net/tracker/index.php?func=detail&aid=1985956&group_id=162557

IRC

2008-10-21 Thread Amie
HI All, Please can you perhaps provide me with links or good places where I can learn what IRC is, how to work with it and how to write to a large log file at the same time as letting the IRC spy read and write to the server. Thank You -- http://mail.python.org/mailman/listinfo/python-list

Re: dumping in destructor

2008-10-21 Thread Митя
Thank you! I have already implemented custom load/save operations without pickle. And they work fine on atexit. Just for information: pickle.dump worked OK when called manually, but being called by atexit it produeced the above described error. I don't know why. On Oct 21, 7:54 am, "Gabriel Genell

Re: IRC

2008-10-21 Thread Ben Finney
Amie <[EMAIL PROTECTED]> writes: > Please can you perhaps provide me with links or good places where I > can learn what IRC is […] A rather strange request on a forum dedicated to the Python programming language. Nevertheless, you will likely find http://irchelp.org/> useful. -- \ “Pi

Re: IRC

2008-10-21 Thread Dotan Cohen
2008/10/21 Amie <[EMAIL PROTECTED]>: > HI All, > > Please can you perhaps provide me with links or good places where I > can learn what IRC is, how to work with it and how to write to a large > log file at the same time as letting the IRC spy read and write to the > server. > http://www.google.com

Error

2008-10-21 Thread Amie
Hi, what does is the meaning of this error: int object is unsubscriptable. This is the code that I have written that seems to give me that: def render_sideMenu(self, ctx, data): def render_dataAge(unit): results = [(i[0], i[1] ) for i in unit] return self.dataTable(["U

Re: Mail reader & spam

2008-10-21 Thread Cousin Stanley
>> >> You might try the python-based  XPN  news client at >> >> http://xpn.altervista.org/index-en.html >> > Hi, I tried it out. I like the layout definitely, plus the feel > of it, colors, etc. > > It doesn't do the things I named that I like though. > > It's threading i

Re: Error

2008-10-21 Thread Philip Semanchuk
On Oct 21, 2008, at 9:05 AM, Amie wrote: Hi, what does is the meaning of this error: int object is unsubscriptable. This is the code that I have written that seems to give me that: def render_sideMenu(self, ctx, data): def render_dataAge(unit): results = [(i[0], i[1] ) for i

Re: PythonWin --> drwatson

2008-10-21 Thread Frank L. Thiel
On 21-Oct-08 03:22, this message was sent by Gabriel Genellina: En Sat, 18 Oct 2008 18:14:46 -0300, Frank L. Thiel <[EMAIL PROTECTED]> escribió: On 18-Oct-08 16:31, this message was sent by Dennis Lee Bieber: Do you have a version of python 2.6 installed? (I'm surprised the standalone wi

Python-URL! - weekly Python news and links (Oct 21)

2008-10-21 Thread Gabriel Genellina
QOTW: "Trust me. Sean is absolutely correct. I'm currently in the process of converting a large Perl project to Python (and learning Python at the same time) and the improvement in code is incredible. After you learn Python, you'll come to despise Perl." - Pat http://groups.google.com/group/c

Re: Unicode (UTF8) in dbhas on 2.5

2008-10-21 Thread Yves Dorfsman
Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Please write the following program and meditate at least 30min in front of > it: > while True: >print "utf-8 is not unicode" I hope you will have a better day today than yesterday ! Now, I did this: while True: print "¡ Python knows about enco

p2exe for python 2.6

2008-10-21 Thread alessio211734
Hi! How can convert my python script in exe for the python version 2.6? Thanks in adavance. Ale. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode (UTF8) in dbhas on 2.5

2008-10-21 Thread Paul Boddie
On 20 Okt, 16:04, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > What is the difference? The dbhash module can only work with *bytestrings*. > Bytestrings are just that - a sequence of 8-bit-values. Sounds like a prime candidate for some improvement work. Patches, anyone? ;-) > u""-literals ar

Re: search for a python compiler program whose name is jingle

2008-10-21 Thread Grant Edwards
On 2008-10-20, oyster <[EMAIL PROTECTED]> wrote: > I don't remember its name very clear, it may be 'jingle' or > not this program runs on windows and can compile a python > program into exe file without gcc it has no webspace but is > announced on the author's blog when I find it some times ago. >

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-21 Thread Grant Edwards
On 2008-10-21, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > >>> However, the normal place to store settings on Windows is in the registry. >>> >> >> Which becomes a single point of failure for the whole system. >> > LOL :-) > > BTW famous big popular programs like firefox and thunderbird > will

Re: Unicode (UTF8) in dbhas on 2.5

2008-10-21 Thread Jerry Hill
On Tue, Oct 21, 2008 at 10:16 AM, Yves Dorfsman <[EMAIL PROTECTED]> wrote: > My terminal is setup in UTF-8, and... It did print correctly. I expected > that by setting coding: utf-8, all the I/O functions would do the encoding > for me, because if they don't then I, and everybody who writes a scrip

Need some advice

2008-10-21 Thread azrael
I am starting to work on a application and need some advice. I am planing to develop a desktop application which would have some usage, but also it should be able to comunicate to a web server which hosts a php web application. So I wanted to ask if someone has some expirience with connecting PHP

Re: Error

2008-10-21 Thread J. Cliff Dyer
On Tue, 2008-10-21 at 09:34 -0400, Philip Semanchuk wrote: > On Oct 21, 2008, at 9:05 AM, Amie wrote: > > > Hi, > > > > what does is the meaning of this error: int object is unsubscriptable. > > This is the code that I have written that seems to give me that: > > > > def render_sideMenu(self, ctx

execve error with the subprocess module

2008-10-21 Thread [EMAIL PROTECTED]
I have some code which runs on a number of different machines, however I see problems on one particular Solaris box. When I call Popen.wait(), the following exception is raised: . . . File "/basis/users/matt/Python-2.4.4/Lib/subprocess.py", line 558, in __init__ errread, errwrite) File "/ba

Re: How to get all variables of some module in that module

2008-10-21 Thread Alex Gusarov
Steven, Peter, thanks a lot from a Python newcomer. Problem solved with you help. Still, Python community is best I ever met :) -- Best regards, Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Need some advice

2008-10-21 Thread Godson Gera
On Tue, Oct 21, 2008 at 9:13 PM, azrael <[EMAIL PROTECTED]> wrote: > I am starting to work on a application and need some advice. > > I am planing to develop a desktop application which would have some > usage, but also it should be able to comunicate to a web server which > hosts a php web applic

Re: default value in __init__

2008-10-21 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Oct 14, 1:36 pm, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > > >[...] > > > In particular default parameters should work the way the user > > expects! The fact that different users will expect different > > things

Exclude Directories from os.walk

2008-10-21 Thread D
Hello, How can one exclude a directory (and all its subdirectories) when running os.walk()? Thanks, Doug -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHON WORKING WITH PERL ??

2008-10-21 Thread srf99
>  http://search.cpan.org/~gaas/pyperl-1.0/perlmodule.pod A friend of mine who is a Perl user pointed out that although the "perl" module exists: I think it was largely experimental. As you can see from its release page: http://search.cpan.org/~gaas/pyperl-1.0/ it was created in 2001 and hasn't b

Re: Exclude Directories from os.walk

2008-10-21 Thread Tim Golden
D wrote: Hello, How can one exclude a directory (and all its subdirectories) when running os.walk()? Just remove it from the dirnames yielded: import os for dirpath, dirnames, filenames in os.walk ("c:/temp"): print dirpath if "archive" in dirnames: dirnames.remove ("archive") TJG -

Re: p2exe for python 2.6

2008-10-21 Thread Mike Driscoll
On Oct 21, 9:44 am, alessio211734 <[EMAIL PROTECTED]> wrote: > Hi! > > How can convert my python script in exe for the python version 2.6? > > Thanks in adavance. > > Ale. Download the py2exe source and try recompiling your script with it: http://sourceforge.net/project/showfiles.php?group_id=155

Re: Exclude Directories from os.walk

2008-10-21 Thread Scott David Daniels
D wrote: Hello, How can one exclude a directory (and all its subdirectories) when running os.walk()? Thanks, Doug for base, dirs, files in os.walk('wherever'): if 'RCS' in dirs: dirs.remove('RCS') As described in the os.walk docs. --Scott David Daniels [EMAIL PROTECTED] -- htt

Re: Unicode (UTF8) in dbhas on 2.5

2008-10-21 Thread Diez B. Roggisch
Yves Dorfsman wrote: > Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > >> Please write the following program and meditate at least 30min in front >> of it: > >> while True: >>print "utf-8 is not unicode" > > I hope you will have a better day today than yesterday ! I had a good day yesterday.

Re: Need some advice

2008-10-21 Thread Tim Chase
I am planing to develop a desktop application which would have some usage, but also it should be able to comunicate to a web server which hosts a php web application. So I wanted to ask if someone has some expirience with connecting PHP webapplications with Python desktop applications. Could someo

csv.reader problem tab-delimiter - newbie

2008-10-21 Thread hidding
Hi all, I use python 2.5 and want to read in a simple 5-columned, tab- delimited ascii file "dummy.txt" such as as 1 23.04 5.6 4 677 8.2 19 I do import csv asciireader = csv.reader(open('dummy.txt'), delimiter='\t') array1 = [] for entry in asciireader: array1.append( e

Re: Need some advice

2008-10-21 Thread Bas
On Oct 21, 5:43 pm, azrael <[EMAIL PROTECTED]> wrote: > Need some advice I advice to come up with a more specific subject line for your posts, might give you some more answers -- http://mail.python.org/mailman/listinfo/python-list

Re: csv.reader problem tab-delimiter - newbie

2008-10-21 Thread Benjamin Kaplan
On Tue, Oct 21, 2008 at 12:26 PM, <[EMAIL PROTECTED]> wrote: > Hi all, > > I use python 2.5 and want to read in a simple 5-columned, tab- > delimited ascii file "dummy.txt" such as as > > 1 23.04 5.6 > 4 677 8.2 19 > > I do > > import csv > asciireader = csv.reader(open('dum

Re: Exclude Directories from os.walk

2008-10-21 Thread D
Ok, my brain's apparently not working right today.. what I'd like to do is allow the user to specify a directory to exclude (ex- "C:\temp \test") - then, when os.walk gets to "C:\temp\test", it excludes that directory and all its subdirectories (so, "C:\temp\mytest\test" should still be recursed).

Developing for Python (2.x or 3)?

2008-10-21 Thread Paulo J. Matos
Hi all, I am in the process of choosing which Python version for a brand new application. Van Rossum in an interview recently advised all new applications to use Python3 but I am afraid, most libraries (PyGtk, PyQt, Networking Libs, etc) won't follow suit to 3.0 and I will end up using a version o

Re: How to transfer data structure or class from Python to C/C++?

2008-10-21 Thread Aaron Brady
On Oct 21, 12:46 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 17 Oct 2008 20:03:44 -0300, Aaron "Castironpi" Brady   > <[EMAIL PROTECTED]> escribió: > > > > > On Oct 16, 9:10 am, Hongtian <[EMAIL PROTECTED]> wrote: > >> Not exactly. > > >> In my C/C++ application, I have following f

Re: csv.reader problem tab-delimiter - newbie

2008-10-21 Thread George Sakkis
On Oct 21, 12:26 pm, [EMAIL PROTECTED] wrote: > Hi all, > > I use python 2.5 and want to read in a simple 5-columned, tab- > delimited ascii file "dummy.txt" such as as > > 1  2    3.0    4     5.6 > 4  6    77     8.2  19 > > I do > > import csv > asciireader = csv.reader(open('dummy.txt'), delim

Re: Developing for Python (2.x or 3)?

2008-10-21 Thread Sean DiZazzo
I would use 2.5.2 or 2.6. I don't think 3 is anywhere near stable yet. Paulo J. Matos wrote: > Hi all, > > I am in the process of choosing which Python version for a brand new > application. Van Rossum in an interview recently advised all new > applications to use Python3 but I am afraid, most li

Changing the middle of strings in a list--I know there is a better way.

2008-10-21 Thread Ben
Hello All: I am new to Python, and I love it!! I am running 2.6 on Windows. I have a flat text file here is an example of 3 lines with numbers changed for security: 9088869199020081099 9088869199020081099 9088869199020081099 I want to

Re: How to open a shell prompt from an existing shell prompt

2008-10-21 Thread Sean DiZazzo
On Oct 21, 4:52 am, gaurav kashyap <[EMAIL PROTECTED]> wrote: > Dear all, > I have a file in which i have written some shell commands to execute. > Herein i require to open another shell prompt from this file. > > or simply i want to open a new shell prompt from an existing shell > prompt. > How co

Re: csv.reader problem tab-delimiter - newbie

2008-10-21 Thread hidding
> > Most likely the file is not tab delimited. If you used an editor to > produce dummy.txt, check whether it uses soft tabs and disable it > temporarily. > > HTH, > George > Most likely the file is not tab delimited. If you used an editor to > produce dummy.txt, check whether it uses soft tabs an

Re: csv.reader problem tab-delimiter - newbie

2008-10-21 Thread Clovis Fabricio
2008/10/21 <[EMAIL PROTECTED]>: > grrr thanks George, thanks Daniel, that's it. Works fine with real > tabs. Now this brings me to a follow-up: I have not prepared the input > ascii file, I just got if for post-processing (23 MB). Now it seems > that I would have to replace all series of spaces in

Re: Changing the middle of strings in a list--I know there is a better way.

2008-10-21 Thread Duncan Booth
Ben <[EMAIL PROTECTED]> wrote: > Since strings are > immutable I can't assign different values to a specific slice of the > string. How can I accomplish this? > ... > #My Current Code > > # read the data file in as a list > F = open('C:\\path\\to\file', "r") > List = F.readlines() > F.close() >

Commercial Products in Python

2008-10-21 Thread Paulo J. Matos
Hi all, I was just wondering, if you wish to commercialize an application developed in Python, what's the way to go? I guess the only way is to sell the source, right? This is because (and tell me if I am wrong): 1) You can't sell an executable because Python doesn't compile to native code (the u

Re: Exclude Directories from os.walk

2008-10-21 Thread Orestis Markou
You then have to also check the base: for d in dirs[:]: if os.path.join(base, d) == EXCLUDED_DIR dirs.remove(d) or if base == EXCLUDED_DIR while dirs: dirs.pop() continue WARNING: untest code - Show quoted text - On Tue, Oct 21, 2008 at 6:13 PM, D <[EMAIL PROTECTED]> wrote: > Ok, my brai

Re: Changing the middle of strings in a list--I know there is a better way.

2008-10-21 Thread J. Cliff Dyer
On Tue, 2008-10-21 at 10:28 -0700, Ben wrote: > Hello All: > > I am new to Python, and I love it!! I am running 2.6 on Windows. I > have a flat text file here is an example of 3 lines with numbers > changed for security: > > 9088869199020081099 > 9088869199020

Re: Commercial Products in Python

2008-10-21 Thread Sebastian Bassi
On Tue, Oct 21, 2008 at 2:50 PM, Paulo J. Matos <[EMAIL PROTECTED]> wrote: > I was just wondering, if you wish to commercialize an application > developed in Python, what's the way to go? You choose the conditions. Nothing in Python license prevents you of selling your work. > I guess the only wa

Re: I want to release the GIL

2008-10-21 Thread Carl Banks
On Oct 21, 7:49 am, MRAB <[EMAIL PROTECTED]> wrote: > On Oct 21, 10:22 am, Carl Banks <[EMAIL PROTECTED]> wrote: > > > On Oct 21, 5:09 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > > > > En Tue, 21 Oct 2008 04:58:00 -0200, Piotr Sobolewski   > > > <[EMAIL PROTECTED]> escribió: > > > > >

Re: Exclude Directories from os.walk

2008-10-21 Thread D
On Oct 21, 1:46 pm, "Orestis Markou" <[EMAIL PROTECTED]> wrote: > You then have to also check the base: > > for d in dirs[:]: >  if os.path.join(base, d) == EXCLUDED_DIR >    dirs.remove(d) > > or > > if base == EXCLUDED_DIR >   while dirs: dirs.pop() > continue > > WARNING: untest code > - Show qu

Re: Exclude Directories from os.walk

2008-10-21 Thread Scott David Daniels
D wrote: Ok, my brain's apparently not working right today.. what I'd like to do is allow the user to specify a directory to exclude (ex- "C:\temp \test") - then, when os.walk gets to "C:\temp\test", it excludes that directory and all its subdirectories (so, "C:\temp\mytest\test" should still be

Re: csv.reader problem tab-delimiter - newbie

2008-10-21 Thread George Sakkis
On Oct 21, 1:44 pm, [EMAIL PROTECTED] wrote: > > Most likely the file is not tab delimited. If you used an editor to > > produce dummy.txt, check whether it uses soft tabs and disable it > > temporarily. > > > HTH, > > George > > Most likely the file is not tab delimited. If you used an editor to >

Re: Developing for Python (2.x or 3)?

2008-10-21 Thread Benjamin Kaplan
On Tue, Oct 21, 2008 at 1:20 PM, Paulo J. Matos <[EMAIL PROTECTED]> wrote: > Hi all, > > I am in the process of choosing which Python version for a brand new > application. Van Rossum in an interview recently advised all new > applications to use Python3 but I am afraid, most libraries (PyGtk, > P

Re: Python equivalent for C module

2008-10-21 Thread Ville M. Vainio
Vinay Sajip <[EMAIL PROTECTED]> writes: > import logging > > logging.warning("Message with %s data", "variable") # or debug, info, > error > > and I'd like to know what simpler interface you think would be better/ > easier to grok for quick hack jobs. It's not the logging itself that is a probl

Re: Commercial Products in Python

2008-10-21 Thread namekuseijin
On 21 out, 15:59, "Sebastian Bassi" <[EMAIL PROTECTED]> wrote: > On Tue, Oct 21, 2008 at 2:50 PM, Paulo J. Matos <[EMAIL PROTECTED]> wrote: > > > I was just wondering, if you wish to commercialize an application > > developed in Python, what's the way to go? > > You choose the conditions. Nothing i

Re: Python equivalent for C module

2008-10-21 Thread Bruno Desthuilliers
Derek Martin a écrit : On Mon, Oct 20, 2008 at 07:29:16PM +0200, Bruno Desthuilliers wrote: This should have been: fprintf(STDERR, "DEBUG: %s", msg); No, it shouldn't have. If I turn on debugging, I want the debug messages to go to stdout, so that they can be captured along with the out

  1   2   >