Re: tuple to string?

2005-07-22 Thread Reinhold Birkenfeld
John Machin wrote: > Reinhold Birkenfeld wrote: >> Berthold Höllmann wrote: >> >>>Francois De Serres <[EMAIL PROTECTED]> writes: >>> >>> hiho, what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) to the string 'spam'? >>> >>>.>>> t = (0x73, 0x70, 0x61, 0x6D) >>>.>>

Re: return None

2005-07-22 Thread Terry Reedy
"Ximo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Can I do a function which don't return anything? No, if you mean like subroutines. > The question is that, if I do a function that have a return or without > return, it returns always "None", but i want that it doesnt return

Re: Using python to runother programs

2005-07-22 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > HI guys, > I am trying to automate some project work which the accounting dept > of the company uses. They have to go through multiple steps to achieve > the final goal. Is there some way that I can use python to automate > these manu

Re: wxPython & Fedora Core 4

2005-07-22 Thread linuxfreak
Yup rebuilt the rpms and it worked Thanks a lot guys Sybren Stuvel wrote: > Christophe Lambin enlightened us with: > > However, since your wxPython package wasn't built for FC4, you may > > run into other problems. > > That should be solved by recompiling the wxPython RPMs. > > Sybren > -- > Th

Re: Location of tk.h

2005-07-22 Thread none
Christopher Subich wrote: > none wrote: > >> Probably a stupid question, but... >> >> I was attempting to install the Tkinter 3000 WCK. It blew up trying >> to build _tk3draw. The first error is a 'No such file or directory' >> for tk.h. I can import and use Tkinter just fine, so I'm not sure

Re: PEP on path module for standard library

2005-07-22 Thread Andrew Dalke
George Sakkis wrote: > Bringing up how C models files (or anything else other than primitive types > for that matter) is not a particularly strong argument in a discussion on > OO design ;-) While I have worked with C libraries which had a well-developed OO-like interface, I take your point. Stil

Re: Location of tk.h

2005-07-22 Thread Christopher Subich
none wrote: > Probably a stupid question, but... > > I was attempting to install the Tkinter 3000 WCK. It blew up trying to > build _tk3draw. The first error is a 'No such file or directory' for > tk.h. I can import and use Tkinter just fine, so I'm not sure what is > what here. You can imp

Re: is this pythonic?

2005-07-22 Thread Chris Lambacher
On Thu, Jul 21, 2005 at 10:27:24AM -0400, Bill Mill wrote: > On 7/21/05, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > On Wed, 20 Jul 2005 16:30:10 -0400, Bill Mill wrote: > > > > > On 7/20/05, Simon Brunning <[EMAIL PROTECTED]> wrote: > > >> On 7/20/05, Mage <[EMAIL PROTECTED]> wrote: > > >> > O

Re: Clearing a Text Widget

2005-07-22 Thread Kane Bonnette
Kane Bonnette wrote: > Does anyone know how the clear the text from a Tkinter Text Widget? The > delete(0, END) trick that works for Entry widgets doesn't work for Text > > I get "0 is an invalid index" when i try to do so > > Thanks in advance In case anyone's wondering, you must use 0.0 inste

Re: "Aliasing" an object's __str__ to a different method

2005-07-22 Thread Christopher Subich
ncf wrote: > Well, suffice to say, having the class not inherit from object solved > my problem, as I suspect it may solve yours. ;) Actually, I did a bit of experimenting. If the __str__ reassignment worked as intended, it would just cause an infinite recursion. To paste the class definition a

Location of tk.h

2005-07-22 Thread none
Probably a stupid question, but... I was attempting to install the Tkinter 3000 WCK. It blew up trying to build _tk3draw. The first error is a 'No such file or directory' for tk.h. I can import and use Tkinter just fine, so I'm not sure what is what here. First few lines of install attempt

Clearing a Text Widget

2005-07-22 Thread Kane Bonnette
Does anyone know how the clear the text from a Tkinter Text Widget? The delete(0, END) trick that works for Entry widgets doesn't work for Text I get "0 is an invalid index" when i try to do so Thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple to string?

