Re: zipfile decompress problems

2006-01-16 Thread Carl Banks
Waguy wrote: > Hi all, > > I am new to python and want to create a process to unzip large numbers of > zip files I get from a SOAP application. The files all have a ZIP extention > and can be unzipped using WinZip. > > However when I try opening the files using zlib or zipfile modules I get the >

Re: Running DOS App on win32 via python over ssh

2006-01-16 Thread Peter Hansen
James Stroud wrote: > I am helping someone write a python script to run their DOS application > through an SSH terminal. It seems that this program wants to access a > DOS shell and send output there. If running remotely, this causes a > problem because it locks up the program. The program seems

Re: Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-16 Thread Larry Hastings
There are exactly four non-Unicode build breakages in the Python source tree that are Win32-specific. Two are simply a matter of #if, two also require new alternative code (calls to PyString_FromStringAndSize()). All told, my changes to Win32-specific code to fix Py_USING_UNICODE consists of exact

Re: magical expanding hash

2006-01-16 Thread Paul Rubin
"braver" <[EMAIL PROTECTED]> writes: > I need a magical expanding hash with the following properties: ... > I have such a class in ruby. Can python do that? Python's built-in dict objects don't do that but you could write such a class pretty straightforwardly. -- http://mail.python.org/mailman/l

Re: magical expanding hash

