BCB5 & Py_InitModule in python 2.3.5 crashes sometimes

2005-06-02 Thread anton
Hi, I embedded the python 2.3.5 interpreter in my Borland C++ Builder 5 application on WinXP pro Sp2 and all runs fine. (I translated the python23.lib with coff2omf) But from time to time when I call Py_InitModule I get a dialog: Title: Microsoft Visual C++ Runtime Library Text: Program: bla

Re: Software licenses and releasing Python programs for review

2005-06-02 Thread Paul Rubin
"poisondart" <[EMAIL PROTECTED]> writes: > If this thread has shown anything it is I'm a bit green with respect to > software licenses, but the other thing is that I consider myself as an > isolated case and I wanted to know if there were others who wanted the > same thing as me. You're going thro

Re: Moving Places, Subtracting from slices/lists

2005-06-02 Thread Mark Sargent
Hi All, getting closer, me thinks. >>> hotcat = ['Cat', 'roof', 'on', 'a', 'hot', 'tin'] >>> for x in hotcat[:]: ... if x == 'roof': hotcat.insert(6,x) ... del hotcat[x] ... Traceback (most recent call last): File "", line 3, in ? TypeError: list indices must be integers How do I get

Re: What's wrong with Zope 3 ?

2005-06-02 Thread Wolfram Kraus
Kay Schluehr wrote: > > Wolfram Kraus wrote: > >> Kay Schluehr wrote: >> >>> The last downloadable release is from november 2004. The Windows >>> installer is configured for Python 2.3(!). The Zope.org main page >>> announces Zope 2.8 beta 2. Is it stillborn? >>> >>> Kay >>> >> >> What you

Re: The need to put "self" in every method

2005-06-02 Thread Peter Maas
Fernando M. schrieb: > i was just wondering about the need to put "self" as the first > parameter in every method a class has because, if it's always needed, > why the obligation to write it? couldn't it be implicit? > > Or is it a special reason for this being this way? See section 1.4.4 in http

Re: Moving Places, Subtracting from slices/lists

2005-06-02 Thread Elliot Temple
On Jun 2, 2005, at 12:12 AM, Mark Sargent wrote: > Hi All, > > getting closer, me thinks. > > hotcat = ['Cat', 'roof', 'on', 'a', 'hot', 'tin'] for x in hotcat[:]: > ... if x == 'roof': hotcat.insert(6,x) > ... del hotcat[x] > ... > Traceback (most recent call last): > Fi

Re: ConfigParser, mapping one key to multiple values

2005-06-02 Thread Thomas Guettler
Am Wed, 01 Jun 2005 17:18:42 -0500 schrieb Larry Bates: > I accomplish this by using the following construct > with ConfigParser: > > [sync files] > ignore_001=.*/foodir/.*\.pyc > ignore_002=.*/foodir/.*~ Hi, I found out, that you can have newlines in the value: ignore_regex = .*/CVS(/.*)?

Re: The need to put "self" in every method

2005-06-02 Thread Peter Maas
Aahz schrieb: >>Because Python has no declarations there must be a different way to >>indicate in which category an identifier falls. [...] > Any objection to swiping this for the FAQ? (Probably with some minor > edits.) There is already a 'self' section (1.4.4) in the official Python FAQ. Looks

Re: How to restrict lenght of entry widget to certain number of character

2005-06-02 Thread Peter Otten
Michael Onfrek wrote: > I'm playing with entry again and trying to restrict length of entry > widget to certain number of character, so users cannot enter more > character into it. Any ideas? import Tkinter as tk root = tk.Tk() var = tk.StringVar() max_len = 5 def on_write(*args): s = var.ge

Re: Like a star, I burn bright, dissipating into the night.

2005-06-02 Thread Jeff_Relf
Hi phaywood, Re: Your grooving to this mantra of mine: Like a star, I burn bright, dissipating into the night. Seeing as you're in Comp.Lang.C, I'll express that in MicroSoft_C++ 7.1, slowly dissipating Sun into Night. I'm using special 32 bit random number routines here, but, because the a

where to find the doc about python regular expression?

2005-06-02 Thread ÒÊÃÉɽÈË
thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: BUG pythonw vs subprocess