2005-07-22 Thread Patricia J. Hawkins
QH> On 7/22/05, Francois De Serres <[EMAIL PROTECTED]> wrote: >> what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) to >> the string 'spam'? QH> Use ''.join and chr() as others have pointed out. Here are QH> just-for-fun versions ;) .> t = (0x73, 0x70, 0x61, 0x6D) QH> (use st

Re: Question about namespaces and import. How to avoid calling os.system

2005-07-22 Thread Patricia J. Hawkins
> "PN" == Pekka Niiranen <[EMAIL PROTECTED]> writes: PN> Hi there, PN> I have two scripts. The first "main.py" sets some variables PN> and then imports another called "gen.py". The idea is to PN> provide "main.py" that defines some paths, variables etc. PN> without using Windows environment va

Re: How to modify a file 'in place' ?

2005-07-22 Thread Chris Connett
There is a module in the library called fileinput, should do what you're looking for. -- http://mail.python.org/mailman/listinfo/python-list

Re: "Aliasing" an object's __str__ to a different method

2005-07-22 Thread ncf
In trying to develop a protocol for a current app I'm working on, I was using classes which inherited from object for my core packet, and using str(Message) to convert it to an encoded packet. However, I found that this did not work, and it drove me insane, so in a test file, I wrote the following

Re: PyGTK or wxPython (not a flame war) on Windows

2005-07-22 Thread Neil Hodgson
One thing I don't like with GTK+ on Windows is that it uses GTK+ file dialogs rather than system file dialogs. wxWidgets uses file dialogs that appear very similar to the system dialogs. Depends on your customers but I don't think this is reasonable for most applications. http://www.scintill

Re: "Aliasing" an object's __str__ to a different method

2005-07-22 Thread Jeffrey E. Forcier
On Jul 22, 2005, at 7:46 PM, Michael Hoffman wrote: > I'm too tired and/or lazy to check, but I believe str() is calling > MyClass.__str__(testObject) as it is supposed to rather than > testObject.__str__() as you say it is supposed to. ;-) > > Someone else or Google can probably enlighten you on

Re: PEP on path module for standard library

2005-07-22 Thread Neil Hodgson
Scott David Daniels: > Isn't it even worse than this? > On Win2K & XP, don't the file systems have something to do with the > encoding? So D: (a FAT drive) might naturally be str, while C: > (an NTFS drive) might naturally be unicode. This is generally safe as Windows is using unicode inte

Re: Something that Perl can do that Python can't?

2005-07-22 Thread Andrew Dalke
Dr. Who wrote: > Well, I finally managed to solve it myself by looking at some code. > The solution in Python is a little non-intuitive but this is how to get > it: > > while 1: > line = stdout.readline() > if not line: > break > print 'LINE:', line, > > If anyone can do it th

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
Peter Hansen wrote: > Practically everything that path does, with a few useful exceptions, is > a thin wrapper around the existing calls. If the implementation is easy to explain, it may be a good idea. OT: I just realized you can now type in "python -m this" at the command line, which is conv

Re: "Aliasing" an object's __str__ to a different method

2005-07-22 Thread Michael Hoffman
Jeffrey E. Forcier wrote: > In other words, str() is _NOT_ apparently calling .__str__ as > it's supposed to! However, calling __str__ directly (which, yes, you're > not supposed to do) does work as expected: I'm too tired and/or lazy to check, but I believe str() is calling MyClass.__str__(

Re: Something that Perl can do that Python can't?

2005-07-22 Thread George Sakkis
"Dr. Who" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Well, I finally managed to solve it myself by looking at some code. > The solution in Python is a little non-intuitive but this is how to get > it: > > while 1: > line = stdout.readline() > if not line: > break

Re: PEP on path module for standard library

2005-07-22 Thread George Sakkis
"Andrew Dalke" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > You're right, conceptually a path > > HAS_A string description, not IS_A string, so from a pure OO point of > > view, it should not inherit string. > > How did you decide it's "has-a" vs. "is-a"? > > All C calls use a "char *" fo

Re: query regarding expect

