Re: tkFileDialog closes main application

2006-12-21 Thread Eric Brunel
On Wed, 20 Dec 2006 18:37:10 +0100, mdmdmd <[EMAIL PROTECTED]> wrote: > Hello, > > I wish to collect 4 files from a user. So I have decided to use > tkFileDialog askopenfilename. My problem is that after a few file > selections the root window is destroyed (the whole program just > dissapp

Re: list1.append(list2) returns None

2006-12-21 Thread Pyenos
i rewrote the code following the advices from subdir of the parent thread: # well, table is composed of a list of columns. # so let's stick them together def enlargetable(table,col): table.append(col) # the code won't return sorted lists :-o return_the_fucking_table_bitch=table # assign it

Re: list1.append(list2) returns None

2006-12-21 Thread Georg Brandl
Pyenos schrieb: > i rewrote the code following the advices from subdir of the parent thread: > > # well, table is composed of a list of columns. > # so let's stick them together > def enlargetable(table,col): > table.append(col) # the code won't return sorted lists :-o Why should it sort the

Re: your opinion about psycopg vs pygresql

2006-12-21 Thread Maxim Sloyko
Martin P. Hellwig wrote: > However, given the choice, what in your opinion would be the reason why > someone would chose one over the other? Now I know this could easily get > into a flamewar, so if you comment (but please do so) I'll still > investigate that, since at this moment I don't even hav

Re: Python-list Digest, Vol 39, Issue 378

2006-12-21 Thread altern
> Just a guess, but I think you need to be using at least Python 2.4 if > you are going to use IDLE version 2.4.4-2. sorry i did a typo. I am actually using python 2.4.4 > On Dec 20, 1:16 pm, altern <[EMAIL PROTECTED]> wrote: >> Hi >> >> when i try to run IDLE on my debian laptop I get this er

Re: rsync for python?

2006-12-21 Thread Laszlo Nagy
nienfeng írta: > Hi, everyone > > I want to build rsync server that can run in linux and windows, and > configure by python. So I'm looking for something like rsync for python. > I find rsync.py and pysync. But rsync.py looks like a client mode, > it can't be a rsync server, is it? Can py

Re: a question on python dict

2006-12-21 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > Thank you very much for your explanation! > > I made a mistake that I said the hash value should be recalculated > each time the dict resize, what I wanted to say was that the position > of each item should be recalculated. > > Maybe I should take a look at the source

FYA: python cell phone is ruby-less

2006-12-21 Thread wesley chun
(mostly off-topic) vertu makes a $310,000US cell phone which has rubies on it. i thought it was quite interesting that they have a "cheaper" phone ($115,000) called Python which *doesn't* have rubies: http://money.cnn.com/popups/2006/biz2/cellphone better order yours now since only 26 will be ma

Re: def index(self):

2006-12-21 Thread Duncan Booth
"George Sakkis" <[EMAIL PROTECTED]> wrote: > Gert Cuykens wrote: >> > > class HelloWorld(object): >> > > @cherrypy.exposed >> > > def index(self): >> > >return "Hello World" >> >> do i have to write @cherrypy.exposed before every def or just once >> for all the def's ? and why not

Re: Stani's Python Editor - questions

2006-12-21 Thread Franz Steinhaeusler
On Wed, 20 Dec 2006 15:45:01 +0100, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > > Hello, > >I was trying to get answers for these. SPE homepage was down. Then I >found it on berlios >(http://developer.berlios.de/forum/forum.php?forum_id=12695) but no one >answered since 5 days. In fact nobody see

Re: tuple.index()

2006-12-21 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, greg <[EMAIL PROTECTED]> writes: |> |> > Not at all. I didn't say that they came in pairs. Consider: |> > |> > [str1, str2, agent1, str3, agent2, agent3, agent4, str4, ...] |> |> That's homogeneous. Any item of the list can be |> either a string or an agent

Re: [PythonCAD] [ANNOUNCE] Thirty-fifth release of PythonCAD now available

2006-12-21 Thread Art Haas
Hi again. In addition to the thirty-fifth release of PythonCAD finally seeing the light of day, the PythonCAD website was given a long overdue makeover. I'd like to thank Jose Antonio Martin for doing the stylesheet and artwork. The new look is an vast improvement from the plain text layout the si

Re: SQLALCHEMY - Method to have the last word, by Michael Bayer

2006-12-21 Thread Hendrik van Rooyen
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen wrote: > > > Wearing skull socks makes you mean. > > Ahh, I guess you're right - that twitching in my feet I should get rid > of them, wear cherubim socks instead and take a more relaxed stance towards > Ilias and his kind. >

Re: tuple.index()

2006-12-21 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: |> "Nick Maclaren" <[EMAIL PROTECTED]> wrote: |> |> > Not at all. I didn't say that they came in pairs. Consider: |> > |> > [str1, str2, agent1, str3, agent2, agent3, agent4, str4, ...] |> > |> > See Algol 68

Re: calling a class instance of function

2006-12-21 Thread Nils Oliver Kröger
Hi, Methods i.e functions bound to a class instance (or object) the self argument in their definition: [code] class pid: def add(self, toadd): pass #or some sensible code [/code] If you want to define a method without that implicit self argument you'll have to make this method a st

Re: what is wrong with my code?

2006-12-21 Thread Nils Oliver Kröger
Hi, this is the line that breaks your code: def progressTable(progress_table, action, task, pid=len(progress_table) your parameter progress_table is known inside the function, not inside its definition. So "pid=len(progress_table)" won't do. If you really think that it is possible that pid is

Re: Stani's Python Editor - questions

2006-12-21 Thread Laszlo Nagy
>> 1. How can I navigate between opened files? Usually I open 10 or more >> files at the same time. There is no way to quickly scroll the tabs and >> select the one that I want. Tabs simply run out of my screen. >> > > Normally with ctrl-tab, ctrl-shift-tab, ctrl-f6 ctrl-shift-f6 (at least

Re: rsync for python?

2006-12-21 Thread sam1
nienfeng wrote: > Hi, everyone > >I want to build rsync server that can run in linux and windows, and > configure by python. So I'm looking for something like rsync for python. >I find rsync.py and pysync. But rsync.py looks like a client mode, it > can't be a rsync server, is it? Can py

Re: Regexp Neg. set of chars HowTo?

2006-12-21 Thread Paul McGuire
On Dec 20, 7:40 am, durumdara <[EMAIL PROTECTED]> wrote: > Hi! > > I want to replace some seqs. in a html. > Let: > a- > b > = ab > > but: > xxx - > b > must be unchanged, because it is not word split. > > I want to search and replace with re, but I don't know how to neg. this > set ['\ \n\t']. >

Re: Stani's Python Editor - questions

2006-12-21 Thread Franz Steinhaeusler
On Thu, 21 Dec 2006 11:58:48 +0100, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > >>> 1. How can I navigate between opened files? Usually I open 10 or more >>> files at the same time. There is no way to quickly scroll the tabs and >>> select the one that I want. Tabs simply run out of my screen. >>>

Re: Stani's Python Editor - questions

2006-12-21 Thread Peter Decker
On 12/21/06, Franz Steinhaeusler <[EMAIL PROTECTED]> wrote: > >Does not work for me! I'm getting messages like this: > > > >python:3255): Gtk-CRITICAL **: gtk_container_remove: assertion > >`GTK_IS_TOOLBARcontainer) || widget->parent == GTK_WIDGETcontainer)' failed > >python:3255): Gtk-CRITICAL **

Re: urllib.unquote and unicode

2006-12-21 Thread Walter Dörwald
Martin v. Löwis wrote: > Duncan Booth schrieb: >> The way that uri encoding is supposed to work is that first the input >> string in unicode is encoded to UTF-8 and then each byte which is not in >> the permitted range for characters is encoded as % followed by two hex >> characters. > > Can you

Re: Need Simple Way To Determine If File Is Executable

2006-12-21 Thread Sebastian 'lunar' Wiesner
Fredrik Lundh <[EMAIL PROTECTED]> schrieb > Sebastian 'lunar' Wiesner wrote: > > no, I'm showing that a local file marked as executable overrides a > shared one, even if the local file isn't actually an executable. > >>> Only if you have your system set up badly. The current direct

Re: Need Simple Way To Determine If File Is Executable

2006-12-21 Thread Sebastian 'lunar' Wiesner
Fredrik Lundh <[EMAIL PROTECTED]> schrieb > Sebastian 'lunar' Wiesner wrote: > >>> you're confusing the shell's "is this file executable" check with >>> the loader's "can I execute this file" check: >>> >>> $ export PATH=.:$PATH >>> $ dd if=/dev/zero of=ls count=1 >>> 1+0 records in >>> 1+0 recor

Re: What am I supposed to do with an egg?!

2006-12-21 Thread Sebastian 'lunar' Wiesner
Morpheus <[EMAIL PROTECTED]> wrote > So, what am I supposed to do here now? That's easy: Breed it... -- Freedom is always the freedom of dissenters. (Rosa Luxemburg) -- http://mail.python.org/mailman/listinfo/python-list

Re: Need Simple Way To Determine If File Is Executable

2006-12-21 Thread Fredrik Lundh
Sebastian 'lunar' Wiesner wrote: >> no, I'm showing that a local file marked as executable overrides a >> shared one, even if the local file isn't actually an executable. > > Only if you have your system set up badly. The current directory > should not be in the search path, a

an hex number problem

2006-12-21 Thread could . net
Hello, I got a number 19968: 1. how can I change it to the hex form 0x4e00, 2. and how can I change 0x4e00 to a python unicode character u"\u4e00"? thank you! -- http://mail.python.org/mailman/listinfo/python-list

Re: an hex number problem

2006-12-21 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I got a number 19968: >>> x = 19968 > 1. how can I change it to the hex form 0x4e00, >>> hex(x) '0x4e00' > 2. and how can I change 0x4e00 to a python unicode character u"\u4e00"? >>> unichr(x) u'\u4e00' also see: http://effbot.org/pyfaq/how-do-i-convert-a-

Re: What am I supposed to do with an egg?!

2006-12-21 Thread Stephan Kuhagen
Sebastian 'lunar' Wiesner wrote: > Morpheus <[EMAIL PROTECTED]> wrote > >> So, what am I supposed to do here now? > > That's easy: Breed it... Since two days I'm fighting with myself not to make this joke. Thanks for relieving me... Regards Stephan -- http://mail.python.org/mailman/listinfo/

[ANN] pygccxml - 0.8.5

2006-12-21 Thread Roman Yakovenko
Hello! I'm pleased to announce the 0.8.5 release of pygccxml. What is pygccxml? = "...The purpose of the GCC-XML extension is to generate an XML description of a C++ program from GCC's internal representation. " -- Introduction to GCC-XML The purpose of pygccxml is to read a ge

Re: an hex number problem

2006-12-21 Thread Eric Brunel
On Thu, 21 Dec 2006 13:33:51 +0100, <[EMAIL PROTECTED]> wrote: > Hello, > I got a number 19968: > > 1. how can I change it to the hex form 0x4e00, '0x%x' % 19968 > 2. and how can I change 0x4e00 to a python unicode character u"\u4e00"? unichr(19968) > thank you! HTH -- python -c "print ''.jo

[ANN] Py++ - 0.8.5

2006-12-21 Thread Roman Yakovenko
Hello! I'm pleased to announce the 0.8.5 release of Py++. What is Py++? = Py++ is an object-oriented framework for creating a code generator for Boost.Python library. Where is Py++? == Site: http://language-binding.net/pyplusplus/pyplusplus.html Download: http://langua

Re: What am I supposed to do with an egg?!

2006-12-21 Thread Sebastian 'lunar' Wiesner
Stephan Kuhagen <[EMAIL PROTECTED]> wrote > Sebastian 'lunar' Wiesner wrote: > >> Morpheus <[EMAIL PROTECTED]> wrote >> >>> So, what am I supposed to do here now? >> >> That's easy: Breed it... > > Since two days I'm fighting with myself not to make this joke. Thanks > for relieving me... No

Displaying contents of a file using PyWin

2006-12-21 Thread MiguelS
How do I display the contents of a file in a window using PyWin? Thanks, MS -- http://mail.python.org/mailman/listinfo/python-list

Re: Good Looking UI for a stand alone application

2006-12-21 Thread Chris Mellon
On 12/20/06, Vincent Delporte <[EMAIL PROTECTED]> wrote: > On Tue, 19 Dec 2006 08:15:18 -0600, "Chris Mellon" <[EMAIL PROTECTED]> > wrote: > >There's a few more caveats I haven't addressed, and there are places > >where wx isn't perfect. > > BTW, do you know of a good article/book on writing cross-

treating MIME messages

2006-12-21 Thread Sergey Dorofeev
Hello all. Anybody who has idle time, please look at my version of MIME tools at http://www.fidoman.ru/prog/mime/. Questions and critical notes are welcome. If somebody will consider that interesting, I will refine these modules and put to pypi. -- http://mail.python.org/mailman/listinfo/pyth

Re: [ANN] PyInstaller 1.3 released

2006-12-21 Thread Robin Becker
Robin Becker wrote: > Giovanni Bajo wrote: > >> yeah that's pretty cryptic. It's a known bug which I need to come around >> and fix it. Anyway, the message itself is harmless: if the program then >> exits, there is *another* problem. >> >> If you want to help with that, you could enable

Re: Stani's Python Editor - questions

2006-12-21 Thread Franz Steinhaeusler
On Thu, 21 Dec 2006 07:09:54 -0500, "Peter Decker" <[EMAIL PROTECTED]> wrote: >On 12/21/06, Franz Steinhaeusler <[EMAIL PROTECTED]> wrote: > >> >Does not work for me! I'm getting messages like this: >> > >> >python:3255): Gtk-CRITICAL **: gtk_container_remove: assertion >> >`GTK_IS_TOOLBARcontaine

Re: [ANN] Py++ - 0.8.5

2006-12-21 Thread Felix Benner
Roman Yakovenko schrieb: > Hello! > > I'm pleased to announce the 0.8.5 release of Py++. I'm just wondering why there is a comp.lang.python.announce newsgroup. Could it be for making announcements or would that be too obvious? -- http://mail.python.org/mailman/listinfo/python-list

Question about Tkinter windows

2006-12-21 Thread Manuel Malo de Molina
Hi everyone, this is the first time I use Python. I'm working on an application using Tkinter and I would like that the windows could only be opened once, is there any option to get that? I don't know if I've explained myself: what I want is that if the user clicks on "Options", for example, and

python-list@python.org

2006-12-21 Thread [EMAIL PROTECTED]
I have a lot of functions returning "const std::string&". Every time I wrap one of those I have to do it like this: class_.def("name", &someclass::bla, boost::python::return_value_policy() ); Is there a way to register a return value conversion for "const std::string&" so I can omit it every time

Re: Displaying contents of a file using PyWin

2006-12-21 Thread MiguelS
import win32ui from pywin.mfc import docview t = object_template() d = t.OpenDocumentFile("d:/temp/music.log", True) Crashes PythonWin -- http://mail.python.org/mailman/listinfo/python-list

Re: Displaying contents of a file using PyWin

2006-12-21 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, MiguelS wrote: > import win32ui > from pywin.mfc import docview > > t = object_template() > d = t.OpenDocumentFile("d:/temp/music.log", True) > > Crashes PythonWin What do you mean by `crashes`? Any chance you get a name error like:: NameError: name 'object_template'

Re: [ANN] Py++ - 0.8.5

2006-12-21 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Felix Benner wrote: > Roman Yakovenko schrieb: >> Hello! >> >> I'm pleased to announce the 0.8.5 release of Py++. > > I'm just wondering why there is a comp.lang.python.announce newsgroup. > Could it be for making announcements or would that be too obvious? Yes that's fo

Strong Unix Developers wanted to work on OO-Database at Major Bank

2006-12-21 Thread Peter Isaacs
A premier bank in New York City is looking for strong unix developers to work on their homegrown OO-database. The ideal developer will have significant experience with one or more of a variety of languages including, Python, Perl, C++ or C. It is very important to have deep knowledge of u

Re: Displaying contents of a file using PyWin

2006-12-21 Thread MiguelS
Sorry, the code I posted was wrong. I tried import win32ui from pywin.mfc import docview t = docview.DocTemplate() t.OpenDocumentFile("d:/temp/music.log", True) This caused windows to close PythonWin. -- http://mail.python.org/mailman/listinfo/python-list

How a script can know if it has been called with the -i command line option?

2006-12-21 Thread Michele Simionato
The subject says it all, I would like a script to act differently when called as $ python script.py and when called as $ python -i script.py. I looked at the sys module but I don't see a way to retrieve the command line flags, where should I look? TIA, Michele Simionato -- http://mail.

Re: Is there a way to push data into Microsoft Excel & Word from Python ?

2006-12-21 Thread Caleb Hattingh
Hi Paul > Thanks for the kind words! No, thank _you_ for taking the time to write such a useful document. regards Caleb -- http://mail.python.org/mailman/listinfo/python-list

are there Tomboy and F-Spot equivalents?

2006-12-21 Thread Tshepang Lekhonkhobe
Hi, I dislike installing the entire Mono stack simply to take notes and manage photos, and am totally biased towards Python. At least for search I got Tracker, instead of Beagle. Are there equvalents applications for Tomboy and F-Spot which are written in Python. -- http://mail.python.org/mailman/

Windows upgrade incomplete

2006-12-21 Thread Pete Forman
I've a few versions of Python on my XP PC, most recently Python 2.5. The file associations appear not to have been upgraded. Executing a .py file turned out to still be using 2.3. >assoc .py .py=Python.File >ftype Python.file Python.file=D:\PROGRA~1\Python23\python.exe "%1" %* Presumably if I'd

[ANNOUNCE] pygtkmvc version 1.0.0 has been released

2006-12-21 Thread Roberto Cavada
Hi all, I'm proud to announce that the first stable release 1.0.0 of pygtkmvc has been released. ** pygtkmvc version 1.0.0 ** pygtkmvc is a fully Python-based implementation of the Model-View-Controller (MVC) and Observer p

Re: merits of Lisp vs Python

2006-12-21 Thread Anders J. Munch
Rob Thorpe wrote: > Anders J. Munch wrote: >> Let u(t) be the actual memory used by the program at time t. >> Let r(t) be the size of reachable memory at time t. >> >> Require that u(t) is a member of O(t -> max{t'<=t: r(t')}) >> >> There. That wasn't so hard, was it? > > That's quite a clever def

Re: list1.append(list2) returns None

2006-12-21 Thread Matimus
Pyenos wrote: > def enlargetable(table,col): > table.append(col) # the code won't return sorted lists :-o > return_the_fucking_table_bitch=table # assign it to a new variable to > return it > return return_the_fucking_table_bitch # :-| Maybe you were just trying to be funny, but ass

python-list@python.org

2006-12-21 Thread Roman Yakovenko
On 21 Dec 2006 07:30:41 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have a lot of functions returning "const std::string&". Every time I > wrap one of those I have to do it like this: > > class_.def("name", &someclass::bla, > boost::python::return_value_policy() > ); > > Is there a way

Re: merits of Lisp vs Python

2006-12-21 Thread Rob Thorpe
Anders J. Munch wrote: > Rob Thorpe wrote: > > Anders J. Munch wrote: > >> Let u(t) be the actual memory used by the program at time t. > >> Let r(t) be the size of reachable memory at time t. > >> > >> Require that u(t) is a member of O(t -> max{t'<=t: r(t')}) > >> > >> There. That wasn't so hard,

PythonCard Auto Placement

2006-12-21 Thread Brandon McGinty
Hi All, I'm getting started with pythoncard. I'm wondering if there is any way to auto-place the gui elements that I use, so that they are all visible, and aligned? I would use the "layout/resource" editors, but I'm blind, so I can't see where the elements end up, and the controls for moving don'

Re: How a script can know if it has been called with the -i command line option?

2006-12-21 Thread Thomas Heller
Michele Simionato schrieb: > The subject says it all, I would like a script to act differently when > called as > $ python script.py and when called as $ python -i script.py. I looked > at the sys module > but I don't see a way to retrieve the command line flags, where should > I look? > TIA, > >

query

2006-12-21 Thread libintr
can anyone help me on indentation in python and tell me some nice text editors used for a beginner in python? -- http://mail.python.org/mailman/listinfo/python-list

Re: How a script can know if it has been called with the -i command line option?

2006-12-21 Thread commander . coder
Michele Simionato wrote: > The subject says it all, I would like a script to act differently when > called as > $ python script.py and when called as $ python -i script.py. I looked > at the sys module > but I don't see a way to retrieve the command line flags, where should > I look? In the optpar

Re: query

2006-12-21 Thread Larry Bates
[EMAIL PROTECTED] wrote: > can anyone help me on indentation in python and tell me some nice text > editors used for a beginner in python? > You MUST tell us what platform you run on for us to make a recommendation. Remember Python runs on Windows, Linux, Mac, ... On Windows my current favorite i

Re: How a script can know if it has been called with the -i command line option?

2006-12-21 Thread Carsten Haese
On Thu, 2006-12-21 at 11:22 -0800, [EMAIL PROTECTED] wrote: > Michele Simionato wrote: > > The subject says it all, I would like a script to act differently when > > called as > > $ python script.py and when called as $ python -i script.py. I looked > > at the sys module > > but I don't see a way t

Re: urllib.unquote and unicode

2006-12-21 Thread Martin v. Löwis
>>> The way that uri encoding is supposed to work is that first the input >>> string in unicode is encoded to UTF-8 and then each byte which is not in >>> the permitted range for characters is encoded as % followed by two hex >>> characters. >> Can you back up this claim ("is supposed to work") by

Re: query

2006-12-21 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > can anyone help me on indentation in python and tell me some nice text > editors used for a beginner in python? http://effbot.org/pyfaq/tutor-whats-the-best-editor-ide-for-python -- http://mail.python.org/mailman/listinfo/python-list

Decorator for Enforcing Argument Types

2006-12-21 Thread Chris
I'm not sure if this has been done before, but I couldn't easily find any prior work on Google, so here I present a simple decorator for documenting and verifying the type of function arguments. Feedback/suggestions/criticism is welcome. ''' 2006.12.21 Created. ''' import unittest import inspect

Re: Decorator for Enforcing Argument Types

2006-12-21 Thread Paul McGuire
"Chris" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm not sure if this has been done before, but I couldn't easily find > any prior work on Google, so here I present a simple decorator for > documenting and verifying the type of function arguments. > Feedback/suggestions/critic

GNUmed - new version released

2006-12-21 Thread Sebastian Hilbert
Hello, Today we are releasing a new GNUmed version. GNUmed is a package to manage medical offices. Version is up to 0.2.3 Version features and bug fixes are explained in our Wiki http://wiki.gnumed.de/bin/view/Gnumed/ReleaseStatus http://wiki.gnumed.de/bin/view/Gnumed/RoadMap Packages avail

Re: Decorator for Enforcing Argument Types

2006-12-21 Thread Fredrik Lundh
Chris wrote: > I'm not sure if this has been done before see example 4 in the original specification: http://www.python.org/dev/peps/pep-0318/#examples -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorator for Enforcing Argument Types

2006-12-21 Thread Chris
On Dec 21, 3:57 pm, "Paul McGuire" <[EMAIL PROTECTED]> wrote: > "Chris" <[EMAIL PROTECTED]> wrote in messagenews:[EMAIL PROTECTED] > > > I'm not sure if this has been done before, but I couldn't easily find > > any prior work on Google, so here I present a simple decorator for > > documenting and v

removing the header from a gzip'd string

2006-12-21 Thread Rajarshi
Hi, I have some code that takes a string and obtains a compressed version using zlib.compress Does anybody know how I can remove the header portion of the compressed bytes, such that I only have the compressed data remaining? (Obviously I do not intend to perform the decompression!) Thanks, --

Re: Decorator for Enforcing Argument Types

2006-12-21 Thread bearophileHUGS
Chris wrote: > I'm not sure if this has been done before, I think this is the best implementation: http://oakwinter.com/code/typecheck/ I have never used it, but it seems well done. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

How to distribute an additional DLL to site-packages?

2006-12-21 Thread Bo Peng
Dear Python experts, I am writing a python extension module that needs to link with a third-party DLL. How can I copy this DLL to the site-packages directory along with my extension modules? It seems that data_files parameter can do this, but I do not know how to get the absolute destination d

Re: removing the header from a gzip'd string

2006-12-21 Thread Fredrik Lundh
Rajarshi wrote: > Hi, I have some code that takes a string and obtains a compressed > version using zlib.compress > > Does anybody know how I can remove the header portion of the compressed > bytes, such that I only have the compressed data remaining? what makes you think there's a "header porti

Re: tkFileDialog closes main application

2006-12-21 Thread James Stroud
Eric Brunel wrote: > BTW, why do you create a sub-class of Frame for your application? Why > not create a sub-class of Tk instead? > The short answer is that inhereting from Frame will allow embedding of the application in another application. A Tk() can not be embedded like this. Tk is appro

Re: removing the header from a gzip'd string

2006-12-21 Thread Bjoern Schliessmann
Rajarshi wrote: > Does anybody know how I can remove the header portion of the > compressed bytes, such that I only have the compressed data > remaining? (Obviously I do not intend to perform the > decompression!) Just curious: What's your goal? :) A home made hash function? Regards, Björn --

13 second delay using select() with Popen3()

2006-12-21 Thread Jonathan Mark
hi all... I wrote a seemingly simple function (below) to use Popen3() and select() to run a program and capture its exit status, stdout output, and stderr output. It worked fine until the box was upgraded to Debian sarge. Now the call to select() always takes about 13 seconds before returning

Re: Decorator for Enforcing Argument Types

2006-12-21 Thread Bruno Desthuilliers
Chris a écrit : > I'm not sure if this has been done before, It has... > but I couldn't easily find > any prior work on Google, so here I present a simple decorator for > documenting and verifying the type of function arguments. > Feedback/suggestions/criticism is welcome. Python is dynamic, an

Building python C++ extension modules using MS VC++ 2005?

2006-12-21 Thread Bo Peng
Dear list, I have been using mingw to build a python extension module. I had to jump through a number of hooks like the _ctype problem caused by the use of msvcr71.dll, but the module was mostly usable. Things become complicated when I use more and more boost libraries and mingw can not work w

Why can't you use varargs and keyword arguments together?

2006-12-21 Thread Sandra-24
I've always wondered why I can't do: def foo(a,b,c): return a,b,c args = range(2) foo(*args, c = 2) When you can do: foo(*args, **{'c':2}) Whenever I stub my toe on this one, I always just use the second approach, which seems less readable. As with most things in Python, I've suspected the

Re: Why can't you use varargs and keyword arguments together?

2006-12-21 Thread Jean-Paul Calderone
On 21 Dec 2006 14:51:15 -0800, Sandra-24 <[EMAIL PROTECTED]> wrote: >I've always wondered why I can't do: > >def foo(a,b,c): >return a,b,c > >args = range(2) >foo(*args, c = 2) > >When you can do: > >foo(*args, **{'c':2}) You just need to turn things around: >>> def foo(a, b, c): ...

Re: Decorator for Enforcing Argument Types

2006-12-21 Thread John Machin
Bruno Desthuilliers wrote: > > Python is dynamic, and fighting against the language is IMHO a really > bad idea. The only places where theres a real need for this kind of > stuff are when dealing with the "outside world" (IOW : inputs and > outputs). And then packages like formencode can do much

Re: def index(self):

2006-12-21 Thread Gert Cuykens
On 21 Dec 2006 09:44:48 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: > "George Sakkis" <[EMAIL PROTECTED]> wrote: > > @expr > def fn(...): ... > > is exactly equivalent to: > > def fn(...): ... > fn = (expr)(fn) > ok i did my homework reading about decorators http://www.python.org/doc/2.4.4/whatsn

RE: Fall of Roman Empire

2006-12-21 Thread Delaney, Timothy (Tim)
Hendrik van Rooyen wrote: > naaah - you don't have to worry - for real control He uses assembler. > with jump statements. > so the loops are closed. > > Unfortunately its not open source. Yet. People are working hard on reverse-engineering it though. I hope no one slaps them with a DMCA-style l

Re: python-hosting.com projects: dead?

2006-12-21 Thread John J. Lee
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: [...] > As of this morning my project is back online, so my thanks to python > hosting/webfaction for that. I'm very grateful to them for the great > free service they have provided. I'm sorry that they are getting killed > with spam, but I'm also sor

Re: list1.append(list2) returns None

2006-12-21 Thread Gabriel Genellina
At Thursday 21/12/2006 14:50, Matimus wrote: The following will do exactly the same thing as the above: [code] def enlargetable(table,col): table.append(col) return table [/code] Which, by the way, was one of the first answers he got, by Edward Kozlowski. -- Gabriel Genellina Softla

Re: [ANN] PyInstaller 1.3 released

2006-12-21 Thread Giovanni Bajo
Robin Becker wrote: > OK I found the problem. First off I still see this message about > msvcr71.dll could not be extracted! > > in the debug output. > > Secondly I found that the icon I specified in the Makespec.py invocation > is actually being added to the distribution exe. I actually want t

Re: regular expression

2006-12-21 Thread Roman
Asper Faner wrote: > I seem to always have hard time understaing how this regular expression > works, especially how on earth do people bring it up as part of > computer programming language. Natural language processing seems not > enough to explain by the way. Why no eliminate it ? > It has very

Re: Building python C++ extension modules using MS VC++ 2005?

2006-12-21 Thread Sandra-24
You can use 2005 to build extensions for Python 2.5. I've done this with several extensions, both my own and others. I do not know if you can use it for Python 2.4, so I won't advise you on that. I thought Microsoft made its C/C++ compiler, version 7.1 (2003) freely available as a command line tool

Re: Why can't you use varargs and keyword arguments together?

2006-12-21 Thread Sandra-24
On Dec 21, 5:59 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >You just need to turn things around: > >>> def foo(a, b, c): > ... return a, b, c > ... > >>> args = range(2) > >>> foo(c=2, *args) > (0, 1, 2) > >>> You know, I feel like a real shmuck for not trying that... Th

Re: regular expression

2006-12-21 Thread aejw.com
Also regular expressions are (pretty much) universal accross a ton of languages... even search engines now provide some support for regular expressions... I know its a bit of a headache, but keep trying to learn it mate. Once you have it wrapped you will never look back. Adam - http://www.aejw.

Re: Building python C++ extension modules using MS VC++ 2005?

2006-12-21 Thread weir
Sure you can build extensions for Python2.4 with VS2005, I've always done this way. And with Pyrex it is very very easy. Make sure to have a look at Pyrex: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex -- http://mail.python.org/mailman/listinfo/python-list

Re: tkFileDialog closes main application

2006-12-21 Thread mdmdmd
Thanks for the reply. I used your modified code to test. I ran the code on Windows Python 2.4 tcl/tk 8.4. When I opened the ui I: 1) click browse button 2) file dialog opens and I double click the file. When I do this, the selected file path is entered in Entry field. I don't need to close d