2005-06-02 Thread Robin Becker
John J. Lee wrote: > Paul Rubin writes: > > >>I thought pythonw didn't provide a console and so it could be that >>stdin and stdout aren't connected to anything. Popen therefore doesn't >>make sense. You have to use sockets or something. > > > Yeah... I don't know a

pointers in com object functions

2005-06-02 Thread Gijs Korremans
Hi, One of the functions in the com object I need to use has a pointer in one of it's functions (object.function(string input, struct * output)) I've tried to use the id() function but then Python gives me a message that it's an int, not a tructure and when I just give the object without a poin

wxpython or PyQT to make a simulink clone ?

2005-06-02 Thread cravephi
I would like to make a software like simulink: http://www.mathworks.com/cmsimages/sl_mainpage_wl_7488.gif using python. In order of bulding the interface (drag&drop block, link system between the blocks, run the simulation, double click on a block to open its properties, ...) which library will ma

Re: where to find the doc about python regular expression?

2005-06-02 Thread Klaus Alexander Seistrup
ÒÊÃÉɽÈË wrote: > thanks Did you try Google: First hit is: -- Klaus Alexander Seistrup Magnetic Ink, Copenhagen, Denmark http://magnetic-ink.dk/ -- http://mail.python.org/mailman

Re: How to restrict lenght of entry widget to certain number of character

2005-06-02 Thread Michael Onfrek
import Tkinter as tk Hi! Can you explain what line above mean? I also found : http://effbot.org/zone/tkinter-entry-validate.htm It works for me, but I not really understand how? :) Thanks for help! -- http://mail.python.org/mailman/listinfo/python-list

Re: viewing generated images

2005-06-02 Thread Fredrik Lundh
Tim Flynn wrote: >def createWidgets(self): >self.image_size = (50,50) >self.pilim = Image.new( "1", self.image_size ) > ># Generate a blank image >f = lambda(x): 0 >Image.eval( self.pilim, f ) I'm not sure what you think that line is doing, but it proba

Re: Newbie Here

2005-06-02 Thread Dave Cook
On 2005-05-31, Mark Sargent <[EMAIL PROTECTED]> wrote: > for the same things, what do you primarily use it for. Could you show me Web apps using nevow/twisted for work, and pygtk apps for fun. You might browse around sourceforge a bit: http://sourceforge.net/softwaremap/trove_list.php?form_cat

Re: Python as client-side browser script language

2005-06-02 Thread Paul Boddie
Greg Ewing <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > > If the DOM objects are implemented as built-in Python > types, there shouldn't be any difficulty with that. > Python objects have complete control over which attributes > can be read or written by Python code. > > Tha

Re: wxpython or PyQT to make a simulink clone ?

2005-06-02 Thread Robert Kern
[EMAIL PROTECTED] wrote: > I would like to make a software like simulink: > http://www.mathworks.com/cmsimages/sl_mainpage_wl_7488.gif > > using python. > In order of bulding the interface (drag&drop block, link system between > the blocks, run the simulation, double click on a block to open its >

Re: wxpython or PyQT to make a simulink clone ?

2005-06-02 Thread cravephi
thank you. I am watching the exemple of OGL. Very interesting! -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionaries and threads

2005-06-02 Thread Bloke
I've been trying to find a Python tutorial on threading - does anyone have a reference? Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionaries and threads

2005-06-02 Thread John Abel
Bloke wrote: >I've been trying to find a Python tutorial on threading - does anyone >have a reference? > >Rob > > > You could try this: http://heather.cs.ucdavis.edu/~matloff/Python/PyThreads.pdf J -- http://mail.python.org/mailman/listinfo/python-list

Re: Software licenses and releasing Python programs for review

2005-06-02 Thread Robert Kern
Paul Rubin wrote: > "poisondart" <[EMAIL PROTECTED]> writes: >>Yes, what I ask may seem ridiculous, but I don't view it that way. >>Instead, I find that it is the implication of using a restrictive >>license such as I described to be ridiculous: if there is no monetary >>gain option in the license

Re: wxpython or PyQT to make a simulink clone ?

2005-06-02 Thread Pierre Schnizer
[EMAIL PROTECTED] writes: > I would like to make a software like simulink: > http://www.mathworks.com/cmsimages/sl_mainpage_wl_7488.gif > > using python. > In order of bulding the interface (drag&drop block, link system between > the blocks, run the simulation, double click on a block to open its

