Re: Delete values from a string using the index

2007-09-27 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: How do I delete or remove values from a list or string using the index. Note you can't do it with a string, since that's not mutable. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using closures and partial functions to eliminate redundant code

2007-09-27 Thread Gabriel Genellina
En Wed, 26 Sep 2007 23:01:17 -0300, Matthew Wilson [EMAIL PROTECTED] escribi�: I wrote some code to create a user and update a user on a remote box by sending emails to that remote box. When I was done, I realized that my create_user function and my update_user function were effectively

Re: database persistence with mysql, sqlite

2007-09-27 Thread Bryan Olson
Lawrence D'Oliveiro wrote: Bryan Olson wrote: Lawrence D'Oliveiro wrote: In Bryan Olson wrote: coldpizza wrote: It turned out that the method above ('SELECT * FROM TABLE LIMIT L1, L2') works ok both with mysql and sqlite3, therefore I have decided to stick with it until I find something

Re: Python class method as an argument of a function in a C extension

2007-09-27 Thread mauro
On 26 Set, 19:00, Matimus [EMAIL PROTECTED] wrote: Can anybody give me an hint (or some link) on how to define 'aCFunction' and how to call 'self.myMethod' in the C source code? A python function defined in C accepts a pointer to self and a tuple of arguments, each of which is also a

Re: Asynchronous Messaging

2007-09-27 Thread Gabriel Genellina
En Thu, 27 Sep 2007 01:43:32 -0300, wink [EMAIL PROTECTED] escribi�: You are most correct, but Queue is slow compared to deque but not for the reason I guessed. Apparently it's because deque is implemented in C while Queue is in python. Using the program below it looks there is about a 35:1

Re: ~ bit-wise unary operator

2007-09-27 Thread Ladislav Andel
Wow, so many answers :). Thank you, guys :). Lada Michal Bozon wrote: cau, maybe int is represented internally as a signed integer you can use numpy types: import numpy ~ numpy.uint16(7978) 57557 -m. On Thu, 27 Sep 2007 00:14:49 +0200, Ladislav Andel wrote:

Re: Google and Python

2007-09-27 Thread Hendrik van Rooyen
Nick Craig-Wood od.com wrote: Hendrik van Rooyen ma.p.co.za wrote: Paul Rubin http://lid wrote: Hendrik van Rooyen m..orp.co.za writes: Ok got it - so instead of starting a thread, as is current practice, you fork a process (possibly on another machine) and hand over the

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-27 Thread Antoon Pardon
On 2007-09-26, Mark Summerfield [EMAIL PROTECTED] wrote: On 26 Sep, 13:22, Antoon Pardon [EMAIL PROTECTED] wrote: Well you should decide what you want. In a previous exchange one of the things that was wanted was that you could already seed a tree by using key word arguments so that you could

Re: strange behavious of the logging module?

2007-09-27 Thread Christian Meesters
Thanks Peter and Vinay, I finally understood. And indeed, removing the pyc-file in questions solves the problem - at least temporarily. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I get the value out of a DOM Element

2007-09-27 Thread Stefan Behnel
kj7ny wrote: I have been able to get xml.dom.minidom.parse('somefile.xml') and then dom.getElementsByTagName('LLobjectID') to work to the point where I get something like: [DOM Element: LLobjectID at 0x13cba08] which I can get down to DOM Element: LLobjectID at 0x13cba08 but then I can't find

Re: Using closures and partial functions to eliminate redundant code

2007-09-27 Thread Bruno Desthuilliers
Matthew Wilson a écrit : I wrote some code to create a user and update a user on a remote box by sending emails to that remote box. When I was done, I realized that my create_user function and my update_user function were effectively identical except for different docstrings and a single

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-27 Thread Duncan Booth
Paul Hankin [EMAIL PROTECTED] wrote: A key which is in dict must be either in __keycache or in __addkeys, but never in both. Yes, I'm sorry: you're right. But there's a different bug: if you delete a key that's not in the dict, you'll add it to the deleted list before the exception for

Re: Google and Python

