Re: regarding system function

2005-04-21 Thread Robert Kern
praba kar wrote: Dear All, In Php If I send a command to system function then It will return 1 on success and 0 on failure. So based upon that value I can to further work. But In Python If I send a command to system function then It will return 0 only for both conditions(success and fail

Re: regarding system function

2005-04-21 Thread Mike Meyer
praba kar <[EMAIL PROTECTED]> writes: > Dear All, > > In Php If I send a command to system function > then It will return 1 on success and 0 on failure. So > based upon that value I can to further work. > > But In Python If I send a command to system > function then It will return 0 onl

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Antoon Pardon
Op 2005-04-21, Dan Bishop schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Op 2005-04-21, Steve Holden schreef <[EMAIL PROTECTED]>: >> > [EMAIL PROTECTED] wrote: > ... >> >> Along the same lines, I think the REQUIREMENT that x[0] rather > than >> >> x[1] be the first element of list x is a mi

time.strftime in 2.4.1 claims data out of range when not

2005-04-21 Thread Sheila King
I have a web app that has been running just fine for several months under Python 2.2.2. We are preparing to upgrade the server to run Python 2.4.1. However, part of my web app is throwing an error on this code (that has previously worked without exception): >>> time.strftime("%Y-%m-%d", (Y, M,

Re: XML parsing per record

2005-04-21 Thread William Park
Willem Ligtenberg <[EMAIL PROTECTED]> wrote: > On Sun, 17 Apr 2005 02:16:04 +, William Park wrote: > > Care to post more details? > > The XML file I need to parse contains information about genes. > So the first element is a gene and then there are a lot sub-elements with > sub-elements. I onl

Run Unix shell command $ parse command line arguments in python

2005-04-21 Thread rkoida
Hello evryone I am a newbie to python. I have a makefile which i can compile in UNIX/LINUX, But i I am planning to write a python script which actually does what my MAKEFILE does. The make file is #Makefile and some scripts to give output #numbers #Change till sign #END var1:=564-574 a1 =

regarding system function

2005-04-21 Thread praba kar
Dear All, In Php If I send a command to system function then It will return 1 on success and 0 on failure. So based upon that value I can to further work. But In Python If I send a command to system function then It will return 0 only for both conditions(success and failure). So What

Re: Manipulating large blobs in Python

2005-04-21 Thread Fredrik Lundh
Tim Stone wrote: I'm working on a module that will manipulate large blobs. I'm using a C dll to allocate big blocks of memory, using PyMem_Malloc, which is working quite well up until I try to manipulate a blob that exhausts Python's heap. how large is that? I'm guessing that to increase the he

Re: goto statement

2005-04-21 Thread Mike Meyer
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-04-21, Roy Smith <[EMAIL PROTECTED]> wrote: >> Grant Edwards <[EMAIL PROTECTED]> wrote: >>>Sure, but what about the case where his program is on paper >>>tape and all he has for an editor is an ice pick? >> >> Can't you emulate that in emacs wit

Re: python LEX

2005-04-21 Thread Mike Meyer
Miki Tebeka <[EMAIL PROTECTED]> writes: > Hello jozo, > >> I have to work on python lexical definition in Lex. I spent lots of my >> time to find regular expresions written for Lex of Python language but >> nothing. >> Can somebody help me? > http://www.antlr.org/grammar/list (search for Python) >

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Mike Meyer
Roy Smith <[EMAIL PROTECTED]> writes: > Greg Ewing <[EMAIL PROTECTED]> wrote: >> Also, everyone, please keep in mind that you always have >> the option of using a *dictionary*, in which case your >> indices can start wherever you want. >> >> You can't slice them, true, but you can't have everythi

Re: Design advice for unit test asserters

2005-04-21 Thread Edvard Majakari
"Gary" <[EMAIL PROTECTED]> writes: [ py.test ad follows :) ] > def test_SomeTest(...): > ... > self.AssertAllFilesExist(fileList) > > or > > def test_SomeTest(...): > ... > [ self.AssertFileExists(f) for f in fileList ] I prefer the latter, because t

Re: grouping subsequences with BIO tags

2005-04-21 Thread Bengt Richter
On Thu, 21 Apr 2005 15:37:03 -0600, Steven Bethard <[EMAIL PROTECTED]> wrote: >I have a list of strings that looks something like: > ['O', 'B_X', 'B_Y', 'I_Y', 'O', 'B_X', 'I_X', 'B_X'] >I need to group the strings into runs (lists) using the following rules >based on the string prefix: >

Re: Regular Expressions - Python vs Perl

2005-04-21 Thread Ilpo Nyyssönen
James Stroud <[EMAIL PROTECTED]> writes: > Is it relevant that Python can produce compiled expressions? I don't think > that there is such a thing with Perl. The problem in python here is that it needs to always recompile the regexp. I would like to have a way to write a regexp as a constant and

Manipulating large blobs in Python

2005-04-21 Thread Tim Stone
I'm working on a module that will manipulate large blobs. I'm using a C dll to allocate big blocks of memory, using PyMem_Malloc, which is working quite well up until I try to manipulate a blob that exhausts Python's heap. I'm guessing that to increase the heapsize, I'm going to have to recom

How to prevent Tkinter frame resize?

2005-04-21 Thread phil_nospam_schmidt
I am trying to prevent a user from resizing a frame beyond its "natural" size as given by winfo_reqwidth and winfo_reqheight, without any success. Can anyone make any suggestions, based on my code below? Thanks! from Tkinter import * class Table(Frame): def __init__(self, master,

Re: How to run Python in Windows w/o popping a DOS box?

2005-04-21 Thread Paul Rubin
[EMAIL PROTECTED] (Bengt Richter) writes: > I would try right-clicking the shortcut icon and selecting > properties, then select the shortcut tab and edit the target string > with s/python/pythonw/ and then click ok. > > Then try double clicking the shortcut icon again. If that does it, > you're

Re: How can I verify that a passed argument is an interiblecollection?

2005-04-21 Thread Terry Reedy
> On Thu, 21 Apr 2005 09:59:54 -0500, Larry Bates > <[EMAIL PROTECTED]> wrote: > >>2) Or if you not you could see if the argument has next and >>__iter__ methods (more general solution) >> >>if hasattr(arg, 'next') and not hasattr(arg, '__iter__'): >># perform work on iterable The 'not' is a

Re: deprecation of has_key?

2005-04-21 Thread John Roth
"Terry Reedy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] "Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Ahh, ok. Now I understand. I think you could probably search the python-dev archives and see why the decision was made as it was. For pretty

Re: Semi-newbie, rolling my own __deepcopy__

2005-04-21 Thread Michael Spencer
Michael Spencer wrote: http://www.python.org/doc/2.3.3/lib/module-copy.html deepcopy: ... This version does not copy types like module, class, function, method, stack trace, stack frame, file, socket, window, *array*, or any similar types. ... On reflection, I realize that this says that the arr

Re: Regular Expressions - Python vs Perl

2005-04-21 Thread codecraig
Thanks for the input. I was just looking for some feedback about which was better and faster, if an answer exists. However, I am not choosing Perl or Python b/c of it's RegEx engine as someone mentioned. The question was just because I was curious, sorry if I misled you to think I was choosing w

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Roy Smith
Greg Ewing <[EMAIL PROTECTED]> wrote: > Also, everyone, please keep in mind that you always have > the option of using a *dictionary*, in which case your > indices can start wherever you want. > > You can't slice them, true, but you can't have everything. :-) Of course you can slice them, you jus

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Paul Rubin
[EMAIL PROTECTED] writes: > > Suppose you could. Then what should > > ([3, 1, 4] indexbase 0) + ([1, 5, 9] indexbase 4) > > equal? > If + means add, the result would be ([4,6,13] indexbase 0) . That's counterintuitive. I'd expect c = a + b to result in c[i] = a[i]+b[i] for all elements. So, fo

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread beliavsky
Dan Bishop wrote: > Antoon Pardon wrote: > > Like users have a choice in how long they make a list, they > > should have a choice where the indexes start. (And that > > shouldn't be limited to 0 and 1). > > Suppose you could. Then what should > > ([3, 1, 4] indexbase 0) + ([1, 5, 9] indexbase

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Greg Ewing <[EMAIL PROTECTED]> wrote: > Roy Smith wrote: > > > What would actually be cool is if Python were to support the normal math > > notation for open or closed intervals. > > > > foo = bar (1, 2) > > foo = bar (1, 2] > > foo = bar [1, 2) > > foo = bar [1

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Greg Ewing
[EMAIL PROTECTED] wrote: I disagree. Programming languages should not needlessly surprise people, and a newbie to Python probably expects that x[1:3] = [x[1],x[2],x[3]]. But said newbie's expectations will differ considerably depending on which other language he's coming from. So he's almost always

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Greg Ewing
Roy Smith wrote: What would actually be cool is if Python were to support the normal math notation for open or closed intervals. > foo = bar (1, 2) foo = bar (1, 2] foo = bar [1, 2) foo = bar [1, 2] That would certainly solve this particular problem, but the cost to the rest of the language synta

Smooth upgrade to New Version

2005-04-21 Thread kent sin
Python is now enter 2.4 era. It is greate, and I want to upgrade too. However, everytime upgrading to a new version is a great pain. For every version, we start to re-install what have been in our past python. Re-install all packages sometimes require searching for a new version of binary which i

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Greg Ewing
Antoon Pardon wrote: This is nonsens. table[i] = j, just associates value j with key i. That is the same independend from whether the keys can start from 0 or some other value. Also, everyone, please keep in mind that you always have the option of using a *dictionary*, in which case your indices ca

Re: Strings

2005-04-21 Thread Bengt Richter
On Thu, 21 Apr 2005 10:09:59 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote: >Dan wrote: >> I've having trouble coming to grip with Python strings. >> >> I need to send binary data over a socket. I'm taking the data from a >> database. When I extract it, non-printable characters come out as a >>

Re: Dictionary question.

2005-04-21 Thread Kent Johnson
hawkesed wrote: Actually, I think I got it now. Here is what I did: for num in alist: ... if adict.has_key(num): ... x = adict.get(num) ... x = x + 1 ... adict.update({num:x}) A simpler way to do this last line is adict[num] = x ... else: ...

Re: Strings

2005-04-21 Thread Dan
On Thu, 21 Apr 2005 10:09:59 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote: Thanks, that's exactly what I wanted. Easy when you know how. Dan >Dan wrote: >> I've having trouble coming to grip with Python strings. >> >> I need to send binary data over a socket. I'm taking the data from a >> da

Re: Dictionary question.

2005-04-21 Thread Brian van den Broek
hawkesed said unto the world upon 2005-04-21 20:28: Actually, I think I got it now. Here is what I did: for num in alist: ... if adict.has_key(num): ... x = adict.get(num) ... x = x + 1 ... adict.update({num:x}) ... else: ... adict.updat

Re: Dictionary question.

2005-04-21 Thread hawkesed
Actually, I think I got it now. Here is what I did: >>> for num in alist: ... if adict.has_key(num): ... x = adict.get(num) ... x = x + 1 ... adict.update({num:x}) ... else: ... adict.update({num:1}) ... >>> adict {128: 2, 129: 2, 132: 1, 15

Re: New line

2005-04-21 Thread Dan
On Thu, 21 Apr 2005 21:34:03 +0100, "ionic" <[EMAIL PROTECTED]> wrote: Open a text editor and write your code. Save the file with a .py extension, i.e., myprogram.py. From the command line type 'python myfile.py' Dan > >Ok sorry guys, > >using the python gui, if i hit the 'enter' key python ju

Re: Semi-newbie, rolling my own __deepcopy__

2005-04-21 Thread Michael Spencer
[EMAIL PROTECTED] wrote: I'm back... [wondering why copy.deepcopy barfs on array instances] http://www.python.org/doc/2.3.3/lib/module-copy.html deepcopy: ... This version does not copy types like module, class, function, method, stack trace, stack frame, file, socket, window, *array*, or any sim

Re: Regular Expressions - Python vs Perl

2005-04-21 Thread Karl A. Krueger
Terry Reedy <[EMAIL PROTECTED]> wrote: > Depending upon you particular application, 'completeness' may be a > more relevant concern than 'performance'. I believe the original > Python regex engine did not have all the Perl extensions, some of them > decidedly 'non regular'. It was replace by the

Re: Dictionary question.

2005-04-21 Thread hawkesed
Steve, thanks for the input. That is actually what I am trying to do, but I don't know the syntax for this in python. For example here is a list I want to work with as input: [101, 66, 75, 107, 108, 101, 106, 98, 111, 88, 119, 93, 115, 95, 114, 95, 118, 109, 85, 75, 88, 97, 53, 78, 98, 91, 115, 77

Ron Grossi: God is not a man

2005-04-21 Thread Obaid R.
SUMMARY === For the past few weeks, a self-professed internet evangelist has posted several times to several news groups to claim several points as facts. It would appear that these assertions do not stand up to close examination, logic and reason, and stand in direct contradiction to the expl

Re: Semi-newbie, rolling my own __deepcopy__

2005-04-21 Thread [EMAIL PROTECTED]
I'm back... Thanks to Michael Spencer and Steven Bethard for their excellent help. It has taken me a few sessions of reading, and programming, and I've had to pick up the exploded fragments of my skull from time to time. But I now have succeeded in making deepcopy work for a simple class that I wr

Re: Dictionary question.

2005-04-21 Thread hawkesed
Here is an example of the input list: [101, 66, 75, 107, 108, 101, 106, 98, 111, 88, 119, 93, 115, 95, 114, 95, 118, 109, 85, 75, 88, 97, 53, 78, 98, 91, 115, 77, 107, 153, 108, 101] Here is the code I am working on now: >>> for num in alist: ... if adict.has_key(num): ... x = adic

Re: Strings

2005-04-21 Thread John Machin
On Thu, 21 Apr 2005 21:16:43 +0800, Dan <[EMAIL PROTECTED]> wrote: >I've having trouble coming to grip with Python strings. > >I need to send binary data over a socket. I'm taking the data from a >database. When I extract it, non-printable characters come out as a >backslash followed by a three

Re: New line

2005-04-21 Thread Esben Pedersen
ionic wrote: Ok sorry guys, using the python gui, if i hit the 'enter' key python just executes what ever ive typed. It doesnt take me to the next line. try shift + enter /Esben -- http://mail.python.org/mailman/listinfo/python-list

Re: Persistent python object and the Web

2005-04-21 Thread Esben Pedersen
[EMAIL PROTECTED] wrote: My problem is that I don't know how to create a graph_object that remains persistent through time (it has to be the same graph_object for One possibility is to have a remote procedure call server that stores the graph running seperately from your wab application. Your web

Re: [ANN] pysqlite 2.0.alpha3

2005-04-21 Thread Gerhard Haering
On Fri, Apr 22, 2005 at 01:34:32AM +0200, Gerhard Haering wrote: > === > pysqlite 2.0.alpha3 > === > > I'm glad to announce pysqlite 2.0.alpha3, which will be the last alpha > release. Documentation and more testing will be what I'm concentrating > on in the beta t

[ANN] pysqlite 2.0.alpha3

2005-04-21 Thread Gerhard Haering
=== pysqlite 2.0.alpha3 === I'm glad to announce pysqlite 2.0.alpha3, which will be the last alpha release. Documentation and more testing will be what I'm concentrating on in the beta test phase, so here's the explanation of the new features within the change log.

Re: Strings

2005-04-21 Thread Terry Reedy
"Dan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I've having trouble coming to grip with Python strings. > > I need to send binary data over a socket. I'm taking the data from a > database. When I extract it, non-printable characters come out as a > backslash followed by a th

Re: Regular Expressions - Python vs Perl

2005-04-21 Thread Terry Reedy
"codecraig" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am interested in regular expressions and how Perl and Python > compare. Particulary, I am interested in performance (i.e. speed), > memory usage, flexibility, completeness (i.e. supports simple and > complex regex oper

Re: How can I verify that a passed argument is an interible collection?

2005-04-21 Thread John Machin
On Thu, 21 Apr 2005 09:59:54 -0500, Larry Bates <[EMAIL PROTECTED]> wrote: >2) Or if you not you could see if the argument has next and >__iter__ methods (more general solution) > >if hasattr(arg, 'next') and not hasattr(arg, '__iter__'): ># perform work on iterable > >else: >print "arg m

Re: grouping subsequences with BIO tags

2005-04-21 Thread Michael Spencer
Steven Bethard wrote: I have a list of strings that looks something like: ['O', 'B_X', 'B_Y', 'I_Y', 'O', 'B_X', 'I_X', 'B_X'] I'd have done it the same way as you, but here's 'another' way: >>> def grp(lst): ... stack = [] ... for label in lst: ... prefix = label[0] ...

Re: Dictionary question.

2005-04-21 Thread Terry Reedy
"hawkesed" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > I am semi new to Python. Here is my problem : I have a list of 100 > random integers. I want to be able to construct a histogram out of the > data. So I want to know how many 70's, 71's, etc. I can't figure out > how

Re: goto statement

2005-04-21 Thread John Roth
"praba kar" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Dear All, In Python what is equivalent to goto statement Sheesh! It took 20 days for this to get to my mail server! John Roth regards, praba -- http://mail.python.org/mailman/listinfo/python-list

Re: Jython run scripts problem (2.2.0a0 on Mac OSX 10.3.8)

2005-04-21 Thread Diez B. Roggisch
scott wrote: > I installed darwinports and did a "sudo port install jython" > > - > > scott$ which jython > /opt/local/bin/jython > > - > > Jython works in interactive mode as shown below: > > - > > pyprogs$ cd hotbits/

Re: Regular Expressions - Python vs Perl

2005-04-21 Thread James Stroud
Is it relevant that Python can produce compiled expressions? I don't think that there is such a thing with Perl. Also, to all of the dozen or so people in the world less wise than me about programming: don't choose your language on how fast the regex engine is. This would then become a case of

Re: deprecation of has_key?

2005-04-21 Thread Terry Reedy
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ahh, ok. Now I understand. I think you could probably search the > python-dev archives and see why the decision was made as it was. For > pretty much all my purposes, "key in dict" is much more useful than "item

Re: python LEX

2005-04-21 Thread Maurice LING
jozo wrote: I have to work on python lexical definition in Lex. I spent lots of my time to find regular expresions written for Lex of Python language but nothing. Can somebody help me? I nEED hELP Jython has a Python language lexer written using JavaCC. -- http://mail.python.org/mailman/listinfo

Re: __del__ and reference count problem

2005-04-21 Thread Terry Reedy
"tiissa" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It's interesting to note that self.pop instead of A.pop works as > expected. > But I don't know why A.pop doesn't. Because the name 'A' is no longer associated with the class object. However, self has a reference to the cla

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Ron
Ron wrote: [EMAIL PROTECTED] wrote: Many people I know ask why Python does slicing the way it does. Can anyone /please/ give me a good defense/justification??? I'm referring to why mystring[:4] gives me elements 0, 1, 2 and 3 but *NOT* mystring[4] (5th element). > There are actually 4 different

Confusing: Canvas image working in function but not in class

2005-04-21 Thread Mudcat
I have an image that displays on a canvas that works unless I put the same code in a class. I can't figure that out. Here's what works: def uts5100(self): self.screen = Toplevel( self.master ) self.screen.geometry("+100+50") self.screen.grab_set() self.screen.fo

Re: __del__ and reference count problem

2005-04-21 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > it looks like we have to use other way, hold the data we want to > preseve in an object, because it is possible the class is removed > before the instance cleaned, What is removed first is the binding between name A and the class obje

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Robert Kern
Paul Rubin wrote: "Dan Bishop" <[EMAIL PROTECTED]> writes: Name a problem space that inherently requires arrays to be 1-based rather than 0-based. "inherently" is too strong a word, since after all, we could do all our computing with Turing machines. Some algorithms are specified in terms of 1-bas

Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you ar

2005-04-21 Thread sheltech
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Don't you know that there's a special hell just for spammertrolls?. You have much repenting to do . You wad. Everybody -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Win32 Extensions and Excel 2003. OL 11.0 Supported?

2005-04-21 Thread John Machin
On 21 Apr 2005 09:13:52 -0700, "Mudcat" <[EMAIL PROTECTED]> wrote: > >Anyone else have to package builds of com applications that need to be >supported on different versions of Office? A few tips on how to make >that run smoother would be some sweet info. You'll probably do better if you ask the

grouping subsequences with BIO tags

2005-04-21 Thread Steven Bethard
I have a list of strings that looks something like: ['O', 'B_X', 'B_Y', 'I_Y', 'O', 'B_X', 'I_X', 'B_X'] I need to group the strings into runs (lists) using the following rules based on the string prefix: 'O' is discarded 'B_...' starts a new run 'I_...' continues a run started by

Re: (Python newbie) Using XP-SP2/MSVC6: No Python24_d.lib,winzip barfs on Python-2.4.1.tar, cannot download bzip2

2005-04-21 Thread Scott David Daniels
Bill Davy wrote: Hi Scott, Nice idea. Tried that but no more information about where the file was (not) found (see below). But many thanks for a useful flag. I did not see them in the documentation. What should I be lkooking for? [StopPres: Ah ha -h why did I not think of that?] ... import SH

Re: __del__ and reference count problem

2005-04-21 Thread flupke
[EMAIL PROTECTED] wrote: look at this discussion: http://www.dbforums.com/archive/index.php/t-1100372.html it looks like we have to use other way, hold the data we want to preseve in an object, because it is possible the class is removed before the instance cleaned, and we can not expect __del__ 10

Re: New line

2005-04-21 Thread ionic
Got it now thanks all -- "It's all in fun or life isn't worth it!" "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > okay, you type your code in idle, and run your code by hitting the F5 > key? > -- http://mail.python.org/mailman/listinfo/python-list

Jython run scripts problem (2.2.0a0 on Mac OSX 10.3.8)

2005-04-21 Thread scott
I installed darwinports and did a "sudo port install jython" - scott$ which jython /opt/local/bin/jython - Jython works in interactive mode as shown below: - pyprogs$ cd hotbits/ hotbits$ ls flips50.py jythoninstall.py ran

Re: Enumerating formatting strings

2005-04-21 Thread Michael Spencer
Steve Holden wrote: Michael Spencer wrote: Andrew Dalke wrote: I see you assume that only \w+ can fit inside of a %() in a format string. The actual Python code allows anything up to the balanced closed parens. Gah! I guess that torpedoes the regexp approach, then. Thanks for looking at this Micha

Re: New line

2005-04-21 Thread Brian van den Broek
ionic said unto the world upon 2005-04-21 16:34: Ok sorry guys, using the python gui, if i hit the 'enter' key python just executes what ever ive typed. It doesnt take me to the next line. How do i type several lines without executing after each line? Cheers A bit more precision in your question

Re: New line

2005-04-21 Thread [EMAIL PROTECTED]
okay, you type your code in idle, and run your code by hitting the F5 key? -- http://mail.python.org/mailman/listinfo/python-list

Re: __del__ and reference count problem

2005-04-21 Thread [EMAIL PROTECTED]
look at this discussion: http://www.dbforums.com/archive/index.php/t-1100372.html it looks like we have to use other way, hold the data we want to preseve in an object, because it is possible the class is removed before the instance cleaned, and we can not expect __del__ 100% in handling finalizin

Re: New line

2005-04-21 Thread ionic
Ok sorry guys, using the python gui, if i hit the 'enter' key python just executes what ever ive typed. It doesnt take me to the next line. How do i type several lines without executing after each line? Cheers -- "It's all in fun or life isn't worth it!" "James Stroud" <[EMAIL PROTECTED]> w

Python CGI Select Multiple Returning all items in box

2005-04-21 Thread larsmtl
Howdy all, Is there an easy way to return all items of an "HTML select multiple" even if they aren't highlighted? form=cgi.FieldStorage() form.getlist("box") only returns those that are selected. Thanks, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Paul Rubin
"Dan Bishop" <[EMAIL PROTECTED]> writes: > Name a problem space that inherently requires arrays to be 1-based > rather than 0-based. "inherently" is too strong a word, since after all, we could do all our computing with Turing machines. Some algorithms are specified in terms of 1-based arrays. A

Re: New line

2005-04-21 Thread Fredrik Lundh
"ionic" wrote: This is probably going to sound very dull but, how do you get to the next line after youve finished typing the first line? Thanks in advance if you don't know how to get a new line, how did you write that message? -- http://mail.python.org/mailman/listinfo/python-list

Re: New line

2005-04-21 Thread James Stroud
In the absence of any context to this question: Hit the button that says "Enter". James On Thursday 21 April 2005 01:15 pm, ionic wrote: > Hi all > > This is probably going to sound very dull but, how do you get to the next > line after youve finished typing the first line? > > Thanks in advance

New line

2005-04-21 Thread ionic
Hi all This is probably going to sound very dull but, how do you get to the next line after youve finished typing the first line? Thanks in advance -- "It's all in fun or life isn't worth it!" -- http://mail.python.org/mailman/listinfo/python-list

Re: recording data between [ and ]

2005-04-21 Thread François Granger
Le 21/04/05 16:19, « rbt » <[EMAIL PROTECTED]> a écrit : > Peter Hansen wrote: >> rbt wrote: >> >>> Output from 'netstat -b' on a win2003 server will show what binary is >>> responsible for the connection. For example, it may list something >>> like this along with other connection specific data:

Re: recording data between [ and ]

2005-04-21 Thread jay graves
[EMAIL PROTECTED] wrote: > Beside rxb15, there is also redict, in the standard lib (Jay Graves > shows the HD path): > http://home.earthlink.net/~jasonrandharper/reverb.py I knew there was a newer one out there but my google skills failed me. Thanks for the link. -- http://mail.python.org/mailma

Re: Array of Chars to String

2005-04-21 Thread "Martin v. Löwis"
Bengt Richter wrote: > But since I'm playing the other side of the table for > the moment, isn't filter to be deprecated? How could we know? It might be removed in P3k, but does that mean it is deprecated, as in "being disapproved", i.e. "being passed unfavorable judgement on"? In Python, I consi

Re: Persistent python object and the Web

2005-04-21 Thread Jeff Shell
The ZODB (Zope's object database, which can be downloaded and installed separately from Zope) and Durus (part of the Quixote family, I believe) are both high quality persistent Python object stores that are used heavily for web sites. I've never used the ZODB outside of Zope, and haven't used Duru

Re: recording data between [ and ]

2005-04-21 Thread bearophileHUGS
Diez B. Roggisch>But as the world is complex and people want solutions to their complex problems, IMHO programming will always be about such nitty gritty details.< REs are like assembly, but high-level languages show us that for a mammal there are (often) better (higher) ways to program a computer

Re: goto statement

2005-04-21 Thread Ron
Grant Edwards wrote: On 2005-04-21, Sergei Organov <[EMAIL PROTECTED]> wrote: Well, I'm writing for embedded realtime systems in C/C++ and have never encountered a single need to use goto. I have encountered situations in C programs where the best thing to use was a goto. Those situations have al

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Dan Bishop
Antoon Pardon wrote: > Op 2005-04-21, Steve Holden schreef <[EMAIL PROTECTED]>: > > [EMAIL PROTECTED] wrote: ... > >> Along the same lines, I think the REQUIREMENT that x[0] rather than > >> x[1] be the first element of list x is a mistake. At least the > >> programmer should have a choice, as in F

Re: python-dev Summary for 2005-04-01 through 2005-04-15

2005-04-21 Thread Gerrit Muller
Tim Lesher wrote: --- New python-dev summary team --- This summary marks the first by the team of Steve Bethard, Tim Lesher, and Tony Meyer. We're trying a collaborative approach to the summaries: each fortnight, we'll be getting together in a virtua

Re: __del__ and reference count problem

2005-04-21 Thread tiissa
[EMAIL PROTECTED] wrote: Your problem can be simplified : class A: pop = 11 def __del__(self): print A.pop if __name__ == '__main__': objA = A() I got the same error message, and I don't know why ? it looks like the class variable can't be accessed from __del__? It's interesting to note t

Re: __del__ and reference count problem

2005-04-21 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Your problem can be simplified : class A: pop = 11 def __del__(self): print A.pop if __name__ == '__main__': objA = A() Exception exceptions.AttributeError: "'NoneType' object has no attribute 'pop'" in > ignored I got the same error message, and I don't know why ? it

Re: python classes/file structure

2005-04-21 Thread Steve Holden
codecraig wrote: also is it common to have one class per file? seems weird to have, MyCustomWidget.MyCustomWidget thanks Well, this *is* fairly normal, but you can manage the namespace to your advantage if you wish. So, for example, gui/__init__.py could do from CustomWidget import CustomWidg

Re: __del__ and reference count problem

2005-04-21 Thread [EMAIL PROTECTED]
Your problem can be simplified : class A: pop = 11 def __del__(self): print A.pop if __name__ == '__main__': objA = A() Exception exceptions.AttributeError: "'NoneType' object has no attribute 'pop'" in > ignored I got the same error message, and I don't know why ? it looks like the c

Persistent python object and the Web

2005-04-21 Thread ramon . aragues
Hi, I'd like to know if I am trying to do something impossible or I am just being unable to find how to do it. In the latter case, please... help me... I´ve implemented a python class Graph, which handles graphs (with its nodes, edges, finding paths, etc). In my text-menu interface, I can add nod

Re: goto statement

2005-04-21 Thread Ivan Van Laningham
Hi All-- Fredrik Lundh wrote: > > Maxim Kasimov wrote: > > > how do use this here: > > are you still claiming you're not a troll? > > *plonk* > Oh, I don't think he's a troll, but his license to use Python should be revoked. I think RPG would be a good language for him, don't you? Metta, I

Re: python classes/file structure

2005-04-21 Thread Steve Holden
codecraig wrote: Thanks, but I am not familiar with the "__all__" variable, could u give me an example? Without using, __all__would i do this in my __init__.py? import MyCustomWidget1 import MyCustomWidget2 import MyCustomWidget3 etc? Yes, correct. __all__ just limits the names that are importe

Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you are, nor if you are a church member, but are you saved? Are you sure you will go to Heaven when you die? GOOGLE·NEWSGROUP·POST·146

2005-04-21 Thread Johnny Gentile
You seem to have a lot of questions for someone who talks to God every three minutes. What do you guys do, discuss the Yankees or something? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a package with convolution and related methods?

2005-04-21 Thread Charles Krug
On Thu, 21 Apr 2005 13:13:17 -0400, David M. Cooke <[EMAIL PROTECTED]> wrote: > Charles Krug <[EMAIL PROTECTED]> writes: > >> List: >> >> Is there a Python package with Convolution and related methods? >> >> I'm working on modeling some DSP processes in Python. I've rolled one >> up, but don't fe

Re: Python instances

2005-04-21 Thread Bengt Richter
On Thu, 21 Apr 2005 07:58:14 -0400, Kent Johnson <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> The following shows nothing static anywhere, yet a class has been defined, >> an instance created, and >> __init__ called with initial value, and the value retrieved as an attribute >> of the ret

Re: goto statement

2005-04-21 Thread Grant Edwards
On 2005-04-21, Sergei Organov <[EMAIL PROTECTED]> wrote: > Grant Edwards <[EMAIL PROTECTED]> writes: > >> On 2005-04-21, Peter Maas <[EMAIL PROTECTED]> wrote: >> > Maxim Kasimov schrieb: >> >> but what if i just can't to do this becouse i'm working thrue ssh, and >> >> have to use only installed e

Re: goto statement

2005-04-21 Thread Grant Edwards
On 2005-04-21, Roy Smith <[EMAIL PROTECTED]> wrote: > Grant Edwards <[EMAIL PROTECTED]> wrote: >>Sure, but what about the case where his program is on paper >>tape and all he has for an editor is an ice pick? > > Can't you emulate that in emacs with M-X inclusive-or-overwrite-mode? Heck, emacs pr

Re: recording data between [ and ]

2005-04-21 Thread Jim Sizelove
Simon Brunning wrote: On 4/21/05, rbt <[EMAIL PROTECTED]> wrote: string.between(data,[,]) def between(data, start, end): return re.findall(re.escape(start) + r'([^]]*)'+ re.escape(end), data) That's cool! But it doesn't quite work if the end tag is not ']': >>> import re >>> def between(d

Re: Array of Chars to String

2005-04-21 Thread Bengt Richter
On Thu, 21 Apr 2005 07:34:09 +0200, =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: >James Stroud wrote: >> astr = "Bob Carol Ted Alice" >> letters = "adB" > >Apparently nobody has proposed this yet: > filter(letters.__contains__, astr) >'Bad' filter(set(letters)._

  1   2   3   >