Re: BUG pythonw vs subprocess

2005-06-02 Thread Robin Becker
Paul Rubin wrote: > I thought pythonw didn't provide a console and so it could be that > stdin and stdout aren't connected to anything. Popen therefore doesn't > make sense. You have to use sockets or something. Well my example is explicitly using PIPE for stderr & stdin, but I don't know how t

Re: How to restrict lenght of entry widget to certain number of character

2005-06-02 Thread Peter Otten
Michael Onfrek wrote: > import Tkinter as tk > > Hi! Can you explain what line above mean? > > I also found : http://effbot.org/zone/tkinter-entry-validate.htm > > It works for me, but I not really understand how? :) >> import Tkinter as tk Make objects defined in Tkinter available under the

Re: wxpython or PyQT to make a simulink clone ?

2005-06-02 Thread Pierre Schnizer
Pierre Schnizer <[EMAIL PROTECTED]> writes: There was an old discussion on comp.lang.python: http://groups.google.de/group/comp.lang.python/browse_thread/thread/9ce44f40011016ec/a2e52b824de9bfb1?q=simulink&rnum=6&hl=de#a2e52b824de9bfb1 I have seen the later code of Eric Lechak looked very intere

Re: how to convert string to list or tuple

2005-06-02 Thread Duncan Booth
Ruud de Jong wrote: > Steven Bethard schreef: >> But unless the person eval-ing your code *only* writes immaculate >> code I can see that you can probably screw them. ;) I wonder why >> __subclasses__ isn't a restricted attribute... Is it ever used for >> something that isn't evil? ;) >> >> S

Re: Moving Places, Subtracting from slices/lists

2005-06-02 Thread Fredrik Lundh
Elliot Temple wrote: > btw hotcat[:] is a *copy* of hotcat, so just leave out "[:]" when you want to modify the thing you're looping over, you need to be careful. looping over a copy is often a good idea (see the Python tutorial and the FAQ for more on this). > enumerate is a function that adds

how to retrieve info about print jobs

2005-06-02 Thread Guy Lateur
Hi all, We have several printers in our company network. I would like to know if it is possible to check the current print jobs/queues for each of them. That way, if a user wants to print something (big), I could give her a hint as to which printer would get the job done first. We're using win2k a

decimal and trunkating

2005-06-02 Thread Timothy Smith
i want to trunkate 199.999 to 199.99 getcontext.prec = 2 isn't what i'm after either, all that does is E's the value. do i really have to use floats to do this? -- http://mail.python.org/mailman/listinfo/python-list

Re: creating a hex value

2005-06-02 Thread Fredrik Lundh
David Bear wrote: >I have a file that I need to parse. Items in it are delimited by a hex 15 > (0x015). I know it must be trivial to assign a hex value to a variable but > I'm not seeing it in my python essential ref. how can I do > > delim = 0x15 > while: >ln = file.read() >if ln[

Re: How to restrict lenght of entry widget to certain number of character

2005-06-02 Thread VK
Peter Otten wrote: > Michael Onfrek wrote: > > >>import Tkinter as tk >> >>Hi! Can you explain what line above mean? >> >>I also found : http://effbot.org/zone/tkinter-entry-validate.htm >> >>It works for me, but I not really understand how? :) > > >>>import Tkinter as tk > > > Make objects

Re: how to retrieve info about print jobs

2005-06-02 Thread Simon Brunning
On 6/2/05, Guy Lateur <[EMAIL PROTECTED]> wrote: > We have several printers in our company network. I would like to know if it > is possible to check the current print jobs/queues for each of them. That > way, if a user wants to print something (big), I could give her a hint as to > which printer w

DOM question

2005-06-02 Thread Richard Lewis
Hi there, I have an XML document which contains a mixture of structural nodes (called 'section' and with unique 'id' attributes) and non-structural nodes (called anything else). The structural elements ('section's) can contain, as well as non-structural elements, other structural elements. I'm doi

Re: using builtin array

2005-06-02 Thread Diez B. Roggisch
> Arrays are homogenous. No chance concatenating them. This should of course read "No chance concatenating arrays of different typecodes". -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: DOM question

