Attention Googlers

2008-06-07 Thread 4394
I would like to remind google of the hours and hours I have spent working on original content. I also suggest I higher level of maturity their regarding indexing. Keep the money gain some brains. http://tardis-db.co.uk/main.html -- http://mail.python.org/mailman/listinfo/python-list

Re: simple question on list manipulation from a newbie

2008-06-07 Thread Sengly
On Jun 8, 6:38 am, Sam Denton <[EMAIL PROTECTED]> wrote: > Sengly wrote: > > Dear all, > > > I am working with wordnet and I am a python newbie. I'd like to know > > how can I transfer a list below > > > In [69]: dog > > Out[69]: > > [{noun: dog, domestic_dog, Canis_familiaris}, > >  {noun: frump,

Re: More than one element of list changing when only one should be

2008-06-07 Thread Chuckk Hubbard
I solved this problem. I still don't understand why, but it seems Python was appending a reference to the first element at the end of the list, rather than copying the data. I used something like: "self.regionlist.append(list(self.regionlist[self.hregion])" and now it works fine, i.e., altering t

Re: New variable?

2008-06-07 Thread Lie
On Jun 4, 1:40 am, tmallen <[EMAIL PROTECTED]> wrote: > What's the proper way to instantiate a new variable? x = ""? You don't need to. The reason why you need to "declare" variable when doing something like a += 1 is because this is actually a shorthand for a = a + 1 (unless you override __radd__

Re: How to get System.Timers.Timer

2008-06-07 Thread John Machin
On Jun 8, 1:37 pm, "BobAtVandy" <[EMAIL PROTECTED]> wrote: > I'll greatly appreciate any help on this. Actually 2 questions: > > 1. I believe I need to use the Windows timer System.Timers.Timer . The > examples I find on the web all access that timer by 'import System' . > (That's System with a

Re: multiprocessing module (PEP 371)

2008-06-07 Thread John Nagle
sturlamolden wrote: On Jun 5, 11:02 am, pataphor <[EMAIL PROTECTED]> wrote: This is probably not very central to the main intention of your post, but I see a terminology problem coming up here. It is possible for python objects to share a reference to some other object. This has nothing to do w

How to get System.Timers.Timer

2008-06-07 Thread BobAtVandy
I'll greatly appreciate any help on this. Actually 2 questions: 1. I believe I need to use the Windows timer System.Timers.Timer . The examples I find on the web all access that timer by 'import System' . (That's System with a capital S.) I have pywin32 installed and 'import System' doesn

Re: ABC question: what is the purpose of the register() method?