Re: Displaying contents of a file using PyWin

2006-12-21 Thread Gabriel Genellina
[Forwarded from [EMAIL PROTECTED] At Thursday 21/12/2006 13:51, MiguelS wrote: import win32ui from pywin.mfc import docview t = docview.DocTemplate() t.OpenDocumentFile("d:/temp/music.log", True) This caused windows to close PythonWin. This appears to be a problem with pywin32. Using releas

Re: PythonCard Auto Placement

2006-12-21 Thread John Henry
Brandon McGinty wrote: > Hi All, > I'm getting started with pythoncard. > I'm wondering if there is any way to auto-place the gui elements that I > use, so that they are all visible, and aligned? > I would use the "layout/resource" editors, but I'm blind, so I can't see > where the elements end up

Re: removing the header from a gzip'd string

2006-12-21 Thread Gabriel Genellina
At Thursday 21/12/2006 18:32, Fredrik Lundh wrote: > Hi, I have some code that takes a string and obtains a compressed > version using zlib.compress > > Does anybody know how I can remove the header portion of the compressed > bytes, such that I only have the compressed data remaining? what mak

I am taking a programming performance match!

2006-12-21 Thread 一首诗
Hi all, The question is like this: = One computer, 2 ethernet adapter. Receving UDP packages and send them out throught another adapter. The one who's program could support the heavies traffic could win a little bonus. = I am considerring tryin

Re: I am taking a programming performance match!

2006-12-21 Thread [EMAIL PROTECTED]
I'm sure it could do the job, but if the sole function is to be an IO relay, I would use a lower level language like C. Cheers, -T 一首诗 wrote: > Hi all, > > The question is like this: > > = > > One computer, 2 ethernet adapter. Receving UDP packages and send them > out th

Re: Is there any python-twisted tutorial or texts?

2006-12-21 Thread Damjan
>> I want to study twisted of python . But I donot know how to start. >> Any suggistions? >> > > There is a book about using Twisted. It's called 'Twisted Network > Programming Essentials.' It is an entry-level book at best, but it does go > over quite a lot of things that the Twisted library is

Problem in using Pulp

2006-12-21 Thread [EMAIL PROTECTED]
Hi, I am trying to run the following example which uses PULP for linear optimization. But I am getting this error in the last line: "EOL while scanning single quoted string". Can anyone help me with this? thanks Amit --Code from pulp imp

RE: [python-win32] Displaying contents of a file using PyWin

2006-12-21 Thread Mark Hammond
Hi Gabriel, > [Forwarded from [EMAIL PROTECTED] > > At Thursday 21/12/2006 13:51, MiguelS wrote: > > >import win32ui > >from pywin.mfc import docview > > > >t = docview.DocTemplate() > >t.OpenDocumentFile("d:/temp/music.log", True) > > > >This caused windows to close PythonWin. > > This appears to

Re: Problem in using Pulp

2006-12-21 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi, > I am trying to run the following example which uses PULP for linear > optimization. But I am getting this error in the last line: "EOL while > scanning single quoted string". > GLPK("C:\Documents and > Settings\Amit\Desktop\glpk-4.9\glpk-4.9\examples\").solve(prob)

  1   2   >