2005-06-02 Thread Diez B. Roggisch
> However, I got exactly the same problem: each time I use this function I > just get a DOM Text node with a few white space (tabs and returns) in > it. I guess this is the indentation in my source document? But why do I > not get the propert element nodes? Welcome to the wonderful world of DOM, W

Newbie question: Allocation vs references

2005-06-02 Thread Jan Danielsson
Hello all, Behold: -- a = [ 'Foo', 'Bar' ] b = [ 'Boo', 'Far' ] q = [ a, b ] print q[0][0] print q[1][1] a[0] = 'Snoo' b[1] = 'Gnuu' print q[0][0] print q[1][1] -- This will output: Foo Far Snoo Gnuu I assume it does so because q stores _references_ to a and b. How would d

Re: Newbie question: Allocation vs references

2005-06-02 Thread rzed
Jan Danielsson <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hello all, > > Behold: > > -- > a = [ 'Foo', 'Bar' ] > b = [ 'Boo', 'Far' ] > q = [ a, b ] > > print q[0][0] > print q[1][1] > > a[0] = 'Snoo' > b[1] = 'Gnuu' > > print q[0][0] > print q[1][1] > -- > > Thi

Re: Newbie question: Allocation vs references

2005-06-02 Thread Stian =?iso-8859-1?Q?S=F8iland?=
On 2005-06-02 14:43:40, Jan Danielsson wrote: > a = [ 'Foo', 'Bar' ] > b = [ 'Boo', 'Far' ] > q = [ a, b ] >Or, better yet, how do I store a and b in q, and then tell Python > that I want a and b to point to new lists, without touching the contents > in q? There are several ways to create a

Re: dictionaries and threads

2005-06-02 Thread Bloke
thanks. Looks good. -- http://mail.python.org/mailman/listinfo/python-list

Re: xml processing

2005-06-02 Thread Jeff Elkins
On Wednesday 01 June 2005 11:01 am, Steven Bethard wrote: > If you're not committed to pyxml, you might consider using ElementTree: > > http://effbot.org/zone/element-index.htm > > I find it *way* easier to work with. Thanks. I've installed it and am experimenting. -- http://mail.python.org/mai

Re: decimal and trunkating

2005-06-02 Thread F. Petitjean
Le Thu, 02 Jun 2005 19:59:08 +1000, Timothy Smith a écrit : > i want to trunkate 199.999 to 199.99 round(199.999, 2) # 2 digits after the decimal point > do i really have to use floats to do this? 19.999 is a float : type(19.999) is float # ==> True -- http://mail.python.org/mailman/listin

Re: decimal and trunkating

2005-06-02 Thread Reinhold Birkenfeld
F. Petitjean wrote: > Le Thu, 02 Jun 2005 19:59:08 +1000, Timothy Smith a écrit : >> i want to trunkate 199.999 to 199.99 > > round(199.999, 2) # 2 digits after the decimal point Wrong. This will yield 200.00. >> do i really have to use floats to do this? > > 19.999 is a float : > type(19.99

Re: decimal and trunkating

2005-06-02 Thread Marc Christiansen
Timothy Smith <[EMAIL PROTECTED]> wrote: > i want to trunkate 199.999 to 199.99 > getcontext.prec = 2 isn't what i'm after either, all that does is E's > the value. > do i really have to use floats to do this? You could try this (from a script I use for my phone bill): from decimal import Decima

Re: wxpython or PyQT to make a simulink clone ?

2005-06-02 Thread cravephi
thank you, I checked viper, but the license is not so simple.. I am testing your truffaldino ! seems interesting, but I could not launch it. I am running: Python 2.3 wxpython 2.6 (for python 2.3) I installed mtalib, Truffaldino, Smeraldina and nodenet. Also installed DSV and pygsl-0.3.1_Numeric.wi

Re: Beginner question: Logs?

2005-06-02 Thread Peter Hansen
Elliot Temple wrote: > from math import * > log10(15625) It's always a good idea, especially when answering a beginner's question, to add the caution that this form ("from xxx import *") has certain dangers** associated with it, and is widely considered poor style, and should really only rarely

Re: DOM question

2005-06-02 Thread Richard Lewis
On Thu, 02 Jun 2005 14:34:47 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]> said: > > However, I got exactly the same problem: each time I use this function I > > just get a DOM Text node with a few white space (tabs and returns) in > > it. I guess this is the indentation in my source document? But