2006-01-16 Thread James Stroud
braver wrote: > I need a magical expanding hash with the following properties: > > * it creates all intermediate keys > > meh['foo']['bar] = 1 > > -- works even if meh['foo'] didn't exist before > > * allows pushing new elements to leaves which are arrays > > meh['foo']['list] << elem1 > meh['

Re: Arithmetic sequences in Python

2006-01-16 Thread Paul Rubin
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > What would be expected from > [1, 3, 6 .. 20] > ??? In Haskell: Hugs.Base> [1,3,6..20] ERROR - Syntax error in expression (unexpected `..') Hugs.Base> > Again, I see [1, 3, 6, 7, 8, 9, 10, ... , 18, 19] You'd write t

Re: boost.python on Debian

2006-01-16 Thread Roman Yakovenko
You'd better ask this question on boost.python mailing list http://python.org/sigs/c++-sig/ or on boost development mailing list http://boost.org/more/mailing_lists.htm On 16 Jan 2006 21:14:28 +, Joe bloggs <[EMAIL PROTECTED]> wrote: > According to apt-get I have the latest (1.32.0

Testing complex new syntax

2006-01-16 Thread astromog
I have some significantly extended syntax for Python that I need to create a reference implementation for. My new syntax includes new keywords, statements and objects that are sort of like classes but not really. The implementation is all possible using standard Python, but the implementation isn't

magical expanding hash

2006-01-16 Thread braver
I need a magical expanding hash with the following properties: * it creates all intermediate keys meh['foo']['bar] = 1 -- works even if meh['foo'] didn't exist before * allows pushing new elements to leaves which are arrays meh['foo']['list] << elem1 meh['foo']['list] << elem2 * allows increm

Re: Newbie ? -- SGML metadata extraction

2006-01-16 Thread Adonis
ProvoWallis wrote: > Thanks. One more question, though. > > I'm not sure how to limit the scope of my search so that I'm just > extracting the id attribute from the sections that I want. I.e., I want > the id attributes from the forms in sections 1 and 3 but not from 2. > > Maybe I'm missing some

Re: Implied instance attribute creation when referencing a class attribute

2006-01-16 Thread Russell Warren
Thanks for the additional examples, David (didn't see this before my last post). All of it makes sense now, including those examples. Russ -- http://mail.python.org/mailman/listinfo/python-list

Re: Implied instance attribute creation when referencing a class attribute

2006-01-16 Thread Russell Warren
D'oh... I just realized why this is happening. It is clear in the longhand as you say, but I don't think in the way you descibed it (or I'm so far gone right now I have lost it). self.I += 1 is the same as self.I = self.I + 1 and when python tries figures out what the 'self.I' is on the ri

Re: PEP 309 (Partial Function Application) Idea

2006-01-16 Thread Ronald Mai
for a new function, named parameter might be a better choise, but for existing function, placeholder would be better, since you don't need to modify the existing code. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 309 (Partial Function Application) Idea

2006-01-16 Thread Ronald Mai
sorry, should be "existing" -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 309 (Partial Function Application) Idea

2006-01-16 Thread Ronald Mai
for a new function, named parameter might be a better choise, but for existing function, placeholder would be better, since you don't need to modify the exiting code. -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation/whitespace

2006-01-16 Thread thakadu
Yes, thats what you have to do. And that was my original point, you cannot just paste and go, you have to first reformat. -- http://mail.python.org/mailman/listinfo/python-list

Re: Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-16 Thread Paul McGuire
"Larry Hastings" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Second of all, the dumb-as-a-bag-of-rocks Windows linker (at least > the one used by VC++ under MSVS .Net 2003) *links in unused static > symbols*. If I want to excise the code for a module, it is not > sufficient to co

Re: Decimal ROUND_HALF_EVEN Default

2006-01-16 Thread Raymond Hettinger
LordLaraby wrote: > If 'bankers rounding' is HALF_ROUND_EVEN, what is HALF_ROUND_UP? I > confess to never having heard the terms. The terms are defined in the docs for the Context object: http://docs.python.org/lib/decimal-decimal.html The rounding option is one of: --

Re: Mutable bytes type

2006-01-16 Thread Donn Cave
Quoth "Klaas" <[EMAIL PROTECTED]>: | A PEP for a mutable bytes type was composed but withdrawn two years | ago: ... | Does anyone know if a well-coded and tested implementation of such a | beast exists now? Strings make me sad. I didn't look at the PEPs - PEPs always make me sad - but if you want

Re: Implied instance attribute creation when referencing a class attribute

2006-01-16 Thread David Wahler
Russell Warren wrote: > Not true as above. The longhand for 'self.I += 1' is 'self.I = self.I > + 1', which normally needs self.I to exist due to the RHS of this. Try this: >>> class foo(object): ... I = 1 ... def __init__(self): ... print self.__dict__ ... self.I = self.I + 1 ...

Problem with FTPLib and incomplete files on some downloads

2006-01-16 Thread Peter A.Schott
I download a lot of 4-6 KB files and regularly run into issues with files that don't get downloaded all the way or otherwise get corrupt. I do something like: RemoteList = nlstdir() for filename in RemoteList: LocalFile = open(filename, "wb") LocalFile.write( "get file code here" ) LocalFil

Re: Implied instance attribute creation when referencing a class attribute

2006-01-16 Thread Russell Warren
> I can see how this can be confusing, but I think the confusion here is > yours, not Pythons ;) This is very possible, but I don't think in the way you describe! > self.I += 10 is an *assignment*. Like any assignment, it causes the > attribute in question to be created ... no it isn't. The +=

Running DOS App on win32 via python over ssh

2006-01-16 Thread James Stroud
Hello All, I am helping someone write a python script to run their DOS application through an SSH terminal. It seems that this program wants to access a DOS shell and send output there. If running remotely, this causes a problem because it locks up the program. The program seems (to me) to be

Mutable bytes type

2006-01-16 Thread Klaas
A PEP for a mutable bytes type was composed but withdrawn two years ago: http://www.python.org/peps/pep-0296.html Another was composed (status unclear) in 2004: http://www.python.org/peps/pep-0332.html It was mentioned on python-dev in 2004 (http://python.fyxm.net/dev/summary/2004-08-16_2004-08-3

Re: On Numbers

2006-01-16 Thread Erik Max Francis
Steven D'Aprano wrote: > The square root of 1 is +1 (the negative root being > explicitly rejected). Pure mathematicians, who may be > expected to care whether the root is the integer 1 or > the real number 1, are unlikely to write 1**0.5, > prefering the squareroot symbol. > > For the rest o

Re: Preventing class methods from being defined

2006-01-16 Thread David Hirschfield
Thanks for this, it's a great list of the ways it can be done. Here's a bit more insight into the arrangement I'm trying to get: restrict = True class A(object): _restrict = ["test"] def _null(self, *args, **kws): raise Exception,"not allowed to access" def test(s

Re: On Numbers

2006-01-16 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > So I don't really know what point you are making. What solution(s) for > 1**0.5 were you expecting? I think it was a sly way of saying "plus one or minus one". -- http://mail.python.org/mailman/listinfo/python-list

Re: On Numbers

2006-01-16 Thread Steven D'Aprano
Tom Anderson wrote: > On Sun, 15 Jan 2006, Alex Martelli wrote: > >> Paul Rubin wrote: >> >>> Mike Meyer <[EMAIL PROTECTED]> writes: >>> I'd like to work on that. The idea would be that all the numeric types are representations of reals with different propert

Re: Decimal ROUND_HALF_EVEN Default

2006-01-16 Thread Steven D'Aprano
LordLaraby wrote: > If 'bankers rounding' is HALF_ROUND_EVEN, what is HALF_ROUND_UP? I > confess to never having heard the terms. > I usually do: Y = int(X + 0.5) scaled to proper # of decimal places. > Which type of rounding is this? If either. Google Is Your Friend: http://www.diycalculator.c

Re: Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-16 Thread Neil Hodgson
Giovanni Bajo: > - There will be some opposition to the obvious policy of "keeping the bare > minimum inside the DLL" because of inefficiencies in the Python build > system. It is also non-optimal for those that do want the full set of modules as separate files can add overhead for block si

Re: Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-16 Thread Neil Hodgson
Larry Hastings: > First and foremost: turning off Py_USING_UNICODE *breaks the build* > on Windows. The following list of breakages were all fixed with > judicious applications of #ifdef Py_USING_UNICODE: > * The implementation of "multi-byte codecs" (CJK codecs) implicitly > assumes that they

Re: Web application design question (long)

2006-01-16 Thread Fried Egg
I must not express myself very clearly. I don't need any help with the disassociated text algorithm. What I need is a framework for data processing web apps, and the disassociated text seems a good example. -- http://mail.python.org/mailman/listinfo/python-list

RE: Restarting scripts

2006-01-16 Thread Ron Griswold
I gave this a shot but haven't had much luck with it. When I try os.execlp I get an error saying unknown file or directory. Whether this is in reference to Python or my script I don't know, however python is in my system's path variable and I'm running the script from the dir it is located in. At

Re: Decimal ROUND_HALF_EVEN Default

2006-01-16 Thread LordLaraby
If 'bankers rounding' is HALF_ROUND_EVEN, what is HALF_ROUND_UP? I confess to never having heard the terms. I usually do: Y = int(X + 0.5) scaled to proper # of decimal places. Which type of rounding is this? If either. -- http://mail.python.org/mailman/listinfo/python-list

Re: Arithmetic sequences in Python

2006-01-16 Thread Paul Rubin
Tom Anderson <[EMAIL PROTECTED]> writes: > The natural way to implement this would be to make .. a normal > operator, rather than magic, and add a __range__ special method to > handle it. "a .. b" would translate to "a.__range__(b)". I note that > Roman Suzi proposed this back in 2001, after PEP 20

Re: Restarting scripts

2006-01-16 Thread Peter Hansen
Brian Cole wrote: > If everything dies by a Python exception... > > if __name__ == '__main__': > try: > main(sys.argv) > except: > os.execlp("python", "python", sys.argv) > > Pretty nasty peice of code, but it works well for restarting your script. Noting that sys.exit()

Re: Web application design question (long)

2006-01-16 Thread Paul Rubin
"Fried Egg" <[EMAIL PROTECTED]> writes: > (1) Has anybody done something general enough for me to use? It's sounds like you're writing a glorified version of Emacs's "Dissociated Press" command. DP used a simpler algorithm but the results were about the same. > (3) Would anybody else be interes

Re: Arithmetic sequences in Python

2006-01-16 Thread Tom Anderson
On Mon, 16 Jan 2006, Alex Martelli wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >> On Mon, 16 Jan 2006 12:51:58 +0100, Xavier Morel wrote: >> >>> For those who'd need the (0..n-1) behavior, Ruby features something >>> that I find quite elegant (if not perfectly obvious at first), >>> (f

Re: Arithmetic sequences in Python

2006-01-16 Thread Tom Anderson
On Mon, 16 Jan 2006, Gregory Petrosyan wrote: > Please visit http://www.python.org/peps/pep-0204.html first. > > As you can see, PEP 204 was rejected, mostly because of not-so-obvious > syntax. But IMO the idea behind this pep is very nice. Agreed. Although i have to say, i like the syntax there

Re: Preventing class methods from being defined

2006-01-16 Thread Bengt Richter
On Sun, 15 Jan 2006 19:23:30 -0800, David Hirschfield <[EMAIL PROTECTED]> wrote: >I should have explicitly mentioned that I didn't want this particular >solution, for a number of silly reasons. >Is there another way to make this work, without needing to place an >explicit "if allowed" around eac

Re: embedding python: simulating sequence get item / set item methods

2006-01-16 Thread Alex Martelli
Johannes Zellner <[EMAIL PROTECTED]> wrote: > Hello, > > when embedding python: how can I create a type which simulates item > getters and setters? Something like this: > > void setter(PyObject* self, int i, PyObject new_value) > { > // do something > } > > PyObject* getter(PyObject* self,

Re: Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-16 Thread LordLaraby
I myself wonder why python.dll can't just load a companion i18n.dll when and if it's called for in the script. Such as by having week references to those functions and loading the dll as needed.And probably throwing an exception if it can't be loaded. Most of the CJK stuff could then be carried in

Re: Arithmetic sequences in Python

2006-01-16 Thread Tom Anderson
On Mon, 16 Jan 2006, it was written: > There's something to be said for that. Should ['a'..'z'] be a list or a > string? And while we're there, what should ['aa'..'zyzzogeton'] be? tom -- Socialism - straight in the mainline! -- http://mail.python.org/mailman/listinfo/python-list

Re: Restarting scripts

2006-01-16 Thread Brian Cole
If exec can't find python, use sys.executable. If exec can't find the program, use os.path.abspath(__file__). The benefit of "exec" is that the process will always use the same PID. If that's not a requirement using a loader program would be a lot easier. Instead of os.spawn, if you have python 2

Re: Is 'everything' a refrence or isn't it?

2006-01-16 Thread Bengt Richter
On Mon, 16 Jan 2006 21:58:26 +1100, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Mon, 16 Jan 2006 10:34:40 +, Bengt Richter wrote: > >> >>> class A: >> ... def __getattr__(self, attr): print 'A().%s'%attr; raise >> AttributeError >> ... >> >>> class B: >> ... def __getattr__(se

embedding python: simulating sequence get item / set item methods

2006-01-16 Thread Johannes Zellner
Hello, when embedding python: how can I create a type which simulates item getters and setters? Something like this: void setter(PyObject* self, int i, PyObject new_value) { // do something } PyObject* getter(PyObject* self, int i) { // do something return something; } and I'd like

Re: Newbie ? -- SGML metadata extraction

2006-01-16 Thread ProvoWallis
Thanks. One more question, though. I'm not sure how to limit the scope of my search so that I'm just extracting the id attribute from the sections that I want. I.e., I want the id attributes from the forms in sections 1 and 3 but not from 2. Maybe I'm missing something. -- http://mail.python.or

Re: Arithmetic sequences in Python

2006-01-16 Thread Xavier Morel
Steven D'Aprano wrote: > On Mon, 16 Jan 2006 12:51:58 +0100, Xavier Morel wrote: > >> For those who'd need the (0..n-1) behavior, Ruby features something that >> I find quite elegant (if not perfectly obvious at first), (first..last) >> provides a range from first to last with both boundaries in

Re: Arithmetic sequences in Python

2006-01-16 Thread Xavier Morel
Steven D'Aprano wrote: > On Mon, 16 Jan 2006 12:51:58 +0100, Xavier Morel wrote: > >> For those who'd need the (0..n-1) behavior, Ruby features something that >> I find quite elegant (if not perfectly obvious at first), (first..last) >> provides a range from first to last with both boundaries in

Re: Decimal ROUND_HALF_EVEN Default

2006-01-16 Thread Tim Peters
[3c273] > I'm just curious as to why the default rounding in the decimal module is > ROUND_HALF_EVEN instead of ROUND_HALF_UP. Because it's the best (numerically "fairest") rounding method for most people most of the time. > All of the decimal arithmetic I do is rounded half up and I can't think

Re: Decimal ROUND_HALF_EVEN Default

2006-01-16 Thread Max Erickson
"3c273" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hello, > > I'm just curious as to why the default rounding in the decimal module > is ROUND_HALF_EVEN instead of ROUND_HALF_UP. All of the decimal > arithmetic I do is rounded half up and I can't think of why one might > use round hal

Web application design question (long)

2006-01-16 Thread Fried Egg
Hi Pythonist(a/o)s I am interested if anyone can shed any light on a web application problem, both in the specific details (see below) but also in the theory of how to do ad hoc data processing and exploration through a web interface (a tall order, I think). It is apropos of my job, if you hadn't

Re: On Numbers

2006-01-16 Thread Tom Anderson
On Sun, 15 Jan 2006, Alex Martelli wrote: > Paul Rubin wrote: > >> Mike Meyer <[EMAIL PROTECTED]> writes: >> >>> I'd like to work on that. The idea would be that all the numeric types >>> are representations of reals with different properties that make them >>> appropr

Decimal ROUND_HALF_EVEN Default

2006-01-16 Thread 3c273
Hello, I'm just curious as to why the default rounding in the decimal module is ROUND_HALF_EVEN instead of ROUND_HALF_UP. All of the decimal arithmetic I do is rounded half up and I can't think of why one might use round half even. I googled a bit and didn't really find a good answer. Any insight

Re: Parsing files -- pyparsing to the rescue?

2006-01-16 Thread Allan Zhang
Try this code = import re p = re.compile(r'([^<]*)<') s = open("file").read() m = re.search(p, s) if m: res = m.groups()[0] res = res.lstrip("\n") res = res.rstrip("\n") print res result: === %python parser.py Sys Data Sys-Data asdkData Data % Thanks Allan "rh0dium" <[EMAIL PROTECTED]>

Re: Pythonic wrappers for SQL?

2006-01-16 Thread Wade Leftwich
Steve Holden wrote: > > > SQLObject is a very popuar object-relational mapper that works with a > range of databases including SQLite. > > But SQL isn't actually that complicated to someone who's already learned > Python! I maintain this page for students on the classes I teach, and it > has some u

Re: Parsing files -- pyparsing to the rescue?

2006-01-16 Thread Paul McGuire
"rh0dium" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > I have a file which I need to parse and I need to be able to break it > down by sections. I know it's possible but I can't seem to figure this > out. > > The sections are broken by <> with one or more keywords

Re: Newbie ? -- SGML metadata extraction

2006-01-16 Thread Adonis
ProvoWallis wrote: From what I gather here is a quickie, probably better solutions on the way but this accomplishes the idea I think. Some helpful links: http://docs.python.org/lib/module-sgmllib.html http://docs.python.org/lib/module-HTMLParser.html http://docs.python.org/lib/module-htmllib.

Re: StringVar() IntVar() vs. Dictionary of same

2006-01-16 Thread Paul Rubin
"Bob Greschke" <[EMAIL PROTECTED]> writes: > Just roughly what do you think the effect would be? Either extremely slight or else nonexistent. -- http://mail.python.org/mailman/listinfo/python-list

StringVar() IntVar() vs. Dictionary of same

2006-01-16 Thread Bob Greschke
Let's say I have a program with roughly 1 bazillion StringVars and IntVars (a lot of tkinter forms). Can anyone guess what the performance hit may or may not be by going from "global" StringVars and IntVars and accessing them directly (like barcode = StringVar()) to putting all of the StringVar

Newbie ? -- SGML metadata extraction

2006-01-16 Thread ProvoWallis
Hi, I'm trying to write a script that will extract the value of an attribute from an element using the attribute value of another element as the basis for extraction. For example, in my situation I have a pre-defined list of main sections and I want to extract the id attribute of the form element

msvcp71.dll and Python 2.4

2006-01-16 Thread Taylor, Martin
Back on 8-Feb-05, "Martin v. Löwis" martin at v.loewis.de  said:   >> "An application should use and redistribute msvcr71.dll, and it should>> avoid placing a copy or using an existing copy of msvcr71.dll in the>> system directory. Instead, the application should keep a copy of>> msvcr71.d

Re: Implied instance attribute creation when referencing a class attribute

2006-01-16 Thread Chris Mellon
On 16 Jan 2006 14:11:25 -0800, Russell Warren <[EMAIL PROTECTED]> wrote: > I just ran across a case which seems like an odd exception to either > what I understand as the "normal" variable lookup scheme in an > instance/object heirarchy, or to the rules regarding variable usage > before creation.

Re: OT: excellent book on information theory

2006-01-16 Thread Xavier Morel
Tim Peters wrote: > Non-English translations have real challenges, and because this series > is more popular than the Python Reference Manual these days, there's a > lot of fascinating info to be found. For example, I think the > Japanese translator deserves a Major Award for their heroic attempt

Re: Arithmetic sequences in Python

2006-01-16 Thread Paul Rubin
"Gregory Petrosyan" <[EMAIL PROTECTED]> writes: > 1) [f(n), f(n)-1 .. 0] can be easily catched by interpreter, and f(n) > can be evaluated only once. I think it would be counterintuitive for the interpreter to do that. If I type f(n) twice I expect it to be evaluated twice. > 2) if you need right

Re: Arithmetic sequences in Python

2006-01-16 Thread Paul Rubin
"Gregory Petrosyan" <[EMAIL PROTECTED]> writes: > 1) both in [5,6,10] and [5,7,10] 10 is included ;-) > And as for [5,6 .. 10] and [5,7 .. 10]... First one should look > like [5 .. 10] I think. But you are right: > it looks like a problem that in one case 10 is included and in > other not.

Re: Is 'everything' a refrence or isn't it?

2006-01-16 Thread Steven D'Aprano
On Mon, 16 Jan 2006 21:18:35 +, Bengt Richter wrote: > On Mon, 16 Jan 2006 21:58:26 +1100, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >>On Mon, 16 Jan 2006 10:34:40 +, Bengt Richter wrote: >> >>> >>> class A: >>> ... def __getattr__(self, attr): print 'A().%s'%attr; raise >>> Att

Re: Arithmetic sequences in Python

2006-01-16 Thread Gregory Petrosyan
Steven D'Aprano wrote: > Python indexing deliberately goes to one-past-the-end counting for a > reason: it helps prevent off-by-one signpost errors. This syntax goes > against that decision, and adds one more thing to memorise about Python: > the end index is not included in the list, except for ar

Re: OT: excellent book on information theory

2006-01-16 Thread Luc The Perverse
"Paul Rubin" wrote in message news:[EMAIL PROTECTED] > Grant Edwards <[EMAIL PROTECTED]> writes: >> That made me smile on a Monday morning (not an insignificant >> accomplishment). I noticed in the one footnote that the H.P. >> book had been "translated into American".

Implied instance attribute creation when referencing a class attribute

2006-01-16 Thread Russell Warren
I just ran across a case which seems like an odd exception to either what I understand as the "normal" variable lookup scheme in an instance/object heirarchy, or to the rules regarding variable usage before creation. Check this out: >>> class foo(object): ... I = 1 ... def __init__(self): ...

Re: Arithmetic sequences in Python

2006-01-16 Thread Gregory Petrosyan
Thanks for your replies. So, some problems and possible solutions: 1) [f(n), f(n)-1 .. 0] can be easily catched by interpreter, and f(n) can be evaluated only once. 2) if you need right border excluded, I think [0 .. n) is very clear (and consistent with mathematics). And about brakets highlighti

Re: SPE [was: Wingide is a beautiful application]

2006-01-16 Thread SPE - Stani's Python Editor
Sybren Stuvel wrote: > It runs now, but some things aren't working. Besides the crashing down, what else? I am very curious. > When I open a file and > click on the "browse" tab, I see the current directory. If I then > double-click on a Python file, I'd expect SPE to open it, but nothing > happen

Re: Arithmetic sequences in Python

2006-01-16 Thread Paul Rubin
Xavier Morel <[EMAIL PROTECTED]> writes: > The only thing that bothers me about the initial proposal is that > there would not, in fact, be any "range object", but merely a > syntactic sugar for list/generator creation. Well, it could create something like an xrange. Maybe that's preferable. >

Re: OT: excellent book on information theory

2006-01-16 Thread Grant Edwards
On 2006-01-16, Tim Peters <[EMAIL PROTECTED]> wrote: >>> http://www.inference.phy.cam.ac.uk/mackay/itila/Potter.html > > [Grant Edwards] >> That made me smile on a Monday morning (not an insignificant >> accomplishment). I noticed in the one footnote that the H.P. >> book had been "translated int

Re: OT: excellent book on information theory

2006-01-16 Thread Paul Rubin
"Tim Peters" <[EMAIL PROTECTED]> writes: > For example, I think the > Japanese translator deserves a Major Award for their heroic attempt to > translate Ron's "Uranus" pun: > >http://www.cjvlang.com/Hpotter/wordplay/uranus.html Gad, I'm surprised that was in the original. For an absolutely

Re: Restarting scripts

2006-01-16 Thread Brian Cole
If everything dies by a Python exception... if __name__ == '__main__': try: main(sys.argv) except: os.execlp("python", "python", sys.argv) Pretty nasty peice of code, but it works well for restarting your script. -Brian On 1/16/06, Ron Griswold <[EMAIL PROTECTED]> wrote:

Re: two questions about thread

2006-01-16 Thread Bryan Olson
Kevin wrote: > The best way to do this is by using a flag or event that the child-threads > monitor each loop (or multiple times per loop if it's a long loop). If the > flag is set, they exit themselves. > > The parent thread only has to set the flag to cause the children to die. Doesn't work, b

Re: Arithmetic sequences in Python

2006-01-16 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > > Oh come on, [5,4,..0] is much easier to read than range(5,-1,-1). > > But not easier than reversed(range(6)) Heh, I like that, and reversed(xrange(6)) appears to do the right thing too. I didn't know about __reversed__ before. > [[the 5 in one of t

Re: Arithmetic sequences in Python

2006-01-16 Thread Szabolcs Nagy
i would love to see a nice, clear syntax instead of for i in xrange(start, stop, step): ... because xrange is ugly and iteration over int sequences are important. we don't need a range() alternative ( [0:10] or [0..10] ) (because no one would ever use range() if there were a nice integer-for-loop)

Restarting scripts

2006-01-16 Thread Ron Griswold
This may be a little OT, but it does involve python scripts. I’ve written a server that hosts my companies asset management system. Of course something like this cannot be down for very long without data being lost (of course I have taken measures to inform the user of the down time and ask

Re: OT: excellent book on information theory

2006-01-16 Thread Tim Peters
[Paul Rubin] ... >> David J.C. MacKay >> Information Theory, Inference, and Learning Algorithms >> >> Full text online: >> http://www.inference.phy.cam.ac.uk/mackay/itila/ ... >> The printed version is somewhat expensive, but according to the >> following analysis it's a better barg

RE: Space left on device

2006-01-16 Thread Tim Golden
[sir_alex] | Is there any function to see how much space is left on a device (such | as a usb key)? I'm trying to fill in an mp3 reader in a little script, | and this information could be very useful! Thanks! If you're talking Win32, have a look at win32file.GetDiskFreeSpace from the pywin32 exte

About socket threading

2006-01-16 Thread Kr z
Hi, Do anyone know the Python source codes on how the client can send/"pump"a lot of threads to the server class?  Receive MSN Hotmail alerts over SMS! -- http://mail.python.org/mailman/listinfo/python-list

BOUNCE [EMAIL PROTECTED]: global taboo header: /^subject:\s*Returned mail\b/i Non-member submission from [EMAIL PROTECTED]

2006-01-16 Thread owner-caliper
Received: (qmail 6583 invoked from network); 16 Jan 2006 21:16:32 - Received: from cupona1.hp.com (HELO cuprel1.hp.com) (15.13.176.10) by cxx.cup.hp.com with SMTP; 16 Jan 2006 21:16:32 - Received: from python.org (ip65-45-63-114.z63-45-65.customer.algx.net [65.45.63.114]) by cuprel1.hp.

Re: boost.python on Debian

2006-01-16 Thread Joe bloggs
According to apt-get I have the latest (1.32.0-6) Debian boost libraries, and bjam version (3.1.10-1) correctly installed. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-16 Thread Bengt Richter
On Mon, 16 Jan 2006 21:58:26 +1100, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Mon, 16 Jan 2006 10:34:40 +, Bengt Richter wrote: > >> >>> class A: >> ... def __getattr__(self, attr): print 'A().%s'%attr; raise >> AttributeError >> ... >> >>> class B: >> ... def __getattr__(se

Re: Parsing files -- pyparsing to the rescue?

2006-01-16 Thread Giovanni Bajo
rh0dium wrote: > I have a file which I need to parse and I need to be able to break it > down by sections. I know it's possible but I can't seem to figure this > out. > > The sections are broken by <> with one or more keywords in the <>. > What I want to do is to be able to pars a particular

Parsing files -- pyparsing to the rescue?

2006-01-16 Thread rh0dium
Hi all, I have a file which I need to parse and I need to be able to break it down by sections. I know it's possible but I can't seem to figure this out. The sections are broken by <> with one or more keywords in the <>. What I want to do is to be able to pars a particular section of the fil

Re: Arithmetic sequences in Python

2006-01-16 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Roy Smith wrote: > Alex Martelli <[EMAIL PROTECTED]> wrote: >>Agreed. *IF* we truly needed an occasional "up to X *INCLUDED*" >>sequence, it should be in a syntax that can't FAIL to be noticed, such >>as range(X, endincluded=True). > > How about... > > for i in (0..x]: >

Re: OT: excellent book on information theory

2006-01-16 Thread Paul Rubin
Grant Edwards <[EMAIL PROTECTED]> writes: > That made me smile on a Monday morning (not an insignificant > accomplishment). I noticed in the one footnote that the H.P. > book had been "translated into American". I've always wondered > about that. I noticed several spots in the H.P. books where >

Re: Arithmetic sequences in Python

2006-01-16 Thread Alex Martelli
Roy Smith <[EMAIL PROTECTED]> wrote: > Alex Martelli <[EMAIL PROTECTED]> wrote: > >Agreed. *IF* we truly needed an occasional "up to X *INCLUDED*" > >sequence, it should be in a syntax that can't FAIL to be noticed, such > >as range(X, endincluded=True). > > How about... > > for i in (0..x]: >

Re: OT: excellent book on information theory

2006-01-16 Thread Andrew Swallow
Grant Edwards wrote: [snip] > > That made me smile on a Monday morning (not an insignificant > accomplishment). I noticed in the one footnote that the H.P. > book had been "translated into American". I've always wondered > about that. I noticed several spots in the H.P. books where > the dialog

Re: zipfile decompress problems

2006-01-16 Thread Giovanni Bajo
Waguy wrote: > I tried that to and it didn't work, got the same message > Thanks though, Can you send / provide a link to a minimal zip file which reproduces the problem? -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-16 Thread Giovanni Bajo
Larry Hastings wrote: > First and foremost: turning off Py_USING_UNICODE *breaks the build* > on Windows. Probably nobody does that nowadays. My own feeling (but I don't have numbers for backing it up) is that the biggest size in the .DLL is represented by things like the CJK codecs (which are ab

Re: zipfile decompress problems

2006-01-16 Thread Waguy
I tried that to and it didn't work, got the same message Thanks though, "Giovanni Bajo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Waguy wrote: > >> import zipfile >> file = zipfile.ZipFile("c:\\chessy.zip", "r") > > > Use "rb". > -- > Giovanni Bajo > > -- http://mail.p

Re: Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-16 Thread Steven Bethard
Larry Hastings wrote: > Of course, it's not the most important thing in the world--after all, > I'm the first person to even *notice*, right? But it seems a shame > that > one can break the build so easily. If it pleases the stewards of > Python, I would be happy to submit patches that fix the no

Re: zipfile decompress problems

2006-01-16 Thread Giovanni Bajo
Waguy wrote: > import zipfile > file = zipfile.ZipFile("c:\\chessy.zip", "r") Use "rb". -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Arithmetic sequences in Python

2006-01-16 Thread Roy Smith
Alex Martelli <[EMAIL PROTECTED]> wrote: >Agreed. *IF* we truly needed an occasional "up to X *INCLUDED*" >sequence, it should be in a syntax that can't FAIL to be noticed, such >as range(X, endincluded=True). How about... for i in (0..x]: blah -- http://mail.python.org/mailman/listinfo/py

Re: pdb.py - why is this debugger different from all other debuggers?

2006-01-16 Thread skip
Andreas> Am Donnerstag, den 05.01.2006, 15:03 -0800 schrieb Andreas> [EMAIL PROTECTED]: I know this sounds like brutal, but I've been Andreas> developing Python code for a decade now, and I've almost never Andreas> used pdb.py. OTOH I also use gdb only for "bt" from a core Andr

Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-16 Thread Larry Hastings
I'm an indie shareware Windows game developer. In indie shareware game development, download size is terribly important; conventional wisdom holds that--even today--your download should be 5MB or less. I'd like to use Python in my games. However, python24.dll is 1.86MB, and zips down to 877k. I

  1   2   >