Re: how to print out each single char from a string in HEX format?

2007-06-05 Thread Troels Thomsen
> Great! It works. > There is a builtin function called hex() that does the same, but also shares the same problem as the solution above: >>> hex(10) '0xa' >>> This is probably not "nice" in your printouts, it doesn't allign. with the printf inspired solution you can set the precision like

Re: subprocess leaves child living

2007-06-05 Thread Thomas Dybdahl Ahle
Den Tue, 05 Jun 2007 22:01:44 +0200 skrev Rob Wolfe: > Thomas Dybdahl Ahle <[EMAIL PROTECTED]> writes: > >> But you can't ever catch sigkill. > > There is no protection against sigkill. > >> Isn't there a way to make sure the os kills the childprocess when the >> parrent dies? > > If the paren

Re: Getting mount stats for filesystems

2007-06-05 Thread Martin v. Löwis
> I am looking at ctypes and it might do what I need but I can't figure > out a way to convert a Python File object to a C FILE pointer (which is > the needed argument for getmntent). > > Any ideas? I think you are supposed to pass the pointer to getmntent that you obtained from setmntent (likely

Re: subprocess leaves child living

2007-06-05 Thread Thomas Dybdahl Ahle
Den Tue, 05 Jun 2007 15:46:39 -0500 skrev Michael Bentley: > But actually *that* is an orphan process. When a parent process dies > and the child continues to run, the child becomes an orphan and is > adopted by init. Orphan processes can be cleaned up on most Unices with > 'init q' (or somethin

Re: how to print out each single char from a string in HEX format?

2007-06-05 Thread Grant Edwards
On 2007-06-05, Troels Thomsen wrote: > with the printf inspired solution you can set the precision like this: > a = "12\n34" for c in a: > ... print "%#04x" % ord(c), > ... > 0x31 0x32 0x0a 0x33 0x34 And if you just want to do the conversion w/o printing: >>> a = "12\n34" >>> ' '.j

PATH or PYTHONPATH under Windows ???

2007-06-05 Thread Stef Mientki
hello, after cleaning up a PC, Python can't find any libraries anymore. But happily I've still one PC, where Python is running perfect. Now I always read about the environment variable "PYTHONPATH". But on neither PC there exists a "PYTHONPATH". On the PC that works ok, there is the standard "PAT

Re: which "GUI module" you suggest me to use?

2007-06-05 Thread Michel Claveau
Hi! Only under Win: PLUIE (http://ponx.org/ponx/guie) This GUI is natively HTML. -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter - resize tkMessageBox

2007-06-05 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Glenn Hutchings <[EMAIL PROTECTED]> wrote: >On 4 Jun, 21:29, [EMAIL PROTECTED] wrote: >> Is there a way to resize the width of the "tkMessageBox.askyesno" >> dialog box, so that the text does not wrap to the next line. > >You can use the Tk option database, either e

Re: Tkinter - resize tkMessageBox

2007-06-05 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, jim-on-linux <[EMAIL PROTECTED]> wrote: >On Monday 04 June 2007 16:29, [EMAIL PROTECTED] >wrote: >> Hi, >> Is there a way to resize the width of the >> "tkMessageBox.askyesno" dialog box, so that the >> text does not wrap to the next line. Thanks >> Rahul >I don't

Re: subprocess leaves child living

2007-06-05 Thread Michael Bentley
On Jun 5, 2007, at 4:17 PM, Thomas Dybdahl Ahle wrote: > Den Tue, 05 Jun 2007 15:46:39 -0500 skrev Michael Bentley: > >> But actually *that* is an orphan process. When a parent process dies >> and the child continues to run, the child becomes an orphan and is >> adopted by init. Orphan processe

Re: Logging: how to suppress default output when adding handlers?

2007-06-05 Thread Vinay Sajip
On Jun 5, 8:38 pm, Chris Shenton <[EMAIL PROTECTED]> wrote: > Yeah, I think this is the cause. Unfortunately I'm using a couple > dozen files and a bunch more libraries and if they're doing a logging.debug() > or whatnot they're creating this. I wouldn't have thought that well-written third part

Re: which "GUI module" you suggest me to use?

2007-06-05 Thread Simon Yau
On Jun 5, 2:57 pm, ZioMiP <[EMAIL PROTECTED]> wrote: > Hi to all... > > I'm actually using Tkinter for my GUI... but I need to "put a piece of a > web-page in a widget" how can I do? > > which GUI module do you suggest me to use for do that? > > or which GUI module do you suggest me to use at all?

Re: which "GUI module" you suggest me to use?

2007-06-05 Thread Matimus
> I know that WxPython work only under Windows Hmm, there seems to be some disparity between what you know and the truth... WxPython works everywhere (Windows, Linux, MacOS), and it works well. Also, it has web widgets that come standard (wx.html.HtmlWindow). Matt -- http://mail.python.org/mai

Re: which "GUI module" you suggest me to use?

2007-06-05 Thread ZioMiP
Matimus ha scritto: >> I know that WxPython work only under Windows > > Hmm, there seems to be some disparity between what you know and the > truth... > > WxPython works everywhere (Windows, Linux, MacOS), and it works well. > Also, it has web widgets that come standard (wx.html.HtmlWindow). > >

Re: which "GUI module" you suggest me to use?

2007-06-05 Thread montyphyton
ZioMiP je napisao/la: > Hi to all... > > I'm actually using Tkinter for my GUI... but I need to "put a piece of a > web-page in a widget" how can I do? > > which GUI module do you suggest me to use for do that? > > or which GUI module do you suggest me to use at all? > > I'm acutally using Windows

which "GUI module" you suggest me to use?

2007-06-05 Thread ZioMiP
Hi to all... I'm actually using Tkinter for my GUI... but I need to "put a piece of a web-page in a widget" how can I do? which GUI module do you suggest me to use for do that? or which GUI module do you suggest me to use at all? I'm acutally using Windows Xp but I also use Linux... I know th

Re: c[:]()

2007-06-05 Thread Terry Reedy
"Warren Stringer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I am porting code that only uses this form |a[:4]b() | | Which translates to: | | for i in range(4): |a[i].b() Or, more directly and perhaps more efficiently: for e in a[:4]: e.b() tjr -- http://mail.py

Re: subprocess leaves child living

2007-06-05 Thread Michael Bentley
On Jun 5, 2007, at 5:13 PM, Michael Bentley wrote: > > On Jun 5, 2007, at 4:17 PM, Thomas Dybdahl Ahle wrote: > >> Den Tue, 05 Jun 2007 15:46:39 -0500 skrev Michael Bentley: >> >>> But actually *that* is an orphan process. When a parent process >>> dies >>> and the child continues to run, the

Re: PATH or PYTHONPATH under Windows ???

2007-06-05 Thread Giuseppe Di Martino
Il Tue, 05 Jun 2007 23:57:15 +0200, Stef Mientki ha scritto: > hello, > > after cleaning up a PC, Python can't find any libraries anymore. > But happily I've still one PC, where Python is running perfect. > Now I always read about the environment variable "PYTHONPATH". > But on neither PC there e

Re: Does Boost.Python participate in cyclic gc?

2007-06-05 Thread Matimus
> The solution was to recognize when we where finished with it to set > self.over_there to None. To my knowledge python does not handle all cyclic gc anyway. Here is some information from the gc documentation: [doc] garbage A list of objects which the collector found to be unreachable but could

Re: which "GUI module" you suggest me to use?

2007-06-05 Thread ZioMiP
Cameron Laird ha scritto: > In article <[EMAIL PROTECTED]>, > ZioMiP <[EMAIL PROTECTED]> wrote: >> Hi to all... >> >> I'm actually using Tkinter for my GUI... but I need to "put a piece of a >> web-page in a widget" how can I do? >> >> which GUI module do you suggest me to use for do that? >> >>

Re: PATH or PYTHONPATH under Windows ???

2007-06-05 Thread Joe Salmeri
Modify the PATHEXT environment variable to include .py; For example the default one on Windows XP is: PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH; Modify it so it says: PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.py Now you can run python programs from your c

Re: Python rocks

2007-06-05 Thread Klaas
On Jun 3, 8:56 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > Allowing a trailing ! in method names has no such cost, because in no > language I know is ! used as a "postfix unary operator"; the gain in the > convention "mutators end with !" is not huge, but substantial. So, the > tradeoffs are d

Re: which "GUI module" you suggest me to use?

2007-06-05 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, ZioMiP <[EMAIL PROTECTED]> wrote: >Hi to all... > >I'm actually using Tkinter for my GUI... but I need to "put a piece of a >web-page in a widget" how can I do? > >which GUI module do you suggest me to use for do that? > >or which GUI module do you suggest me to us

Re: magic names in python

2007-06-05 Thread Steven D'Aprano
On Tue, 05 Jun 2007 18:08:31 +, Lenard Lindstrom wrote: > Steven D'Aprano wrote: >> On Mon, 04 Jun 2007 22:19:35 +, Lenard Lindstrom wrote: >> >>> What is "magic" about __init__ and __repr__? They are identifiers just >>> like "foo" or "JustAnotherClass". They have no special meaning to

Re: Who uses Python?

2007-06-05 Thread Klaas
On Jun 4, 12:37 pm, walterbyrd <[EMAIL PROTECTED]> wrote: > I mean other than sysadmins, programmers, and web-site developers? > > I have heard of some DBAs who use a lot of python. > > I suppose some scientists. I think python is used in bioinformatics. I > think some math and physics people use p

copying generatrors

2007-06-05 Thread Horace Enea
Does anyone have code to copy a generator? Here is what I'd like to do: def foo(): yield 1 yield 2 yield 3 f = foo() g = copy(foo) print f.next() 1 print f.next() 2 print g.next() 1 Thanks, Horace -- http://mail.python.org/mailman/listinfo/python-list

Re: copying generatrors

2007-06-05 Thread Matimus
Why not just do this: >>> def foo(): ... yield 1 ... yield 2 ... yield 3 ... >>> f = foo() >>> g = foo() >>> f.next() 1 >>> f.next() 2 >>> f.next() 3 >>> g.next() 1 >>> g.next() 2 >>> g.next() 3 -- http://mail.python.org/mailman/listinfo/python-list

Need a Little Help on Tkinter and Python

2007-06-05 Thread W. Watson
I have about a 1600 line Pythron program I'd like to make some simple mods to, but have really just a nodding acquaintance with Python and Tkinter. I know quite a few languages, including C++. Let's change that. I've not used anything but C in recent years, and C++ was in my bag before that alon

Re: which "GUI module" you suggest me to use?

2007-06-05 Thread Grant Edwards
On 2007-06-05, ZioMiP <[EMAIL PROTECTED]> wrote: > I know that WxPython work only under Windows and PyGTK work only under > Linux... You 'know' wrong. wxPython works fine under Windows, Linux and OSX. PyGTK works under Linux and Windows, but doens't use native widgets under Windows, so it wo

Re: copying generatrors

2007-06-05 Thread Horace Enea
My example wasn't very good. Here's another try: def foo(): yield 1 yield 2 yield 3 f = foo() f.next() 1 g=copy(f) # copy the generator after an iteration f.next() 2 f.next() 3 g.next() 2 I want to copy the generator's state after one or more iterations. In article <[EMAI

Re: copying generatrors

2007-06-05 Thread Steven Bethard
Horace Enea wrote: > My example wasn't very good. Here's another try: > > def foo(): >yield 1 >yield 2 >yield 3 > > f = foo() > f.next() > 1 > > g=copy(f) # copy the generator after an iteration > > f.next() > 2 > f.next() > 3 > > g.next() > 2 > > I want to copy the generat

Re: excel library without COM

2007-06-05 Thread james_027
On Jun 5, 6:17 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jun 5, 1:04 pm, james_027 <[EMAIL PROTECTED]> wrote: > > > > > On Jun 4, 8:16 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > On Jun 4, 3:52 pm, yuce <[EMAIL PROTECTED]> wrote: > > > > > i think this one works pretty nice:http://www.

Re: Who uses Python?

2007-06-05 Thread Steve Howell
--- walterbyrd <[EMAIL PROTECTED]> wrote: > I am getting the idea that most python "programmers" > use python more > like a tool, rather than as their primary > specialization. In other > words, python is usually not the primary > specialization. I'm one of the exceptions to this rule. My prima

Re: which "GUI module" you suggest me to use?

2007-06-05 Thread Eric
On Jun 5, 4:17 pm, ZioMiP <[EMAIL PROTECTED]> wrote: > Cameron Laird ha scritto: > > > > > In article <[EMAIL PROTECTED]>, > > ZioMiP <[EMAIL PROTECTED]> wrote: > >> Hi to all... > > >> I'm actually using Tkinter for my GUI... but I need to "put a piece of a > >> web-page in a widget" how can I do

Which class's comparison function is called?

2007-06-05 Thread Bill Jackson
For example, class A: def __init__(self,a): self.a = a def __eq__(self, other): return self.a == other.a class B: def __init__(self,b): self.b = b def __eq__(self, other): return self.b == other.b A(1) == B(1) ---> AttributeError: B instance has no attribute a B

Re: copying generatrors

2007-06-05 Thread Horace Enea
Steve, Hey, thanks. I'll try that. Horace In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: > Horace Enea wrote: > > My example wasn't very good. Here's another try: > > > > def foo(): > >yield 1 > >yield 2 > >yield 3 > > > > f = foo() > > f.next() > > 1 >

Re: c[:]()

2007-06-05 Thread Steven D'Aprano
On Tue, 05 Jun 2007 18:26:50 -0400, Terry Reedy wrote: > "Warren Stringer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] | I am porting code that > only uses this form |a[:4]b() > | > | Which translates to: > | > | for i in range(4): > |a[i].b() > > Or, more directly and p

Re: web development without using frameworks

2007-06-05 Thread Chris Stewart
Interesting. So I guess to accomplish my goals, I'll have to explore one of these frameworks. On 6/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: On Jun 5, 9:24 pm, Christoph Haas <[EMAIL PROTECTED]> wrote: > On Tue, Jun 05, 2007 at 03:01:01PM -0400, Chris Stewart wrote: > > I'm intereste

Re: get_traceback

2007-06-05 Thread Gabriel Genellina
En Mon, 04 Jun 2007 23:03:04 -0300, <[EMAIL PROTECTED]> escribió: > Thanks Gabriel. That was exactly what I was looking for. Also, I'm > glad to make a connection to the StringIO class. I'm sure I will > remember it the next time I need it. Glad to see it helped. Certainly StringIO is a good t

Re: Which class's comparison function is called?

2007-06-05 Thread Basilisk96
Try adding the following diagnostic messages to your __eq__ class definitions, and see if it will dispel the confusion for the four equality tests you have tried: class A: def __init__(self,a): self.a = a def __eq__(self, other): print "(A) self:%r, other:%r" %(self.__class__,

Re: Which class's comparison function is called?

2007-06-05 Thread Steven D'Aprano
On Tue, 05 Jun 2007 19:16:53 -0700, Bill Jackson wrote: [snip] > From the above, it seems that Python always uses the function defined > by the class on the LEFT. However, I don't understand the following > then: [snip] In general, infix operators like + - * etc. will call the appropriate me

Re: c[:]()

2007-06-05 Thread Erik Max Francis
Steven D'Aprano wrote: > On Tue, 05 Jun 2007 18:26:50 -0400, Terry Reedy wrote: > >> "Warren Stringer" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] | I am porting code that >> only uses this form |a[:4]b() >> | >> | Which translates to: >> | >> | for i in range(4): >> |a

Re: Embedding Python in C

2007-06-05 Thread Gabriel Genellina
En Tue, 05 Jun 2007 03:41:19 -0300, <[EMAIL PROTECTED]> escribió: > On 5 Jun., 01:32, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> Yes, it appears that you are building a plain list but your code is >> expecting another kind of object. I'm unfamiliar with Numeric arrays, if >> that is what y

Re: Who uses Python?

2007-06-05 Thread [EMAIL PROTECTED]
On Jun 6, 12:07 pm, Steve Howell <[EMAIL PROTECTED]> wrote: > --- walterbyrd <[EMAIL PROTECTED]> wrote: > > I am getting the idea that most python "programmers" > > use python more > > like a tool, rather than as their primary > > specialization. In other > > words, python is usually not the primar

Re: web development without using frameworks

2007-06-05 Thread Michele Simionato
On Jun 5, 9:24 pm, Christoph Haas <[EMAIL PROTECTED]> wrote: > On Tue, Jun 05, 2007 at 03:01:01PM -0400, Chris Stewart wrote: > > I'm interested in learning web based python without the use of fancy > > frameworks > > that are out there. I'm having a hard time coming up with resources and > > exa

Re: which "GUI module" you suggest me to use?

2007-06-05 Thread [EMAIL PROTECTED]
On Jun 6, 12:13 pm, Eric <[EMAIL PROTECTED]> wrote: > On Jun 5, 4:17 pm, ZioMiP <[EMAIL PROTECTED]> wrote: > > > > > Cameron Laird ha scritto: > > > > In article <[EMAIL PROTECTED]>, > > > ZioMiP <[EMAIL PROTECTED]> wrote: > > >> Hi to all... > > > >> I'm actually using Tkinter for my GUI... but I

Re: Who uses Python?

2007-06-05 Thread Vijayendra Bapte
On Jun 5, 12:37 am, walterbyrd <[EMAIL PROTECTED]> wrote: > I mean other than sysadmins, programmers, and web-site developers? > > I have heard of some DBAs who use a lot of python. > > I suppose some scientists. I think python is used in bioinformatics. I > think some math and physics people use p

Re: Strange errors on exit

2007-06-05 Thread Gabriel Genellina
En Tue, 05 Jun 2007 17:59:18 -0300, Thomas Dybdahl Ahle <[EMAIL PROTECTED]> escribió: > When I close my (gtk) program, I get errors like the below. > It seams that when the interpreter shuts down, it sets every variable to > None, but continues running the threads, (seems only in cases where > t

Re: Who uses Python?

2007-06-05 Thread Grant Edwards
On 2007-06-06, Vijayendra Bapte <[EMAIL PROTECTED]> wrote: > Python is a rapid application development language..we uses it > every where.. in web application development..GUI > development..Automation/Regression test-suite > development..Text/XML processing..website Scrapping Boy, do I know some

Re: which "GUI module" you suggest me to use?

2007-06-05 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: > >ZioMiP je napisao/la: >> Hi to all... >> >> I'm actually using Tkinter for my GUI... but I need to "put a piece of a >> web-page in a widget" how can I do? >> >> which GUI module do you suggest me to use for do that? >> >> or which GUI

Re: subprocess leaves child living

2007-06-05 Thread Nick Craig-Wood
Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote: > But you can't ever catch sigkill. > Isn't there a way to make sure the os kills the childprocess when the > parrent dies? Not as far as I know. If you've got a pipe open to the child then killing the parent should deliver SIGPIPE to the child w

Re: magic names in python

2007-06-05 Thread Lenard Lindstrom
Steven D'Aprano wrote: > On Tue, 05 Jun 2007 18:08:31 +, Lenard Lindstrom wrote: > >> Steven D'Aprano wrote: >>> On Mon, 04 Jun 2007 22:19:35 +, Lenard Lindstrom wrote: >>> What is "magic" about __init__ and __repr__? They are identifiers just like "foo" or "JustAnotherClass". T

who know?

2007-06-05 Thread Michel Claveau
Hi! This image show IronPython. But... what is it? Link : http://msdn2.microsoft.com/en-us/vstudio/bb510103.vss_IronPython_large.jpg -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Does unicode() equal to unicode(sys.getfilesystemencoding()) ?

2007-06-05 Thread 人言落日是天涯,望极天涯不见家
The follow statement comes from the Python 2.5 documentation -- encode( [encoding[,errors]]) Return an encoded version of the string. Default encoding is the current default string encoding. errors may be given to set a different error handling scheme. --- what's the "Defau

<    1   2