Re: decimal and trunkating

2005-06-02 Thread Peter Hansen
Timothy Smith wrote: > i want to trunkate 199.999 to 199.99 > getcontext.prec = 2 isn't what i'm after either, all that does is E's > the value. > do i really have to use floats to do this? I think you need a context with appropriate rounding set (e.g. ROUND_FLOOR?) and then use the quantize() m

Two questions

2005-06-02 Thread qscomputing
Hi, I've developed in several other languages and have recently found Python and I'm trying to use it in the shape of the PythonCard application development tool. My two questions: 1. What is the easiest way to create a for loop in the style I'm used to from Delphi ie: for I:=0 to 2 do begin /

Re: any macro-like construct/technique/trick?

2005-06-02 Thread Neal Norwitz
Andrew's approach is good, but you could so something a little simpler/more flexible. Untested of course. :-) Every callable object is followed by the args to pass it. So this: debug_emit(DbgObjFoo(a, b, costly_function(c))) becomes: debug_emit(DbgObjFoo, (a, b, costly_function, (c,)))

Re: decimal and trunkating

2005-06-02 Thread Peter Hansen
Reinhold Birkenfeld wrote: > He is speaking of Decimals... > > d = Decimal("199.999") > d._round(5, decimal.ROUND_DOWN) Is one really supposed to call the underscore methods like that? -Peter -- http://mail.python.org/mailman/listinfo/python-list

Python Win32 and Condor

2005-06-02 Thread brian.hamm
Hi. I have a created a python script that opens a program then uses the com package to run a few things and then close. the program. It works perfectly fine when run normally. ie from command prompt or shell. Now I am using the University of Wisconsins queueing program "Condor" to execute thi

Re: decimal and trunkating

2005-06-02 Thread Peter Hansen
Peter Hansen wrote: > >>> d = decimal.Decimal('199.999') > >>> decimal.getcontext().rounding = decimal.ROUND_FLOOR > >>> d.quantize(decimal.Decimal('1.00')) > Decimal("199.99") Or skip changing the context and use the second argument to quantize: d.quantize(Decimal('1.00'), decimal.ROUND_FLOOR

Re: Two questions

2005-06-02 Thread Richard Lewis
On 2 Jun 2005 06:45:18 -0700, [EMAIL PROTECTED] said: > Hi, > > I've developed in several other languages and have recently found > Python and I'm trying to use it in the shape of the PythonCard > application development tool. > > My two questions: > > 1. What is the easiest way to create a for

Re: Two questions

2005-06-02 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > I've developed in several other languages and have recently found > Python and I'm trying to use it in the shape of the PythonCard > application development tool. > > My two questions: > > 1. What is the easiest way to create a for loop in the style I'm used > to from D

Re: How to restrict lenght of entry widget to certain number of character

2005-06-02 Thread Michael Onfrek
Ideed, good idea! -- http://mail.python.org/mailman/listinfo/python-list

Re: Two questions

2005-06-02 Thread Joal Heagney
[EMAIL PROTECTED] wrote: > Hi, > > I've developed in several other languages and have recently found > Python and I'm trying to use it in the shape of the PythonCard > application development tool. > > My two questions: > > 1. What is the easiest way to create a for loop in the style I'm used >

optparse.py: FutureWarning error

2005-06-02 Thread kosuke
I keep getting the following error/warning message when using the python based program getmail4: /usr/lib/python2.3/optparse.py:668: FutureWarning: %u/%o/%x/%X of negative int will return a signed string in Python 2.4 and up return ("<%s at 0x%x: %r>" I'm using python2.3.5 on a debian sid box.

calling ksh script from python

2005-06-02 Thread ronan_boisard
hi all, I'm trying to call ksh script from python. I have a file (toto.env) with a scirpt looking like: -- begin --- #!/bin/ksh # export TOTO_ENV=/home/toto -- end --- I call it from python like that: -- begin --- import commands commands.getstatusoutput('. toto.env') -- end --- but it always r

Re: Two questions

2005-06-02 Thread rbt
Peter Hansen wrote: > Philosophy not entirely aside, you should note that object code in any > language can "easily" be reverse-engineered in the same way, with the > only difference being the degree of ease involved. If the code is worth > enough to someone that they are willing to risk violat

wxPython

2005-06-02 Thread Michael
Hi, I've got a question about wxPython, wheres the best place to ask?? Mike -- http://mail.python.org/mailman/listinfo/python-list

return pramater in com object function

2005-06-02 Thread Gijs Korremans
Hi, One of the functions in the com object I need to use has a pointer in one of it's functions (object.function(string input, struct * output)) (I've created the struct with win32com.client.Record("structure", object)) I've tried to use the id() function but then Python gives me a message that

[python-gtk] problem with multiple inheritance

2005-06-02 Thread Taki Jeden
Hi I'm trying to install a certain python program which uses gtk, and the following line: class view_tree_model(gtk.GenericTreeModel,gtk.TreeSortable): raises a "TypeError: multiple bases have instance lay-out conflict" Is this a bug in gtk, or python-gtk, or something? I know of people who run

Re: decimal and trunkating

2005-06-02 Thread Reinhold Birkenfeld
Peter Hansen wrote: > Reinhold Birkenfeld wrote: >> He is speaking of Decimals... >> >> d = Decimal("199.999") >> d._round(5, decimal.ROUND_DOWN) > > Is one really supposed to call the underscore methods like that? Umm... no, I think not ;) But I couldn't find something better. Reinhold -- htt

Re: Performance Issues please help

2005-06-02 Thread PyPK
Yep that improved the speed by about 50% now it takes about 10 secs instead of 24 seconds..Thanks much. I guess that is the best we could do right.It would be really helpful if I could get it less than 5 seconds. Any suggestions on that?? -- http://mail.python.org/mailman/listinfo/python-list

Re: Two questions

2005-06-02 Thread Diez B. Roggisch
rbt wrote: > Peter Hansen wrote: > >> Philosophy not entirely aside, you should note that object code in any >> language can "easily" be reverse-engineered in the same way, with the >> only difference being the degree of ease involved. If the code is >> worth enough to someone that they are wi

Re: Two questions

2005-06-02 Thread Reinhold Birkenfeld
Richard Lewis wrote: > On 2 Jun 2005 06:45:18 -0700, [EMAIL PROTECTED] said: >> Hi, >> >> I've developed in several other languages and have recently found >> Python and I'm trying to use it in the shape of the PythonCard >> application development tool. >> >> My two questions: >> >> 1. What is

PYTHONSTARTUP and the -i command line option

2005-06-02 Thread Christopher Wood
Greetings all, A quick query: as all sorts of stuff can be defined in a .pythonrc.py file or similar and called at python startup using the PYTHONSTARTUP environment variable, it's very useful and can enhance the interpreter experience greatly. However, executing a script using the -i command

Re: DOM question

2005-06-02 Thread Diez B. Roggisch
> > Yes, in fact: > > //[EMAIL PROTECTED]//*[name()!='section'] > > would do the trick. > > I was trying to avoid using anything not in the standard Python > distribution if I could help it; I need to be able to use my code on > Linux, OS X and Windows. > > The xml.path package is from PyXML,

Re: Software licenses and releasing Python programs for review

2005-06-02 Thread Andreas Kostyrka
On Thu, Jun 02, 2005 at 01:57:25AM -0700, Robert Kern wrote: > And for thoroughness, allow me to add "even if they have no intention or > desire to profit monetarily." I can't explain exactly why this is the > case, but it seems to be true in the overwhelming majority of cases. > Academic projec

Re: anygui,anydb, any opinions?

2005-06-02 Thread Thomas Bartkus
"Skip Montanaro" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > >> Are we talking about a drag-and-drop GUI builder? > Thomas> I am! > > >> What about Glade? > Thomas> Dying to try that. Ask me again in a week. > > I use Glade at work on a regular basis. Took me a

Re: Is there a better way of doing this?

2005-06-02 Thread Steven D'Aprano
On Mon, 30 May 2005 14:05:36 +0200, Magnus Lycka wrote: > Steven D'Aprano wrote: > > print is a statement, not a function. The brackets are syntactically > > correct, but pointless. Remove them. > ... >> On Sat, 28 May 2005 13:24:19 +, Michael wrote: >>> while( newNS ): >> >> Guido (our Ben

Software for System Builders, Resellers, and Hardware Purchasers Only.