2005-07-22 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Girish <[EMAIL PROTECTED]> wrote: >Hi, > >I wanna do some automation using "pexpect". >I have an application which must be invoked from the command line in >linux environment,it consists of buttons,textboxes etc can i access >those widgets using "pexpect",say i wanna

Re: Detecting computers on network

2005-07-22 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, gene tani <[EMAIL PROTECTED]> wrote: >Hi Sandeep, > >i didn't see where you said if these hosts you want to ping are on your >internal network, or beyond your gateway. Probably the only truly >reliable way to maintain an active hosts list is to install a >ping-sendi

Re: tuple to string?

2005-07-22 Thread John Machin
Reinhold Birkenfeld wrote: > Berthold Höllmann wrote: > >>Francois De Serres <[EMAIL PROTECTED]> writes: >> >> >>>hiho, >>> >>>what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) >>>to the string 'spam'? >> >>.>>> t = (0x73, 0x70, 0x61, 0x6D) >>.>>> ''.join('%c' % c for c in t) >>

Re: Interleave merge pdf files

2005-07-22 Thread ssteward
Mark Jackson wrote: > "Chirayu Krishnappa" <[EMAIL PROTECTED]> writes: > > Hi, > > > > I need to scan documents with pages having printed matter on both > > sides. It is easiest to stack them in the autosheet feeder and let it > > scan. I end up with one file (say A.pdf) containing the odd pages in

"Aliasing" an object's __str__ to a different method

2005-07-22 Thread Jeffrey E. Forcier
I am attempting to write a class whose string representation changes in response to external stimuli. While that effect is obviously possible via other means, I attempted this method first and was surprised when it didn't work, so I now want to know why :) Given the following class definitio

Re: How to modify a file 'in place' ?

2005-07-22 Thread John Machin
Elby wrote: > I'm looking for a the most simple and generic way to modify a file, with the > possibility of making backups. In fact, I would like to emulate Perl's -i > option. > > here is a bit of code, to explain it further : > > < code > > > from os import rename > > class Modif_File

Re: sys.path - stuff from nowhere?

2005-07-22 Thread Robert Kern
Richard Kessler wrote: > Just build python 2.3.4 (needed for Zope and Plone). Trying to learn more > about use the data in sys.path from importing. When I run Python at the > command prompt, import sys and print sys.path I get stuff that makes no > sense. For example, /usr/local/lib/python23.zip.

sys.path - stuff from nowhere?

2005-07-22 Thread Richard Kessler
Just build python 2.3.4 (needed for Zope and Plone). Trying to learn more about use the data in sys.path from importing. When I run Python at the command prompt, import sys and print sys.path I get stuff that makes no sense. For example, /usr/local/lib/python23.zip. Such a file does not even live

Re: Extending python - undefined symbol error on import

2005-07-22 Thread John Machin
ch424 wrote: [snip] > However, when I open up the python command line, and type "from gpib > import *" or "import gpib" I get "ImportError: /usr/.../gpibmodule.so: > undefined symbol: ibdev" -- but I know it's defined in the ni488.h > file, especially as I can use this code from actual C programs

Re: Getting TypeError in Changing file permissions

2005-07-22 Thread Peter Hansen
Benjamin Niemann wrote: > Pranav Bagora wrote: >>" os.chmod(outfile,0700) >>TypeError: coercing to Unicode: need string or buffer, >>file found" > > Looks as if your are using a file object (that you got from an open() call) > as the first parameter. What you need is a string with the path to the

Re: tuple to string?

2005-07-22 Thread Reinhold Birkenfeld
Berthold Höllmann wrote: > Francois De Serres <[EMAIL PROTECTED]> writes: > >> hiho, >> >> what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) >> to the string 'spam'? > > .>>> t = (0x73, 0x70, 0x61, 0x6D) > .>>> ''.join('%c' % c for c in t) > 'spam' Or: t = (0x73, 0x70, 0x61,

Re: PEP on path module for standard library

2005-07-22 Thread Peter Hansen
Michael Hoffman wrote: > Peter Hansen wrote: > >> When files are opened through a "path" object -- e.g. >> path('name').open() -- then file.name returns the path object that was >> used to open it. > > Also works if you use file(path('name')) or open(path('name')). Since that's exactly what th

Re: Query - Pexpect

2005-07-22 Thread Lee Harr
On 2005-07-22, Girish <[EMAIL PROTECTED]> wrote: > Hi , > > I wanna do some automation work using "pexpect". > I have an application which must be invoked from the command line in > linux environment,it consists of buttons,textboxes etc can i access > those widgets using "pexpect",say i wanna enter

Re: Extending python - undefined symbol error on import

2005-07-22 Thread Daniel Dittmar
ch424 wrote: > However, when I open up the python command line, and type "from gpib > import *" or "import gpib" I get "ImportError: /usr/.../gpibmodule.so: > undefined symbol: ibdev" -- but I know it's defined in the ni488.h > file, especially as I can use this code from actual C programs without

Re: PEP on path module for standard library

2005-07-22 Thread John Machin
Michael Hoffman wrote: > John Roth wrote: > >> However, a path as a sequence of characters has even less >> meaning - I can't think of a use, while I have an application >> where traversing a path as a sequence of path elements makes >> perfect sense: I need to descend the directory structure, dir

Re: Something that Perl can do that Python can't?

2005-07-22 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Dr. Who" <[EMAIL PROTECTED]> wrote: > So here it is: handle unbuffered output from a child process. Your Perl program works the same for me, on MacOS X, as your Python program. That's what we would expect, of course, because the problem is with the (Python) progr

Re: Something that Perl can do that Python can't?

2005-07-22 Thread Dr. Who
Well, I finally managed to solve it myself by looking at some code. The solution in Python is a little non-intuitive but this is how to get it: while 1: line = stdout.readline() if not line: break print 'LINE:', line, If anyone can do it the more Pythonic way with some sort of

Re: PEP on path module for standard library

2005-07-22 Thread John Machin
Daniel Dittmar wrote: > Duncan Booth wrote: > >> I would have expected a path object to be a sequence of path elements >> rather than a sequence of characters. > > > Maybe it's nitpicking, but I don't think that a path object should be a > 'sequence of path elements' in an iterator context.

Re: Mapping a drive to a network path

2005-07-22 Thread Thierry Lam
Thanks, that helps. Thierry -- http://mail.python.org/mailman/listinfo/python-list

Something that Perl can do that Python can't?

2005-07-22 Thread Dr. Who
So here it is: handle unbuffered output from a child process. Here is the child process script (bufcallee.py): import time print 'START' time.sleep(10) print 'STOP' In Perl, I do: open(FILE, "python bufcallee.py |"); while ($line = ) {

Re: Question about namespaces and import. How to avoid calling os.system

2005-07-22 Thread Jeff Epler
In main.py, execfile("gen.py") or In gen.py, have something like from __main__ import env_params or In main.py, have something like import __builtins__; __builtins__.env_params = env_params or call a function in the gen.py with env_params as a parameter import gen gen.do(env_p

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
Peter Hansen wrote: >> Most prominent change is that it doesn't inherit from str/unicode >> anymore. >> I found this distinction important, because as a str subclass the Path >> object >> has many methods that don't make sense for it. > > On this topic, has anyone ask the original author (Jason

Re: PyGTK or wxPython (not a flame war) on Windows

2005-07-22 Thread Jarek Zgoda
TPJ napisał(a): > In the nearest future I will have to decide what to use: PyGTK or > wxPython. I like those both APIs. wxPython has more widgets, but PyGTK > seems to be faster. I can use them both for free (it's very important). > My only concern is that although I'm doing development on Linux,

Re: What does "::" mean?

2005-07-22 Thread Paul Villani
I'm very new to Python, but I think it's really ':' and ':' side-by-side with no values, not a single "::". In V2.3 and higher, slicing supports an optional third index which works as a step, e.g., X[2:9:2] fetches every other item in indexes 2-8. The useage you cite is really defaultin

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
Reinhold Birkenfeld wrote: > Andrew Dalke wrote: > >>I disagree. I've tried using a class which wasn't derived from >>a basestring and kept running into places where it didn't work well. >>For example, "open" and "mkdir" take strings as input. There is no >>automatic coercion. > > Well, as a Pa

Re: Question about namespaces and import. How to avoid calling os.system

2005-07-22 Thread Pekka Niiranen
Thanks, I will analyse these 4 options and select the most suitable since there are other issues involved too, like "the "main.py" reads contents of a file to a list that gets passed to the "gen.py" with dictionary "env_params"". I try to avoid parsing the contents of the file both in "main.py" an

Re: Python and Tablet PC: limitations?

2005-07-22 Thread Do Re Mi chel La Si Do
Hi ! I am a Tablet-PC's user. I am a Python programmer. I am happy, with this combo. For use Tablet's extensions, I use Internet-Explorer, drived by Python (via .HTA). Your problem is not Python, but, perhaps, Mozilla ? @-salutations Michel Claveau -- http://mail.python.org/mailman/listinf

Re: Getting TypeError in Changing file permissions

2005-07-22 Thread Jeff Epler
If you are using Unix, and all you have is the file object, you can use os.fchmod(outfile.fileno(), 0700) Jeff pgp8U05e26RUt.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting TypeError in Changing file permissions

2005-07-22 Thread Benjamin Niemann
Pranav Bagora wrote: > Hello , > i am trying to change mode of files using the > os.chmod()function. But i am getting an error > > " os.chmod(outfile,0700) > TypeError: coercing to Unicode: need string or buffer, > file found" Looks as if your are using a file object (that you got from an open()

Getting TypeError in Changing file permissions

2005-07-22 Thread Pranav Bagora
Hello , i am trying to change mode of files using the os.chmod()function. But i am getting an error " os.chmod(outfile,0700) TypeError: coercing to Unicode: need string or buffer, file found" Please Help, Pranav __ Do You Yahoo!? Tired of spam?

Re: PEP on path module for standard library

2005-07-22 Thread Reinhold Birkenfeld
Andrew Dalke wrote: > Duncan Booth wrote: >> Personally I think the concept of a specific path type is a good one, but >> subclassing string just cries out to me as the wrong thing to do. > > I disagree. I've tried using a class which wasn't derived from > a basestring and kept running into plac

Re: Mapping a drive to a network path

2005-07-22 Thread Jeff Epler
in fact, see this thread, it may have something useful for you: http://mail.python.org/pipermail/python-win32/2003-April/000959.html Jeff pgprYPOH3yOyI.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
Peter Hansen wrote: > When files are opened through a "path" object -- e.g. > path('name').open() -- then file.name returns the path object that was > used to open it. Also works if you use file(path('name')) or open(path('name')). -- Michael Hoffman -- http://mail.python.org/mailman/listinfo

Re: tuple to string?

2005-07-22 Thread Berthold Höllmann
Francois De Serres <[EMAIL PROTECTED]> writes: > hiho, > > what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) > to the string 'spam'? .>>> t = (0x73, 0x70, 0x61, 0x6D) .>>> ''.join('%c' % c for c in t) 'spam' -- "Es gelten die Regeln der christlichen Seefahrt: Rot und Grün mar

Re: Mapping a drive to a network path

2005-07-22 Thread Jeff Epler
import os os.system(r"net use z: \\computer\folder") Something in the win32net module of win32all may be relevant if you don't want to do it through os.system: http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/pywin32/win32net__NetUseAdd_meth.html Jeff pgp7mEoPdAfNP.pgp Description: P

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
Scott David Daniels wrote: > Duncan Booth wrote: > >> BTW, does it matter at all in practical use that the base class of >> path varies between str and unicode depending on the platform? > > Isn't it even worse than this? > On Win2K & XP, don't the file systems have something to do with the > en

Question about namespaces and import. How to avoid calling os.system

2005-07-22 Thread Pekka Niiranen
Hi there, I have two scripts. The first "main.py" sets some variables and then imports another called "gen.py". The idea is to provide "main.py" that defines some paths, variables etc. without using Windows environment variables. Various other "hackers" will make additional Python scripts (subrout

Mapping a drive to a network path

2005-07-22 Thread Thierry Lam
In DOS, if I want to map a network path to a drive, I do the following: net use z: \\computer\folder How do we do something similar in python? Thanks Thierry -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting environment variables for tcsh session

2005-07-22 Thread Dan Sommers
On Fri, 22 Jul 2005 10:56:22 -0500, David Durkee <[EMAIL PROTECTED]> wrote: > I didn't get much from the discussion of Command Substitution. Any tips > on how to do that? I don't use tcsh, so there may be some subtleties I don't get, but it's going to look something like this: c

Re: PEP on path module for standard library

2005-07-22 Thread Terry Reedy
"Michael Hoffman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> on 22.07.2005 00:21 Michael Hoffman said the following: >>> Any Java hackers here want to tell us of the wonders of the Java Path >>> class? > Ah, here it is: > > http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.

Re: Separation of Code in CGI App

2005-07-22 Thread Paul McNett
Rob Cowie wrote: > So to be clear, if a .py module is in the same directory as my python > cgi script, I can import it thus 'import XXX.py'? Not quite. If you had a XXX.py, XXX.pyc, and/or XXX.pyo in the same directory as your Python cgi script, you'd import it by issuing: import XXX -- Paul

Re: PEP on path module for standard library

2005-07-22 Thread Oliver Andrich
Hi, 2005/7/22, Michael Hoffman <[EMAIL PROTECTED]>: > What is this Java Path class? I have been STFWing and have found nothing > on it in the. Indeed if you search for "Java Path class" (with quotes) > almost half of the pages are this message from Guido. ;) > > Any Java hackers here want to tell

Re: PEP on path module for standard library

2005-07-22 Thread Peter Hansen
Reinhold Birkenfeld wrote: > FYI: I modified the path module a bit so that it fits many of the suggestions > from python-dev, and put the result in the Python CVS tree under > nondist/sandbox/path. By the way, thanks for doing this Reinhold! > Most prominent change is that it doesn't inherit from

Re: PEP on path module for standard library

2005-07-22 Thread Peter Hansen
Duncan Booth wrote: > As I said elsewhere I haven't > used path for anything real, so I'm still finding surprises such as why > this doesn't do what I expect: > p = path('a/b') q = path('c/d') p+q > > path(u'a/bc/d') Just a note, though you probably know, that this is intended to b

Re: PEP on path module for standard library

2005-07-22 Thread Peter Hansen
Stefan Rank wrote: > (It would be nice to get `path`(s) easily from a `file`, at the moment > there is only file.name if I'm not mistaken). When files are opened through a "path" object -- e.g. path('name').open() -- then file.name returns the path object that was used to open it. -Peter --

Re: PEP on path module for standard library

2005-07-22 Thread Peter Hansen
Duncan Booth wrote: > BTW, does it matter at all in practical use that the base class of path > varies between str and unicode depending on the platform? I haven't seen any problem. I confess I can't even imagine exactly what the problem might be, since they're both subclasses of basestring, a

Re: return None

2005-07-22 Thread Andreas Kostyrka
On Fri, Jul 22, 2005 at 07:40:00PM +0200, Ximo wrote: > Can I do a function which don't return anything? > > The question is that, if I do a function that have a return or without > return, it returns always "None", but i want that it doesnt return me > nothing Define nothing :) None is the repr

Re: return None

2005-07-22 Thread Grant Edwards
On 2005-07-22, Roy Smith <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, Ximo <[EMAIL PROTECTED]> wrote: >>Can I do a function which don't return anything? >> >>The question is that, if I do a function that have a return or without >>return, it returns always "None", but i want that i

Re: Python and Tablet PC: limitations?

2005-07-22 Thread Peter Hansen
André wrote: > I'm considering buying a Tablet PC and read somewhere (sorry, can't > point to a link) that someone had tried running a "standard" Python > program (wxMozilla demo I *think*, but can't be sure) that simply > crashed. > > Any happy Tablet PC user/Python programmer combo? If so, any

Re: wxPythin installation woes

2005-07-22 Thread Florian Diesch
linuxfreak <[EMAIL PROTECTED]> wrote: > > Sybren Stuvel wrote: >> linuxfreak enlightened us with: >> > Turns out that libstdc++.so.5 is needed but I checked and i see >> > that libstdc++.so.6 is installed on my system. >> >> On my system (Ubuntu, based on Debian), I can have multiple versions >> o

Re: PEP on path module for standard library

2005-07-22 Thread Terry Reedy
"Daniel Dittmar" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Duncan Booth wrote: >> I would have expected a >> path object to be a sequence of path elements rather than a sequence of >> characters. Glad I'm not the only oddball. > Maybe it's nitpicking, but I don't think tha

Re: return None

2005-07-22 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Ximo <[EMAIL PROTECTED]> wrote: >Can I do a function which don't return anything? > >The question is that, if I do a function that have a return or without >return, it returns always "None", but i want that it doesnt return me >nothing What do you mean by "don't r

Re: Interleave merge pdf files

2005-07-22 Thread Mark Jackson
"Chirayu Krishnappa" <[EMAIL PROTECTED]> writes: > Hi, > > I need to scan documents with pages having printed matter on both > sides. It is easiest to stack them in the autosheet feeder and let it > scan. I end up with one file (say A.pdf) containing the odd pages in > sequence. Similarly, I can e

Re: Difference between " and '

2005-07-22 Thread Brian van den Broek
Andrew Dalke said unto the world upon 2005-07-22 13:30: > François Pinard wrote: > >>There is no strong reason to use one and avoid the other. Yet, while >>representing strings, Python itself has a _preference_ for single >>quotes. > > > I use "double quoted strings" in almost all cases becaus

Re: return None

2005-07-22 Thread geon
Ximo wrote: > Can I do a function which don't return anything? > > The question is that, if I do a function that have a return or without > return, it returns always "None", but i want that it doesnt return me > nothing Nothing is None, or isnt? You probably print the function, what you neednt

rcslib.py doesn't like dot in revision numbers?

2005-07-22 Thread Chris Shenton
[Disclaimer: I'm a python newbie.] I'm using rcslib.py to massage an RCS repo. The code uses a "name_rev" object which acts two ways: 1. if it's a string, represents the head version of the file 2. if a tuple (name, rev) represents a name and a revision Works fine if I use it like: checkout(

Re: Separation of Code in CGI App

2005-07-22 Thread Rob Cowie
Thanks, I have run through the tutorial - very good. One day, I'd like to try and organise a similar tutorial involving CGI programming. There are several very basic examples, but they leave plenty of unanswered questions such as how to best structure a cgi app, apache permissions, etc So to be c

Using python to runother programs

2005-07-22 Thread adityabhambri
HI guys, I am trying to automate some project work which the accounting dept of the company uses. They have to go through multiple steps to achieve the final goal. Is there some way that I can use python to automate these manual steps. I can give you an example. 1. run the crystal report using s

Re: return None

2005-07-22 Thread Michael Hoffman
Ximo wrote: > Can I do a function which don't return anything? > > The question is that, if I do a function that have a return or without > return, it returns always "None", but i want that it doesnt return me > nothing When you execute the statement a = myfunction() What do you want to be in

Re: Iterators from urllib2

2005-07-22 Thread Andrew Dalke
Joshua Ginsberg wrote: > >>> dir(ifs) > ['__doc__', '__init__', '__iter__', '__module__', '__repr__', 'close', > 'fileno', 'fp', 'geturl', 'headers', 'info', 'next', 'read', > 'readline', 'readlines', 'url'] > > Yep. But what about in my code? I modify my code to print dir(ifs) > before cr

return None

2005-07-22 Thread Ximo
Can I do a function which don't return anything? The question is that, if I do a function that have a return or without return, it returns always "None", but i want that it doesnt return me nothing Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between " and '

2005-07-22 Thread Andrew Dalke
François Pinard wrote: > There is no strong reason to use one and avoid the other. Yet, while > representing strings, Python itself has a _preference_ for single > quotes. I use "double quoted strings" in almost all cases because I think it's easier to see than 'single quoted quotes'.

Re: time.time() under load between two machines

2005-07-22 Thread Tim Peters
[EMAIL PROTECTED] > I am seeing negative latencies of up to 1 second. I am using ntp to > synchronize both machines at an interval of 2 seconds, so the clocks > should be very much in sync (and are from what I have observed). I > agree that it is probably OS, perhaps I should hop over to a Micro

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
John Roth wrote: > However, a path as a sequence of characters has even less > meaning - I can't think of a use, while I have an application > where traversing a path as a sequence of path elements makes > perfect sense: I need to descend the directory structure, directory > by directory, looking

Re: PEP on path module for standard library

2005-07-22 Thread Scott David Daniels
Duncan Booth wrote: > BTW, does it matter at all in practical use that the base class of path > varies between str and unicode depending on the platform? Isn't it even worse than this? On Win2K & XP, don't the file systems have something to do with the encoding? So D: (a FAT drive) might natural

Re: PEP on path module for standard library

2005-07-22 Thread Andrew Dalke
George Sakkis wrote: > You're right, conceptually a path > HAS_A string description, not IS_A string, so from a pure OO point of > view, it should not inherit string. How did you decide it's "has-a" vs. "is-a"? All C calls use a "char *" for filenames and paths, meaning the C model file for the f

Re: decoding html

2005-07-22 Thread gene tani
http://docs.python.org/lib/module-htmlentitydefs.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting computers on network

2005-07-22 Thread gene tani
Hi Sandeep, i didn't see where you said if these hosts you want to ping are on your internal network, or beyond your gateway. Probably the only truly reliable way to maintain an active hosts list is to install a ping-sending client on them, like http://aspn.activestate.com/ASPN/Cookbook/Python/R

Re: use libs from one of two releases

2005-07-22 Thread Terry Reedy
"Alberto Vera" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have two versions of Python. They were intalled in two different >folders. (python22 and python23) >I have an old py that works in an older version. I presume you mean older than 2.2 > How can I change my old py to

Re: PEP on path module for standard library

2005-07-22 Thread Andrew Dalke
Duncan Booth wrote: > Personally I think the concept of a specific path type is a good one, but > subclassing string just cries out to me as the wrong thing to do. I disagree. I've tried using a class which wasn't derived from a basestring and kept running into places where it didn't work well.

Re: PEP on path module for standard library

2005-07-22 Thread Duncan Booth
Michael Hoffman wrote: > Here's some code I just wrote seconds ago to construct a path for a > scp upload: > > """ > DST_DIRPATH = path("host:~/destination") > RSS_EXT = "rss" > > dst_filenamebase = os.extsep.join([postcode.lower(), RSS_EXT]) > dst_filepath = DST_DIRPATH.joinpath(dst_filenamebas

Interleave merge pdf files

2005-07-22 Thread Chirayu Krishnappa
Hi, I need to scan documents with pages having printed matter on both sides. It is easiest to stack them in the autosheet feeder and let it scan. I end up with one file (say A.pdf) containing the odd pages in sequence. Similarly, I can end up with B.pdf containing the even pages. I want to combine

Re: PEP on path module for standard library

2005-07-22 Thread John Roth
"Daniel Dittmar" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Duncan Booth wrote: >> I would have expected a path object to be a sequence of path elements >> rather than a sequence of characters. > > Maybe it's nitpicking, but I don't think that a path object should be a > 'seq

Python and Tablet PC: limitations?

2005-07-22 Thread André
I'm considering buying a Tablet PC and read somewhere (sorry, can't point to a link) that someone had tried running a "standard" Python program (wxMozilla demo I *think*, but can't be sure) that simply crashed. Any happy Tablet PC user/Python programmer combo? If so, any word of advice, suggestio

Re: tuple to string?

2005-07-22 Thread Qiangning Hong
Francois De Serres wrote: > hiho, > > what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) to > the string 'spam'? Use ''.join and chr() as others have pointed out. Here are just-for-fun versions ;) .>>> t = (0x73, 0x70, 0x61, 0x6D) (use string formatter): .>>> '%c%c%c%c' % t

Re: PEP on path module for standard library

2005-07-22 Thread John Roth
"Duncan Booth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > John Roth wrote: >> You have to start somewhere. One of the lessons that's beginning >> to seep into people's minds is that getting something that works >> out there is almost always preferable to (over) design by commi

  1   2   3   >