Re: why this server can not run in python30

2008-10-21 Thread Gabriel Genellina
En Wed, 22 Oct 2008 03:45:31 -0200, davy zhang <[EMAIL PROTECTED]> escribió: import asyncore, asynchat import os, socket, string PORT = 8000 class HTTPChannel(asynchat.async_chat): def __init__(self, server, sock, addr): asynchat.async_chat.__init__(self, sock) self.set_

Re: IDLE home page?

2008-10-21 Thread Terry Reedy
Sebastian Bassi wrote: If I put IDLE in the search box at python.org, the first hit is: http://www.python.org/idle/ But this page is a directory without any index file: Index of /idle Icon NameLast modified Size Description[DIR] Parent Directory

Re: Could anyone give a working example using asynchat in Python3.0?

2008-10-21 Thread Gabriel Genellina
En Wed, 22 Oct 2008 00:29:04 -0200, davy zhang <[EMAIL PROTECTED]> escribió: I tried to use them but the terminator option seems no effect I search the google but all the code is Python2.x format, I modified them but I get no luck. The original package by Sam Rushing (available at htt

Re: import a function from bash to python? -HELP!-

2008-10-21 Thread greg
James Mills wrote: Directly importing a bash function into python is not possible. Well, you could write a bash interpreter in Python... but that's probably more work than it's worth -- Greg -- http://mail.python.org/mailman/listinfo/python-list

why this server can not run in python30

2008-10-21 Thread davy zhang
import asyncore, asynchat import os, socket, string PORT = 8000 class HTTPChannel(asynchat.async_chat): def __init__(self, server, sock, addr): asynchat.async_chat.__init__(self, sock) self.set_terminator("\r\n") self.request = None self.data = "" self

Re: Deviation from object-relational mapping (pySQLFace)

2008-10-21 Thread huy
On Oct 12, 11:19 am, [EMAIL PROTECTED] wrote: > I have made a simple python module to handle SQL > databases:https://fedorahosted.org/pySQLFace/wiki > Its goal to separate relational database stuff (SQL) from algorythmic > code (python). A SQLFace is a facade initialized with a configuration > fil

Re: execve error with the subprocess module

2008-10-21 Thread Gabriel Genellina
En Tue, 21 Oct 2008 13:45:10 -0200, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: 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/

Re: no module named _tkinter

2008-10-21 Thread Michele Simionato
On Oct 22, 2:10 am, Ben ZX <[EMAIL PROTECTED]> wrote: > When I type > > import Tkinter > > I get > > no module named _tkinter. > > I compiled my own python 2.5.2, and I didn't do anything special: just > configure; make; make install. > > I checked there is a tk library in /usr/lib64. You need the

Re: dumping in destructor

2008-10-21 Thread Gabriel Genellina
En Tue, 21 Oct 2008 10:31:58 -0200, Митя <[EMAIL PROTECTED]> escribió: 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 ab

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

2008-10-21 Thread Asun Friere
That should be "Triple-quoted strings HAVE not the Python-nature." 'Hath' is the archaic 3rd person SINGULAR form of 'to have,' as in "a tripple-quoted string hath ..." -- http://mail.python.org/mailman/listinfo/python-list

Could anyone give a working example using asynchat in Python3.0?

2008-10-21 Thread davy zhang
I tried to use them but the terminator option seems no effect I search the google but all the code is Python2.x format, I modified them but I get no luck. thanks for any advice -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6, multiprocessing module and BSD

2008-10-21 Thread Philip Semanchuk
On Oct 21, 2008, at 6:45 PM, [EMAIL PROTECTED] wrote: It seems that the multiprocessing module in 2.6 is broken for *BSD; I've seen issue 3770 regarding this. I'm curious if there are more details on this issue since the posts in 3770 were a bit unclear. For example, one post claimed that the p

Re: Commercial Products in Python

2008-10-21 Thread Banibrata Dutta
On Tue, Oct 21, 2008 at 11:48 PM, namekuseijin <[EMAIL PROTECTED]>wrote: > 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 > >

Re: better scheduler with correct sleep times

2008-10-21 Thread Gabriel Genellina
On 2008-10-21, 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 multithreading. It >>

IDLE home page?

2008-10-21 Thread Sebastian Bassi
If I put IDLE in the search box at python.org, the first hit is: http://www.python.org/idle/ But this page is a directory without any index file: Index of /idle Icon NameLast modified Size Description[DIR] Parent Directory - [ ] Makefile

Re: What was that, what was it?

2008-10-21 Thread greg
Ross Ridge wrote: 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

Re: import a function from bash to python? -HELP!-

2008-10-21 Thread James Mills
On Wed, Oct 22, 2008 at 10:32 AM, gita ziabari <[EMAIL PROTECTED]> wrote: > Is is possible to import a function from bash to python? If so, what is the > syntax and how should I pass the input parameters? The only possibility is to use the subprocess module and this is a more general problem, one

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

2008-10-21 Thread Ross Ridge
Ross Ridge wrote: > As opposed to the file system being the single point failure? Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >The file system is involved regardless. But leaving out an additional >layer of failure on top of it does make things more robust, yes. No, that doesn't follow. Havi

Re: better scheduler with correct sleep times

2008-10-21 Thread greg
sokol wrote: Also, the scheduler runs inside a loop. How do you suppose to run other code while the loop is executing? The sleep function could be doing a select with a timeout on some other source of events, such as a socket or a gui input event stream. One possible response to such an event i

Re: a question about Chinese characters in a Python Program

2008-10-21 Thread John Machin
On Oct 22, 11:07 am, Ben Finney <[EMAIL PROTECTED]> wrote: > John Machin <[EMAIL PROTECTED]> writes: > > What is that 0+IBM-127 +IBw-guess+IB0- gibberish in your posting? > > It wasn't in my message as sent to my news server, nor as I read the > message in comp.lang.python. The message was encoded

import a function from bash to python? -HELP!-

2008-10-21 Thread gita ziabari
All, Is is possible to import a function from bash to python? If so, what is the syntax and how should I pass the input parameters? Thanks, Gita -- http://mail.python.org/mailman/listinfo/python-list

Re: importing a class thru a variable?

2008-10-21 Thread Aaron Brady
On Oct 21, 6:07 pm, john <[EMAIL PROTECTED]> wrote: > Hi, > This is probably a question of questionable sanity, due to the fact I A question of questionable? Unacceptable. None of those, please. Yes, __import__ will do dynamics. Check your terminology. 'arguments that get passed to the class'

Re: Unicode (UTF8) in dbhas on 2.5

2008-10-21 Thread Martin v. Löwis
>> Many database engines are encoding-aware, and distinguish between >> 'text' columns and 'blob' columns -- the latter are arbitrary bags >> of bytes, but text columns store text, and a good database (with a >> sensibly designed database) will be aware of this and handle >> encoding and decoding o

no module named _tkinter

2008-10-21 Thread Ben ZX
When I type import Tkinter I get no module named _tkinter. I compiled my own python 2.5.2, and I didn't do anything special: just configure; make; make install. I checked there is a tk library in /usr/lib64. -- http://mail.python.org/mailman/listinfo/python-list

Re: windows / unix path

2008-10-21 Thread greg
Dennis Lee Bieber wrote: The command line is the only place the slash direction has any effect any way... Avoid os.system(), subprocess with shell = True, and forward is safe in any position. I'm not sure that's quite true. On Windows, it's not the shell that splits up the command line into arg

Re: a question about Chinese characters in a Python Program

2008-10-21 Thread Ben Finney
John Machin <[EMAIL PROTECTED]> writes: > On Oct 21, 11:03 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: > > 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 othe

Re: Unicode (UTF8) in dbhas on 2.5

2008-10-21 Thread Joe Strout
On Oct 21, 2008, at 2:39 PM, Martin v. Löwis wrote: It's not possible to "fix" this - it isn't even broken. The *db modules, by design, support storing of arbitrary bytes, not just character data. Many database engines are encoding-aware, and distinguish between 'text' columns and 'blob'

Re: importing a class thru a variable?

2008-10-21 Thread Chris Rebert
On Tue, Oct 21, 2008 at 4:07 PM, john <[EMAIL PROTECTED]> wrote: > Hi, > This is probably a question of questionable sanity, due to the fact I > don't think I can explain this well. I'd like to have a script set up > such that it imports a class that is named in the command line > arguments as the

Re: a question about Chinese characters in a Python Program

2008-10-21 Thread John Machin
On Oct 21, 11:03 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > 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 document

importing a class thru a variable?

2008-10-21 Thread john
Hi, This is probably a question of questionable sanity, due to the fact I don't think I can explain this well. I'd like to have a script set up such that it imports a class that is named in the command line arguments as the first argument to the script. Let's say I have a script, command.py, and I

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

2008-10-21 Thread Robert Lehmann
On Tue, 21 Oct 2008 21:58:57 +1300, Lawrence D'Oliveiro wrote: > 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\nst

Python 2.6, multiprocessing module and BSD

2008-10-21 Thread YouCanCallMeAl
It seems that the multiprocessing module in 2.6 is broken for *BSD; I've seen issue 3770 regarding this. I'm curious if there are more details on this issue since the posts in 3770 were a bit unclear. For example, one post claimed that the problem was that sem_open isn't implemented in *BSD, but it

[JOB] Systems Engineer, San Francisco, CA | 90-150k - Relo OK

2008-10-21 Thread OSS
Job Title: Software Engineer--Systems Location: San Francisco - Relocation assistance provided Duration: Full Time/Permanent Salary: 90-150k DOE Our client is home to a new type of search that makes it easy to find subjective information. Starting in early 2008 the company raised seed financing fr

Re: Commercial Products in Python

2008-10-21 Thread Diez B. Roggisch
Which of the programs there makes an "real" executable, I mean an executable that can't be reversed engineered in less than 2 minutes ? None. Who cares? I work for a company that produces a C++ application with quite a few embedded license checks. The cracks are available a few hours af

Re: Need some advice

2008-10-21 Thread azrael
There have been some discutions with my partner about which protocol to use. We agreed to use also http. But we are looking for a possibility to use something to trasfer python objects like Json objects. If my memory is me well http transfers data in plaintext. Because of the risk of datacapturing

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

2008-10-21 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Ross Ridge wrote: > Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > >> Ross Ridge 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. > > As opposed to the

Re: Don't understand syntax error: unqualified exec is not allowed ..

2008-10-21 Thread Stef Mientki
Terry Reedy wrote: Stef Mientki wrote: import sys p_locals = sys._getframe(1).f_locals Which locals does this get you? __init__'s? (locals()?) AFAIK locals() == sys._getframe(0).f_locals Then it is not clear to me which locals your are getting. The locals of the code block where th

RE: Commercial Products in Python

2008-10-21 Thread Delaney, Timothy (Tim)
Paulo J. Matos wrote: > Question cleared: > http://wiki.python.org/moin/DistributionUtilities Another option that we've used in the past was to write the "sensitive" bits in Pyrex/Cython. These get compiled to executable code (a .pyd/DLL on Windows, .so on Unix-like systems). They are tied to the

Re: Resizing Tif's to smaller gifs adds pixels

2008-10-21 Thread Samuel
Scott, I appreciate the quick response, but I need this in a GIF format. Samuel On Oct 21, 3:46 pm, Scott David Daniels <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > ...I need to scale a TIFF image from 1925x588 px to a GIF of 600xnnn px. > > I've tried the following code, but it lea

Re: Don't understand syntax error: unqualified exec is not allowed ..

2008-10-21 Thread Terry Reedy
Stef Mientki wrote: import sys p_locals = sys._getframe(1).f_locals Which locals does this get you? __init__'s? (locals()?) AFAIK locals() == sys._getframe(0).f_locals Then it is not clear to me which locals your are getting. p_globals = sys._getframe(1).f_globals Isn't this j

Re: Unicode (UTF8) in dbhas on 2.5

2008-10-21 Thread Martin v. Löwis
Paul Boddie wrote: > 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, > any

Re: Commercial Products in Python

2008-10-21 Thread Terry Reedy
Paulo J. Matos wrote: 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? Google has done quite well selling the services of programs written in Python (and other languages).

Re: Commercial Products in Python

2008-10-21 Thread Erich
On Oct 21, 12:50 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: > 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? > If this application is a Windows app, and can use .Ne

Re: I want to release the GIL

2008-10-21 Thread Martin v. Löwis
> When I run it, I notice that only one thread works and the other one > never has a chance to run. I guess it is because the thread don't > have a chance to release the GIL This guess is wrong. A call to lock.acquire *does* release the GIL, (as does the call to thread.sleep, as somebody else poi

Re: Resizing Tif's to smaller gifs adds pixels

2008-10-21 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: ...I need to scale a TIFF image from 1925x588 px to a GIF of 600xnnn px. I've tried the following code, but it leads to a lot of extra odd colored pixels being inserted into the resulting image. img = "tmp/tmsho20080901.tif" im = Image.open("tmp/tmsho20080901.tif") w,

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

2008-10-21 Thread Terry Reedy
Duncan Booth wrote: 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? You probably don't want to use readlines. It is almost always cleaner just to iterate over the file itself. You can'

pymssql stored procedures - NEW THREAD

2008-10-21 Thread Aspersieman
On Tue, 21 Oct 2008 20:44:24 +0200, Mike Hansen <[EMAIL PROTECTED]> wrote: Hi, I saw your posting on the python list about pymssql and you mentioned that you call stored procedures and get back output parameters. Are you doing this on Windows or Linux? I can't seem to get it to work on Li

Re: Commercial Products in Python

2008-10-21 Thread Grant Edwards
On 2008-10-21, Paulo J. Matos <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: >> On 2008-10-21, Paulo J. Matos <[EMAIL PROTECTED]> wrote: >>> 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 i

Re: Abnormal Interpreter Shutdown

2008-10-21 Thread Terry Reedy
k3xji wrote: 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.

Re: Commercial Products in Python

2008-10-21 Thread Robert Kern
Stef Mientki wrote: Paulo J. Matos wrote: Question cleared: http://wiki.python.org/moin/DistributionUtilities Which of the programs there makes an "real" executable, I mean an executable that can't be reversed engineered in less than 2 minutes ? None of them, most likely. That's not th

Re: Commercial Products in Python

2008-10-21 Thread Bruno Desthuilliers
Paulo J. Matos a écrit : Bruno Desthuilliers wrote: Paulo J. Matos a écrit : 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? Nope, why ? This is because (and tell me if I

Re: Commercial Products in Python

2008-10-21 Thread Stef Mientki
Paulo J. Matos wrote: Paulo J. Matos wrote: Grant Edwards wrote: On 2008-10-21, Paulo J. Matos <[EMAIL PROTECTED]> wrote: 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 sou

Re: Commercial Products in Python

2008-10-21 Thread Paulo J. Matos
Paulo J. Matos wrote: > Grant Edwards wrote: >> On 2008-10-21, Paulo J. Matos <[EMAIL PROTECTED]> wrote: >>> 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? >>> >>

Re: Commercial Products in Python

2008-10-21 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paulo J. Matos <[EMAIL PROTECTED]> wrote: >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)

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

2008-10-21 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Sean DiZazzo <[EMAIL PROTECTED]> wrote: >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 intervie

Re: Commercial Products in Python

2008-10-21 Thread Paulo J. Matos
Grant Edwards wrote: > On 2008-10-21, Paulo J. Matos <[EMAIL PROTECTED]> wrote: >> 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 i

Re: Commercial Products in Python

2008-10-21 Thread Paulo J. Matos
Bruno Desthuilliers wrote: > Paulo J. Matos a écrit : >> 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? > > Nope, why ? > >> This is because (and tell me if I am wr

Re: Commercial Products in Python

2008-10-21 Thread Paulo J. Matos
Sebastian Bassi 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 in Python license prevents you of > selling

Resizing Tif's to smaller gifs adds pixels

2008-10-21 Thread smullen . uclick
I'm not entirely sure how this group works: if there is a page I'm supposed to follow up on or if I should expect an email in reply. Anyway, here's my question. I'm very new to Python and PIL, I know how to do this stuff in perl and ImageMagick, but I'm having issues with Python and PIL. I need t

Re: Commercial Products in Python

2008-10-21 Thread Ville M. Vainio
"Paulo J. Matos" <[EMAIL PROTECTED]> writes: > 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? That should be a good way to go about it. It doesn't make it "open source

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

2008-10-21 Thread Ville M. Vainio
"Paulo J. Matos" <[EMAIL PROTECTED]> writes: > 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, I don't think he meant "all new" application

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

2008-10-21 Thread Ben
On Oct 21, 1:53 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > 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: > > >

Re: Porting VB apps to Python for Window / Linux use

2008-10-21 Thread Stef Mientki
Grant Edwards wrote: On 2008-10-20, Stef Mientki <[EMAIL PROTECTED]> wrote: I don't think I'm feeding the troll, but - ever took a look at PyQt? I wanted to go from Delphi to a free / open source environment, for both open source and commercial applications. So the Qt license stoppe

Re: Need some advice

2008-10-21 Thread Bruno Desthuilliers
azrael a écrit : 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 w

Re: Commercial Products in Python

2008-10-21 Thread Grant Edwards
On 2008-10-21, Paulo J. Matos <[EMAIL PROTECTED]> wrote: > 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

Re: Commercial Products in Python

2008-10-21 Thread Bruno Desthuilliers
Paulo J. Matos a écrit : 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? Nope, why ? This is because (and tell me if I am wrong): 1) You can't sell an executable because Py

Re: Don't understand syntax error: unqualified exec is not allowed ..

2008-10-21 Thread Stef Mientki
Terry Reedy wrote: Stef Mientki wrote: hello, I've syntax error which I totally don't understand: ## mainfile : import test_upframe2 if __name__ == '__main__': var1 = 33 code = 'print var1 + 3 \n' test_upframe2.Do_Something_In_Parent_NameSpace ( code ) ### file = test_upfr

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

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 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: 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: 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: 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: 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: 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: 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: 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: 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

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: 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() >

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: 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: 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

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: 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

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: 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

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: 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).

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: 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

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 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

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: 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: 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 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: 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

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: 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

  1   2   >