2007-09-27 Thread David
It is trivial to pass a socket to a new thread or a forked child - you don't need this mechanism for that. It doesn't work on different machines though - it has to be on the same machine. 8 - nice explanation by Nick--- How does a very large volume site

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-27 Thread Bryan Olson
Mark Summerfield wrote: The sorteddict API that has emerged so far is (1) apart from the constructor, everything is identical to dict, (2) the constructor takes the same args as sorted(), so if you want to seed with a dict or with keywords you write sorteddict(dict(a=1,b=2), ...), (or you

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-27 Thread Mark Summerfield
On 27 Sep, 08:32, Duncan Booth [EMAIL PROTECTED] wrote: Paul Hankin [EMAIL PROTECTED] wrote: A key which is in dict must be either in __keycache or in __addkeys, but never in both. Yes, I'm sorry: you're right. But there's a different bug: if you delete a key that's not in the dict,

Re: sorteddict [was a PEP proposal, but isn't anymore!]

2007-09-27 Thread Mark Summerfield
On 26 Sep, 18:59, Raymond Hettinger [EMAIL PROTECTED] wrote: [Mark Summerfield] Below is a PEP proposal for a sorteddict. It arises out of a discussion on this list that began a few weeks ago with the subject of An ordered dictionary for the Python library? It is worth remembering that

Re: How do I get the value out of a DOM Element

2007-09-27 Thread Paul Boddie
On 27 Sep, 07:50, kj7ny [EMAIL PROTECTED] wrote: I have been able to get xml.dom.minidom.parse('somefile.xml') and then dom.getElementsByTagName('LLobjectID') to work to the point where I get something like: [DOM Element: LLobjectID at 0x13cba08] which I can get down to DOM Element: LLobjectID

Re: Using closures and partial functions to eliminate redundant code

2007-09-27 Thread Paul Hankin
On Sep 27, 3:01 am, Matthew Wilson [EMAIL PROTECTED] wrote: I wrote some code to create a user and update a user on a remote box by sending emails to that remote box. When I was done, I realized that my create_user function and my update_user function were effectively identical except for

Re: Tkinter / Tk 8.5

2007-09-27 Thread Eric Brunel
On Thu, 27 Sep 2007 04:41:48 +0200, Scott David Daniels [EMAIL PROTECTED] wrote: Michal Bozon wrote: Today has been released a first beta of Tk 8.5, including a Ttk (tile) style engine, which makes possible the native look of widgets on MS platform, without having to install any extension.

Load balancing and passing sockets; was: Re: Google and Python

2007-09-27 Thread Bryan Olson
Hendrik van Rooyen wrote: Nick Craig-Wood wrote: [about passing sockets between processes] It is trivial to pass a socket to a new thread or a forked child - you don't need this mechanism for that. It doesn't work on different machines though - it has to be on the same machine. How does a

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-27 Thread Duncan Booth
Mark Summerfield [EMAIL PROTECTED] wrote: As for the license, while it is on PyPI, I'll leave it as GPL v 3. If it was wanted for the standard library (and I can't see that ever happening), I will happily change it to the one that is preferred for Python modules. Ok, your choice, just be

No backend servers available using httplib

2007-09-27 Thread Henrik Lied
Hi there! I'm using a recipe found on ASPN [1] to upload some data to an external server. The request fails, and all I get in response is No backend servers available. So I'm wondering: Is this a known exception-message in httplib, or could it be an error in the requested external resource?

Re: Using closures and partial functions to eliminate redundant code

2007-09-27 Thread Bjoern Schliessmann
Matthew Wilson wrote: I'm interested to hear how other people deal with really similar code. The similarity just bugs me. However, I wonder if using stuff like closures or partial function application is needlessly showy. ACK -- but not because it's showy, but because it may be more

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-27 Thread Paul Rubin
Duncan Booth [EMAIL PROTECTED] writes: Ok, your choice, just be aware that by using such a restrictive license you will dissuade a lot of people from using your code. You've prevented your module being used in any existing projects with Python license, GPL v2, or probably any license other

URGENT REQUIREMENT FOR PYTHON DEVELOPERS

2007-09-27 Thread kishore
HI THIS IS KRISHNA KISHORE FROM MindRiver. We have an Urgent requirement for Python Developers who have 5-7 YRS of EXP. SKILLS :PYTHON AND C/C++ WORK LOCATION: BANGALROE PLEASE REVERT US WITH YOUR UPDATED PROFILES. Thanks Regards, Kishore Seethanraju |Senior

Re: No backend servers available using httplib

2007-09-27 Thread Bruno Desthuilliers
Henrik Lied a écrit : Hi there! I'm using a recipe found on ASPN [1] to upload some data to an external server. The request fails, and all I get in response is No backend servers available. So I'm wondering: Is this a known exception-message in httplib, If it was, you should have a

Re: comparing elements of a list with a string

2007-09-27 Thread Shriphani
Hello, Would that mean that if I wanted to append all the (date, time) tuples to a list, I should do something like: for file in list_of_backup_files: some_list.append(file) By the way I did this: def listAllbackups(filename): list_of_backups =

Re: Simple threading example freezes IDLE?

2007-09-27 Thread 7stud
On Sep 26, 5:01 pm, Sergio Correia [EMAIL PROTECTED] wrote: I'm using IDLE 1.2.1, Python 2.5.1, and Tk 8.4. Does anyone has any idea of why is this happening? Two mainloops == bad. IDLE == 1 mainloop. your program == 1 mainloop. -- http://mail.python.org/mailman/listinfo/python-list

Re: No backend servers available using httplib

2007-09-27 Thread Henrik Lied
On Sep 27, 11:56 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Henrik Lied a écrit : Hi there! I'm using a recipe found on ASPN [1] to upload some data to an external server. The request fails, and all I get in response is No backend servers available. So I'm wondering:

mod_python preprocess/filter before proxy

2007-09-27 Thread David Sánchez Martín
Hi! I've seen the message below in this python list, that seems to be unanswered. I'm trying to do the pretty same thing. There's a way to preprocess the request with a mod_python handler and then proxying it with mod_proxy? Thank you very much in advance, and sorry for trying to

ANN: RuPy 2008 Python Ruby Conference

2007-09-27 Thread Jakub P. Nowak
RuPy 2008 Python Ruby Conference Poznan, Poland April 12-13, 2008 -- Call for speakers RuPy is a Ruby and Python conference. Held for the first time in April 2007 it gathered enthusiasts from Poland and other countries. The idea behind the conference was to liven up the Ruby and Python

Re: Cross-platform time out decorator

2007-09-27 Thread Tim Golden
Joel wrote: I've been using this nice timing out decorator : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/307871 . The problem is that since it relies on sigalarm, it doesn't work under windows. Would anyone know how to do a cross-platform version? I don't think you're going to

Re: No backend servers available using httplib

2007-09-27 Thread Diez B. Roggisch
Henrik Lied wrote: On Sep 27, 11:56 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Henrik Lied a écrit : Hi there! I'm using a recipe found on ASPN [1] to upload some data to an external server. The request fails, and all I get in response is No backend servers available.

Re: URGENT REQUIREMENT FOR PYTHON DEVELOPERS

2007-09-27 Thread Steve Holden
Krishna: You might want to consider reading http://www.python.org/community/jobs/howto/ and submitting these jobs to the Job Board. It's free. regards Steve [EMAIL PROTECTED] wrote: HI THIS IS KRISHNA KISHORE FROM MindRiver. We have an Urgent requirement for Python Developers

Re: comparing elements of a list with a string

2007-09-27 Thread Steve Holden
Shriphani wrote: Hello, Would that mean that if I wanted to append all the (date, time) tuples to a list, I should do something like: for file in list_of_backup_files: some_list.append(file) That would be one way to do it (assuming you started with some_list as an empty list). But a

Re: sorteddict [was a PEP proposal, but isn't anymore!]

2007-09-27 Thread gatti
I don't see a focused discussion of computational complexity of a sorted dict; its API cannot be simpler than sorting a dictionary and it has issues and complications that have already been discussed without completely satisfactory solutions, so the only possible reason to adopt a sorted dict is

Confusion regarding constructor as default value

2007-09-27 Thread aine_canby
Why are the following different? def AddRow(self, rowName, tableRow=TableRow(ReleaseDate(), ExpiryDate())): # check to see if the row already exists, if not add it to the container if not self.dict.has_key(rowName): self.dict[rowName] =

Mysqldb stderr

2007-09-27 Thread mastro . francesco
developing a daemon (using python 2.4 and mysqldb 1.2.1_p2) we notes that mysqldb class write on stderr some warnings and error asyncronously (uhmmm it's good written? ;P ). If stderr is closed these function raise up an I/O error (obviously). We spent a lot of time to understand for now we

Launching command on windows

2007-09-27 Thread Alexandre Badez
Hy, I'm working on windows and I try to do something like: import os APP = os.path.abspath(C:\\Program Files\\Notepad++\\notepad++.exe) FILE1 = os.path.abspath(D:\\Documents and settings\\test1.py) FILE2 = os.path.abspath(D:\\Documents and settings\\test2.py) command = '%(app)s %(file1)s

Re: What is a good way of having several versions of a python module installed in parallell?

2007-09-27 Thread Neil Cerutti
On 2007-09-25, Joel Hedlund [EMAIL PROTECTED] wrote: First of all, thanks for all the input - it's appreciated. Otherwise, three words: test driven development Do you also do this for all the little stuff, the small hacks you just whip together to get a particular task done? My

Re: Cross-platform time out decorator

2007-09-27 Thread kyosohma
On Sep 26, 5:21 am, Joel [EMAIL PROTECTED] wrote: I've been using this nice timing out decorator :http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/307871. The problem is that since it relies on sigalarm, it doesn't work under windows. Would anyone know how to do a cross-platform

Re: Cross-platform time out decorator

2007-09-27 Thread Joel
On Sep 26, 12:21 pm, Joel [EMAIL PROTECTED] wrote: I've been using this nice timing out decorator :http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/307871. The problem is that since it relies on sigalarm, it doesn't work under windows. Would anyone know how to do a cross-platform

Re: Confusion regarding constructor as default value

2007-09-27 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Why are the following different? def AddRow(self, rowName, tableRow=TableRow(ReleaseDate(), ExpiryDate())): # check to see if the row already exists, if not add it to the container if not self.dict.has_key(rowName): self.dict[rowName] = tableRow def

Re: Confusion regarding constructor as default value

2007-09-27 Thread aine_canby
On 27 Sep, 15:03, [EMAIL PROTECTED] wrote: Why are the following different? def AddRow(self, rowName, tableRow=TableRow(ReleaseDate(), ExpiryDate())): # check to see if the row already exists, if not add it to the container if not self.dict.has_key(rowName):

Re: Confusion regarding constructor as default value

2007-09-27 Thread aine_canby
On 27 Sep, 15:34, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Why are the following different? def AddRow(self, rowName, tableRow=TableRow(ReleaseDate(), ExpiryDate())): # check to see if the row already exists, if not add it to the container if not

Translating Event.time from pyhook

2007-09-27 Thread randy . tucker7
I use pyhook to monitor user usage of keyboard and mouse. According to pyhook specs, event.time hold the number of seconds since the epoch. However, when I use the example source code I get numbers like 358054093, which translates to 07 May 1981.. Can anyone explain to me what am I doing wrong?

PyObject_CallObject: difference between functions and class methods

2007-09-27 Thread mauro
Hi all! I am trying to call within a C extension a Python function provided as an argument by the user with: PyObject_Call(). The C extension should work also if the user supplies a class method, but in this case I am getting an error. Do I need to explicitly pass 'self' as an argument to

Emailing the attachment created with the Quick Screenshots Script (Python + PIL)

2007-09-27 Thread Mark Bratcher
The Quick Screenshots Script (Python + PIL) is a dream come true, and yet so simple to use reliably. Does anyone have a suggestion or know how to include in the script, the ability to email the attachment? This would make the dream perfect! Thanks! Mark Bratcher Consolidated Citrus, LP

making run time changes..

2007-09-27 Thread Piyush Jain
Hi, I am new(almost) to python. I wish to making a server in which I can make changes at run time. For example , add a method to a class/attribute to object etc. by sending it messages. Can anyone help me with what features to look into and how to go about it. Are there any similar projects?

Re: Launching command on windows

2007-09-27 Thread mauro
On 27 Set, 15:17, Alexandre Badez [EMAIL PROTECTED] wrote: Hy, I'm working on windows and I try to do something like: import os APP = os.path.abspath(C:\\Program Files\\Notepad++\\notepad++.exe) FILE1 = os.path.abspath(D:\\Documents and settings\\test1.py) FILE2 =

Re: Launching command on windows

2007-09-27 Thread kyosohma
On Sep 27, 8:17 am, Alexandre Badez [EMAIL PROTECTED] wrote: Hy, I'm working on windows and I try to do something like: import os APP = os.path.abspath(C:\\Program Files\\Notepad++\\notepad++.exe) FILE1 = os.path.abspath(D:\\Documents and settings\\test1.py) FILE2 =

Re: Tkinter / Tk 8.5

2007-09-27 Thread Kevin Walzer
Michal Bozon wrote: Today has been released a first beta of Tk 8.5, including a Ttk (tile) style engine, which makes possible the native look of widgets on MS platform, without having to install any extension. http://wiki.tcl.tk/11075

Re: Tkinter / Tk 8.5

2007-09-27 Thread Kevin Walzer
Eric Brunel wrote: On Thu, 27 Sep 2007 04:41:48 +0200, Scott David Daniels [EMAIL PROTECTED] wrote: Michal Bozon wrote: Today has been released a first beta of Tk 8.5, including a Ttk (tile) style engine, which makes possible the native look of widgets on MS platform, without having to

Re: PyObject_CallObject: difference between functions and class methods

2007-09-27 Thread Hrvoje Niksic
[ Note that there is now a mailing list dedicated to the C API: http://mail.python.org/mailman/listinfo/capi-sig ] mauro [EMAIL PROTECTED] writes: I am trying to call within a C extension a Python function provided as an argument by the user with: PyObject_Call(). The C extension should work

Re: setuptools without unexpected downloads

2007-09-27 Thread kyosohma
On Sep 26, 5:52 pm, Steve Holden [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On Sep 26, 8:30 am, Steve Holden [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: Paul Boddie wrote: P.S. Of course, the package maintainer problem manifests itself most prominently on Windows where you

Re: Confusion regarding constructor as default value

2007-09-27 Thread Steve Holden
[EMAIL PROTECTED] wrote: On 27 Sep, 15:03, [EMAIL PROTECTED] wrote: Why are the following different? def AddRow(self, rowName, tableRow=TableRow(ReleaseDate(), ExpiryDate())): # check to see if the row already exists, if not add it to the container if not

Getting web page throught a proxy (squid)

2007-09-27 Thread Vincent Sabard
salut jean-paul, comment vas-tu ? vincent sabard.-- http://mail.python.org/mailman/listinfo/python-list

Re: Cross-platform time out decorator

2007-09-27 Thread Hrvoje Niksic
Joel [EMAIL PROTECTED] writes: I found the solution : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440569 describes a solution based on threads. I tested it and it works perfectly. Note that, unlike the original alarm code, it doesn't really interrupt the timed-out method, it just

os.removedirs - How to force this delete?

2007-09-27 Thread cstewart913
I've been searching to find a way to force this delete to work even if the directory isn't empty. I've had no luck thus far. Anyone know what that would be? -- http://mail.python.org/mailman/listinfo/python-list

Re: Google and Python

2007-09-27 Thread asdfjehqwjerhqjwljekrh
On Sep 24, 10:40 am, [EMAIL PROTECTED] (Alex Martelli) wrote: Good motto. So is most of Google's code base now in Python? About what is the ratio of Python code to C++ code? Of course lines of code is kine of a bogus measure. Of all those cycles Google executes, about what portion are

Re: How do I get the value out of a DOM Element

2007-09-27 Thread kj7ny
Forgot to mention I'm using Python 2.4.3. -- http://mail.python.org/mailman/listinfo/python-list

Pb with an AttributeError

2007-09-27 Thread Eric BOUVIER
Hello, First, sorry for my english. I've just been assigned a project written in Python which contains bug(s). I've never programmed in Python, but I've read the code and understood basically what the different source codes do. I've traced the code and found where the problem is but I don't

Re: Cross-platform time out decorator

2007-09-27 Thread Joel
On Sep 27, 4:36 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote: Joel [EMAIL PROTECTED] writes: I found the solution : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440569 describes a solution based on threads. I tested it and it works perfectly. Note that, unlike the original alarm

Re: making run time changes..

2007-09-27 Thread Steve Holden
Piyush Jain wrote: Hi, I am new(almost) to python. I wish to making a server in which I can make changes at run time. For example , add a method to a class/attribute to object etc. by sending it messages. Can anyone help me with what features to look into and how to go about it. Are

Traveling Europe

2007-09-27 Thread freeaircon
World's most popular traveling destinations http://world-traveling-destinations.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: setuptools without unexpected downloads

2007-09-27 Thread Istvan Albert
On Sep 26, 2:09 am, Ben Finney [EMAIL PROTECTED] wrote: behaviour with a specific invocation of 'setup.py'. But how can I disallow this from within the 'setup.py' program, so my users don't have to be aware of this unexpected default behaviour? I don't have the answer for this, but I can tell

Re: Launching command on windows

2007-09-27 Thread Alexandre Badez
On Sep 27, 4:20 pm, [EMAIL PROTECTED] wrote: I got it to work using subprocess.Popen Not sure why it doesn't work with os.system though. Mike Thanks Mike and Mauro, Mauro, your solution do not seems to work (or I made a mistake..) Mike your solution work great, thanks. But, I steel think

Re: setuptools without unexpected downloads

2007-09-27 Thread Steve Holden
[EMAIL PROTECTED] wrote: On Sep 26, 5:52 pm, Steve Holden [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On Sep 26, 8:30 am, Steve Holden [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: Paul Boddie wrote: P.S. Of course, the package maintainer problem manifests itself most prominently on

Re: setuptools without unexpected downloads

2007-09-27 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: What would it entail to do this? Using py2exe + some installer (like Inno Setup) to create an installer that basically copies/installs the files into the site-packages folder or wherever the user chooses? if the setup.py file is properly built, python setup.py

Re: Cross-platform time out decorator

2007-09-27 Thread Steve Holden
Joel wrote: On Sep 27, 4:36 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote: Joel [EMAIL PROTECTED] writes: I found the solution : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440569 describes a solution based on threads. I tested it and it works perfectly. Note that, unlike the

Re: Cross-platform time out decorator

2007-09-27 Thread Tim Golden
Steve Holden wrote: Joel wrote: On Sep 27, 4:36 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote: Joel [EMAIL PROTECTED] writes: I found the solution : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440569 describes a solution based on threads. I tested it and it works perfectly. Note

Re: os.removedirs - How to force this delete?

2007-09-27 Thread Marc Christiansen
[EMAIL PROTECTED] wrote: I've been searching to find a way to force this delete to work even if the directory isn't empty. I've had no luck thus far. Anyone know what that would be? Answering your immediate question: you can't force os.removedirs to delete non-empty dirs. But

Re: Pb with an AttributeError

2007-09-27 Thread Nathan Harmston
Hi, I m not sure what your trying to do, but this is where your problem is: string1 is not a string it is actually a dict because of your eval. When you call string1[param] inside the string.split() it is returning a dictionary and not a string 'param': {'key': 'SP136=', 'value': ['SD:0 ']}

Re: Pb with an AttributeError

2007-09-27 Thread Nathan Harmston
Did I just help someone with their homework? Hope not :S On 27/09/2007, Nathan Harmston [EMAIL PROTECTED] wrote: Hi, I m not sure what your trying to do, but this is where your problem is: string1 is not a string it is actually a dict because of your eval. When you call string1[param]

Implement file download using python

2007-09-27 Thread skulka3
Hello, I want to implement file downloads inside an authenticated web page, such that when a user clicks a link, the server side python code connects to a ftp server, downloads a relevant file and then streams the file to the browser for the user to open it with the appropriate application. In

True of False

2007-09-27 Thread koutoo
I tried writing a true and false If statement and didn't get anything? I read some previous posts, but I must be missing something. I just tried something easy: a = [a, b, c, d, e, f] if c in a == True: Print Yes When I run this, it runs, but nothing prints. What am I doing wrong?

ValueError: too many values to unpack,

2007-09-27 Thread Shawn Minisall
I am trying to read a few lines of a file with multiple values, the rest are single and are reading in fine. With the multiple value lines, python says this ValueError: too many values to unpack I've googled it and it says that happens when you have too few or too many strings that don't

RE: Pb with an AttributeError

2007-09-27 Thread Eric BOUVIER
Thanks, I find the type function and effectively the type is a dict. I didn't know this type before ! :-} The program normally try to get the value of SP between the in the string1. Here, it's 136. The string1 is normally longer and had a lot of value but only one with value=. I find

Re: Implement file download using python

2007-09-27 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Hello, I want to implement file downloads inside an authenticated web page, such that when a user clicks a link, the server side python code connects to a ftp server, downloads a relevant file and then streams the file to the browser for the user to open it with

RE: making run time changes..

2007-09-27 Thread Piyush Jain
Hi, It seems that pyro provides remote access to object acting as middleware. My requirement is a bit different. It need not be remote. But I need to make run time changes at the running program, say changing it's functionality. More in lines of dynamic modules, but triggered by messages from

Re: ValueError: too many values to unpack,

2007-09-27 Thread Marc 'BlackJack' Rintsch
On Thu, 27 Sep 2007 12:36:58 -0400, Shawn Minisall wrote: With the multiple value lines, python says this ValueError: too many values to unpack I've googled it and it says that happens when you have too few or too many strings that don't match with the variables in number your trying to

ValueError: too many values to unpack

2007-09-27 Thread Shawn Minisall
I am trying to read a few lines of a file with multiple values, the rest are single and are reading in fine. With the multiple value lines, python says this ValueError: too many values to unpack I've googled it and it says that happens when you have too few or too many strings that don't

Re: True of False

2007-09-27 Thread Simon Brunning
On 9/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I tried writing a true and false If statement and didn't get anything? I read some previous posts, but I must be missing something. I just tried something easy: a = [a, b, c, d, e, f] if c in a == True: Print Yes When I run

Re: True of False

2007-09-27 Thread skulka3
On Sep 27, 11:33 am, [EMAIL PROTECTED] wrote: I tried writing a true and false If statement and didn't get anything? I read some previous posts, but I must be missing something. I just tried something easy: a = [a, b, c, d, e, f] if c in a == True: Print Yes When I run this, it

Re: True of False

2007-09-27 Thread Marc 'BlackJack' Rintsch
On Thu, 27 Sep 2007 09:33:34 -0700, koutoo wrote: I tried writing a true and false If statement and didn't get anything? I read some previous posts, but I must be missing something. I just tried something easy: a = [a, b, c, d, e, f] if c in a == True: Print Yes When I run

Re: True of False

2007-09-27 Thread Shriphani
[EMAIL PROTECTED] wrote: I tried writing a true and false If statement and didn't get anything? I read some previous posts, but I must be missing something. I just tried something easy: a = [a, b, c, d, e, f] if c in a == True: Print Yes When I run this, it runs, but nothing

Re: comparing elements of a list with a string

2007-09-27 Thread Marc 'BlackJack' Rintsch
On Thu, 27 Sep 2007 08:16:59 -0400, Steve Holden wrote: Shriphani wrote: Hello, Would that mean that if I wanted to append all the (date, time) tuples to a list, I should do something like: for file in list_of_backup_files: some_list.append(file) That would be one way to do it

Re: Implement file download using python

2007-09-27 Thread skulka3
On Sep 27, 11:39 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hello, I want to implement file downloads inside an authenticated web page, such that when a user clicks a link, the server side python code connects to a ftp server, downloads a relevant file and

Re: True of False

2007-09-27 Thread Casey
On Sep 27, 12:48 pm, Simon Brunning [EMAIL PROTECTED] wrote: On 9/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I tried writing a true and false If statement and didn't get anything? I read some previous posts, but I must be missing something. I just tried something easy: a = [a,

Re: True of False

2007-09-27 Thread Duncan Booth
Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: In [268]: 'c' in a == True Out[268]: False In [269]: ('c' in a) == True Out[269]: True In [270]: 'c' in (a == True) --- type 'exceptions.TypeError'

Re: True of False

2007-09-27 Thread Steve Holden
[EMAIL PROTECTED] wrote: I tried writing a true and false If statement and didn't get anything? I read some previous posts, but I must be missing something. I just tried something easy: a = [a, b, c, d, e, f] if c in a == True: Print Yes When I run this, it runs, but nothing

Re: True of False

2007-09-27 Thread Richard Thomas
On 27/09/2007, Casey [EMAIL PROTECTED] wrote: On Sep 27, 12:48 pm, Simon Brunning [EMAIL PROTECTED] wrote: On 9/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I tried writing a true and false If statement and didn't get anything? I read some previous posts, but I must be missing

Re: True of False

2007-09-27 Thread Casey
On Sep 27, 1:12 pm, Richard Thomas [EMAIL PROTECTED] wrote: On 27/09/2007, Casey [EMAIL PROTECTED] wrote: On Sep 27, 12:48 pm, Simon Brunning [EMAIL PROTECTED] wrote: On 9/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I tried writing a true and false If statement and didn't get

Re: True of False

2007-09-27 Thread Carsten Haese
On Thu, 2007-09-27 at 16:47 +, Marc 'BlackJack' Rintsch wrote: On Thu, 27 Sep 2007 09:33:34 -0700, koutoo wrote: I tried writing a true and false If statement and didn't get anything? I read some previous posts, but I must be missing something. I just tried something easy: a =

getopt with negative numbers?

2007-09-27 Thread Casey
Is there an easy way to use getopt and still allow negative numbers as args? I can easily write a workaround (pre-process the tail end of the arguments, stripping off any non-options including negative numbers into a separate sequence and ignore the (now empty) args list returned by getopt, but

Re: True of False

2007-09-27 Thread Erik Jones
On Sep 27, 2007, at 11:47 AM, Marc 'BlackJack' Rintsch wrote: On Thu, 27 Sep 2007 09:33:34 -0700, koutoo wrote: I tried writing a true and false If statement and didn't get anything? I read some previous posts, but I must be missing something. I just tried something easy: a = [a, b, c,

Re: True of False

2007-09-27 Thread Gary Herron
Richard Thomas wrote: On 27/09/2007, Casey [EMAIL PROTECTED] wrote: On Sep 27, 12:48 pm, Simon Brunning [EMAIL PROTECTED] wrote: On 9/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I tried writing a true and false If statement and didn't get anything? I read some

Re: getopt with negative numbers?

2007-09-27 Thread Peter Otten
Casey wrote: Is there an easy way to use getopt and still allow negative numbers as args? I can easily write a workaround (pre-process the tail end of the arguments, stripping off any non-options including negative numbers into a separate sequence and ignore the (now empty) args list

Re: getopt with negative numbers?

2007-09-27 Thread Casey
On Sep 27, 1:34 pm, Peter Otten [EMAIL PROTECTED] wrote: optparse can handle options with a negative int value; -- can be used to signal that no more options will follow: Thanks, Peter. getopt supports the POSIX -- end of options indicator as well, but that seems a little less elegant than

Re: How do I get the value out of a DOM Element

2007-09-27 Thread Stefan Behnel
kj7ny wrote: Forgot to mention I'm using Python 2.4.3. You can install both lxml and ET on Python 2.4 (and 2.3). It's just that ET went into the stdlib from 2.5 on. Stefan -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >