Re: How to create linked list automatically

2005-12-19 Thread Shahriar Shamil Uulu
Thank you very much to all, we have figured it out, how to make it work, w=[] for i in range(10): node=Node(i) w.append(node) for i in range(10): a=w[i] if i+1>9: b=w[9] a.next=b else: b=w[i+1] a.next=b we have runned in this way

Weird memory consumption problem.

2005-12-19 Thread Bo Peng
Dear list, I spent the last 12 hours in catching this bug (?) and what I found out is very difficult to explain: Basically, I need to call a user-provided function many times, with a tuple as parameter. C/C++ side: (class A, constructed using a python function m_func) // create in the con

Re: valide html - Encoding/Decoding

2005-12-19 Thread gene tani
rabby wrote: > hello world! > how to get the string "/ + ( ) + \ + [ ] + : + äöü" converted into > valide html. > "...".decode("html") does not run :( > thank you for help the a-umlaut <=> ä and other translations are in htmlentitydefs, like Dennis said. cgi.escape will give you < & "e; etc, xml

Re: adding vectors

2005-12-19 Thread Terry Hancock
On Mon, 19 Dec 2005 22:06:31 -0500 Andy Leszczynski <[EMAIL PROTECTED]> wrote: > Short question: why (1,"abc",0.3)+(2,"def",10.2) != > (3,"abcdef",10.5)? > > How to elegantly achieve (3,"abcdef",10.5) as a result of > addition ... (a,b,c) is a "tuple", not a "vector". IMHO, the "elegant" thing t

Re: putenv

2005-12-19 Thread Terry Hancock
On Tue, 20 Dec 2005 05:35:48 - Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2005-12-20, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > wrote: > > I have csh script that calls a bunch of python programs > > and I'd like to use env variables as kind of a global > > variable that I can pass around to th

Re: What is unique about Python?

2005-12-19 Thread Kay Schluehr
gsteff wrote: > So I'm wondering, what is > innovative about Python, either in its design or implementation? Or is > its magic really just in combining many useful features of prior > languages in an unusually pleasant way? > > Greg The latter. http://www.python-in-business.org/ep2005/download.

UDP socket, need help setting sending port

2005-12-19 Thread Sells, Fred
I'm using MSW XP Pro with Python 2.4 to develop but production will be Linux with Python 2.3. (could upgrade to 2.4 if absolutely necessary) I can also switch to Linux for development if necessary. I am writing some python to replace proprietary software that talks to a timeclock via UDP. The ti

Re: putenv

2005-12-19 Thread Grant Edwards
On 2005-12-20, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is there a trick to getting putenv/getenv to work? No. > I have csh script that calls a bunch of python programs and I'd like to > use env variables as kind of a global variable that I can pass around > to the pythong scripts. You ca

putenv

2005-12-19 Thread [EMAIL PROTECTED]
Is there a trick to getting putenv/getenv to work? I have csh script that calls a bunch of python programs and I'd like to use env variables as kind of a global variable that I can pass around to the pythong scripts. Thanks, Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: adding vectors

2005-12-19 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > >>> map(operator.add, (1, "abc", 0.3), (2, "def", 10.2)) > [3, 'abcdef', 10.5] > > Not having to do the zip is win. operator.add is a lose. I'm not sure > either is what I'd call elegant. Yeah, I didn't bother checking whether you could pass dyadic functio

Re: adding vectors

2005-12-19 Thread Alex Martelli
Andy Leszczynski <[EMAIL PROTECTED]> wrote: > Hi, > > Short question: why (1,"abc",0.3)+(2,"def",10.2) != (3,"abcdef",10.5)? Because '+' applied to sequences means to concatenate them -- a more frequent need than "element by element addition" (which I notice you would NOT want to apply to string

Re: step argument for count

2005-12-19 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Does anyone know why a step argument was left off of count? There must > be something that I am missing in why this is the case. For example, I > read that the negative start and step were left off of islice because > iterables can be of "infinite length" so you won't

Re: adding vectors

2005-12-19 Thread Mike Meyer
Paul Rubin writes: > Andy Leszczynski <[EMAIL PROTECTED]> writes: >> Short question: why (1,"abc",0.3)+(2,"def",10.2) != (3,"abcdef",10.5)? >> How to elegantly achieve (3,"abcdef",10.5) as a result of addition ... > tuple([(a+b) for a,b in zip((1,"abc",0.3),(2,"def",10.2

Re: ANNOUNCE; Try python beta

2005-12-19 Thread Mike Meyer
[EMAIL PROTECTED] writes: > >> It does work for me in FireFox and Netscape: > >> >>> 1+1 > >> 2 > Mike> Also Safari, Mozilla and Netscape. > I tried 4+3 in Safari and got I've been futzing with it all evening. Various things I've done have broken it in strange ways. It's working n

step argument for count

2005-12-19 Thread smichr
Does anyone know why a step argument was left off of count? There must be something that I am missing in why this is the case. For example, I read that the negative start and step were left off of islice because iterables can be of "infinite length" so you won't know apriori where the end is. But h

Re: ANNOUNCE; Try python beta

2005-12-19 Thread Mike Meyer
"David Wahler" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> The previous version was in a jail, which is why I didn't want it >> generally announced. The logs made amusing reading. I like Gerhard's >> idea of removing __import__, and have done that. > Oh, you have, eh? Are you absolutely sur

Re: adding vectors

2005-12-19 Thread Paul Rubin
Andy Leszczynski <[EMAIL PROTECTED]> writes: > Short question: why (1,"abc",0.3)+(2,"def",10.2) != (3,"abcdef",10.5)? > How to elegantly achieve (3,"abcdef",10.5) as a result of addition ... tuple([(a+b) for a,b in zip((1,"abc",0.3),(2,"def",10.2))]) -- http://mail.python.org/mailman/listinfo/pyt

Re: How to SetFocus to an activex control when a dialog is prompted?

2005-12-19 Thread Haobing
Got it!! Thanks for everybody!! -- http://mail.python.org/mailman/listinfo/python-list

adding vectors

2005-12-19 Thread Andy Leszczynski
Hi, Short question: why (1,"abc",0.3)+(2,"def",10.2) != (3,"abcdef",10.5)? How to elegantly achieve (3,"abcdef",10.5) as a result of addition ... Andy -- http://mail.python.org/mailman/listinfo/python-list

synchronized enumerate

2005-12-19 Thread smichr
I see that there is a thread of a similar topic that was posted recently ( enumerate with a start index ) but thought I would start a new thread since what I am suggesting is a little different. I posted a very similar item to python-dev, but they said to post it here. Tutor also said that if any

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Scott David Daniels
Alex Martelli wrote: > Scott David Daniels <[EMAIL PROTECTED]> wrote: >> If the data you store and update is sufficiently valuable to your >> enterprise, picking a database may be vital. Transactions guarantee >> every update either happens or not, and infrastructure is provided >> for you to be a

Existing FTP server code?

2005-12-19 Thread [EMAIL PROTECTED]
Hi, I'm writing a program that needs to upload files to a server (probably using FTP), that also needs to be secured and be able to setup username/password programmatically. I wonder if there are already well written base code I can work on. The reason I choose FTP is because it is well known/sup

Re: Existing FTP server code?

2005-12-19 Thread Murtog (sent by Nabble.com)
So you want to upload some files to a FTP Server. This is pretty easy with Python. Give a look at this page: http://docs.python.org/lib/module-ftplib.html Look for the examples, they should help you a lot. cheers! =] Sent from the Python - python-list forum at Nabble.com: Re: Existing FTP serve

Re: What is unique about Python?

2005-12-19 Thread Alex Martelli
gsteff <[EMAIL PROTECTED]> wrote: > The indentation-based syntax seems to be unique No, you can find it in Haskell too (independently developed), and older languages such as Occam. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: What is unique about Python?

2005-12-19 Thread jhujsak
Indeed. I've found that I can code applications with 10-20% of the amount of code required by other languages and write the code in a correspondingly shorter period of time. The result is far less brittle, more functional and far more maintainable. This is code you can come back to a year later and

Re: ANN: DecInt 0.4 and processor specific GMPY binaries

2005-12-19 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: ... > I've also compiled processor-specific binaries of GMPY. I have versions > for AMD 32-bit processors and Intel Pentium 4 processors. The Pentium 4 > version is approximately 4x faster than the default version of GMPY. > > DecInt and the experimental GMPY binaries

Re: mod_python and threads

2005-12-19 Thread grahamd
Depends on what you mean exactly. If one is on Win32 or using worker mode for Apache, the threads are actually initially created down at the Apache level as part of a common pool and are not bound to a specific Python interpreter. That is, two distinct requests in time could make use of the same t

Re: Writing pins to the RS232

2005-12-19 Thread [EMAIL PROTECTED]
For those looking, I've already used IC's that convert RS232 to TTL, look up MAX233. It drops 12 to 5, essentially converting RS232 to TTL and vice versa. PyParallel is definitely the way I'll go, however, this project will be on hold for me for my priorities have been shifted. Thanks again for

Re: ANNOUNCE; Try python beta

2005-12-19 Thread David Wahler
Mike Meyer wrote: > The previous version was in a jail, which is why I didn't want it > generally announced. The logs made amusing reading. I like Gerhard's > idea of removing __import__, and have done that. Oh, you have, eh? Are you absolutely sure? Try running "grep 'all your base' log". -- Dav

mod_python and threads

2005-12-19 Thread skip
I'm just getting started with Myghty and using it under mod_python (also a new beast for me). Do I have to worry about threading conflicts between different mod_python interpreters or are they all independent? Thx, Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: ANNOUNCE; Try python beta

2005-12-19 Thread skip
>> It does work for me in FireFox and Netscape: >> >>> 1+1 >> 2 Mike> Also Safari, Mozilla and Netscape. I tried 4+3 in Safari and got 500 Internal Server Error Internal Server Error The server encountered an internal error or misconfiguration and

Re: How can I load python script into Html ??

2005-12-19 Thread Roger Upole
"Claudio Grondi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > PatPoul wrote: >> Yes I register Python script. >> I see in your exemple that you use file extention pys. >> That was why my exemple does'nt work. >> >> Thanks ! >> >> Patrick Poulin >> > > In this context I have a ques

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Alex Martelli
Scott David Daniels <[EMAIL PROTECTED]> wrote: > Mike Meyer wrote: > > Benji York <[EMAIL PROTECTED]> writes: > >> Perhaps it's off-topic for this thread, but I think "picking a > >> database" is the first mistake most people make. It's a form of > >> premature optimization. > > > > For lots of

Re: ANNOUNCE; Try python beta

2005-12-19 Thread Mike Meyer
Claudio Grondi <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Ok, I've given it the interface I want, and made it less of an >> attractive nuisance. >> http://www.mired.org/home/mwm/try_python/ is now ready for people to >> play with. There's no tutorial information on it yet, that's the next >

Re: show in GUI stdout of a command

2005-12-19 Thread Noah
Try Pexpect for running your command interactively http://pexpect.sourceforge.net/ For example, if you wanted to run the "top" command you could use a script like below. This updates the output every 5 seconds. You can easily adjust the timeout.

Re: ANNOUNCE; Try python beta

2005-12-19 Thread Mike Meyer
"Lonnie Princehouse" <[EMAIL PROTECTED]> writes: > Pretty neat =) > But aren't you concerned about security? Letting anybody execute > arbitrary Python expressions (and therefore also arbitrary system > commands?!) on your box --- even from within a FreeBSD jail --- seems a > bit dangerous. What'

Re: Parsing text

2005-12-19 Thread Noah
sicvic wrote: > I was wondering if theres a way where python can read through the lines > of a text file searching for a key phrase then writing that line and > all lines following it up to a certain point, such as until it sees a > string of "-" >... > Thanks, > Victor You did

ANN: DecInt 0.4 and processor specific GMPY binaries

2005-12-19 Thread casevh
I've released a new version of DecInt that fixes a bug in multiplication. Anyone using version 0.3b or earlier should upgrade. DecInt implements fast arithmetic on large decimal integers. For example, it can calculate the decimal representation of the largest Mersenne prime, all 7816230 digits, in

Re: ANNOUNCE; Try python beta

2005-12-19 Thread Devan L
Mike Meyer wrote: > Ok, I've given it the interface I want, and made it less of an > attractive nuisance. > > http://www.mired.org/home/mwm/try_python/ is now ready for people to > play with. There's no tutorial information on it yet, that's the next > thing to do. However, I won't be able to work

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Scott David Daniels
Mike Meyer wrote: > Benji York <[EMAIL PROTECTED]> writes: >> Perhaps it's off-topic for this thread, but I think "picking a >> database" is the first mistake most people make. It's a form of >> premature optimization. > > For lots of problems, that's true. But not for all of them. If the data y

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Dave Benjamin
On Mon, 19 Dec 2005, Paul Rubin wrote: > "Russell E. Owen" <[EMAIL PROTECTED]> writes: >> I disagree. Once you've picked a database (not trivial in itself, of >> course), you typically only have a few options for talking to in in >> Python. Also, typically either: >> - One stands out (because othe

Re: What is unique about Python?

2005-12-19 Thread Kevin Yuan
2005/12/20, Murtog (sent by Nabble.com) <[EMAIL PROTECTED]>: I would say to your teacher that Python is one of the few languagens that are fun to program with. It realy is! I have to say it although I have used it for only 3 days!  -- http://mail.python.org/mailman/listinfo/python-list

Re: modify a long-running python script while it is running?

2005-12-19 Thread Kevin Yuan
2005/12/20, Mike Meyer <[EMAIL PROTECTED]>: Benjamin Rutt <[EMAIL PROTECTED]> writes:> I suppose this question could be reformatted as "does CPython read the> entire script file into memory and then close the file before > executing the script, making it safe for me to modify the script after> I kn

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Paul Rubin
Paul Rubin writes: > If the transactions are simple and low-latency, then it can be enough > to have a single process own the whole database, and have every client > send all its requests to the db process. Meant to say: it can be enough to let the clients lock the datab

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > What makes me think "I need a database" is a requirement that says > "multiple simultaneous writers". I'd go a little further and say "multiple simultaneous writers doing multi-step transactions with steps that can have high latency", e.g. transactions tha

Re: ANNOUNCE; Try python beta

2005-12-19 Thread Gerhard Häring
Lonnie Princehouse wrote: > Pretty neat =) > > But aren't you concerned about security? Letting anybody execute > arbitrary Python expressions (and therefore also arbitrary system > commands?!) on your box --- even from within a FreeBSD jail --- seems a > bit dangerous. I found out about the Fre

Re: Double-Ended Heaps

2005-12-19 Thread Scott David Daniels
Bryan Olson wrote: > Scott David Daniels wrote: >> I've just put together a Double-Ended Heap package. >> Of course I'd love comments. >> >>http://members.dsl-only.net/~daniels/deheap.html > > I think there's a typo in: > > Note that any change to the contents of a DeHeap (and > there

Re: ANNOUNCE; Try python beta

2005-12-19 Thread Claudio Grondi
Mike Meyer wrote: > Ok, I've given it the interface I want, and made it less of an > attractive nuisance. > > http://www.mired.org/home/mwm/try_python/ is now ready for people to > play with. There's no tutorial information on it yet, that's the next > thing to do. However, I won't be able to work

Re: ANNOUNCE; Try python beta

2005-12-19 Thread Lonnie Princehouse
Pretty neat =) But aren't you concerned about security? Letting anybody execute arbitrary Python expressions (and therefore also arbitrary system commands?!) on your box --- even from within a FreeBSD jail --- seems a bit dangerous. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing text

2005-12-19 Thread Peter Hansen
sicvic wrote: > I was wondering if theres a way where python can read through the lines > of a text file searching for a key phrase then writing that line and > all lines following it up to a certain point, such as until it sees a > string of "-" > > Right now I can only have p

Re: How to get the local mac address?

2005-12-19 Thread Daniel Crespo
> I was looking on how to get MAC address universally (Windows and Linux) and > found one package that is doing that and more... > http://libdnet.sourceforge.net/ Thank you for the info too :) Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I load python script into Html ??

2005-12-19 Thread Claudio Grondi
PatPoul wrote: > Yes I register Python script. > I see in your exemple that you use file extention pys. > That was why my exemple does'nt work. > > Thanks ! > > Patrick Poulin > In this context I have a question: How can the registering of the Python scripting engine be easily and completely

ANNOUNCE; Try python beta

2005-12-19 Thread Mike Meyer
Ok, I've given it the interface I want, and made it less of an attractive nuisance. http://www.mired.org/home/mwm/try_python/ is now ready for people to play with. There's no tutorial information on it yet, that's the next thing to do. However, I won't be able to work on it for a while, so if you

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Mike Meyer
Benji York <[EMAIL PROTECTED]> writes: > Russell E. Owen wrote: >> I disagree. Once you've picked a database (not trivial in itself, of >> course), you typically only have a few options for talking to in in >> Python. > Perhaps it's off-topic for this thread, but I think "picking a > database" is t

Re: modify a long-running python script while it is running?

2005-12-19 Thread Mike Meyer
Benjamin Rutt <[EMAIL PROTECTED]> writes: > I suppose this question could be reformatted as "does CPython read the > entire script file into memory and then close the file before > executing the script, making it safe for me to modify the script after > I know it has started?"[1] Yes, but (didn't

Re: how to lock a file in ftp site

2005-12-19 Thread andy
[EMAIL PROTECTED] wrote: >hi all > >am trying to write some information into the file, which is located in >ftp, and this file can be updated by number of people, but if at all i >download a file from the ftp to my local machine, update it and then >upload it back to ftp, and at the same time if s

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Benji York
Russell E. Owen wrote: > I disagree. Once you've picked a database (not trivial in itself, of > course), you typically only have a few options for talking to in in > Python. Perhaps it's off-topic for this thread, but I think "picking a database" is the first mistake most people make. It's a f

Re: attach a pdf file to an email

2005-12-19 Thread [EMAIL PROTECTED]
also the code are useful thanks again -- http://mail.python.org/mailman/listinfo/python-list

Parsing text

2005-12-19 Thread sicvic
I was wondering if theres a way where python can read through the lines of a text file searching for a key phrase then writing that line and all lines following it up to a certain point, such as until it sees a string of "-" Right now I can only have python write just the line

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Paul Rubin
"Russell E. Owen" <[EMAIL PROTECTED]> writes: > I disagree. Once you've picked a database (not trivial in itself, of > course), you typically only have a few options for talking to in in > Python. Also, typically either: > - One stands out (because others have been abandoned or whatever), so > t

modify a long-running python script while it is running?

2005-12-19 Thread Benjamin Rutt
I often execute a long-running python script which is a "driver" for my application; it may run for several hours on a large input. Under CPython, is it safe for me to modify the Python script and run it under some smaller inputs for test purposes, while the long-running script is still running?

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: >"Ben Sizer" <[EMAIL PROTECTED]> writes: >> I see what you mean, but unfortunately I think there is a lot more >> fuzziness than that. If the separate parts were clearly delineated >> things would be a lot better. I look to the

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: >[EMAIL PROTECTED] (Alex Martelli) writes: >> To put it another way: one reason I love Python is that I strongly >> subscribe to the idea that there should preferably be only one obvious >> way to do something. Unfortun

Re: What is unique about Python?

2005-12-19 Thread Murtog (sent by Nabble.com)
I would say to your teacher that Python is one of the few languagens that are fun to program with. Cheers =] Sent from the Python - python-list forum at Nabble.com: Re: What is unique about Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: attach a pdf file to an email

2005-12-19 Thread [EMAIL PROTECTED]
Thanks I think I should use MIMEBase for any file. -- http://mail.python.org/mailman/listinfo/python-list

Re: Enumeration idioms: Values from different enumerations

2005-12-19 Thread Ben Finney
[EMAIL PROTECTED] writes: > Ben Finney wrote: >> Is there some behaviour other than "evaluate to False" or "raise an >> exception", that could indicate "not comparable"? > > Yes: return NotImplemented. Note that the == operator automagically > returns False in this case. > > >>> "spam".__eq__(

Re: What is unique about Python?

2005-12-19 Thread James
>> The indentation-based syntax seems to be unique I think Haskell was there first. As well as ABC, one of Python's precursors. Python is a pragmatic language, just like C (I wish I could say that about Java). It does not necessarily innovate but incorporates things known to work elsewhere. C and

Re: understanding mod_python

2005-12-19 Thread grahamd
PyPK wrote: > Hi I'm trying to learn mod python and need some one to explain how to > do http redirection(302) with an example code Have you read the documentation? Specifically, check out the function mod_python.util.redirect(): http://www.modpython.org/live/current/doc-html/pyapi-util-f

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Luis M. Gonzalez
Sorry for the interruption, but... Has anyone tried KARRIGELL?? I find hard to believe there is any easier python framework than this one. It's incredibly flexible, very fun, very powerful and with an almost flat learning curve. Go check it out (NOW!) http://karrigell.sourceforge.net/ -- http:/

Re: How to create linked list automatically

2005-12-19 Thread Dave Hansen
On Mon, 19 Dec 2005 20:51:39 + in comp.lang.python, Simon Brunning <[EMAIL PROTECTED]> wrote: >I haven't the time (or inclination) to sort out all your problems >here, but one thing jumps out at me: > >On 12/19/05, Shahriar Shamil Uulu <[EMAIL PROTECTED]> wrote: >> class Node: >> def __ini

Re: Merging Subway and TurboGears

2005-12-19 Thread Jan Niklas Fingerle
[EMAIL PROTECTED] wrote: > My real worries are the controller styles (functions vs classes) and You can wrap those quite easily, but ... > the templating language (Cheetah vs Kid). Those will be points of ... how should the user base of one migrate to the other? I depend on (as far as "depend" m

Announcement: mrquery finds duplicate images

2005-12-19 Thread Edward C. Jones
I have uploaded "mrquery.05.12.19.tgz"' to my web page "http://members.tripod.com/~edcjones/pycode.html";. "mrquery" finds the duplicate images in a collection of images. It implements a variant of the algorithm in "Fast Multiresolution Image Querying" by Charles E. Jacobs, Adam Finkelstein and Da

Re: How to create linked list automatically

2005-12-19 Thread Simon Brunning
I haven't the time (or inclination) to sort out all your problems here, but one thing jumps out at me: On 12/19/05, Shahriar Shamil Uulu <[EMAIL PROTECTED]> wrote: > class Node: > def __init__(self,name=None,next=None): > self.name=name > self.next=next > > def __str__(self

Re: How to create linked list automatically

2005-12-19 Thread Fredrik Lundh
"Shahriar Shamil Uulu" wrote: > w=[] > for i in range(10): > node=Node(i) > w.append(node) > > for i in range(10): > a=w[i] > if i+1>9: > b=w[9] > a.next=b I'm not sure what you're trying to do here, but I'm quite sure that this code doesn't do what you think it do

Re: how to lock a file in ftp site

2005-12-19 Thread billie
No, I think you have to manually set this policy directly on the ftp server. -- http://mail.python.org/mailman/listinfo/python-list

Re: canceling and joining threads

2005-12-19 Thread sir_alex
1) no, i didn't; i'll go and read that function 2) well, the actual situation is: there's the main thread (the application itself) and then the second thread that i create with threading.Thread, in which i make some things; in this thread i call gtk.gdk to update a window with a progress bar... 3)

How to create linked list automatically

2005-12-19 Thread Shahriar Shamil Uulu
Hi All, i have this program, = class Node: def __init__(self,name=None,next=None): self.name=name self.next=next def __str__(self): return str(self.name) w=[] for i in range(10): node=Node(i)

Re: Testing the availability of a module

2005-12-19 Thread Erik Max Francis
Bo Peng wrote: > Is there a better way than doing > > try: >import aModule > except: >has_aModule = False > else: >has_aModule = True > > The main concern here is that loading aModule is unnecessary (and may > take time). Yes. Specifically catch ImportError in your except clause.

Re: What is unique about Python?

2005-12-19 Thread Luis M. Gonzalez
Perhaps you should ask yourself why you like Python first, and then you'll probably have an answer. I'd say that Python is all about productivity. You can get more done in less time and with fewer lines of code because it's more consice, flexible and expressive. It's also very clear, easy to write

Re: Difference between ActivePython and Python.org

2005-12-19 Thread Peter A.Schott
Amen to this one. Found out this after struggling with no SSL module when trying to write some secure FTP and HTTPS code. Downloaded the version from Python.org and it worked like a champ. I believe you can get both and have no issues with the install, though. For my part, I decided to standard

this where I am so far !

2005-12-19 Thread Marian
Any one who  have a clue how can I add and remove records from a list. if the record is dictionary type)  This the program I am working on. I have no idea how can I remove and add some more courses !  import cPickle, shelve def write_file():         C

Re: What is unique about Python?

2005-12-19 Thread Kent Johnson
gsteff wrote: > I'm a computer science student, and have recently been trying to > convince the professor who teaches the programming language design > course to consider mentioning scripting languages in the future. Along > those lines, I've been trying to think of features of Python, and > scrip

how to lock a file in ftp site

2005-12-19 Thread muttu2244
hi all am trying to write some information into the file, which is located in ftp, and this file can be updated by number of people, but if at all i download a file from the ftp to my local machine, update it and then upload it back to ftp, and at the same time if some one else downloads the same

Re: Wingide is a beautiful application

2005-12-19 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: ... > I get the feeling that a ot of people working with heavy IDEs don't > realize how capable vim/emacs are, so I'll give a brief rundown of what > my Vim environment does for me. (I do Python web development)--if y

Re: How can I load python script into Html ??

2005-12-19 Thread PatPoul
Yes I register Python script. I see in your exemple that you use file extention pys. That was why my exemple does'nt work. Thanks ! Patrick Poulin -- http://mail.python.org/mailman/listinfo/python-list

understanding mod_python

2005-12-19 Thread PyPK
Hi I'm trying to learn mod python and need some one to explain how to do http redirection(302) with an example code -- http://mail.python.org/mailman/listinfo/python-list

show in GUI stdout of a command

2005-12-19 Thread twigster
Hi, I need to display in real time the output of a command line tool in a GUI written so far with Tkinter and Pmw. I've got a command line tool that I want to integrate to a GUI. The parameters are set using the GUI and a button executes the command. The calc is long so I need to see how fast

valide html - Encoding/Decoding

2005-12-19 Thread rabby
hello world! how to get the string "/ + ( ) + \ + [ ] + : + äöü" converted into valide html. "...".decode("html") does not run :( thank you for help -- http://mail.python.org/mailman/listinfo/python-list

Re: Please i need a hand with writing a simple task.

2005-12-19 Thread Brian van den Broek
Marian said unto the world upon 2005-12-19 10:58: > Can you pleae help me with this task. I have really hard time with > my textbook desolving this problem. The Task: Write a program that > will create a text file, print the contents of the text file as you > create the file. Read the contents of

Re: Enumeration idioms: Values from different enumerations

2005-12-19 Thread eswald
Ben Finney wrote: > Antoon Pardon wrote: > > I just downloaded your enum module for python [from the Cheeseshop] > > and played a bit with it. IMO some of the behaviour makes it less > > usefull. > [...] > > I also think it would be more usefull if enums from different > > enumerations just tested

Re: settings network timeouts in python

2005-12-19 Thread Narendra
Thanks Steve Itz working. Thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list

What is unique about Python?

2005-12-19 Thread gsteff
I'm a computer science student, and have recently been trying to convince the professor who teaches the programming language design course to consider mentioning scripting languages in the future. Along those lines, I've been trying to think of features of Python, and scripting languages in genera

Re: hi, ive a new mail address (Away from my office until January 2)

2005-12-19 Thread Aaron Del Monte
Thank you for your e-mail. I am away from my office until Monday, January 2. I will respond to your e-mail when I return. Happy Holidays! Aaron * * * * * * * * * * * * * * * * * * * * * * * * * * * Aaron Del Monte Assistant Information Systems Analyst Webmaster, CDFG Marine Region Web Site http

Re: debian and python--any potential pitfalls?

2005-12-19 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-12-19 00:36: > Brian van den Broek wrote: >>I've tried solo and failed a few times to install various Linux >>distros on Intel x86 laptops. (The software modem was always the >>sticking point.) A recent acquaintance has volunteered to guide me >>th

Re: how to remove duplicated elements in a list?

2005-12-19 Thread Brian van den Broek
Alex Martelli said unto the world upon 2005-12-19 10:48: > Brian van den Broek <[EMAIL PROTECTED]> wrote: >... > >orig_list = [3,1,2,3,1,2,3,1,2,1,2,1,3] >new_list = list(set(orig_list)) >new_list.sort(cmp= lambda x,y: cmp(orig_list.index(x), >> >>orig_list.index(y))) >> >new_

Re: Testing the availability of a module

2005-12-19 Thread Peter Otten
Bo Peng wrote: > def GUI(): >if options['cml']: > cml() >else: > if imp.find_module('wx'): >wxGUI() > elif imp.find_module('Tkinter'): >tkGUI() > else: >cml() On the other hand, I don't see how this is superior to an exception-based approach...

Re: Testing the availability of a module

2005-12-19 Thread Fredrik Lundh
Bo Peng wrote: > > here's an outline that matches your use case: > > > > if user wants command line: > > command line only > > else: > > if wxPython is available: > > prepare wx based GUI > > elif Tkinter is available: > > prepare tk based GU

Re: reading files

2005-12-19 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > The text you read is still hanging around, waiting for you to use it. Once > you are done with it, you might want to reclaim that memory used, > especially if it is a 100MB text file: > > mytext = "" # re-bind the name 'mytext' to the empty string If

Re: settings network timeouts in python

2005-12-19 Thread Steve Holden
Narendra wrote: > Hi All, > > I have a problem here. I'm connecting to some pop server.Here i need to > set the network timeouts,since some times my program disconnecting from > net at tht point of time I'm unable to connect to POP server. Can any > one provide the solution for it. > > code; > >

Re: Wingide is a beautiful application

2005-12-19 Thread Claudio Grondi
BartlebyScrivener wrote: > Go to Options. Near the bottom, it will say "Edit Init.File" Click on > it. Done. A completely new file was created. > > Make an entry on a separate line near the top as follows > > (require 'python-mode) > > Then save the init file. Have copy/pasted to it including b

  1   2   >