Re: Headers for Form Submision, and also HTTPrequests

2006-07-10 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: > action="http://login.myspace.com/index.cfm?fuseaction=login.process"; > method="post" name="theForm" id="theForm"> > > > What happens when you add the form param "submit" with value "Login" to the request you're doing? Perhaps the page needs this third parameter

Re: Error type for shelve.open()

2006-07-10 Thread aomighty
I reported the bug to python.org and apparently it has already been fixed in the latest SVN build :). [EMAIL PROTECTED] wrote: > Yes, the problem was that I hadn't imported anydbm.error... it's > working now. > > As for the AttributeError at the end, I talked to someone else, and he > looked at the

Re: What is a type error?

2006-07-10 Thread Chris Smith
I <[EMAIL PROTECTED]> wrote: > Incidentally, I'm not saying that such a feature would be a good idea. > It generally isn't provided in languages specifically because it gets to > be a big pain to maintain all of the type specifications for this kind > of stuff. There are other good reasons, to

Re: type comparison and wxpython

2006-07-10 Thread Simon Forman
borris wrote: > ive been trying to do a test for type with wxpython objects > > like > > passing in a wx.TextCtrl into > > def XXX(obj) > if type(obj) is type(self.Button) > > I have to make an object self.Button to get its type. > as I tried is type("wx.Button") which didnt work. type("wx.Butt

Re: Detecting 64bit vs. 32bit Linux

2006-07-10 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, dwelch91 <[EMAIL PROTECTED]> wrote: >I need to detect whether the operating system I am running on (not the >Python version) is 64bit or 32bit. One requirement is that I need to >include support for non-Intel/AMD architectures. The standard C way would be to che

Re: Error type for shelve.open()

2006-07-10 Thread Simon Forman
[EMAIL PROTECTED] wrote: > I reported the bug to python.org and apparently it has already been > fixed in the latest SVN build :). Awesome! Open Source at work! :D -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-10 Thread Marshall
Chris Smith wrote: > > But this starts to look bad, because we used to have this nice property > called encapsulation. To work around that, we'd need to make one of a > few choices: (a) give up encapsulation, which isn't too happy; (b) rely > on type inference for this kind of stuff, and consider

Re: Nested scopes, and augmented assignment

2006-07-10 Thread Antoon Pardon
This is probably my last response to you in this thread. My impression is that for the moment nothing productive can come from this exchange. I have the feeling that you are not reading so much with the interntion of understanding what I want to say, but with the intention of confirming your suspit

Re: What is a type error?

2006-07-10 Thread Joachim Durchholz
Chris Smith schrieb: > For example, I wrote that example using variables of type int. If we > were to suppose that we were actually working with variables of type > Person, then things get a little more complicated. We would need a few > (infinite classes of) derived subtypes of Person that fu

Re: What is a type error?

2006-07-10 Thread Chris Smith
Marshall <[EMAIL PROTECTED]> wrote: > Chris Smith wrote: > > > > But this starts to look bad, because we used to have this nice property > > called encapsulation. To work around that, we'd need to make one of a > > few choices: (a) give up encapsulation, which isn't too happy; (b) rely > > on type

Re: concatenate Numeric

2006-07-10 Thread Sheldon
Robert Kern wrote: > Sheldon wrote: > > Hi, > > > > I am trying to build a large array using concatenate function in > > python. > > So as I loop over the number of arrays, of which there are 12 (4 down > > and 3 across), I create 3 long arrays by concatenating them at the > > bottom and then conc

Re: What is a type error?

2006-07-10 Thread Joachim Durchholz
Chris Smith schrieb: > I think > there's something fundamentally important about information hiding that > can't be given up. Indeed. Without information hiding, with N entities, you have O(N^2) possible interactions between them. This quickly outgrows the human capacity for managing the inter

Re: What is a type error?

2006-07-10 Thread Pascal Bourguignon
Chris Smith <[EMAIL PROTECTED]> writes: > But the point here is that I don't WANT the compiler to be able to infer > that, because it's a transient consequence of this year's tax code. I > want the compiler to make sure my code works no matter what the tax code > is. The last thing I need to

Re: language design question