2005-06-02 Thread Rosaline
GET latest softwares, 99% savings. http://jtj.pebms6p0mh7wm87.narrjl.com Human nature is not of itself vicious. I believe in God, only I spell it Nature. -- http://mail.python.org/mailman/listinfo/python-list

TkInter Listbox Widget Formatting

2005-06-02 Thread Kyle . Robertson
I've searched high and low, and I can't seem to find a way to center or right justify the text in a Listbox widget using TkInter.  The justify option is unrecognized.  Any options I'm missing, or a known work-around?   Thanks!   Kyle -- http://mail.python.org/mailman/listinfo/python-list

Re: python 2.4: tarfile tell() and seek() seem to be broeken

2005-06-02 Thread =?iso-8859-1?q?Lars_Gust=E4bel?=
On Wed, 01 Jun 2005 14:58:23 +0200, N. Volbers wrote: > - subsequent calls of fd.readline() and fd.tell() will yield the correct > lines but always the same value from fd.tell(). > > Is there a mistake on my side or does this need fixing? This is a bug. Although the pseudo file object's readli

link to the HP 3115 iPAQ - list of features for info -- $350 w/Bluetooth built-in

2005-06-02 Thread val
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=5778810554&ssPageName=MER C_VIC_ReBay_Pr4_PcY_BIN -- http://mail.python.org/mailman/listinfo/python-list

Re: convert a string to tuple

2005-06-02 Thread Steven D'Aprano
On Tue, 31 May 2005 13:14:09 -0700, querypk wrote: > how do I convert > b is a string b = '(1,2,3,4)' to b = (1,2,3,4) You can do: def str2tuple(s): """Convert tuple-like strings to real tuples. eg '(1,2,3,4)' -> (1, 2, 3, 4) """ if s[0] + s[-1] != "()": raise ValueErro

Re: calling ksh script from python

2005-06-02 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: ... > I call it from python like that: > -- begin --- > import commands > commands.getstatusoutput('. toto.env') > -- end --- > > but it always return an error saying: > sh: TOTO_ENV=/home/home: is not an identifier > > doesn anyone know w

Re: anygui,anydb, any opinions?

2005-06-02 Thread Skip Montanaro
Thomas> My reference to Visual Basic was meant to be a poke in the eye. Thomas> The language itself stinks. BUT - having a robust IDE with Thomas> keyword tooltip prompts, built in language documentation, robust Thomas> built in debugging, and most of all - a stable GUI , a standa

Re: Two questions

2005-06-02 Thread qscomputing
Thanks to you all for the quick response. I've noticed that when I do $ python myprog.py the file myprog.pyc file is not created, but the .pyc files for files I import *are* created. Is this intentional and, if so, how do I get the myprog.pyc file? Thanks, - QS Computing. -- http://mail.pytho

Re: Newbie question: Allocation vs references

2005-06-02 Thread Steven Bethard
Stian Søiland wrote: > There are several ways to create a copy of a list: [snip] > a2 = list(a) # create a new list object out of any sequence I'll just point out that FWIW, this is by far my favorite idiom of the ones offered because it applies to pretty much all the builtin container typ

Re: Two questions

2005-06-02 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Thanks to you all for the quick response. > > I've noticed that when I do > $ python myprog.py > the file myprog.pyc file is not created, but the .pyc files for files I > import *are* created. Is this intentional and, if so, how do I get the > myprog.pyc file? I thought

Re: Two questions

2005-06-02 Thread Steven D'Aprano
On Thu, 02 Jun 2005 06:45:18 -0700, qscomputing wrote: > Hi, > > I've developed in several other languages and have recently found > Python and I'm trying to use it in the shape of the PythonCard > application development tool. > > My two questions: > > 1. What is the easiest way to create a fo

Re: Two questions

2005-06-02 Thread Peter Hansen
rbt wrote: > Peter Hansen wrote: >> Philosophy not entirely aside, you should note that object code in any >> language can "easily" be reverse-engineered in the same way, with the >> only difference being the degree of ease involved. If the code is >> worth enough to someone that they are willi

Easy way to detect hard drives and partitions in Linux

2005-06-02 Thread RunLevelZero
I need a way to detect hard drives and their partitions... labels would be nice too... I did some googling but did not find anything all too useful. This will strictly be on Linux / Unix so any help would be greatly appreciated. TIA -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython

