Re: PyQt layout question: QScrollView and QGridLayout?

2005-11-17 Thread Volker Lenhardt
Phil Thompson schrieb: > On Thursday 17 November 2005 2:56 pm, Volker Lenhardt wrote: > >>prefer to use QGridLayout, but cannot add it to the scroll view. >> >>sc=QScrollView(self) >>layout=QGridLayout(..., sc.viewport()) >>sc.addChild(layout) >> >>results in a TypeError. >> >>Is there a way to ge

Re: how to organize a module that requires a data file

2005-11-17 Thread Paul Boddie
Steven Bethard wrote: [Text file for a module's internal use.] > My problem is with the text file. Where should I keep it? If I want to > keep the module simple, I need to be able to identify the location of > the file at module import time. That way, I can read all the data into > the appropr

Re: how to organize a module that requires a data file

2005-11-17 Thread Terry Hancock
On Thu, 17 Nov 2005 12:18:51 -0700 Steven Bethard <[EMAIL PROTECTED]> wrote: > My problem is with the text file. Where should I keep it? > > I can only think of a few obvious places where I could > find the text file at import time -- in the same > directory as the module (e.g. lib/site-package

Hashing Function

2005-11-17 Thread Dave
Hello All, I'm wondering what hashing function Python uses for dictionaries. Thanks for your help. Dave __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com -- http://mail.python.org/mailman/listinfo/python-list

os.spawnl error

2005-11-17 Thread Salvatore
Hello, Does someone already had ths problem ? >>> os.spawnl(os.P_NOWAIT,'c:\windows\notepad.exe') Traceback (most recent call last): File "", line 1, in ? File "C:\Python24\lib\os.py", line 565, in spawnl return spawnv(mode, file, args) OSError: [Errno 22] Invalid argument Regards Salva

Re: Any help with PLY?

2005-11-17 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi folks, > > I've been trying to write a PLY parser and have run into a bit of > bother. > > At the moment, I have a RESERVEDWORD token which matches all reserved > words and then alters the token type to match the reserved word that >

Re: How to write an API for a Python application?

2005-11-17 Thread Mike Meyer
[EMAIL PROTECTED] (Cameron Laird) writes: > In article <[EMAIL PROTECTED]>, > Paul Boddie <[EMAIL PROTECTED]> wrote: > . >>meaning that callbacks and other things just work. Rolling your own >>solution, on the other hand, can end in a long road discovering what >>those CORBA p

Re: how to organize a module that requires a data file

2005-11-17 Thread Steven Bethard
Terry Hancock wrote: > On Thu, 17 Nov 2005 12:18:51 -0700 > Steven Bethard <[EMAIL PROTECTED]> wrote: > >>My problem is with the text file. Where should I keep it? >> >>I can only think of a few obvious places where I could >>find the text file at import time -- in the same >>directory as the mo

Re: Hashing Function

2005-11-17 Thread Fredrik Lundh
Dave wrote: > I'm wondering what hashing function Python uses for > dictionaries. use the source, luke: http://svn.python.org/view/python/trunk/Objects/dictobject.c?rev=39608&view=markup http://svn.python.org/view/python/trunk/Objects/dictnotes.txt?rev=35428&view=markup -- http://mail.pyt

Re: is parameter an iterable?

2005-11-17 Thread Steve Holden
Micah Elliott wrote: > On Nov 17, Duncan Booth wrote: > >>Steven D'Aprano wrote: >> >>>What should I do when I can't rely on functions that >>>don't exist in older versions of Python? > > >> sys.exit('Archaic Python not supported, please upgrade') > > > +1 QOTW. > > I recently gave up o

Re: os.spawnl error

2005-11-17 Thread Larry Bates
The backslashes in your path are being interpreted as escape characters (e.g. \n is a newline). Try instead: os.spawnl(os.P_NOWAIT,r'c:\windows\notepad.exe') or os.spawnl(os.P_NOWAIT,'c:\\windows\\notepad.exe') -Larry Bates Salvatore wrote: > Hello, > > Does someone already had ths problem

Re: Python, Linux, Desktop Environment

2005-11-17 Thread Florian Diesch
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > So, I've written my first GUI app in python. I've turned it into a > binary .exe and .app that runs on Windows and Mac respectively, but on > my Linux box, where I wrote the thing, I still have to drop to the > command line and ./myscript.py. What ca

Re: sqlite utf8 encoding error

2005-11-17 Thread Jarek Zgoda
Fredrik Lundh napisał(a): >>UnicodeDecodeError: 'utf8' codec can't decode bytes in position 13-18: >>unsupported Unicode code range >> >>does anyone have any idea on what could be going wrong? The string >>that I store in the database table is: >> >>'Keinen Text für Übereinstimmungsfehler gefunde

Re: os.spawnl error

2005-11-17 Thread Fredrik Lundh
Salvatore wrote: > Does someone already had ths problem ? > os.spawnl(os.P_NOWAIT,'c:\windows\notepad.exe') > Traceback (most recent call last): > File "", line 1, in ? > File "C:\Python24\lib\os.py", line 565, in spawnl >return spawnv(mode, file, args) > OSError: [Errno 22] Invalid arg

Re: how to organize a module that requires a data file

2005-11-17 Thread Larry Bates
Personally I would do this as a class and pass a path to where the file is stored as an argument to instantiate it (maybe try to help user if they don't pass it). Something like: class morph: def __init__(self, pathtodictionary=None): if pathtodictionary is None: #

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-17 Thread RalfGB
Alex Martelli schrieb: > MrJean1 <[EMAIL PROTECTED]> wrote: > > > This may work on MacOS X. An initial, simple test does yield credible > > values. > > Definitely looks promising, thanks for the pointer. > > > However, I am not a MacOS X expert. It is unclear which field of the > > malloc_statis

Re: Default method arguments

2005-11-17 Thread Martin Miller
Mike Meyer wrote, in part:: > "Gregory Petrosyan" <[EMAIL PROTECTED]> writes: > ... > > 2) Is 'foo.s = n' a correct solution? It seems to be a little more > > elegant. (I tested it, and it worked well) > > It's basically the same solution. You're replacing binding a variable > with mutating an obj

Tkinter's coordinates setting

2005-11-17 Thread Ben Bush
Tkinter's coordinates setting are: the left upper corner is the smallest X and Y, which is different from our usual think that Y is largest in that location. If i draw some lines on the canvas and show some relationship among them, do I need transfer the coordinates? -- http://mail.python.org/mail

Re: how to organize a module that requires a data file

2005-11-17 Thread Steven Bethard
Larry Bates wrote: > Personally I would do this as a class and pass a path to where > the file is stored as an argument to instantiate it (maybe try > to help user if they don't pass it). Something like: > > class morph: > def __init__(self, pathtodictionary=None): > if pathtodictiona

Re: Simulating call-by-reference

2005-11-17 Thread Alex Martelli
Dan Sommers <[EMAIL PROTECTED]> wrote: ... > Put the results into a dictionary (untested code follows!): > > l = [ (re1, 'bar'), > (re2, 'foo'), > (re3, 'baz'), > ] > results = {} > for (regexp, key) in l: > m = re.search(regexp, data) > i

Re: Simulating call-by-reference

2005-11-17 Thread Dan Sommers
On Thu, 17 Nov 2005 12:31:08 -0800, [EMAIL PROTECTED] (Alex Martelli) wrote: > Dan Sommers <[EMAIL PROTECTED]> wrote: >... >> Put the results into a dictionary (untested code follows!): [ example code snipped ] >> Now you can access the results as results['foo'], etc. Or look up >> the Borg

Re: catch dbi.program-error ?

2005-11-17 Thread Brian Herbert Withun
try: self.__cur.execute(sql) except dbi.program-error,e: print " caught " raise should be changed to: try: self.__cur.execute(sql) except dbi.progError,e: print " caught " raise In my infinite googling I found some source code that showed the actual name of this exception clas

Re: searching for files on Windows with Python

2005-11-17 Thread Kent Johnson
Shane wrote: > I've been giving Google a good workout with no luck. I would like to > be able to search a Windows filesystem for filenames, returning a > list off absolute paths to the found files, something like:> > def findFiles(filename, pathToSearch): > ... > ... > return foundF

Zope vs Php

2005-11-17 Thread Steve
We are building a web app and the our backend is currently using python with php front end. We would like to do everything in python but php for our front end is so easy to use. We would like to use zope on our front end(no experience with it) can anyone provide any experience with this? >From w

Stretching a bitmap

2005-11-17 Thread David Poundall
Is it possible to import a bitmap and stretch it to fit a defined area with wxPython? If so, could someone point me to any relevent web reference on the subject? Thanks in advance David -- http://mail.python.org/mailman/listinfo/python-list

Re: searching for files on Windows with Python

2005-11-17 Thread Do Re Mi chel La Si Do
Hi! But fnmatch (or glob) is unix-like. With few error in windows (sample ? trye '*.' ) Test this code rather: import os l=os.popen4('dir c:\\python\\*.pyw /S /B')[1].readlines() print ''.join(l) @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/pytho

Re: sqlite utf8 encoding error

2005-11-17 Thread Serge Orlov
Jarek Zgoda wrote: > Fredrik Lundh napisa³(a): > > >>UnicodeDecodeError: 'utf8' codec can't decode bytes in position 13-18: > >>unsupported Unicode code range > >> > >>does anyone have any idea on what could be going wrong? The string > >>that I store in the database table is: > >> > >>'Keinen Tex

Python and U3 devices

2005-11-17 Thread Philippe C. Martin
Dear all, Has anyone attempted to compile Python for a U3 device ? Regards, Philippe -- http://mail.python.org/mailman/listinfo/python-list

Py 3.0 print

2005-11-17 Thread bearophileHUGS
There is/was a long discussion about the replacement for print in Python 3.0 (I don't know if this discussion is finished): http://mail.python.org/pipermail/python-dev/2005-September/055968.html There is also a wiki page that collects the ideas: http://wiki.python.org/moin/PrintAsFunction There i

Re: Stretching a bitmap

2005-11-17 Thread NavyJay
Try ImageMagik: http://www.imagemagick.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter's coordinates setting

2005-11-17 Thread Steve Juranich
On 11/17/05, Ben Bush <[EMAIL PROTECTED]> wrote: > Tkinter's coordinates setting are: the left upper corner is the smallest X > and Y, which is different from our usual think that Y is largest in that > location. If i draw some lines on the canvas and show some relationship > among them, do I need

Re: Hashing Function

2005-11-17 Thread jepler
As Fredrik suggests, consult the source to find out. Almost all of this is in the realm of being an implementation detail, and hashes aren't guaranteed to be the same from version to version or machine to machine. I'm not even sure they're guaranteed to be the same from run to run. Here's an exam

Re: Zope vs Php

2005-11-17 Thread Larry Bates
Zope doesn't really work like that. Zope page templates provide an environment that is something like you are accustomed to in php, but you can't just drop in python code. Zope is an entire application server that has a very extensive set of capabilities that are on the order of WebSphere or WebL

Re: Stretching a bitmap

2005-11-17 Thread David Poundall
I need to be able to do this on the fly within a WX frame. I think I have found it though. There is a resize function in the image class in the _core code of wxPython. All I have to do now is learn how to access the bugger. Syntax anyone ?? -- http://mail.python.org/mailman/listinfo/python-li

Re: Stretching a bitmap

2005-11-17 Thread Larry Bates
Python Imaging Library (PIL) can size bitmaps. I use it to create thumbnails or to size bitmaps quite often. There may be a "wxPython" built-in for this also, but I don't know what it would be. -Larry Bates David Poundall wrote: > Is it possible to import a bitmap and stretch it to fit a defined

Re: Zope vs Php

2005-11-17 Thread Peter Maas
Steve schrieb: >>From what I can tell you can't just do > <% > #python code > %> > some title > > this is what we would like to do with session support and things that > php provides? Google for "python web frame works". Most have session support, and some offer Python Code embedded in HTML (e.g

Re: os.spawnl error

2005-11-17 Thread utabintarbo
I have found the judicious use of os.path.normpath(path) to be quite useful as well. Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: Zope vs Php

2005-11-17 Thread Bruno Desthuilliers
Steve a écrit : > We are building a web app and the our backend is currently using python > with php front end. We would like to do everything in python but php > for our front end is so easy to use. We would like to use zope on our > front end(no experience with it) can anyone provide any experi

PayPal co-founder looking for talented developers for his new venture!!!

2005-11-17 Thread court
Slide, ( http://www.slide.com ) the new SF startup founded by Max Levchin (who also founded PayPal, which sold to eBay for $1.5B) is seeking qualified candidates to help us change the way we share photos online! http://www.slide.com please send resumes to: jobs (at) slide (dot) com If you know of

Re: running functions

2005-11-17 Thread Tom Anderson
On Wed, 16 Nov 2005, [EMAIL PROTECTED] wrote: > Gorlon the Impossible wrote: > >> Is it possible to run this function and still be able to do other >> things with Python while it is running? Is that what threading is >> about? > > Threading's a good answer if you really need to share all your me

Re: Zope vs Php

2005-11-17 Thread Steve
I am going to go the mod_python route. as for why a person would go route one over route 2 is that the number of lines of html/output vs python code are usually 10 to 1 and it's much easier to encapsulate the python code than to quote and escape all the html/css/xml Thanks for the help <% #pyth

Re: PyQt layout question: QScrollView and QGridLayout?

2005-11-17 Thread dwelch
Volker Lenhardt wrote: > Phil Thompson schrieb: > >> On Thursday 17 November 2005 2:56 pm, Volker Lenhardt wrote: >> >>> prefer to use QGridLayout, but cannot add it to the scroll view. >>> >>> sc=QScrollView(self) >>> layout=QGridLayout(..., sc.viewport()) >>> sc.addChild(layout) >>> >>> results

Re: PyQt layout question: QScrollView and QGridLayout?

2005-11-17 Thread David Boddie
Volker Lenhardt wrote: > Phil Thompson schrieb: > > On Thursday 17 November 2005 2:56 pm, Volker Lenhardt wrote: [Using a QGridLayout in a QScrollView] > >>Is there a way to get it to work? Filling a box viewport with lots of > >>padding boxes and white space labels to establish grids is very > >

Importing a class without knowing the module

2005-11-17 Thread Franck PEREZ
Hello, I'm developing a small XML marshaller and I'm facing an annoying issue. Here's some sample code: ### My test application class Foo(object): #The class I'd like to serialize pass import myMarshaller foo = Foo() s = myMarshaller.dumps(foo) #works fine, spits somethi

Re: Zope vs Php

2005-11-17 Thread Mike Meyer
"Steve" <[EMAIL PROTECTED]> writes: > I am going to go the mod_python route. > > as for why a person would go route one over route 2 > > is that the number of lines of html/output vs python code are usually > 10 to 1 and it's much easier to encapsulate the python code than to > quote and escape al

Re: how to organize a module that requires a data file

2005-11-17 Thread [EMAIL PROTECTED]
I have tried several ways, this is the way I like best (I develop in Windows, but this technique should work in *NIX for your application) :: \whereever\whereever\ (the directory your module is in, obviously somewhere where PYTHONPATH can

Re: Tkinter's coordinates setting

2005-11-17 Thread Shi Mu
On 11/17/05, Steve Juranich <[EMAIL PROTECTED]> wrote: > On 11/17/05, Ben Bush <[EMAIL PROTECTED]> wrote: > > Tkinter's coordinates setting are: the left upper corner is the smallest X > > and Y, which is different from our usual think that Y is largest in that > > location. If i draw some lines on

Re: install python2.4 on FreeBSD and keep using python2.3

2005-11-17 Thread Andrew MacIntyre
[posted & mailed] Ksenia Marasanova wrote: > I have python2.3, installed from port /lang/python long time ago. The > current version is 2.4, but I'd rather have two python versions, > instead of upgrading. > Is there maybe a way to somehow link installed python to > /lang/python2.3 port, and then

Re: Importing a class without knowing the module

2005-11-17 Thread Mike Meyer
Franck PEREZ <[EMAIL PROTECTED]> writes: > ### My test application > class Foo(object): > #The class I'd like to serialize > pass > > import myMarshaller > foo = Foo() > s = myMarshaller.dumps(foo) #works fine, spits something like class = "Foo"...> > another_foo = loads(s

about try and exception

2005-11-17 Thread Ben Bush
I wrote the following code to test the use of "try...exception", and I want n to be printed out. However, the following code's output is: Traceback (most recent call last):  File "C:\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript    exec codeObject in _

Re: about try and exception

2005-11-17 Thread Carl J. Van Arsdall
I would think that when the exception occurs the interpreter exits the block of code it is currently in and enters the exception block. Thus the line n = 1/2 would never get executed. -Carl Ben Bush wrote: > I wrote the following code to test the use of "try...exception", > and I want n to be

XML and namespaces

2005-11-17 Thread Wilfredo Sánchez Vega
I'm having some issues around namespace handling with XML: >>> document = xml.dom.minidom.Document() >>> element = document.createElementNS("DAV:", "href") >>> document.appendChild(element) >>> document.toxml() '\n' Note that the namespace wa

Re: about try and exception

2005-11-17 Thread Shi Mu
On 11/17/05, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote: > I would think that when the exception occurs the interpreter exits the > block of code it is currently in and enters the exception block. > > Thus the line n = 1/2 would never get executed. > > > -Carl > > Ben Bush wrote: > > I wrote the

line order

2005-11-17 Thread Ben Bush
I run the following code and the red line and black line show at the same time. is there anyway to show the red line first, then the black line? for example, after I click the 'enter' key?   from Tkinter import *tk = Tk()canvas = Canvas(tk, bg="white", bd=0, highlightthickness=0)canvas.pack(fill=BO

Re: GTK for windows and Linux

2005-11-17 Thread hrh1818
Chapter 13 in "Beginning Python" by Peter Norton has a good introduction to using GTK to create a GUI. . Howard Ask wrote: > Hi All, > > Can someone please tell me what I need to use GTK with python for windows > and Linux? > > Any links to the appropriate installations would be greatly appreciat

Re: about try and exception

2005-11-17 Thread Carl J. Van Arsdall
Shi Mu wrote: > On 11/17/05, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote: > >> I would think that when the exception occurs the interpreter exits the >> block of code it is currently in and enters the exception block. >> >> Thus the line n = 1/2 would never get executed. >> >> >> -Carl >> >> B

Re: Importing a class without knowing the module

2005-11-17 Thread Franck PEREZ
I thought about it, but it would make the XML file depend on the machine... no more portability... On 11/18/05, Mike Meyer <[EMAIL PROTECTED]> wrote: > Franck PEREZ <[EMAIL PROTECTED]> writes: > > ### My test application > > class Foo(object): > > #The class I'd like to seri

Re: about try and exception

2005-11-17 Thread Shi Mu
On 11/17/05, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote: > Shi Mu wrote: > > On 11/17/05, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote: > > > >> I would think that when the exception occurs the interpreter exits the > >> block of code it is currently in and enters the exception block. > >> > >>

Re: Configure failing why?

2005-11-17 Thread Samuel M. Smith
Thanks for your help. Your confirmation that gcc should be setting the execute permissions gave me something easy to test against. I finally discovered the problem. It was nfs. The file system was nfs mounted and nfs is causing the aberrant behavior. If I did the test on the onboard flash fil

Re: running functions

2005-11-17 Thread Gorlon the Impossible
On Thu, 17 Nov 2005 23:29:16 +, Tom Anderson <[EMAIL PROTECTED]> wrote: >On Wed, 16 Nov 2005, [EMAIL PROTECTED] wrote: > >> Gorlon the Impossible wrote: >> >>> Is it possible to run this function and still be able to do other >>> things with Python while it is running? Is that what threading

Re: Python obfuscation

2005-11-17 Thread Bengt Richter
On Thu, 17 Nov 2005 10:53:24 -0800, [EMAIL PROTECTED] (Alex Martelli) wrote: >Anton Vredegoor <[EMAIL PROTECTED]> wrote: [...] >> The idea of using a webservice to hide essential secret parts of your >> application can only work well if one makes some random alterations to >> the results of the qu

Re: running functions

2005-11-17 Thread Scott David Daniels
Gorlon the Impossible wrote: > I have to agree with you there. Threading is working out great for me > so far. The multiprocess thing has just baffled me, but then again I'm > learning. Any tips or suggestions offered are appreciated... The reason multiprocess is easier is that you have enforced

How to draw a dash line in the Tkinter?

2005-11-17 Thread Ben Bush
How to draw a dash line in the Tkinter? -- http://mail.python.org/mailman/listinfo/python-list

Re: about try and exception

2005-11-17 Thread Alex Martelli
Shi Mu <[EMAIL PROTECTED]> wrote: ... > If we do not know when the error will happen during the calculation > but still want to continue till end, what should I do? > for example: > > def test(a,b,c): > return a/(b-c) > q=[1,1,2,2,4,6,9,0] > for i in range(len(q)): > print test(q[i],q[i

Socket Error

2005-11-17 Thread Chad Everett
Does anyone know why you get socket error while trying to run IDLE and the module. Is says something about a Subprocess Startup Error. I know that it always says something about a personal firewall. I have all that shut off. About 50% of the time when I try and test code by running the module

newb ?

2005-11-17 Thread Chad Everett
Hey guys, I am back. Trying to expand on a program that was given in the book I am studying. No I am not a high school or college student. Doing this on my own. and having way to much trouble I am trying to add a hint section to a word jumble program. I get a traceback error that the word

Re: Importing a class without knowing the module

2005-11-17 Thread Alex Martelli
Franck PEREZ <[EMAIL PROTECTED]> wrote: > I thought about it, but it would make the XML file depend on the > machine... no more portability... ... > > How about adding Foo.__file__ to the serialized data? Your top-posting makes this discourse weird (why put your comments BEFORE the text you're

Reading a file in same directory as code with relative path

2005-11-17 Thread dan . j . weber
I'm trying to read an XML file in the same directory as my python code, using minidom: document = xml.dom.minidom.parse("data.xml") How can I read in the file "data.xml" without knowing it's full path--just that it's in the same directory as my code file? Thanks for any help with this. I'm new to

Re: running functions

2005-11-17 Thread Grant Edwards
On 2005-11-18, Scott David Daniels <[EMAIL PROTECTED]> wrote: > Gorlon the Impossible wrote: > >> I have to agree with you there. Threading is working out great for me >> so far. The multiprocess thing has just baffled me, but then again I'm >> learning. Any tips or suggestions offered are apprecia

Re: Rename files with numbers

2005-11-17 Thread Dudu Figueiredo
thanks, i'll take a look ;] -- http://mail.python.org/mailman/listinfo/python-list

Re: Importing a class without knowing the module

2005-11-17 Thread Mike Meyer
[Format recovered from top posting.] Franck PEREZ <[EMAIL PROTECTED]> writes: > On 11/18/05, Mike Meyer <[EMAIL PROTECTED]> wrote: >> Franck PEREZ <[EMAIL PROTECTED]> writes: >> > ### My test application >> > class Foo(object): >> > #The class I'd like to serialize >> > pa

Re: Reinvent no more forever

2005-11-17 Thread Phillip J. Eby
Ben Finney wrote: > - Proliferation. What's the protocol when[1] someone else puts an > (incompatible, differently-specified) Enum implementation into > PyPI? Either one of the two will be judged better, and the other will wither away, or else each will be better for different circumstan

Re: newb ?

2005-11-17 Thread [EMAIL PROTECTED]
Chad Everett wrote: > Hey guys, > > I am back. Trying to expand on a program that was given in the book I am > studying. > > No I am not a high school or college student. Doing this on my own. and > having way to much trouble > > I am trying to add a hint section to a word jumble program. > >

stringified cPickle

2005-11-17 Thread David Bear
I'm rather new to pickling but I have some dictionaries and lists I want to package and send to another process (on another machine). I was hoping I could just send a stringified pickle. However, the examples in the doc have: >>> import pickle >>> pickle.dump(obj,open('save.p','w')) I don't real

Re: newb ?

2005-11-17 Thread Chad Everett
Mensanator, Thanks for your help. That should get me along. I appreciate your time. Chad <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Chad Everett wrote: >> Hey guys, >> >> I am back. Trying to expand on a program that was given in the book I >> am >> studying. >> >> No I

Re: stringified cPickle

2005-11-17 Thread Chris Mellon
On 11/17/05, David Bear <[EMAIL PROTECTED]> wrote: > I'm rather new to pickling but I have some dictionaries and lists I want to > package and send to another process (on another machine). > > I was hoping I could just send a stringified pickle. However, the examples > in the doc have: > > >>> impo

Re: Zope vs Php

2005-11-17 Thread [EMAIL PROTECTED]
I believe Cheetah can do this kind of thing, Kid too. Personally, I like Kid more. And you can take a look at TurboGears which is a bag of tools (web server - cherrypy, template - Kid, ORM - SQLObject) glued together in a pretty nice way. Steve wrote: > We are building a web app and the our backen

Hot to split string literals that will across two or more lines ?

2005-11-17 Thread Xiao Jianfeng
Hi, I need to print a long sting, which is two long so it must expand two lines. I know that we can use backslash(\) to explicitly join two lines into a logical line, but this doesn't work for string literals :( my code:

Re: Zope vs Php

2005-11-17 Thread Jorge Godoy
Mike Meyer <[EMAIL PROTECTED]> writes: > That said, I have to confess that lately I've been using Cheetah > templates, because the syntax for inserting values is simpler, and the > way Cheetah templates work naturally in the Python inheritance > hierarchy. KID is also nice and can be used as he w

Re: Python obfuscation

2005-11-17 Thread The Eternal Squire
>You have not been working with the right people. They do exist, but they >are rare. Elucidate? -- http://mail.python.org/mailman/listinfo/python-list

Re: Zope vs Php

2005-11-17 Thread Fernando Lujan
Jorge Godoy wrote: >Mike Meyer <[EMAIL PROTECTED]> writes: > > >>That said, I have to confess that lately I've been using Cheetah >>templates, because the syntax for inserting values is simpler, and the >>way Cheetah templates work naturally in the Python inheritance >>hierarchy. >> In this arti

Re: Hot to split string literals that will across two or more lines ?

2005-11-17 Thread jmdeschamps
Xiao Jianfeng wrote: > Hi, > > I need to print a long sting, which is two long so it must expand two > lines. > I know that we can use backslash(\) to explicitly join two lines into a > logical line, > but this doesn't work for string literals :( > > my code: >

Re: Hot to split string literals that will across two or more lines ?

2005-11-17 Thread Lars Kellogg-Stedman
> print "a string whcih is very very looo\ > ng." print "a string which is very loo" \ + "ong." -- Lars -- Lars Kellogg-Stedman <[EMAIL PROTECTED]> This email address will expire on 2005-11-23. -- http://mail.python.org/mailm

simple array question

2005-11-17 Thread purna chandra
Hello, I have a simple question.Hoping not to take much of your valuable time...:-). I am trying to get the data from a string, and am wondering if I get http://groups.google.com/intl/en/googlegroups/tour/index.html from the array : array('c', '\x00=http://groups.google.com/intl/en/googlegroup

Re: Reinvent no more forever

2005-11-17 Thread Ben Finney
Phillip J. Eby <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > - It's just a pretty simple type, with unit tests. Does this > > really justify a PyPI package? > > Yes. Thanks for the brief, but supportive discussion from everyone. I've now packaged and uploaded my simple module. (No prizes

Re: Zope vs Php

2005-11-17 Thread Mike Meyer
Jorge Godoy <[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> That said, I have to confess that lately I've been using Cheetah >> templates, because the syntax for inserting values is simpler, and the >> way Cheetah templates work naturally in the Python inheritance >> hierarc

Re: Hot to split string literals that will across two or more lines ?

2005-11-17 Thread Xiao Jianfeng
[EMAIL PROTECTED] wrote: >Xiao Jianfeng wrote: > > >>Hi, >> >>I need to print a long sting, which is two long so it must expand two >>lines. >>I know that we can use backslash(\) to explicitly join two lines into a >>logical line, >>but this doesn't work for string literals :( >> >>my code: >>--

Re: Hot to split string literals that will across two or more lines ?

2005-11-17 Thread Xiao Jianfeng
Lars Kellogg-Stedman wrote: >>print "a string whcih is very very looo\ >>ng." >> >> > >print "a string which is very loo" \ > + "ong." > >-- Lars > > > Oh, Thank you! -- http://mail.python.org/mailman/listinfo/python-list

Re: Hot to split string literals that will across two or more lines ?

2005-11-17 Thread Sam Pointon
> print "a string which is very loo" \ > + "ong." Minor pedantry, but the plus sign is redundant. Python automatically concatenates string literals on the same logical line separated by only whitespace. -- http://mail.python.org/mailman/listinfo/python-list

Re: Zope vs Php

2005-11-17 Thread Lars Kellogg-Stedman
> And finally - got a URL? This got me to the right place pretty quickly: http://www.google.com/search?q=python+kid+template -- Lars -- Lars Kellogg-Stedman <[EMAIL PROTECTED]> This email address will expire on 2005-11-23. -- http://mail.python.org/mailman/listinfo/python-list

Re: Hot to split string literals that will across two or more lines ?

2005-11-17 Thread rurpy
You can leave out the "+" if you want, adjacent strings are automatically concatenated. print "a string which is very loo" \ "ong." Perhaps this is more efficient, since the string concatenation can be done by Python's parser rather than at runtime? Lars Kellogg-Stedman <[EMAIL

Re: Hot to split string literals that will across two or more lines ?

2005-11-17 Thread Lars Kellogg-Stedman
> Minor pedantry, but the plus sign is redundant. Thanks for catching that...I haven't been working with Python as much as I was a year or so ago and I'm forgetting some of the details. -- Lars -- Lars Kellogg-Stedman <[EMAIL PROTECTED]> This email address will expire on 2005-11-23. -- http:

Immutable instances, constant values

2005-11-17 Thread Ben Finney
Howdy all, I've recently packaged 'enum' in PyPI. In its description, I make the claim that it creates "immutable" enumeration objects, and that the enumeration values are "constant" values. This raises questions. Is there any difference between a Python immutable value, and a constant? I suppos

Re: simple array question

2005-11-17 Thread Daniel Schüle
purna chandra wrote: > Hello, >I have a simple question.Hoping not to take much of > your valuable time...:-). I am trying to get the data > from a string, and am wondering if I get > http://groups.google.com/intl/en/googlegroups/tour/index.html > from the array : > array('c', > '\x00=http://

Re: Hot to split string literals that will across two or more lines ?

2005-11-17 Thread Ben Finney
Xiao Jianfeng <[EMAIL PROTECTED]> wrote: > I need to print a long sting, which is two long so it must expand > two lines. How is this string being constructed in the source? If it exists as a single long string, why must it be so long? Some techniques you may not be aware of: >>> chunks = ["

Re: Zope vs Php

2005-11-17 Thread Lars Kellogg-Stedman
> While I'm at it - how does KID do for things that aren't HTML? I've taken a brief look over the Kid documentation. It looks like Kid is in the same class of solutions as Zope's TAL (or Perl's Petal). In particular, a Kid template is always a valid XML document, so your designers can open a Kid

Re: Importing a class without knowing the module

2005-11-17 Thread Alex Martelli
Mike Meyer <[EMAIL PROTECTED]> wrote: ... > >> How about adding Foo.__file__ to the serialized data? > > I thought about it, but it would make the XML file depend on the > > machine... no more portability... > > They already depend on the machine. You can't take them to an arbitary > machine an

Re: Zope vs Php

2005-11-17 Thread Jorge Godoy
Mike Meyer <[EMAIL PROTECTED]> writes: > Jorge Godoy <[EMAIL PROTECTED]> writes: > > Mike Meyer <[EMAIL PROTECTED]> writes: > >> That said, I have to confess that lately I've been using Cheetah > >> templates, because the syntax for inserting values is simpler, and the > >> way Cheetah templates w

Re: Simulating call-by-reference

2005-11-17 Thread Bengt Richter
On Thu, 17 Nov 2005 10:03:50 GMT, Rikard Bosnjakovic <[EMAIL PROTECTED]> wrote: >I'm tidying up some code. Basically, the code runs a bunch of >regexp-searches (> 10) on a text and stores the match in a different variable. > >Like this: > > re1 = r' ..(.*).. ' > re2 = r' ' > re3

Re: Python Library Reference - question

2005-11-17 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > The "Python LIbrary Reference" at > http://docs.python.org/lib/contents.html seems to be an important > document. I have two questions > > Q1. How do you search inside "Python LibraryReference" ? Does it exist > in pdf or chm form? ...

<    1   2   3   >