Re: newb ?

2005-11-17 Thread Fredrik Lundh
Chad Everett wrote: > I am back. > No I am not a high school or college student. your subject lines still suck. please read this http://www.catb.org/~esr/faqs/smart-questions.html#bespecific before you post your next question. (the entire article is worth reading, if you haven't done so

Newbie question: does file("text.txt', "w").write("stuff") ever get closed?

2005-11-17 Thread John Doe
 I am learning as Python as we speak, to do some text processing stuff.  For instance,>>> l = [[]]*5>>> l[0].append("a")>>> l[['a'], ['a'], ['a'], ['a'], ['a']]just bit me; however, thats not the question.  In an effort to avoid another potential mistake, I am wondering if the anonymous file ob

Python under Citrix Metaframe

2005-11-17 Thread Xaver Hinterhuber
Hello, I wanted to use python under Citrix Metaframe. After installation of the ActivePython 2.4.1 msi-File, printing under Citrix Metaframe no longer worked. Do you use python under Citrix Metaframe? What problems did you encounter? Greets Xaver Hinterhuber -- http://mail.python.org/mailma

Re: Importing a class without knowing the module

2005-11-17 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >... >> >> >> How about adding Foo.__file__ to the serialized data? >... >> >> depends on somewhere on it. You can use the module name if you have it >> >> available. If not, deriving the module name from the

Re: GTK for windows and Linux

2005-11-17 Thread Ask
Of course that's where I first looked but the amount of options are many. Thanks anyway. "Antoon Pardon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Op 2005-11-17, Ask schreef <[EMAIL PROTECTED]>: >> Hi All, >> >> Can someone please tell me what I need to use GTK with python for

Re: GTK for windows and Linux

2005-11-17 Thread Ask
Thanks Batfree "batfree" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > all you need are GTK+ envirement and the pygtk module.You can get more > information in www.pygtk.org. -- http://mail.python.org/mailman/listinfo/python-list

Re: GTK for windows and Linux

2005-11-17 Thread Ask
Thanks Howard "hrh1818" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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

Re: GTK for windows and Linux

2005-11-17 Thread Ask
Thanks Renato, I'm downloading now. Pauly "Renato" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You'll need to install the libglade/gtk/pygtk packages from: > > http://www.pcpm.ucl.ac.be/~gustin/win32_ports/ > > When your app is complete you can package it with py2exe > -- h

Re: .pth - howto?

2005-11-17 Thread flippetigibbet
Ok, I think I've finally worked out where my error was. My .pth file had: C:\Documents and Settings\user\My Documents\my\scripts\py\mydir and I was importing mydir, but that's wrong. I changed my .pth to have: C:\Documents and Settings\user\My Documents\my\scripts\py and imported mydir and it wo

Re: running functions

2005-11-17 Thread Donn Cave
Quoth Grant Edwards <[EMAIL PROTECTED]>: | 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 | >> l

Re: .pth - howto?

2005-11-17 Thread flippetigibbet
I've just realized. I dropped a copy of my script in site-packages, in order to get it working. When I remove that, I'm back to the orginal problem. If I add the pdb tracing in site.py, I reply 'r' as it enters each function, then I try and import my module and ... >>> import textfile Traceback (m

Re: problem with from win32com.client import Dispatch

2005-11-17 Thread muttu2244
thank you so very much robert, now its working after i put the sleep command. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path.expanduser('~/foo') and MSWindows "My Documents"

2005-11-17 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Try this: > > > from win32com.shell import shell, shellcon > HOMEDIR = shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_PERSONAL) > myfile_location = os.path.join(HOMEDIR, myfile_name) > > Define a HOMEDIR for your various platforms (use

Re: .pth - howto?

2005-11-17 Thread flippetigibbet
I inserted the 'import pdb...' suggestions and set the .pth back to the first thing I'd tried: C:\Documents and Settings\user\My Documents\my\scripts\py\mydir and lo and behold - it works!! Then I took out the "import pdb ...' and ... it still works!! What did you do to my system to get it to wor

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

2005-11-17 Thread Alex Martelli
Ben Finney <[EMAIL PROTECTED]> wrote: > Tony Nelson <[EMAIL PROTECTED]> wrote: > > While we're at it, I use bracketing instead of line continuation: > > > > print ( "a long string, longer than this " > > "and some more of the string" ) > > To continue the pedantry: Those are pare

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? ... > >> depends on somewhere on it. You can use the module name if you have it > >> available. If not, deriving the module name from the file name is > >> about the best you can do. > > I

Re: os.path.expanduser('~/foo') and MSWindows "My Documents"

2005-11-17 Thread jim . mccoy
Try this: from win32com.shell import shell, shellcon HOMEDIR = shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_PERSONAL) myfile_location = os.path.join(HOMEDIR, myfile_name) Define a HOMEDIR for your various platforms (use sys.platform to figure out what choice to make) and the rest of your code

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

2005-11-17 Thread Bengt Richter
On Fri, 18 Nov 2005 11:33:57 +0800, Xiao Jianfeng <[EMAIL PROTECTED]> wrote: >Lars Kellogg-Stedman wrote: > >>>print "a string whcih is very very looo\ >>>ng." >>> >>> >> >>print "a string which is very loo" \ >> + "ong." >> Pers

Re: Reading a file in same directory as code with relative path

2005-11-17 Thread Bengt Richter
On 17 Nov 2005 17:29:55 -0800, [EMAIL PROTECTED] wrote: >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 dire

Re: newbie question: 'import site' failed; use -v for traceback

2005-11-17 Thread Steve Holden
Tony Gill wrote: > Hi, > > I've just downloaded and installed Python 2.4.2 for Windows and am having > troubling getting started. > > My system is: MS Windows XP Pro SP2 > > When I run 'python (command line)' from the start menu the first line in the > CMD window is: > 'import site' failed; u

Re: AJAX => APAX? Or: is there support for python in browsers?

2005-11-17 Thread Tim Roberts
[EMAIL PROTECTED] (Alex Martelli) wrote: >Tim Roberts <[EMAIL PROTECTED]> wrote: > ... >> Internet Explorer will allow any registered ActiveScript language to be >> used in a web page. Python qualifies. In the latest Win32 extensions, >> there is a script in win32comext/axscript/client/pyscrip

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

2005-11-17 Thread Ben Finney
Tony Nelson <[EMAIL PROTECTED]> wrote: > While we're at it, I use bracketing instead of line continuation: > > print ( "a long string, longer than this " > "and some more of the string" ) To continue the pedantry: Those are parentheses, not brackets. Slightly more on-topic, the p

textwrap.dedent() drops tabs - bug or feature?

2005-11-17 Thread Steven Bethard
So I've recently been making pretty frequent use of textwrap.dedent() to allow me to use triple-quoted strings at indented levels of code without getting the extra spaces prefixed to each line. I discovered today that not only does textwrap.dedent() strip any leading spaces, but it also substi

Re: Zope vs Php

2005-11-17 Thread Mike Meyer
Jorge Godoy <[EMAIL PROTECTED]> writes: >> While I'm at it - how does KID do for things that aren't HTML? >> Cheetah integrates with web servers, but can be used to generate >> nearly anything. I've found that using Cheetah scripts to build >> Makefiles that run Cheetah scripts to build a dynamical

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

2005-11-17 Thread Mike Meyer
Xiao Jianfeng <[EMAIL PROTECTED]> writes: > Can I install python2.4.2 and keep using python2.4.1 on IRIX? Yes, but you'll have to install it with a different prefix. Use the --prefix flag to configure when you install it. http://www.mired.org/home/mwm/ Independent WWW/

Re: Importing a class without knowing the module

2005-11-17 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > 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

Re: Zope vs Php

2005-11-17 Thread [EMAIL PROTECTED]
Jorge Godoy wrote: > Kid is for XML output. It won't work with non-HTML output... > I believe someone patches it to output plain text, thus it is possible to do "makefile" like things. I don't have such a need so don't know the detail. It can output XML as well as HTML which I believe you already

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

2005-11-17 Thread Xiao Jianfeng
Andrew MacIntyre wrote: >[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

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

2005-11-17 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Sam Pointon" <[EMAIL PROTECTED]> wrote: > > 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 > whitespa

Re: .pth - howto?

2005-11-17 Thread Peter Hansen
flippetigibbet wrote: > I've tried specifying the .pth file with > r'\documents and settings\user\My Documents\my\scripts\py\dirname' > \DOCUME~1\user\MyDocu~1\my\scripts\py\dirname > /doceme~1/user/MYDOCU~1/MY/SCRIPTS/PY/DIRNAME > but I can't seem to get python 2.4 to pick up an absolute path on >

Re: searching for files on Windows with Python

2005-11-17 Thread Peter Hansen
Kent Johnson wrote: > I always use Jason Orendorff's path module for this kind of stuff. It's > way easier to use than os.whatever: > > import path > files = path.path(pathToSearch).walkfiles(filename) A minor enhancement (IMHO) (though I certainly agree with Kent's recommendation here): since

.pth - howto?

2005-11-17 Thread flippetigibbet
I was thinking that if I create: \documents and settings\user\My Documents\my\scripts\py\dirname\__init__.py and a .pth file in site-packages with something like: \documents and settings\user\My Documents\my\scripts\py\dirname then my script __init__.py should run when I import dirname but it doesn

os.path.expanduser('~/foo') and MSWindows "My Documents"

2005-11-17 Thread Tony Nelson
On *nix, ~/foo refers to a file in a user's home directory. On MSWindows, users normally look at "My Documents" in their home directory. ISTM that a file that my program would put in ~/. on Linux should be put in "~/My Documents/" (modulo os.path.normpath()) on MSWindows, where a user would e

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? ...

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: 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: 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 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: 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: 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://

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: 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:

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: 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 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: 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 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: 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: 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

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: 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

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: 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: 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 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

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 [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

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: 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

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 [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. > >

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: 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: 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: 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

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: 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

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

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

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

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: 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

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 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: 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: 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: 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 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: 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

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: 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

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 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

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: 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

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: 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: 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: 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

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: 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 > >

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: 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: 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

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: 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

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 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: 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: 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

  1   2   3   >