2005-06-02 Thread Peter Hansen
Michael wrote: > Hi, > I've got a question about wxPython, wheres the best place to ask?? The wxPython mailing list. Visit www.wxpython.org to find it and more. -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance Issues please help

2005-06-02 Thread Michael Spencer
PyPK wrote: > Yep that improved the speed by about 50% now it takes about 10 secs > instead of 24 seconds..Thanks much. I guess that is the best we could > do right.It would be really helpful if I could get it less than 5 > seconds. Any suggestions on that?? > Things to try: * in-lining the min a

Re: PYTHONSTARTUP and the -i command line option

2005-06-02 Thread Peter Hansen
Christopher Wood wrote: > But these two things won't play together, as (by design, it seems) > $PYTHONSTARTUP isn't read when the -i option is used, leaving me with an > unenhanced Python interpreter environment after after script execution. > > Is the any way round this, other than editing all

Re: Easy way to detect hard drives and partitions in Linux

2005-06-02 Thread Peter Hansen
RunLevelZero wrote: > I need a way to detect hard drives and their partitions... labels would > be nice too... I did some googling but did not find anything all too > useful. This will strictly be on Linux / Unix so any help would be > greatly appreciated. os.popen('/sbin/sfdisk -l /dev/hda') etc.

Re: calling ksh script from python

2005-06-02 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Donn Cave <[EMAIL PROTECTED]> wrote: . . . >Meanwhile, it might be worthwhile to reconsider the use >of ksh here, if you have any choice in the matter. Ksh >is fine for interactive use, but has

PYSH? (was:Re: calling ksh script from python)

2005-06-02 Thread Paul McNett
Cameron Laird wrote: > Infidel. While I sure feel that way about csh(1), it > surprises me you'd criticize ksh(1) so. 'Fact, 'mong > all the *sh-s, I *recommend* ksh for programming. May- > be the two of us see things differently. I keep wondering how difficult it would be to make a Python shel

Re: Beginner question: Logs?

2005-06-02 Thread Terry Reedy
> import math > math.log10(15625) To find out the names of function in the math module without checking the docs, do >>> dir(math) #same for any other module To get more info, do >>> help(math) # same for any other module with a doc string Terry J. Reedy -- http://mail.python.org/mailman

Re: Beginner question: Logs?

2005-06-02 Thread Terry Reedy
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Elliot Temple wrote: >> from math import * >> log10(15625) > > It's always a good idea, especially when answering a beginner's > question, to add the caution that this form ("from xxx import *") has > certain dangers** a

New mailing list to discuss Google Summer of Code

2005-06-02 Thread David Ascher
In order to centralize discussion and minimize spam, we've created a new mailing list to discuss the Google Summer of Code from a Python POV. I strongly encourage people interested in discussing possible projects, people who'd be willing to help students this summer as mentors, and any students co

Re: python 2.4: tarfile tell() and seek() seem to be broeken

2005-06-02 Thread N. Volbers
Am Thu, 02 Jun 2005 17:57:20 +0200 schrieb Lars Gustäbel: > On Wed, 01 Jun 2005 14:58:23 +0200, N. Volbers wrote: > >> - subsequent calls of fd.readline() and fd.tell() will yield the correct >> lines but always the same value from fd.tell(). [...] > > Thank you for pointing that out. I'll tak

Re: Unicode string in exec

2005-06-02 Thread Jeff Epler
First off, I just have to correct your terminology. "exec" is a statement, and doesn't require parentheses, so talking about "exec()" invites confusion. I'll answer your question in terms of eval(), which takes a string representing a Python expression, interprets it, and returns the result. In

Re: TkInter Listbox Widget Formatting

2005-06-02 Thread Jeff Epler
This isn't an option in the stock Tk listbox or any of the alternatives I know of offhand (bwidget ListBox, TixTList). The TkTable widget, which can also display multiple columns, can select different justifications, either for the whole table, or for single cells. I've never used TkTable with Pyt

Looking for Image, Audio and Internet/Web HOTWO's or tutorials

2005-06-02 Thread CPUFreak91
The Python Tutorials don't suply me with enough info and examples. If you know of any python tutorials or howto's please tell me, but preferably the Audio, Image, and Internet/Web ones. Thanks -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >