Re: OpenOpt install

2007-12-18 Thread Matthieu Brucher
Hi, My solution was the correct way to go, IIRC, only a few changes were to be done so that those files were detected correctly (I think there were some __init__.py files that were not present this may have to do with the fact that you add a lot of additional paths in sys.path when you load openop

Rounding

2007-12-18 Thread katie smith
if i have a number 6.345 and i wanted it to be 6 without subtracting .345 because it won't always be .345 what do i do? how do i round to the nearest whole number. Or in this case round down. Is there an easy way to round down to the nearest whole number? ___

Text into a label

2007-12-18 Thread Sam Garson
Hi again. I am trying to get the text of the selection in a list box and put into a variable, which is put into a label. i.e., whatever is selected will show in the label. However, because at the beginning there is nothing in the listbox (and therefore no selection), the tuple returned by cursele

Re: strptime() in _strptime.py vs lib-dynload/time.so

2007-12-18 Thread Gabriel Genellina
En Tue, 18 Dec 2007 04:45:25 -0300, <[EMAIL PROTECTED]> escribió: > On Dec 17, 8:01 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Mon, 17 Dec 2007 01:53:24 -0300, <[EMAIL PROTECTED]> escribió: >> >> > actually, the C-version of strptime() is also getting called: >> > 577650.96

Re: Rounding

2007-12-18 Thread Vladimir Rusinov
On 12/15/07, katie smith <[EMAIL PROTECTED]> wrote: > > if i have a number 6.345 and i wanted it to be 6 without subtracting .345 > because it won't always be .345 what do i do? > > how do i round to the nearest whole number. Or in this case round down. Is > there an easy way to round down to the n

Re: OpenOpt install

2007-12-18 Thread Robert Kern
dmitrey wrote: > When earlier OpenOpt versions had been installed there were no > compiled pyc-files (in destination directory). I called to mailing > list but no obvious receipt had been achieved. Matthieu had done some > changes but it yielded other mistakes (no some py-files detected or > kind o

Re: OpenOpt install

2007-12-18 Thread Matthieu Brucher
OK, in fact distutils can compile every python script without a problem as long as it is in a package. For instance every solver is in the solvers folder, but there is no __init__.py file there, so distutils cannot compile the scripts that are in the subfolders, it is logical. What you have to do i

Python decompiler

2007-12-18 Thread K.L.
I'm searching a maneuverable python bytecode decompiler. There is one named 'decompyle', but it doesn't support Python2.5 and too hard to use. And the 'depython'(http://www.depython.net/) is good enough except it cannot process file more than 5kb. Is there some else available? I'm novice at python

No tab completion if sys.stdout is redirected

2007-12-18 Thread Dirk Loss
Hi, I want to have tab completion in my program for interactive input. Using readline and rlcompleter this works nicely. But I also have to catch and modify all "print" output, so I redirect sys.stdout to a custom file-like object. The problem is: After the redirection, readline support seems sudd

Re: Rounding

2007-12-18 Thread Lars Johansen
that does not round up.. int(round(6.345)) maybe tir, 18.12.2007 kl. 11.53 +0300, skrev Vladimir Rusinov: > > > On 12/15/07, katie smith <[EMAIL PROTECTED]> wrote: > if i have a number 6.345 and i wanted it to be 6 without > subtracting .345 because it won't always be .345 what do

Re: Rounding

2007-12-18 Thread John Machin
On Dec 18, 7:53 pm, "Vladimir Rusinov" <[EMAIL PROTECTED]> wrote: > On 12/15/07, katie smith <[EMAIL PROTECTED]> wrote: > > > > > if i have a number 6.345 and i wanted it to be 6 without subtracting .345 > > because it won't always be .345 what do i do? > > > how do i round to the nearest whole num

Re: Rounding

2007-12-18 Thread Chris
On Dec 18, 10:53 am, "Vladimir Rusinov" <[EMAIL PROTECTED]> wrote: > On 12/15/07, katie smith <[EMAIL PROTECTED]> wrote: > > > > > if i have a number 6.345 and i wanted it to be 6 without subtracting .345 > > because it won't always be .345 what do i do? > > > how do i round to the nearest whole nu

Re: Rounding

2007-12-18 Thread Vladimir Rusinov
On 12/18/07, Lars Johansen <[EMAIL PROTECTED]> wrote: > > that does not round up.. > Yep, this is truncation. I'd read the question better. -- Vladimir Rusinov GreenMice Solutions: IT-решения на базе Linux http://greenmice.info/ -- http://mail.python.org/mailman/listinfo/python-list

Re: New to Python Would like debug advice

2007-12-18 Thread Bruno Desthuilliers
Ramsey Nasser a écrit : > On Dec 17, 2007 9:17 PM, PatrickMinnesota <[EMAIL PROTECTED]> wrote: >> Yep, I'm new to the language, it's been a couple of months. >> >> I opted for gvim and console window for developing on a Windows XP >> box. I'm not a huge fan of IDEs except for when I need some >> d

Re: How to read a binary file into a mysql table

2007-12-18 Thread Hans Müller
Sorry, I found the mistake: There is more than one blob type, blob as a default stores only 64k of data. LONGBLOB has a 4G limit which is Ok for my purposes. Happy Christmas to all, Hans -- http://mail.python.org/mailman/listinfo/python-list

Re: More than one interpreter per process?

2007-12-18 Thread Roger Binns
sturlamolden wrote: > If one can have more than one interpreter in a single process, You can. Have a look at mod_python and mod_wsgi which does exactly this. But extension modules that use the simplified GIL api don't work with them (well, if at all). > Most of the conversion of the current Py

Re: How to read a binary file into a mysql table

2007-12-18 Thread Hans Müller
Hello, thanks a lot for the Binary(). This does the trick, now I can import all my binary data. But now I found the next problem: The Blob is now limited to 65535 Bytes. I love all these stone age (16bit) limits on my 64bit machines... All bigger files a truncated. Has someone an idea how to so

Re: Best way to protect my new commercial software.

2007-12-18 Thread Jan Claeys
Op Fri, 14 Dec 2007 16:54:35 +, schreef Grant Edwards: > Uh what? I don't know what country you're in, but in the US, it doesn't > take any time at all to copyright something. The mere act of writing > something copyrights it. I thought it was the same in Europe as well. No, it's only copy

operator module isSequenceType with builtin set produces False

2007-12-18 Thread English, Mark
X-Replace-Address: [EMAIL PROTECTED] receding_xxxs_.com This wasn't what I was expecting, so I thought I'd ask those more knowledgeable, which is pretty much everybody. Same result on Python 2.3.5 and Python 2.5.1 installed from python.org binaries on Windows XP. >>> try: set >>> except NameError

checking a string against multiple patterns

2007-12-18 Thread tomasz
Hi, here is a piece of pseudo-code (taken from Ruby) that illustrates the problem I'd like to solve in Python: str = 'abc' if str =~ /(b)/ # Check if str matches a pattern str = $` + $1# Perform some action elsif str =~ /(a)/ # Check another pattern str = $1 + $'# Perform some oth

Re: python-xlib question

2007-12-18 Thread giovanni . iovino
Solved, I solved using Xtest fake_input, hoping helping other people i post the code: #!/usr/bin/env python import Xlib.display import Xlib.X import Xlib.XK import Xlib.error import Xlib.ext.xtest display = Xlib.display.Display() def mouse_click(button): #button= 1 left, 2 middle, 3 right

Re: checking a string against multiple patterns

2007-12-18 Thread kib
tomasz a écrit : > Is there an alternative to it? Am I missing something? Python doesn't > have special variables $1, $2 (right?) so you must assign the result > of a match to a variable, to be able to access the groups. > Hi Thomasz, See ie : http://www.regular-expressions.info/python.html [Se

Re: checking a string against multiple patterns

2007-12-18 Thread Gabriel Genellina
On 18 dic, 09:41, tomasz <[EMAIL PROTECTED]> wrote: > Hi, > > here is a piece of pseudo-code (taken from Ruby) that illustrates the > problem I'd like to solve in Python: > > str = 'abc' > if str =~ /(b)/ # Check if str matches a pattern > str = $` + $1# Perform some action > elsif str =

Re: checking a string against multiple patterns

2007-12-18 Thread grflanagan
On Dec 18, 1:41 pm, tomasz <[EMAIL PROTECTED]> wrote: > Hi, > > here is a piece of pseudo-code (taken from Ruby) that illustrates the > problem I'd like to solve in Python: > > str = 'abc' > if str =~ /(b)/ # Check if str matches a pattern > str = $` + $1# Perform some action > elsif str

Re: checking a string against multiple patterns

2007-12-18 Thread Tim Chase
> Define a small function with each test+action, and iterate over them > until a match is found: > > def check1(input): > match = re.search(pattern1, input) > if match: > return input[:match.end(1)] > > def check2(input): > match = re.search(pattern2, input) > if match: > return .

.NET and Python Integration Problem and PDF Library (Need Help and Suggestions)

2007-12-18 Thread Ravi Kumar
Hi. First I am explaining the Problem so it would not get messed up. :) == PROBLEM I have to integrate a small part in .NET Projects. .NET project is actually all Web-based application, user interface is Web-page for multiple actions. But a backend component of project

Re: Best way to protect my new commercial software.

2007-12-18 Thread Piet van Oostrum
> Jan Claeys <[EMAIL PROTECTED]> (JC) wrote: >JC> Op Fri, 14 Dec 2007 16:54:35 +, schreef Grant Edwards: >>> Uh what? I don't know what country you're in, but in the US, it doesn't >>> take any time at all to copyright something. The mere act of writing >>> something copyrights it. I th

Re: .NET and Python Integration Problem and PDF Library (Need Help and Suggestions)

2007-12-18 Thread Ravi Kumar
In continuation of last mail [since pressing tab+space sent the mail :( ] Things on high priorities right now are: - How to integrate Python calling from .NET - Any suggestions for optimizations that would prevent overburden to application due to IronPython interpretation calling, if any, or does s

Does fileinput.input() read STDIN all at once?

2007-12-18 Thread Adam Funk
I'm using this sort of standard thing: for line in fileinput.input(): do_stuff(line) and wondering whether it reads until it hits an EOF and then passes lines (one at a time) into the variable line. This appears to be the behaviour when it's reading STDIN interactively (i.e. from the ke

Re: Another newbie design question

2007-12-18 Thread MartinRinehart
Fortran (1957) had line comments. C (1972) replaced these with non- nested block comments. C++ (1983) added here-to-EOL comments. Python (1991) keeps here-to-EOL comments but replaces block comments with multi-line quotes. Block comments and multi-line quotes both serve the same purpose as doc comm

Re: No tab completion if sys.stdout is redirected

2007-12-18 Thread Bjoern Schliessmann
Dirk Loss wrote: > I want to have tab completion in my program for interactive input. > Using readline and rlcompleter this works nicely. But I also have > to catch and modify all "print" output, so I redirect sys.stdout > to a custom file-like object. The problem is: After the > redirection, readl

Re: More than one interpreter per process?

2007-12-18 Thread sturlamolden
On 18 Des, 05:46, Michael L Torrie <[EMAIL PROTECTED]> wrote: > How would this handle python resources that a programmer would want to > share among the threads? What facilities for IPC between the > interpreters would be used? There would be no IPC as they would live in the same process. A thre

Re: Another newbie design question

2007-12-18 Thread Sion Arrowsmith
<[EMAIL PROTECTED]> wrote: >I've designed a language, Decaf, for beginners. I've got block >comments but not multi-line strings. > >If you can only have one or the other, which is more helpful? Given a one-or-the-other choice, any editor worth using can do "comment/uncomment region", and if only

Re: More than one interpreter per process?

2007-12-18 Thread sturlamolden
On 18 Des, 10:24, Roger Binns <[EMAIL PROTECTED]> wrote: > The biggest stumbling block is what to do when the external environment > makes a new thread and then eventually calls back into Python. It is > hard to know which interpretter that callback should go to. Not if you explicitely hav to pa

New+old-style multiple inheritance

2007-12-18 Thread [EMAIL PROTECTED]
We are trying to monkey-patch a third-party library that mixes new and old-style classes with multiple inheritance. In so doing we have uncovered some unexpected behaviour: class Foo: pass class Bar(object): pass class Baz(Foo,Bar): pass # Monkey-patch Foo to add a special method

Re: More than one interpreter per process?

2007-12-18 Thread sturlamolden
On 18 Des, 10:24, Roger Binns <[EMAIL PROTECTED]> wrote: > You can. Have a look at mod_python and mod_wsgi which does exactly > this. But extension modules that use the simplified GIL api don't work > with them (well, if at all). mod_python implements use Py_NewInterpreter() to create sub- inte

Re: Best way to protect my new commercial software.

2007-12-18 Thread Preston Landers
Jan Claeys([EMAIL PROTECTED])@2007.12.18 12:06:08 +: > Op Fri, 14 Dec 2007 16:54:35 +, schreef Grant Edwards: > > > Uh what? I don't know what country you're in, but in the US, it doesn't > > take any time at all to copyright something. The mere act of writing > > something copyrights it

Re: Python on Leopard issues

2007-12-18 Thread arthurwoll
Hi Folks: I am new to python, and, (thanks to on-site help) just installed ipython, matplotlib, numpy and scipy on my PPC running Leopard (10.5.1). Since scipy.org's install page is out-dated -- it recommends beginning by re-installing python (http://www.scipy.org/ Installing_SciPy/Mac_OS_X) -- I t

Re: Debugging pipe IPC

2007-12-18 Thread Ian Clark
Jim B. Wilson wrote: > Ian Clark wrote: >> Jim B. Wilson wrote: >> ... >>> The child/client sends requests on its stdout and receives responses >>> on stdin. >> So, why can't you just run this client on the command line and let the >> shell handle stdin/stdout for you? > > I'm not sure I underst

Re: embedding filedialog in a frame in tkinter

2007-12-18 Thread [EMAIL PROTECTED]
> Try using Tix, a Tkinter extension included in the Python library. It > provides a DirList widget: > thanx Gabriel.. -- http://mail.python.org/mailman/listinfo/python-list

Re: checking a string against multiple patterns

2007-12-18 Thread Hrvoje Niksic
tomasz <[EMAIL PROTECTED]> writes: > here is a piece of pseudo-code (taken from Ruby) that illustrates the > problem I'd like to solve in Python: [...] I asked the very same question in http://groups.google.com/group/comp.lang.python/browse_frm/thread/3e8da954ff2265e/4deb5631ade8b393 It seems tha

Re: Best way to protect my new commercial software.

2007-12-18 Thread Grant Edwards
On 2007-12-18, Jan Claeys <[EMAIL PROTECTED]> wrote: > Op Fri, 14 Dec 2007 16:54:35 +, schreef Grant Edwards: > >> Uh what? I don't know what country you're in, but in the US, it doesn't >> take any time at all to copyright something. The mere act of writing >> something copyrights it. I tho

clearing text on canvas

2007-12-18 Thread [EMAIL PROTECTED]
hi i am new to tkinter and would like some help with canvas i am doing validation of contents of a folder and need to show the ok/error messages on a canvas resultdisplay =Canvas(...) errmessage="error!" okmessage="dir validation ok!" if dirvalidate is False: resultdisplay.create_text(1,50,an

Re: More than one interpreter per process?

2007-12-18 Thread Aahz
In article <[EMAIL PROTECTED]>, sturlamolden <[EMAIL PROTECTED]> wrote: >On 18 Des, 10:24, Roger Binns <[EMAIL PROTECTED]> wrote: >> >> You would have more luck getting this sort of change into Python 3 since >> that requires most extension modules to be modified a bit (eg to deal >> with string

Re: Another newbie design question

2007-12-18 Thread MartinRinehart
Sion Arrowsmith wrote: > Given a one-or-the-other choice, any editor worth using can do > "comment/uncomment region", and if only to-EOL comments are > available, it will do that for you instead of using block > comments. So block comments are not really a useful language > feature. I'd expect the

Searching for Happiness ?

2007-12-18 Thread aassime abdellatif
Searching for Happiness ? Dr. Saleh Abdul Azeez As Sindee Happiness is a common goal that everyone strives to attain. Philosophers, intellectuals, doctors and artists alike have all strived in search of the causes of happiness and ways to escape anxiety. The reality is, however, that the pro

Re: checking a string against multiple patterns

2007-12-18 Thread Duncan Booth
tomasz <[EMAIL PROTECTED]> wrote: > Is there an alternative to it? Am I missing something? Python doesn't > have special variables $1, $2 (right?) so you must assign the result > of a match to a variable, to be able to access the groups. Look for repetition in your code and remove it. That will a

Re: Debugging pipe IPC

2007-12-18 Thread Jim B. Wilson
Ian Clark wrote: > ... whatever 'mother' was sending it ("Clean your room!" most like) :) > If it's very verbose ... Alas, it is quite verbose. Constructing a single instance of a class (from the Pyrex extension acting as the child's two-way radio) could involve tens of thousands of more-or-le

Best idiom to unpack a variable-size sequence

2007-12-18 Thread ram
Here's a little issue I run into more than I like: I often need to unpack a sequence that may be too short or too long into a fixed-size set of items: a, b, c = seq # when seq = (1, 2, 3, 4, ...) or seq = (1, 2) What I usually do is something like this: a, b, c = (list(seq) + [None, No

Re: Best way to protect my new commercial software.

2007-12-18 Thread Jon Ribbens
On 2007-12-18, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-12-18, Jan Claeys <[EMAIL PROTECTED]> wrote: >> No, it's only copyrighted when you _publish_ it. > > Interesting. So, in Europe, if somebody steals something you > wrote before you get it published, they're free to do with it > as t

Re: OpenOpt install

2007-12-18 Thread dmitrey
thank you, I'll try to fix the issue when I'll have more time, I'm short of the one for now because of some other urgent work. D. On Dec 18, 10:53 am, Robert Kern <[EMAIL PROTECTED]> wrote: > dmitrey wrote: > > When earlier OpenOpt versions had been installed there were no > > compiled pyc-files (

Changing intobject to use int rather than long

2007-12-18 Thread Clarence
Does anyone think (or know) that it might cause any internal problems if the ival member of the struct defining an intobject were to be changed from its current "long int" to just "int"? When you move your application to a 64-bit system in order to get a bigger address space to store your millions

Re: Best idiom to unpack a variable-size sequence

2007-12-18 Thread George Sakkis
On Dec 18, 12:49 pm, ram <[EMAIL PROTECTED]> wrote: > Here's a little issue I run into more than I like: I often need to > unpack a sequence that may be too short or too long into a fixed-size > set of items: > > a, b, c = seq # when seq = (1, 2, 3, 4, ...) or seq = (1, 2) > > What I usually d

Re: Best idiom to unpack a variable-size sequence

2007-12-18 Thread Duncan Booth
ram <[EMAIL PROTECTED]> wrote: > Here's a little issue I run into more than I like: I often need to > unpack a sequence that may be too short or too long into a fixed-size > set of items: > > a, b, c = seq # when seq = (1, 2, 3, 4, ...) or seq = (1, 2) > > What I usually do is something lik

Re: lotus nsf to mbox

2007-12-18 Thread Fabian Braennstroem
Hi to all, thanks, I'll try your suggestions... Regards! Fabian Brian Munroe schrieb am 12/15/2007 07:10 PM: > On Dec 15, 11:04 am, Fabian Braennstroem <[EMAIL PROTECTED]> > wrote: > >> thanks for your ideas! I actually thought of something like >> a python parser, which just converts the nsf s

Re: Changing intobject to use int rather than long

2007-12-18 Thread Chris Mellon
On Dec 18, 2007 11:59 AM, Clarence <[EMAIL PROTECTED]> wrote: > Does anyone think (or know) that it might cause any internal problems > if the ival member of the struct defining an intobject were to be > changed from its current "long int" to just "int"? > > When you move your application to a 64-b

Re: Changing intobject to use int rather than long

2007-12-18 Thread Clarence
On Dec 18, 6:24 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > Your int objects get twice as large, but you get 4294967296 times more > address space. > > (They don't always get twice as large, and you don't actually get that > much address space, and there's lots of other things wrong with this

Re: Best way to protect my new commercial software.

2007-12-18 Thread tinnews
Jan Claeys <[EMAIL PROTECTED]> wrote: > Op Fri, 14 Dec 2007 16:54:35 +, schreef Grant Edwards: > > > Uh what? I don't know what country you're in, but in the US, it doesn't > > take any time at all to copyright something. The mere act of writing > > something copyrights it. I thought it was

why only an msi-installer for windows ?

2007-12-18 Thread Stef Mientki
hello, having a lot of trouble installing 2.5 (without affecting my stable 2.4), I wonder why there's only a msi installer for windows users ? thanks, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: .NET and Python Integration Problem and PDF Library (Need Help and Suggestions)

2007-12-18 Thread Joshua Kugler
Ravi Kumar wrote: > - your opinion with available PDF Libraries, that are best among. Also > which library to use for Windows server platform (there is limitation > on installing long chain libraries that include other deep > dependencies too). A pure python PDF library would be good, but which > o

Re: Changing intobject to use int rather than long

2007-12-18 Thread Hrvoje Niksic
Clarence <[EMAIL PROTECTED]> writes: > When you move your application to a 64-bit system in order to get a > bigger address space to store your millions/billions of integers in > RAM, but they get twice as big, you don't gain very much. I don't think changing the underlying type will help at all.

Re: New+old-style multiple inheritance

2007-12-18 Thread Jonathan Gardner
On Dec 18, 7:08 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > We are trying to monkey-patch a third-party library that mixes new and > old-style classes with multiple inheritance. In so doing we have > uncovered some unexpected behaviour: > > > I know this level of messing with python inte

Re: Debugging pipe IPC

2007-12-18 Thread Ian Clark
Jim B. Wilson wrote: > ... My fondest wish is to play the role of the child at the > good old ">>>" prompt. ... > > Jim Okay, I misunderstood the direction you wanted to go. I thought that you wanted to play the part of the mother, giving commands to the child and not the other way around. As

Re: WikiInclude on 0.11 - Noah Kantrowitz blocks bug-fix

2007-12-18 Thread smallpond
On Dec 17, 9:23 pm, Ilias Lazaridis <[EMAIL PROTECTED]> wrote: > Essence: > > * Deletion of valid defect reports on trac community resources > > The "WikiInclude" plugin is not recognised on trac 0.11, thus I took a > look an made a small addition to the setup.py (the entry_point). > > Other users

Re: Changing intobject to use int rather than long

2007-12-18 Thread Clarence
On Dec 18, 6:58 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > I don't think changing the underlying type will help at all. The > > On a 64-bit machine, that's 16 bytes for PyObject_HEAD and 8 more > bytes for the value, 24 bytes total. Changing long to int won't > decrease the struct size to 2

Re: Does fileinput.input() read STDIN all at once?

2007-12-18 Thread Jonathan Gardner
On Dec 18, 5:55 am, Adam Funk <[EMAIL PROTECTED]> wrote: > I'm using this sort of standard thing: > >for line in fileinput.input(): > do_stuff(line) > > and wondering whether it reads until it hits an EOF and then passes > lines (one at a time) into the variable line. This appears to be

Why custom objects take so much memory?

2007-12-18 Thread jsanshef
Hi, after a couple of days of script debugging, I kind of found that some assumptions I was doing about the memory complexity of my classes are not true. I decided to do a simple script to isolate the problem: class MyClass: def __init__(self,s): self.mystring = s mylist

Re: checking a string against multiple patterns

2007-12-18 Thread Jonathan Gardner
On Dec 18, 4:41 am, tomasz <[EMAIL PROTECTED]> wrote: > Is there an alternative to it? Am I missing something? Python doesn't > have special variables $1, $2 (right?) so you must assign the result > of a match to a variable, to be able to access the groups. > > I'd appreciate any hints. > Don't us

Re: Changing intobject to use int rather than long

2007-12-18 Thread Terry Reedy
"Clarence" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | That's an excellent point. And true, too. Thanks, that will lay the | issue to rest. Good idea. I think people who moved to 64 bits to get 64 bits would be upset if they did not ;-). -- http://mail.python.org/mailma

Re: is it possible to install 2 Python versions on windows XP ?

2007-12-18 Thread Stef Mientki
I finally found a way to let everything work: My base system is a stable Scipy installation, based on Python 2.4, with a few extra or updated libraries. This Python installation is completed with RPYC and PyScripter, to form a good workplace to develop GUI through wxPython. Installing of a worki

Re: New+old-style multiple inheritance

2007-12-18 Thread Gabriel Genellina
On 18 dic, 12:08, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > We are trying to monkey-patch a third-party library that mixes new and > old-style classes with multiple inheritance. In so doing we have > uncovered some unexpected behaviour: > > > class Foo: > pass > > class Bar(object): >

Funny python cartoon... hope it's not a repost

2007-12-18 Thread Breal
http://xkcd.com/353/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Another newbie design question

2007-12-18 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Fortran (1957) had line comments. C (1972) replaced these with non- > nested block comments. C++ (1983) added here-to-EOL comments. Python > (1991) keeps here-to-EOL comments but replaces block comments with > multi-line quotes. Block comments and multi-line quotes bot

Re: Another newbie design question

2007-12-18 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) > I'd like to hear from people who use Python's multi-line strings other > than in doc comments. Then: do you hear me ?-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Funny python cartoon... hope it's not a repost

2007-12-18 Thread Bruno Desthuilliers
Breal a écrit : > http://xkcd.com/353/ Bad luck: it *is* a repost. While we're at it, did you notice the alternate text for the image ?-) -- http://mail.python.org/mailman/listinfo/python-list

Re: why only an msi-installer for windows ?

2007-12-18 Thread Tim Couper
I think as msi is "The *Windows Installer* .. is an engine for the installation, maintenance, and removal of software on modern Microsoft Windows systems" (from Wikipaedia)", it's clear it's a Windows product ... not sure that they're up for putt

Newbie observations

2007-12-18 Thread MartinRinehart
Warning! Complaints coming. The good news is that 10-days of part-time Python coding has convinced me that I picked the right language. Now, observations. First, it is absolutely horrible being a newbie. I'd forgot how bad it was. In addition to making a fool of yourself in public, you have to lo

Re: Rounding

2007-12-18 Thread Ron Provost
Adding 0.5, then converting to an int always works for me. >>> x = 6.345 >>> int( x + 0.5 ) >>> 6 Ron - Original Message - From: "katie smith" <[EMAIL PROTECTED]> To: Sent: Saturday, December 15, 2007 9:09 AM Subject: Rounding > if i have a number 6.345 and i wanted it to be 6 witho

Re: Passing arguments to exe

2007-12-18 Thread kyosohma
On Dec 15, 6:46 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Fri, 14 Dec 2007 16:38:28 -0800 (PST), [EMAIL PROTECTED] declaimed > the following in comp.lang.python: > > > The executable runs, but no argument appears to get passed into it. Of > > course, I don't really know that for sure as

Re: Why custom objects take so much memory?

2007-12-18 Thread Chris Mellon
On Dec 18, 2007 1:26 PM, jsanshef <[EMAIL PROTECTED]> wrote: > Hi, > > after a couple of days of script debugging, I kind of found that some > assumptions I was doing about the memory complexity of my classes are > not true. I decided to do a simple script to isolate the problem: > > class MyClass:

Re: New+old-style multiple inheritance

2007-12-18 Thread Carl Banks
On Dec 18, 10:08 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > We are trying to monkey-patch a third-party library that mixes new and > old-style classes with multiple inheritance. New library? Geez, if people are dumb enough to do this, are you sure you want your application to depend on

Re: Why custom objects take so much memory?

2007-12-18 Thread Hrvoje Niksic
jsanshef <[EMAIL PROTECTED]> writes: > That means every object is around 223 bytes in size That's too > much considering it only contains a string with a maximum size of 7 > chars. The list itself consumes 4 MB because it stores 1 million PyObject pointers. It possibly consumes more due to o

Re: Newbie observations

2007-12-18 Thread John Machin
On Dec 19, 7:14 am, [EMAIL PROTECTED] wrote: > Warning! Complaints coming. > > The good news is that 10-days of part-time Python coding has convinced > me that I picked the right language. Now, observations. > > First, it is absolutely horrible being a newbie. I'd forgot how bad it > was. In additi

Re: New+old-style multiple inheritance

2007-12-18 Thread Carl Banks
On Dec 18, 2:09 pm, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > On Dec 18, 7:08 am, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > We are trying to monkey-patch a third-party library that mixes new and > > old-style classes with multiple inheritance. In so doing we have > > uncovered som

Re: Newbie observations

2007-12-18 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > First, it is absolutely horrible being a newbie. I'd forgot how bad it > was. In addition to making a fool of yourself in public, you have to > look up everything. I wanted to find a substring in a string. OK, > Python's a serious computer language, so you know it's got a

Re: Another newbie design question

2007-12-18 Thread MartinRinehart
> My 2 cents... Thanks for the feedback, Bruno. Seriously thinking about ditching the block comments and adding multi-line strings. (Block comments are the last item on my tokenizer's "todo" list. Multi-line strings would be easier.) Beginners will be programming fun things in a GUI environment.

Re: Rounding

2007-12-18 Thread John Machin
On Dec 19, 7:21 am, "Ron Provost" <[EMAIL PROTECTED]> wrote: > Adding 0.5, then converting to an int always works for me. > > >>> x = 6.345 > >>> int( x + 0.5 ) > >>> 6 Always? >>> x = -6.345 >>> int(x + 0.5) -5 >>> I therefore deduce that you have never crossed the equator :-) Be careful, doin

Re: lotus nsf to mbox

2007-12-18 Thread Adam Lanier
On Tue, 2007-12-18 at 19:25 +, Fabian Braennstroem wrote: > Hi to all, > > thanks, I'll try your suggestions... > > Regards! > Fabian > > Brian Munroe schrieb am 12/15/2007 07:10 PM: > > Well, If you wish to go that route, I believe you will have to reverse > > engineer the Notes Database bi

Re: why only an msi-installer for windows ?

2007-12-18 Thread John Machin
On Dec 19, 7:11 am, Tim Couper <[EMAIL PROTECTED]> wrote: > I think as msi is "The *Windows Installer* .. is an engine for the > installation, maintenance, and removal of software on modern Microsoft > Windows systems" (from > Wikipaedia)", it's clea

Re: New+old-style multiple inheritance

2007-12-18 Thread [EMAIL PROTECTED]
On Dec 18, 8:25 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Dec 18, 2:09 pm, Jonathan Gardner > > > > <[EMAIL PROTECTED]> wrote: > > On Dec 18, 7:08 am, "[EMAIL PROTECTED]" > > > <[EMAIL PROTECTED]> wrote: > > > We are trying to monkey-patch a third-party library that mixes new and > > > old-sty

Re: New+old-style multiple inheritance

2007-12-18 Thread [EMAIL PROTECTED]
Thank Gabriel, That sounds exactly right and your work-around provides confirmation. This code is an expedient solution for us so I expect we'll go with forcing a slot update. Hopefully the library concerned is going to fix the problem in a future release. Cheers, Stephen. On Dec 18, 7:40 pm,

Re: Funny python cartoon... hope it's not a repost

2007-12-18 Thread Breal
On Dec 18, 11:56 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Breal a écrit : > > >http://xkcd.com/353/ > > Bad luck: it *is* a repost. > > While we're at it, did you notice the alternate text for the image ?-) Did not notice the alt text... friggin hilarious!!! -- http://mail.python.org/

Re: why only an msi-installer for windows ?

2007-12-18 Thread Gabriel Genellina
On 18 dic, 15:54, Stef Mientki <[EMAIL PROTECTED]> wrote: > having a lot of trouble installing 2.5 (without affecting my stable 2.4), > I wonder why there's only a msi installer for windows users ? What's your problem? I have five versions installed (2.1, 2.3, 2.4, 2.5 and svn) and they coexist p

Re: Best way to protect my new commercial software.

2007-12-18 Thread Steven D'Aprano
On Tue, 18 Dec 2007 17:04:29 +, Grant Edwards wrote: > On 2007-12-18, Jan Claeys <[EMAIL PROTECTED]> wrote: >> Op Fri, 14 Dec 2007 16:54:35 +, schreef Grant Edwards: >> >>> Uh what? I don't know what country you're in, but in the US, it >>> doesn't take any time at all to copyright someth

Re: Funny python cartoon... hope it's not a repost

2007-12-18 Thread Ben Finney
Breal <[EMAIL PROTECTED]> writes: > http://xkcd.com/353/ Instead of *hoping* it's not a repost, please search the group archives *before* posting. -- \ "I'm beginning to think that life is just one long Yoko Ono | `\ album; no rhyme or reason, just a lot of incoherent shrieks and |

Strict mode?

2007-12-18 Thread Jack
While enjoying the dynamic feature of Python I find it difficult to refactor code without breaking it. For example, if I modify a function to take more arguments, or arguments of different types, I'll need to manually find out all places where the function is called and make sure I modify them a

Don't use __slots__ (was Re: Why custom objects take so much memory?)

2007-12-18 Thread Aahz
In article <[EMAIL PROTECTED]>, Chris Mellon <[EMAIL PROTECTED]> wrote: > >You can reduce the size of new-style classes (inherit from object) by >quite a bit if you use __slots__ to eliminate the class dictionary. You can also reduce your functionality quite a bit by using __slots__. Someday I'll

Re: Best way to protect my new commercial software.

2007-12-18 Thread Grant Edwards
On 2007-12-18, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Tue, 18 Dec 2007 17:04:29 +, Grant Edwards wrote: > >> On 2007-12-18, Jan Claeys <[EMAIL PROTECTED]> wrote: >>> Op Fri, 14 Dec 2007 16:54:35 +, schreef Grant Edwards: >>> Uh what? I don't know what country you're in, but i

Re: Strict mode?

2007-12-18 Thread John Machin
On Dec 19, 9:03 am, "Jack" <[EMAIL PROTECTED]> wrote: > While enjoying the dynamic feature of Python I find it difficult to refactor > code without breaking it. For example, if I modify a function to take more > arguments, or arguments of different types, I'll need to manually find out > all places

Re: Allowing Arbitrary Indentation in Python

2007-12-18 Thread Grant Edwards
On 2007-12-18, Sam <[EMAIL PROTECTED]> wrote: > A friend of mine is picking up some Python and is frustrated by > Python's indentation rules (http://greatbiggary.livejournal.com/ > 260460.html?thread=1835884#t1835884). Personally, I've never had any > issues with Python's ways of indentation, but

  1   2   >