2008-06-07 Thread Benjamin
On Jun 7, 1:37 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > I was reading PEP 3119 (http://www.python.org/dev/peps/pep-3119/) and > have done some experiments using Python 3.0a5. Now I'm somewhat > puzzled about the purpose of the ABCMeta.register() method. > > One can use the register() method to

Re: Macro like functionality for shorthand variable names

2008-06-07 Thread Paul Hankin
On Jun 7, 6:13 am, Tilman Kispersky <[EMAIL PROTECTED]> wrote: > I have python code in a class method translated from C++ that looks > sort of like this: > > >>>  self.dydt[1] = self.a * (self.b * self.y[0] - self.y[1]) > > To make this more readable in C++ I had made macros to achieve this: > #de

Duplicate widget with threads

2008-06-07 Thread Andrew Burton
I'm trying to create a GUI application with CherryPy running in the background for communications. However, when I use Tkinter, CherryPy, and thread together in a test script, my Tkinter widget pops up twice. Could someone tell me what I'm doing wrong? Thanks! Here's the code: --- START COD

Re: Do this as a list comprehension?

2008-06-07 Thread Mensanator
On Jun 7, 8:22�pm, John Salerno <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > What I DID say was that how the builtins actually > > work should be understood and it APPEARED that the > > OP didn't understand that. Maybe he understood that > > all along but his example betrayed no evidence of >

Re: Do this as a list comprehension?

2008-06-07 Thread Paul Hankin
On Jun 7, 7:21 pm, Paul Miller <[EMAIL PROTECTED]> wrote: > On Fri, 06 Jun 2008 18:01:45 -0700, Mensanator wrote: > > What happens if your iterables aren't the same length? > > I chose not to consider that case, since they were the same length in the > original post.  Based on the variable names, i

Re: Do this as a list comprehension?

2008-06-07 Thread John Salerno
Mensanator wrote: What I DID say was that how the builtins actually work should be understood and it APPEARED that the OP didn't understand that. Maybe he understood that all along but his example betrayed no evidence of that understanding. Well, the truth is that I know zip truncates to the s

Most effective coding.. IDE question.

2008-06-07 Thread dave
Hello everyone, I'm a beginning self-taught python student. Currently, I work out my code within IDLE then when I have a version that I like, or that's working, I move it over to a new window and save it. I've been playing w/ Komodo IDE lately, and while it's nice, what I don't like is the

Re: Do this as a list comprehension?

2008-06-07 Thread Mensanator
On Jun 7, 6:43�pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "John Salerno" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED]| Mensanator wrote: > > | > | > Surely enumerate() wasn't added to Python with no intention of > | > ever being used. > | > | I see your reasons for preferring

Re: UnicodeEncodeError while reading xml file (newbie question)

2008-06-07 Thread John Machin
On Jun 8, 10:12 am, nikosk <[EMAIL PROTECTED]> wrote: > I just spent a whole day trying to read an xml file and I got stuck > with the following error: > > Exception Type: UnicodeEncodeError > Exception Value:'charmap' codec can't encode characters in position > 164-167: character m

Invalid Version Number (Distutils from Cygwin)

2008-06-07 Thread newbie73
OS: Vista Python 2.5.2.2 (ActiveState Software Installation) Running latest Cygwin release The error generated is pasted below - please help. - Luis *** I'm attempting to build a project (FANN libraries) using cygwin (to avoid installing MSVC 2003) and am re

Re: Can this be done with list comprehension?

2008-06-07 Thread Terry Reedy
"Karlo Lozovina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I figured that out few minutes ago, such a newbie mistake :). The fix I | came up with is: | | result = ['something'] + [someMethod(i) for i in some_list] | | Are there any other alternatives to this approach? result

UnicodeEncodeError while reading xml file (newbie question)

2008-06-07 Thread nikosk
I just spent a whole day trying to read an xml file and I got stuck with the following error: Exception Type: UnicodeEncodeError Exception Value:'charmap' codec can't encode characters in position 164-167: character maps to Exception Location: C:\Python25\lib\encodings\cp1252.

SQlite none english char

2008-06-07 Thread Gandalf
I works with python 2.5 on windows, And I use sqlite3 Now, I have problem searching string in Hebrew in my database I have table called "test" with field num and test firs row i insert "1" and "עברית" (that is "Hebrew" in Hebrew) second row i insert "2" and "English" now this code will print

Re: Can this be done with list comprehension?

2008-06-07 Thread John Machin
On Jun 8, 8:31 am, Karlo Lozovina <[EMAIL PROTECTED]> wrote: > This is what I'm trying to do (create a list using list comprehesion, then > insert new element at the beginning of that list): > > result = [someFunction(i) for i in some_list].insert(0, 'something') result = ['something'] + [someFu

Re: Need help porting Perl function

2008-06-07 Thread John Machin
On Jun 8, 8:17 am, [EMAIL PROTECTED] wrote: > On Jun 7, 5:56 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > > On Jun 8, 6:05 am, [EMAIL PROTECTED] wrote: > > > > On Jun 7, 2:42 pm, "Daniel Fetchinson" <[EMAIL PROTECTED]> > > > wrote: > > > > > > Hi. I'd like to port a Perl function that does s