2006-07-10 Thread Bruno Desthuilliers
Alex Martelli wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >... > >>>This would allow things like: >>>key = '',join( list(word.lower().strip()).sort() ) >> >>key = ''.join(list(sorted(word.lower().strip())) > > > No need to make yet another list here (also, I think eac

Re: concatenate Numeric

2006-07-10 Thread Robert Kern
Sheldon wrote: > Thanks again for showing me this. I have been trying to read up on > reduce() as I have never used it before. I would like to know what it > does. So far my search has found nothing that I can grasp. The > reference library notes are estoteric at best. > Can you enlighten me on thi

Re: language design question

2006-07-10 Thread Bruno Desthuilliers
Steven Bethard wrote: > Terry Reedy wrote: > >> "Gregory Guthrie" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> >>> - why is len() not a member function of strings? Instead one says >>> len(w). >> >> >> Consider >> > map(len, ('abc', (1,2,3), [1,2], {1:2})) >> >> [3, 3, 2

Re: language design question

2006-07-10 Thread Paul Rubin
Steven Bethard <[EMAIL PROTECTED]> writes: > If len() were a method of string objects, you could try using the > unbound method and writing this as:: > > >>> sorted(['aaa', 'bb', 'c'], key=str.len) > ['c', 'bb', 'aaa'] > > But then your code would break on lists that weren't strings. s

Re: language design question

2006-07-10 Thread Bruno Desthuilliers
guthrie wrote: > Good point, thanks. > > But if (as I proposed..!) the user interface is better if presented as a > method. one could porovide convenience methods which would then > interface to these underlying library functions; yes? > Actually, and AFAIK, len(obj) = lambda obj : obj.__len__().

RE: [wwwsearch-general] ClientForm request re ParseErrors

2006-07-10 Thread John J Lee
On Sun, 9 Jul 2006, bruce wrote: [...] > sgmllib.SGMLParseError: expected name token at ' > > partial html > --- > > > Action="/servlets/iclientservlet/a2k_prd/?ICType=Panel&Menu=SA_LEARNER_SERVI > CES&Market=GBL&PanelGroupName=CLASS_SEARCH" autocomplete=off> >

Re: Running multiple versions of Python on the same host..

2006-07-10 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "Cowmix" <[EMAIL PROTECTED]> wrote: >What is the best way to run multiple version of Python on the same >system? You could use chroot. Ask if you want more details. -- http://mail.python.org/mailman/listinfo/python-list

compiling 2.3.5 on ubuntu

2006-07-10 Thread Py Py
Hi, list.I'm having a hard time trying to get a couple of tests to pass when compling Python 2.3.5 on Ubuntu Server Edition 6.06 LTS. I'm sure it's not too far removed from the desktop edition but, clearly, I need to tweak something or install some missling libs.uname -aLinux server 2.6.15-23-serve

Re: help a newbie with a IDE/book combination

2006-07-10 Thread Jack
I use PyScripter. http://www.mmm-experts.com/ I find it easy to use. It runs on Windows and it does have a good help file. <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I already have a couple of newbie books on Python itself, but would > rather get started with a nice to

Re: help a newbie with a IDE/book combination

2006-07-10 Thread jelle
I think SPE is a terrific IDE, a real pleasure to work with! Also it's very complete in terms of functionality. http://stani.be/python/spe/page_download -- http://mail.python.org/mailman/listinfo/python-list

Re: concatenate Numeric

2006-07-10 Thread Sheldon
Robert Kern skrev: > Sheldon wrote: > > Thanks again for showing me this. I have been trying to read up on > > reduce() as I have never used it before. I would like to know what it > > does. So far my search has found nothing that I can grasp. The > > reference library notes are estoteric at best

Re: language design question

2006-07-10 Thread Fredrik Lundh
"guthrie" wrote: > But if (as I proposed..!) the user interface is better if presented as a > method. one could porovide convenience methods which would then > interface to these underlying library functions; yes? but if it isn't? and why this obsession with superficial syntax details? there's

Re: Augument assignment versus regular assignment

2006-07-10 Thread Antoon Pardon
On 2006-07-09, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Frank Millman wrote: > >> So it looks as if x += [] modifies the list in place, while x = x + [] >> creates a new list. > > objects can override the += operator (by defining the __iadd__ method), > and the list type maps __iadd__ to extend

Re: Scope, type and UnboundLocalError

2006-07-10 Thread Fredrik Lundh
Paddy wrote: > I had a look Frederick but the page lead to: > http://pyref.infogami.com/subscriptions > Which again failed to mention namespace issues. it says The primary must evaluate to an object of a sequence or mapping type. and links to a page that explains what a primary is. the in

threading troubles

2006-07-10 Thread sreekant
Hi folks What am I doing wrong in the following? I just want to run fluidsynth in the background. # class MyThread(threading.Thread): def __init__(self, cmd, callback): self.__cmd = cmd self.__callback = callback threading.Th

Re: first book about python

2006-07-10 Thread Steve Holden
tac-tics wrote: > Philippe Martin wrote: > >>I don't know, if I were the genious that made up Python I would not believe >>in any bible (small b) > > > Take it to alt.religion please. > > Take it to alt.narrow-mondedness please. regards Steve -- Steve Holden +44 150 684 7255 +1 800

Re: Validating Python - need doctype HTML strict

2006-07-10 Thread Ben Sizer
PapaRandy wrote: > When I add the doctype, and other necessities to the .py page > > (i.e., "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> > http://www.w3.org/1999/xhtml""; xml:lang="en" lang="en">) > > I get an invalid script error. Bear in mind, that this isn't 'a webpage', it's

Help Needed !!! Browsing and Selecting More Than One File(Problem Solved)

2006-07-10 Thread Kilicaslan Fatih
Special Thanks to Diez B. Roggisch and Eric Brunel. Last week on Friday I solved the problems I encountered thanks to your helpful indications. I think I covered all the ambiguity in my code. Here's the code: # executing with Python from Tkinter import * from tkFileDialog import * import

Re: Web Browser Pygame Plug-in?

2006-07-10 Thread Ben Sizer
Gregory Piñero wrote: > I was just idley curious on what it would take to make a web plug-in > for Pygame. I'm picturing it working the way my browser currently > shows flash games. Is such an idea even possible? Has anyone > attempted this? I doubt you can get PyGame to work this way - at leas

Re: WANTED: logging of all file operations on Windows

2006-07-10 Thread Claudio Grondi
Tim Golden wrote: > Claudio Grondi wrote: > >> I am aware, that it is maybe the wrong group to ask this question, but >> as I would like to know the history of past file operations from >> within a Python script I see a chance, that someone in this group was >> into it already and is so kind to

Re: function that modifies a string

2006-07-10 Thread Steven D'Aprano
On Sun, 09 Jul 2006 21:31:00 -0700, placid wrote: > > greenflame wrote: >> I want to make a function that does the following. I will call it >> thefunc for short. >> >> >>> s = "Char" >> >>> thefunc(s) >> >>> s >> '||Char>>' >> >> I tried the following >> >> def thefunc(s): >> s = "||" + s +

Re: WANTED: logging of all file operations on Windows

2006-07-10 Thread Tim Golden
Claudio Grondi wrote: > Here a small update to the code at > http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html#use_readdirectorychanges > : > > ACTIONS = { >1 : "Created", >2 : "Deleted", >3 : "Updated", >4 : "Renamed from something" >5 : "Renamed to

Re: WANTED: logging of all file operations on Windows

2006-07-10 Thread Tim Golden
[Tim Golden] >> On the offchance that you haven't seen it, you might >> look at this: >> >> http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html#use_readdirectorychanges >> [Claudio Grondi] > It seems, that it will be necessary to use some logic based on the > sequence

Re: help a newbie with a IDE/book combination

2006-07-10 Thread kilnhead
[EMAIL PROTECTED] wrote: > Hi, > > I already have a couple of newbie books on Python itself, but would > rather get started with a nice to use IDE and I am therefore looking > for a good IDE to learn Python. On my computer I have installed eric > (http://ericide.python-hosting.com/) but it lacks

Re: help a newbie with a IDE/book combination

2006-07-10 Thread kilnhead
[EMAIL PROTECTED] wrote: > Hi, > > I already have a couple of newbie books on Python itself, but would > rather get started with a nice to use IDE and I am therefore looking > for a good IDE to learn Python. On my computer I have installed eric > (http://ericide.python-hosting.com/) but it lacks

Re: language design question

2006-07-10 Thread Ant
>- why is len() not a member function of strings? Instead one says len(w). Coming from a Java background, I also thought this a weird setup. However IMHO there is another good reason to have len(obj) as we do in Python: it helps to enforce some sort of uniformity across code. If I want to fi

Re: pyXLWriter - grid lines and if formula

2006-07-10 Thread Luis P. Mendes
Waldemar Osuch escreveu: > Luis P. Mendes wrote: >> Gregory Piñero escreveu: >>> On 7/7/06, Luis P. Mendes <[EMAIL PROTECTED]> wrote: Hi, I know that pyExelerator is the supported project now, but I can't use it because I'd need it to generate files from a web platform. Since I

Need help in xml

2006-07-10 Thread Kirt
i have two xml documemts of type test 2006-12-12 12:12:12 /home/ test2 12:12:12 /home/test test3 12:12:12 i have to compare 2 similar xml document and get the add, changed and deleted files.and write it into acd.xml file. can u help me with

Re: xml aggregator

2006-07-10 Thread kepioo
thanks a lot for the code. It was not working the first time (do not recognize item and existing_time --> i changed item by r[-1] and existing_time by existing_equip). however, it is not producing the result i expected, as in it doesn't group by same category the elements, it creates a new block

Accessors in Python (getters and setters)

2006-07-10 Thread mystilleef
Hello, What is the Pythonic way of implementing getters and setters. I've heard people say the use of accessors is not Pythonic. But why? And what is the alternative? I refrain from using them because they smell "Javaish." But now my code base is expanding and I'm beginning to appreciate the wisdo

Re: Accessors in Python (getters and setters)

2006-07-10 Thread Lawrence Oluyede
mystilleef <[EMAIL PROTECTED]> wrote: > What is the Pythonic way of implementing getters and setters. Using public members and turning them into properties when needed > I've > heard > people say the use of accessors is not Pythonic. But why? Because there's no need to have them everywhere >

Re: Augument assignment versus regular assignment

2006-07-10 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, Antoon Pardon <[EMAIL PROTECTED]> wrote: >On 2006-07-09, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> Frank Millman wrote: >> >>> So it looks as if x += [] modifies the list in place, while x = x + [] >>> creates a new list. >> >> objects can override the += operato

Re: Accessors in Python (getters and setters)

2006-07-10 Thread Diez B. Roggisch
mystilleef wrote: > Hello, > > What is the Pythonic way of implementing getters and setters. I've > heard > people say the use of accessors is not Pythonic. But why? And what is > the alternative? I refrain from using them because they smell > "Javaish." > But now my code base is expanding and I'

Re: threading troubles

2006-07-10 Thread Jean-Paul Calderone
On Mon, 10 Jul 2006 11:29:37 +, sreekant <[EMAIL PROTECTED]> wrote: >Hi folks > >What am I doing wrong in the following? I just want to run fluidsynth in >the background. ># >class MyThread(threading.Thread): > def __init__(self, cmd, callback): >

Re: first book about python

2006-07-10 Thread gregarican
Learning Python, Perl, or Ruby would help you create admin scripts that would save you lots of manual work. For me automated log file alerting, SQL query parsing, SQL table updates, Internet file uploading/downloading, etc. has been a huge plus. Perl is likely the most widely used in terms of exist

Looking for a HTML like rendering library (wishlist)

2006-07-10 Thread Laszlo Nagy
Hello, I'm looking for a library that can do the following: * Parse a simple structured text file (XML or HTML etc.) * Render its output to an image * I would like to give the maximum width of the image (but not the minimum) * I would like to use my custom TrueType fonts,

std in and stdout

2006-07-10 Thread Juergen Huber
hello, i have a question! how would i fix the following problem: now i have an input file with a fix name and an output file! i have this two files hardcoded written in the sourcecode of this function! in the future i will start this script with the command line. the syntax should be look like

Re: std in and stdout

2006-07-10 Thread Laszlo Nagy
Juergen Huber írta: > hello, > > i have a question! > > how would i fix the following problem: > > now i have an input file with a fix name and an output file! > i have this two files hardcoded written in the sourcecode of this function! > > in the future i will start this script with the command l

To compile the VideoCapture module

2006-07-10 Thread J�r�me Le Bougeant
Hello (and sorry for my English), I downloaded the VideoCapture module on the http://videocapture.sourceforge.net/ site. I tested it with a webcam and that functions. Now I want to compile his file .cpp (vidcap.cpp). Thereafter, the idea is to be able to modify the code to include my own mod

Re: Accessors in Python (getters and setters)

2006-07-10 Thread mystilleef
I decided to change the name of an attribute. Problem is I've used the attribute in several places spanning thousands of lines of code. If I had encapsulated the attribute via an accessor, I wouldn't need to do an unreliable and tedious search and replace accross several source code files to achiev

RE: Detecting 64bit vs. 32bit Linux

2006-07-10 Thread Michael Yanowitz
The one thing I observed (just an observation) is that: a) on 32-bit machines: sizeof(int) = 32 sizeof(long) = 32 b) on 64-bit machines: sizeof(int) = 32 sizeof(long) = 64 This in C and Python. Thanks in advance: Michael Yanowitz -Original Message- From: [EMAIL PR

Re: converting file formats to txt

2006-07-10 Thread Gaurav Agarwal
tks this ws really helpful, i used catdoc, catppt, xls2csv, pdftotext from xdf and ps2txt from ghostview!.. BJörn Lindqvist wrote: > On 4 Jul 2006 08:38:47 -0700, Gaurav Agarwal > <[EMAIL PROTECTED]> wrote: > > Thanks Steven, Actually i wanted a do text processing for my office > > where I can vie

Re: Accessors in Python (getters and setters)

2006-07-10 Thread Ant
mystilleef wrote: > I decided to change the name of an attribute. Problem is I've used the > attribute in several places spanning thousands of lines of code. If I > had encapsulated the attribute via an accessor, I wouldn't need to do > an unreliable and tedious search and replace accross several

mod_python fails to load under wamp

2006-07-10 Thread Gaurav Agarwal
Hi, Am using WAMP5 and python 2.4.3. I tried to install mod_python 3.2.5 for python2.4. When i tried starting wamp, Firstly there was no error message in the apache error log. I saw error message in windows event viewer : "The Apache service named Apache.exe reported the following error: >>> Synt

Re: Detecting 64bit vs. 32bit Linux

2006-07-10 Thread Robin Becker
Michael Yanowitz wrote: .. > >> I need to detect whether the operating system I am running on (not the >> Python version) is 64bit or 32bit. One requirement is that I need to >> include support for non-Intel/AMD architectures. > > The standard C way would be to check sizeof(void *). so on t

Re: xml aggregator

2006-07-10 Thread Gerard Flanagan
> Gerard Flanagan wrote: > > Gerard Flanagan wrote: > > > kepioo wrote: > > > > Hi all, > > > > > > > > I am trying to write an xml aggregator, but so far, i've been failing > > > > miserably. > > > > > > > > what i want to do : > > > > > > > > i have entries, in a list format :[[key1,value],[key2,

Re: Augument assignment versus regular assignment

2006-07-10 Thread Antoon Pardon
On 2006-07-10, Jim Segrave <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Antoon Pardon <[EMAIL PROTECTED]> wrote: >>On 2006-07-09, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >>> Frank Millman wrote: >>> So it looks as if x += [] modifies the list in place, while x = x + [] >>>

Re: mod_python fails to load under wamp

2006-07-10 Thread Ant
> "The Apache service named Apache.exe reported the following error: > >>> Cannot load c:/wamp/apache/modules/mod_python.so into server: (126) The > >>> specified module could not be found: <<< > before the error.log file could be opened." I have just had a similar problem (same error message),

Re: Detecting 64bit vs. 32bit Linux

2006-07-10 Thread Robert Kern
Michael Yanowitz wrote: > The one thing I observed (just an observation) is that: > a) on 32-bit machines: > sizeof(int) = 32 > sizeof(long) = 32 > b) on 64-bit machines: > sizeof(int) = 32 > sizeof(long) = 64 > > This in C and Python. As I've said previously in this threa

Re: first book about python

2006-07-10 Thread John Salerno
IOANNIS MANOLOUDIS wrote: > I want to learn python. > I plan to buy a book. I always find printed material more convenient than > reading on-line tutorials. > I don't know PERL or any other scripting language. I only know some BASH > programming. I am looking for a book which will help me get start

Re: threading troubles

2006-07-10 Thread faulkner
you don't need twisted to run processes in the background, either. os.popen* returns a file or set of files representing std streams immediately subprocess.Popen is a spiffy little object new in 2.4 and available for download for 2.3. check the module docstrings for usage tips. you can use threads

RE: [wwwsearch-general] ClientForm request re ParseErrors

2006-07-10 Thread bruce
is this where i've seen references to integrating Beautifulsoup in the wb browsing app? -bruce -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of John J Lee Sent: Monday, July 10, 2006 2:29 AM To: [EMAIL PROTECTED] Cc: python-list@python.org Subject: RE: [wwws

re question

2006-07-10 Thread Schüle Daniel
Hello, consider the following code >>> re.search("[a-z](?i)[a-z]","AA") <_sre.SRE_Match object at 0x40177e20> this gives a match if we provide an extra group for the first character it still works >>> re.search("([a-z])(?i)[a-z]","AA").group(1) 'A' >>> it doesn't matter where (?i) is placed

Re: inheritance, types, operator overload, head ache

2006-07-10 Thread thorley
Thanks very much for the reply. I'll give that a shot and post back with the result. -- matthew Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : > > I'm working with the following code. I included some tests to make it > > easy to see--if you run the code--what troubles I'm having. > > >

Re: Accessors in Python (getters and setters)

2006-07-10 Thread Diez B. Roggisch
mystilleef wrote: > I decided to change the name of an attribute. Problem is I've used the > attribute in several places spanning thousands of lines of code. If I > had encapsulated the attribute via an accessor, I wouldn't need to do > an unreliable and tedious search and replace accross several

Re: eval to dict problems NEWB going crazy !

2006-07-10 Thread Sion Arrowsmith
Fredrik Lundh <[EMAIL PROTECTED]> wrote: >Ant wrote: >> It seems that there must be a way to use eval safely, as there are >> plenty of apps that embed python as a scripting language - and what's >> the point of an eval function if impossible to use safely, and you have >> to write your own Python

Re: function that modifies a string

2006-07-10 Thread Sion Arrowsmith
Steven D'Aprano <[EMAIL PROTECTED]> wrote: >Of course, another right way would be to have mutable strings in Python. What significant advantage would mutable strings have over StringIO and wrapping list manipulation in list(s) and ''.join(l). Other than that pleasing symmetry with sets/frozensets

Re: split a line, respecting double quotes

2006-07-10 Thread Sion Arrowsmith
Jim <[EMAIL PROTECTED]> wrote: >Is there some easy way to split a line, keeping together double-quoted >strings? > >I'm thinking of > 'a b c "d e"' --> ['a','b','c','d e'] >. I'd also like > 'a b c "d \" e"' --> ['a','b','c','d " e'] >which omits any s.split('"')-based construct that I could c

Re: function that modifies a string

2006-07-10 Thread Diez B. Roggisch
> Of course, another right way would be to have mutable strings in Python. > I understand why strings need to be immutable in order to work with dicts, > but is there any reason why (hypothetical) mutable strings should be > avoided in situations where they aren't needed as dictionary keys? Python

Full splitting of a file's pathname

2006-07-10 Thread tac-tics
I know about os.path.split(), but Is there any standard function for "fully" splitting a file's pathname? A function that is the opposite of the os.path.join() function? For example: >>> ret = myster_function(./foo/bar/moo/lar/myfile.txt) >>> print ret ['.', 'foo', 'bar', 'moo', 'lar', 'myfile.txt

Re: function that modifies a string

2006-07-10 Thread tac-tics
Diez B. Roggisch wrote: > > Of course, another right way would be to have mutable strings in Python. > > I understand why strings need to be immutable in order to work with dicts, > > but is there any reason why (hypothetical) mutable strings should be > > avoided in situations where they aren't n

Re: eval to dict problems NEWB going crazy !

2006-07-10 Thread Ant
> As Fredrik points out, embedded Python isn't the same as running > untrusted code. The reality is, Python has not been designed for running > untrusted code safely. So how do python app's typically embed python? For example things like Zope and idle are scripted using Python - presumably they r

Python-2.5beta1 crash

2006-07-10 Thread Robin Becker
I'm testing ReportLab against Python-2.5beta1 and am getting some kind of problem as below === C:\Python24\reportlab\test>\python25\python runAll.py .C:\Python24\reportlab\test\test_docstrings.py:54: ImportWarning: Not importing directory 'C:\py

Re: language design question

2006-07-10 Thread Piet van Oostrum
> Bruno Desthuilliers <[EMAIL PROTECTED]> (BD) wrote: >BD> Actually, and AFAIK, len(obj) = lambda obj : obj.__len__(). You mean: len = lambda obj : obj.__len__(). -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] --

Re: What is a type error?

2006-07-10 Thread Marshall
Joachim Durchholz wrote: > Chris Smith schrieb: > > For example, I wrote that example using variables of type int. If we > > were to suppose that we were actually working with variables of type > > Person, then things get a little more complicated. We would need a few > > (infinite classes of) de

Re: Full splitting of a file's pathname

2006-07-10 Thread BartlebyScrivener
I don't know if it's "standard," but why not just: dir = './foo/bar/moo/lar/myfile.txt' dir.split('/') ['.', 'foo', 'bar', 'moo', 'lar', 'myfile.txt'] rd -- http://mail.python.org/mailman/listinfo/python-list

Re: function that modifies a string

2006-07-10 Thread Diez B. Roggisch
tac-tics wrote: > > Diez B. Roggisch wrote: >> > Of course, another right way would be to have mutable strings in >> > Python. I understand why strings need to be immutable in order to work >> > with dicts, but is there any reason why (hypothetical) mutable strings >> > should be avoided in situa

RE: [wwwsearch-general] ClientForm request re ParseErrors

2006-07-10 Thread bruce
hi john... this is in regards to the web/parsing/factory/beautifulsoup to reiterate, i have python 2.4, mechanize, browser, beatifulsoup installed. i have the latest mech from svn. i'm getting the same err as reported by john t. the code/err follows.. (i can resend the test html if you need)

Re: Web Browser Pygame Plug-in?

2006-07-10 Thread Gregory Piñero
That's interesting, Ben. So we'd be better off making a new library similiar to Pygame in functionality but designed from the ground up to work in a browser. I guess that XPCOM technology that someone mentioned might be the way to go? On 10 Jul 2006 03:54:33 -0700, Ben Sizer <[EMAIL PROTECTED]>

RE: Full splitting of a file's pathname

2006-07-10 Thread Kerry, Richard
Unless it's the sort of operating system that uses something like : Sys$disk:[foo.bar.moo.lar]myfile.txt (VaxVMS, from quite a few years ago) And if I recall, the parsing function provided would also separate the extension from the main part of the file's name. Unhelpfully, Richard. -

Re: function that modifies a string

2006-07-10 Thread Steven D'Aprano
On Mon, 10 Jul 2006 15:23:36 +0100, Sion Arrowsmith wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: >>Of course, another right way would be to have mutable strings in Python. > > What significant advantage would mutable strings have over StringIO > and wrapping list manipulation in list(s) a

Re: What is a type error?

2006-07-10 Thread Marshall
Chris Smith wrote: > Marshall <[EMAIL PROTECTED]> wrote: > > Chris Smith wrote: > > > > > > But this starts to look bad, because we used to have this nice property > > > called encapsulation. To work around that, we'd need to make one of a > > > few choices: (a) give up encapsulation, which isn't

Re: function that modifies a string

2006-07-10 Thread Steven D'Aprano
On Mon, 10 Jul 2006 16:27:03 +0200, Diez B. Roggisch wrote: >> Of course, another right way would be to have mutable strings in Python. >> I understand why strings need to be immutable in order to work with dicts, >> but is there any reason why (hypothetical) mutable strings should be >> avoided i

Re: Nested scopes, and augmented assignment

2006-07-10 Thread Piet van Oostrum
> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote: >AP> I'm sorry to see you missed it, but since I had answered this already in >AP> this thread I saw at the moment no need to repeat it: There would be no >AP> value for c, the line would raise an UnboundLocalError. OK. That could have been chos

Re: What is a type error?

2006-07-10 Thread Joachim Durchholz
Marshall schrieb: > Joachim Durchholz wrote: >> Chris Smith schrieb: >>> For example, I wrote that example using variables of type int. If we >>> were to suppose that we were actually working with variables of type >>> Person, then things get a little more complicated. We would need a few >>> (in

Re: Full splitting of a file's pathname

2006-07-10 Thread Iain King
tac-tics wrote: > I know about os.path.split(), but Is there any standard function for > "fully" splitting a file's pathname? A function that is the opposite of > the os.path.join() function? For example: > > >>> ret = myster_function(./foo/bar/moo/lar/myfile.txt) > >>> print ret > ['.', 'foo', 'b

PIL - Transparency Nightmares

2006-07-10 Thread tac-tics
I'm trying to make a simple script which attaches watermarks to every image in one directory and saves the output image to another. However, while I understand (in theory at least) what I need to be doing, I can't figure out where to go from here. First of all, I have a watermark image and a list

Re: language design question

2006-07-10 Thread Bruno Desthuilliers
Piet van Oostrum wrote: >>Bruno Desthuilliers <[EMAIL PROTECTED]> (BD) wrote: > > >>BD> Actually, and AFAIK, len(obj) = lambda obj : obj.__len__(). > > > You mean: len = lambda obj : obj.__len__(). yes, of course - not enough caffein, I guess... Thanks -- bruno desthuilliers python -c "p

Mechanize/Browser question

2006-07-10 Thread bruce
hi... i can do the following br = Browser br.open("www.yahoo.com") br.open("file:///foo") but can i do s = "..." qualified html text br.open(s) i'm curious, if i have html from someother source, is there a way to simply get it into the "Browser" so i can modify it... thanks -b

ANN: eGenix mxODBC Zope Database Adapter 1.0.10

2006-07-10 Thread eGenix Team: M.-A. Lemburg
ANNOUNCEMENT EGENIX.COM mxODBC Zope Database Adapter Version 1.0.10 Usable with Zope and the Plone CMS. Availa

Re: Accessors in Python (getters and setters)

2006-07-10 Thread Bruno Desthuilliers
mystilleef wrote: > I decided to change the name of an attribute. Problem is I've used the > attribute in several places spanning thousands of lines of code. If I > had encapsulated the attribute via an accessor, I wouldn't need to do > an unreliable and tedious search and replace find and grep ar

Detecting socket connection failure

2006-07-10 Thread schwehr
Hi All, I've tried to RTFM this and am having no luck.First off, I am using Mac OSX 10.4.7 with python 2.4.2 from fink. I am trying to connect to a server that should be rejecting connections and I was surprised when it did not throw an exception or do something otherwise equally nasty. It ju

Re: xml aggregator

2006-07-10 Thread kepioo
Thank you so much, it works and it rocks ! bad thing i need ot figure out is why mozilla cannot parse my xsl sheet, but it works in IE ( most of my users are using IE) so the module u wrote is to top up element tree with Xpath capabilities, is it? Does the new element tree does that? which one is

Re: function that modifies a string

2006-07-10 Thread Jason
Simon Forman wrote: > greenflame wrote: > > Jason wrote: > > > > > > There /are/ a few hacks which will do what you want. However, if you > > > really need it, then you probably need to rethink your program design. > > > Remember, you can't change a string since a string is immutable! You > > > c

compiling 2.3.5 on ubuntu

2006-07-10 Thread Py PY
(Apologies if this appears twice. I posted it yesterday and it was held due to a 'suspicious header') I'm having a hard time trying to get a couple of tests to pass when compling Python 2.3.5 on Ubuntu Server Edition 6.06 LTS. I'm sure it's not too far removed from the desktop edition but, clea

Re: PIL - Transparency Nightmares

2006-07-10 Thread tac-tics
I RTFM harder, and found that paste with an image mask (using the watermark as the mask) does the trick. -- http://mail.python.org/mailman/listinfo/python-list

Re: language design question

2006-07-10 Thread Sébastien Boisgérault
Steven Bethard a écrit : > The advantage of a functional form over a method shows up when you write > a function that works on a variety of different types. Below are > implementations of "list()", "sorted()" and "join()" that work on any > iterable and only need to be defined once:: > > [... skip

  1   2   3   >