Re: Do this as a list comprehension?

2008-06-07 Thread Terry Reedy
"John Salerno" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Mensanator wrote: | | > Surely enumerate() wasn't added to Python with no intention of | > ever being used. | | I see your reasons for preferring enumerate over zip, but I'm wondering | if using enumerate this way isn't

Re: Can this be done with list comprehension?

2008-06-07 Thread Karlo Lozovina
Gary Herron <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > The problem is that list methods like insert do not return a list -- > they modify it in place. If you do > a = [1,2,3] > a.insert(0, 'something') > then a will have the results you expect, but if you do > b = a.insert(0,'

Re: Python 2.5.2 on Ubuntu Hardy Utf-8-Euro error

2008-06-07 Thread Jan Claeys
Op Fri, 30 May 2008 22:37:14 +0200, schreef M.-A. Lemburg: > On 2008-05-30 17:41, Peter Otten wrote: >> Josep wrote: >>> My Python version is 2.5.2, Ubuntu Hardy .deb package. >> Python might get confused by an @EURO suffix in the locale: > Right, that's what's happening. > > The locale module

Re: Can this be done with list comprehension?

2008-06-07 Thread Gary Herron
Karlo Lozovina wrote: This is what I'm trying to do (create a list using list comprehesion, then insert new element at the beginning of that list): result = [someFunction(i) for i in some_list].insert(0, 'something') But instead of expected results, I get None as `result`. If instead of cal

Re: Dynamically naming objects.

2008-06-07 Thread Kalibr
On Jun 8, 2:58 am, Hans Nowak <[EMAIL PROTECTED]> wrote: > Kalibr wrote: > > On Jun 7, 1:20 pm, Hans Nowak <[EMAIL PROTECTED]> wrote: > >> Kalibr wrote: > >>> I've been developing a small script to fiddle with classes, and came > >>> accross the following problem. Assuming I get some user input ask

Can this be done with list comprehension?

2008-06-07 Thread Karlo Lozovina
This is what I'm trying to do (create a list using list comprehesion, then insert new element at the beginning of that list): result = [someFunction(i) for i in some_list].insert(0, 'something') But instead of expected results, I get None as `result`. If instead of calling `insert` method I t

Re: definition of a highlevel language?

2008-06-07 Thread Jan Claeys
Op Mon, 26 May 2008 15:49:33 -0400, schreef Dan Upton: > The point about them looking very little like x86/ARM/etc chips is the > important part though--IIRC, part of the failure of Java machines was > lousy support for preexisting code, due to the optimizations for Java > bytecode, and I expect t

Re: Need help porting Perl function

2008-06-07 Thread eatrnr
On Jun 7, 5:56 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jun 8, 6:05 am, [EMAIL PROTECTED] wrote: > > > > > On Jun 7, 2:42 pm, "Daniel Fetchinson" <[EMAIL PROTECTED]> > > wrote: > > > > > Hi.  I'd like to port a Perl function that does something I don't > > > > know how to do in Python.  (In

Re: Need help porting Perl function

2008-06-07 Thread John Machin
On Jun 8, 6:05 am, [EMAIL PROTECTED] wrote: > On Jun 7, 2:42 pm, "Daniel Fetchinson" <[EMAIL PROTECTED]> > wrote: > > > > > > Hi. I'd like to port a Perl function that does something I don't > > > know how to do in Python. (In fact, it may even be something that > > > is distinctly un-Pythonic!)

Re: Need help porting Perl function

2008-06-07 Thread Paul McGuire
On Jun 7, 1:24 pm, kj <[EMAIL PROTECTED]> wrote: > The original Perl function takes a reference to an array, removes > from this array all the elements that satisfy a particular criterion, > and returns the list consisting of the removed elements.  Hence > this function returns a value *and* has a

Re: simple question on list manipulation from a newbie

2008-06-07 Thread Sam Denton
Sengly wrote: Dear all, I am working with wordnet and I am a python newbie. I'd like to know how can I transfer a list below In [69]: dog Out[69]: [{noun: dog, domestic_dog, Canis_familiaris}, {noun: frump, dog}, {noun: dog}, {noun: cad, bounder, blackguard, dog, hound, heel}, {noun: frank,

Re: Do this as a list comprehension?

2008-06-07 Thread Mensanator
On Jun 7, 1:16�pm, John Salerno <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > Surely enumerate() wasn't added to Python with no intention of > > ever being used. > > I see your reasons for preferring enumerate over zip, It's not that I prefer it, it's that you specifically asked a list compre

Re: how to build a street with more than 1 house ?

2008-06-07 Thread Stef Mientki
thanks guys, David C. Ullrich wrote: On Sat, 07 Jun 2008 00:45:07 +0200, Stef Mientki <[EMAIL PROTECTED]> wrote: hello, In the code below, I can build a large street like this: large_street = house * 25 but not a small street. like this: small_street = 5 * house Why is this different ?

Re: Need help porting Perl function

2008-06-07 Thread Sam Denton
kj wrote: Hi. I'd like to port a Perl function that does something I don't know how to do in Python. (In fact, it may even be something that is distinctly un-Pythonic!) The original Perl function takes a reference to an array, removes from this array all the elements that satisfy a particular

Re: simple question on list manipulation from a newbie

2008-06-07 Thread John Machin
On Jun 8, 5:14 am, Sengly <[EMAIL PROTECTED]> wrote: > Dear all, > > I am working with wordnet and I am a python newbie. I'd like to know > how can I transfer a list below > > In [69]: dog > Out[69]: > [{noun: dog, domestic_dog, Canis_familiaris}, > {noun: frump, dog}, > {noun: dog}, > {noun: ca

Re: Python is slow

2008-06-07 Thread Sean Allen
On May 24, 2008, at 1:56 AM, cm_gui wrote: okay, maybe Python is only slightly slower than PHP, but it APPEARS to be much slower. there is a distinct waiting time whenever you access a python web page before the page starts loading. but once it loads, it is fast. php page starts loading immedi

Re: simple question on list manipulation from a newbie

2008-06-07 Thread Larry Bates
Sengly wrote: Dear all, I am working with wordnet and I am a python newbie. I'd like to know how can I transfer a list below In [69]: dog Out[69]: [{noun: dog, domestic_dog, Canis_familiaris}, {noun: frump, dog}, {noun: dog}, {noun: cad, bounder, blackguard, dog, hound, heel}, {noun: frank,

Re: Need help porting Perl function

2008-06-07 Thread eatrnr
On Jun 7, 2:42 pm, "Daniel Fetchinson" <[EMAIL PROTECTED]> wrote: > > Hi.  I'd like to port a Perl function that does something I don't > > know how to do in Python.  (In fact, it may even be something that > > is distinctly un-Pythonic!) > > > The original Perl function takes a reference to an arr

Re: Newbie question, list comprehension

2008-06-07 Thread Larry Bates
Johannes Bauer wrote: Hello group, I'm currently doing something like this: import time localtime = time.localtime(1234567890) fmttime = "%04d-%02d-%02d %02d:%02d:%02d" % (localtime[0], localtime[1], localtime[2], localtime[3], localtime[4], localtime[5]) print fmttime For the third line the

Re: Macro like functionality for shorthand variable names

2008-06-07 Thread Larry Bates
Tilman Kispersky wrote: I have python code in a class method translated from C++ that looks sort of like this: self.dydt[1] = self.a * (self.b * self.y[0] - self.y[1]) To make this more readable in C++ I had made macros to achieve this: #define du (dydt[1]) #define u (y[1]) #define V (y[0])

Re: Need help porting Perl function

2008-06-07 Thread kj
>This function will take a list of integers and modify it in place such >that it removes even integers. The removed integers are returned as a >new list Great! Thanks! kynn -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, sh

simple question on list manipulation from a newbie

2008-06-07 Thread Sengly
Dear all, I am working with wordnet and I am a python newbie. I'd like to know how can I transfer a list below In [69]: dog Out[69]: [{noun: dog, domestic_dog, Canis_familiaris}, {noun: frump, dog}, {noun: dog}, {noun: cad, bounder, blackguard, dog, hound, heel}, {noun: frank, frankfurter, ho

Re: Need help porting Perl function

2008-06-07 Thread Daniel Fetchinson
> Hi. I'd like to port a Perl function that does something I don't > know how to do in Python. (In fact, it may even be something that > is distinctly un-Pythonic!) > > The original Perl function takes a reference to an array, removes > from this array all the elements that satisfy a particular c

Re: Python is slow

2008-06-07 Thread Charlie Hubbard
That hardware battle was fought long ago. Von Neumann machine vs. the Lisp machine. Guess who won? http://en.wikipedia.org/wiki/Lisp_machine It would be very hard to fight that war all over again. Charlie On Fri, Jun 6, 2008 at 4:59 PM, Jan Claeys <[EMAIL PROTECTED]> wrote: > Op Fri, 23 May

ABC question: what is the purpose of the register() method?

2008-06-07 Thread Kay Schluehr
I was reading PEP 3119 (http://www.python.org/dev/peps/pep-3119/ ) and have done some experiments using Python 3.0a5. Now I'm somewhat puzzled about the purpose of the ABCMeta.register() method. One can use the register() method to register any class as a virtual subclass of any ABC. For example o

Re: How to send a POST request?

2008-06-07 Thread kj
Thanks to Jeff and subeen for the helpful comments and suggestions. Kynn -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded. -- http://mail.python.org/mailman/listinfo/python-list

Need help porting Perl function

2008-06-07 Thread kj
Hi. I'd like to port a Perl function that does something I don't know how to do in Python. (In fact, it may even be something that is distinctly un-Pythonic!) The original Perl function takes a reference to an array, removes from this array all the elements that satisfy a particular criterion,

Re: Do this as a list comprehension?

2008-06-07 Thread John Salerno
Mensanator wrote: Surely enumerate() wasn't added to Python with no intention of ever being used. I see your reasons for preferring enumerate over zip, but I'm wondering if using enumerate this way isn't a little hackish or artificial. Isn't the point of enumerate to get the index of a speci

Re: expression IF (was: Why does python not have a mechanism for data hiding?)

2008-06-07 Thread John Nagle
BJörn Lindqvist wrote: On Wed, Jun 4, 2008 at 2:02 PM, Antoon Pardon <[EMAIL PROTECTED]> wrote: Now of course noone would defend such a limitation on the grounds that one doesn't need the general case and that the general case will only save you some vertical space. But when it came to the tern

Re: Do this as a list comprehension?

2008-06-07 Thread Mensanator
On Jun 7, 5:21�am, Paul Miller <[EMAIL PROTECTED]> wrote: > On Fri, 06 Jun 2008 18:01:45 -0700, Mensanator wrote: > > What happens if your iterables aren't the same length? > > I chose not to consider that case, That's a bad habit to teach a newbie, isn't it? > since they were the same length in

Re: Dynamically naming objects.

2008-06-07 Thread Hans Nowak
Kalibr wrote: On Jun 7, 1:20 pm, Hans Nowak <[EMAIL PROTECTED]> wrote: Kalibr wrote: I've been developing a small script to fiddle with classes, and came accross the following problem. Assuming I get some user input asking for a number, how would I spawn 'n' objects from a class? i.e. I have a

Re: Python and Flaming Thunder

2008-06-07 Thread Sam Denton
John Salerno wrote: "Dave Parker" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On May 20, 7:05 pm, Collin <[EMAIL PROTECTED]> wrote: --- For example, consider the two statements: x = 8 x = 10 The reaction from most math teachers (and kids) was "one of those is wrong b

Re: Why does python not have a mechanism for data hiding?

2008-06-07 Thread BJörn Lindqvist
On Wed, Jun 4, 2008 at 2:02 PM, Antoon Pardon <[EMAIL PROTECTED]> wrote: > Now of course noone would defend such a limitation on the grounds > that one doesn't need the general case and that the general case > will only save you some vertical space. > > But when it came to the ternary operator that

Re: time module methods give an am or pm value ?

2008-06-07 Thread Scott David Daniels
dj wrote: Hello again, Does anyone know which method in the time module will generate and am or pm ? If none of the method will do this for me. Can I produce the value on my own ? Any suggestions ? Read up about strftime (a function, not a method). Generally, if you know you'll be using somet

Re: time module methods give an am or pm value ?

2008-06-07 Thread Mark Tolonen
"dj" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello again, Does anyone know which method in the time module will generate and am or pm ? If none of the method will do this for me. Can I produce the value on my own ? Any suggestions ? from time import * strftime('%I:%M:%S

Re: Parsing a path to components

2008-06-07 Thread Mark Tolonen
"eliben" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Jun 7, 10:15 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: On Fri, 06 Jun 2008 23:57:03 -0700, s0suk3 wrote: > You can just split the path on `os.sep', which contains the path > separator of the platform on which

Re: Dynamically naming objects.

2008-06-07 Thread Kalibr
Thanks for all this info. I'll try all your scripts out. from what you guys have said, I did the following: I set up a 'computer class' (I'lm leaving out the mutators) class computer: def __init__(self, IP, owner, ph_connections, connections): assert isIP(IP) == True self.

Re: time module methods give an am or pm value ?

2008-06-07 Thread dj
Hello again, Does anyone know which method in the time module will generate and am or pm ? If none of the method will do this for me. Can I produce the value on my own ? Any suggestions ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Import, site packages, my modules, Windows vs. Linux

2008-06-07 Thread rzed
John Ladasky <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED] com: > Hi folks, > > Running Python 2.5 on both a Windows XP laptop, and an Ubuntu > Linux 7.04 desktop. > > I've gotten tired of maintaining multiple copies of my personal > modules that I use over and over. I have copies of the

Re: how to build a street with more than 1 house ?

2008-06-07 Thread David C. Ullrich
On Sat, 07 Jun 2008 00:45:07 +0200, Stef Mientki <[EMAIL PROTECTED]> wrote: >hello, > >In the code below, I can build a large street like this: > large_street = house * 25 >but not a small street. like this: > small_street = 5 * house > >Why is this different ? Because you're multiplying on the

Re: Re: File-writing not working in Windows?

2008-06-07 Thread Ivan
John Machin ?: On Jun 7, 1:18 am, [EMAIL PROTECTED] wrote: Assume nothing. Don't believe anyone who says "always". Insert some print statements and repr() calls to show what's actually there. I hope however that it's something obvious that a Python guru here will be able to spot and

You can earn Rs.25000 very month from internet. This is easy form filling jobs. Work less than 1 hr daily. No investment. Please visit the website http://mahesbiotech.googlepages.com/You can earn R

2008-06-07 Thread sawmyaa
You can earn Rs.25000 very month from internet. This is easy form filling jobs. Work less than 1 hr daily. No investment. Please visit the website http://mahesbiotech.googlepages.com/ -- http://mail.python.org/mailman/listinfo/python-list

Job opportunity for Python developer in Moscow, Russia

2008-06-07 Thread Denis S. Otkidach
We are looking for Python experts with strong knowledge of web technologies, RDBMS, UNIX, object-oriented development. Experience in django, sqlalchemy, CORBA, memcached, jquery and development of scalable high-prefomance applications is a plus. Compensation is above the market. If you are interes

sendKey

2008-06-07 Thread Gandalf
I found some script that send keys , But I couldn't manage to send CTRL+c with none of them can any one tell me what i'm doing wrong: import win32api import win32com.client shell = win32com.client.Dispatch("WScript.Shell") shell.Run("Notepad") win32api.Sleep(100) shell.AppActivate("Notepad") wi

Re: investigate python auth problem

2008-06-07 Thread David Hláčik
Hello Julien, ALL I have reproduced steps, to show you sample on another module and its results in INN (becouse i really like to solve this :) Here is part from nnrpd_auth.py module autheticate(args) which is called when authentication begins: part from readers.conf : *auth "pdg" { pyth

Re: How to kill a thread?

2008-06-07 Thread Nick Craig-Wood
David <[EMAIL PROTECTED]> wrote: > Would it be possible for a 3rd-party threading library to an > 'interruptible' version of Queue? > > The same methods as the normal Queue, but when you call a new .kill() > method on the queue, all the threads locking on the queue get a > "QueueKilled" excep

Re: Do this as a list comprehension?

2008-06-07 Thread Paul Miller
On Fri, 06 Jun 2008 18:01:45 -0700, Mensanator wrote: > What happens if your iterables aren't the same length? I chose not to consider that case, since they were the same length in the original post. Based on the variable names, it seemed reasonable that there would always be a 1-to-1 corresp

Re: Parsing a path to components

2008-06-07 Thread Marc 'BlackJack' Rintsch
On Sat, 07 Jun 2008 02:15:07 -0700, s0suk3 wrote: > On Jun 7, 3:15 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Fri, 06 Jun 2008 23:57:03 -0700, s0suk3 wrote: >> > You can just split the path on `os.sep', which contains the path >> > separator of the platform on which Python is ru

Re: Parsing a path to components

2008-06-07 Thread s0suk3
On Jun 7, 3:15 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 06 Jun 2008 23:57:03 -0700, s0suk3 wrote: > > You can just split the path on `os.sep', which contains the path > > separator of the platform on which Python is running: > > > components = pathString.split(os.sep) > > W

Re: Parsing a path to components

2008-06-07 Thread eliben
On Jun 7, 10:15 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 06 Jun 2008 23:57:03 -0700, s0suk3 wrote: > > You can just split the path on `os.sep', which contains the path > > separator of the platform on which Python is running: > > > components = pathString.split(os.sep) > >

Re: How to kill a thread?

2008-06-07 Thread David
Would it be possible for a 3rd-party threading library to an 'interruptible' version of Queue? The same methods as the normal Queue, but when you call a new .kill() method on the queue, all the threads locking on the queue get a "QueueKilled" exception thrown. It might be as simple as a Queue wra

Re: Parsing a path to components

2008-06-07 Thread Marc 'BlackJack' Rintsch
On Fri, 06 Jun 2008 23:57:03 -0700, s0suk3 wrote: > You can just split the path on `os.sep', which contains the path > separator of the platform on which Python is running: > > components = pathString.split(os.sep) Won't work for platforms with more than one path separator and if a separator is

Re: cgi, parse_header and semi-colon

2008-06-07 Thread Sylvain
On Jun 6, 5:33 pm, "Richard Brodie" <[EMAIL PROTECTED]> wrote: > "Sylvain" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > If we upload a file with a semi-colon (i.e : "C:/my;file.jpg") : > > cgi.FieldStorage.filename returns only "my" everything after the semi- > > colon is m

Re: Parsing a path to components

2008-06-07 Thread s0suk3
On Jun 7, 12:55 am, eliben <[EMAIL PROTECTED]> wrote: > Hello, > > os.path.split returns the head and tail of a path, but what if I want > to have all the components ? I could not find a portable way to do > this in the standard library, so I've concocted the following > function. It uses os.path.s