Re: socket on cygwin python

2007-06-24 Thread Gabriel Genellina
En Mon, 25 Jun 2007 03:03:45 -0300, <[EMAIL PROTECTED]> escribió: > So I tried to find a binary files on Python.org, but I can't find it. > Could you tell me the binary location for the file? Thank you. Go to http://www.python.org/ Click on DOWNLOAD on the left Choose the version/release/flavor y

Re: What was that web interaction library called again?

2007-06-24 Thread Harald Korneliussen
On Jun 22, 8:04 pm, felciano <[EMAIL PROTECTED]> wrote: > Maybe http://twill.idyll.org/ That was it! Thanks, I'd googled for hours. -- http://mail.python.org/mailman/listinfo/python-list

Re: Chroot Jail Not Secure for Sandboxing Python?

2007-06-24 Thread [EMAIL PROTECTED]
On Jun 25, 1:43 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > This wiki page suggests using a chroot jail to sandbox Python, but > > wouldn't running something like this in your sandboxed Python instance > > still break you out of the chroot jail: > > > os.exe

Re: subprocess.popen question

2007-06-24 Thread [EMAIL PROTECTED]
On Jun 23, 6:46 am, SPE - Stani's Python Editor <[EMAIL PROTECTED]> wrote: > On Jun 23, 5:35 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > > > > > En Fri, 22 Jun 2007 10:08:49 -0300, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> escribió: > > > > I seemed to have it working sorta when I ru

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-24 Thread Paul Rubin
Douglas Alan <[EMAIL PROTECTED]> writes: > And likewise, good macro programming can solve some problems that no > amount of linting could ever solve. I think Lisp is more needful of macros than other languages, because its underlying primitives are too, well, primitive. You have to write all the

Re: socket on cygwin python

2007-06-24 Thread bacon . chao
On Jun 25, 1:26 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > I've installed cygwin with latest python 2.5.1, but it seems that the > > socket lib file do NOT support IPv6(cygwin\lib\python2.5\lib-dynload > > \_socket.dll), what can I do if I want to use IPv6?

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-24 Thread Douglas Alan
Michele Simionato <[EMAIL PROTECTED]> writes: > You should really be using pychecker (as well as Emacs autocompletion > feature ...): I *do* use Emacs's autocompletion, but sometimes these sorts of bugs creep in anyway. (E.g., sometimes I autocomplete in the wrong variable!) > ~$ pychecker -v x

Re: regular expressions eliminating filenames of type foo.thumbnail.jpg

2007-06-24 Thread half . italian
On Jun 24, 10:00 pm, Justin Ezequiel <[EMAIL PROTECTED]> wrote: > Why not ditch regular expressions altogether for this problem? > > [ p for p in os.listdir(dir) > if os.path.isfile(os.path.join(dir,p)) > and p.lower().find('.thumbnail.')==-1 ] I like `and '.thumbnail.' not in p]` as a better

Re: Chroot Jail Not Secure for Sandboxing Python?

2007-06-24 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > This wiki page suggests using a chroot jail to sandbox Python, but > wouldn't running something like this in your sandboxed Python instance > still break you out of the chroot jail: > > os.execle ('/usr/bin/python','-c','import os; os.execlp("/bin/sh")', > {}) Depend

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-24 Thread Michele Simionato
On Jun 23, 6:39 pm, Douglas Alan <[EMAIL PROTECTED]> wrote: > > One of the things that annoys me when coding in Python (and this is a > flaw that even lowly Perl has a good solution for), is that if you do > something like > > longVarableName = foo(longVariableName) > > You end up with a bug t

Re: Chroot Jail Not Secure for Sandboxing Python?

2007-06-24 Thread [EMAIL PROTECTED]
On Jun 25, 1:21 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > This wiki page suggests using a chroot jail to sandbox Python, but > wouldn't running something like this in your sandboxed Python instance > still break you out of the chroot jail: > > os.execle ('/usr/bin/python','-c','import o

Re: socket on cygwin python

2007-06-24 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > I've installed cygwin with latest python 2.5.1, but it seems that the > socket lib file do NOT support IPv6(cygwin\lib\python2.5\lib-dynload > \_socket.dll), what can I do if I want to use IPv6? Use the Python binaries from python.org. If that is not acceptable, recomp

Chroot Jail Not Secure for Sandboxing Python?

2007-06-24 Thread [EMAIL PROTECTED]
This wiki page suggests using a chroot jail to sandbox Python, but wouldn't running something like this in your sandboxed Python instance still break you out of the chroot jail: os.execle ('/usr/bin/python','-c','import os; os.execlp("/bin/sh")', {}) or maybe: del os.environ['LD_PRELOAD'] os.

socket on cygwin python

2007-06-24 Thread bacon . chao
I've installed cygwin with latest python 2.5.1, but it seems that the socket lib file do NOT support IPv6(cygwin\lib\python2.5\lib-dynload \_socket.dll), what can I do if I want to use IPv6? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: regular expressions eliminating filenames of type foo.thumbnail.jpg

2007-06-24 Thread Justin Ezequiel
On Jun 25, 1:00 pm, Justin Ezequiel <[EMAIL PROTECTED]> wrote: > [ p for p in os.listdir(dir) > if os.path.isfile(os.path.join(dir,p)) > and p.lower().find('.thumbnail.')==-1 ] if you really want a regexp solution, the following seems to work (?i)(?http://kodos.sourceforge.net/) -- http://ma

Re: is this a valid import sequence ?

2007-06-24 Thread Michele Simionato
On Jun 24, 1:29 pm, Steven D'Aprano > I would like to hear your opinion of whether the > following two functions are equally as wrong: > > def f1(gizmo): > global spam # holds the frommet needed for the gizmo > gizmo.get_frommet(spam) > > def f2(gizmo): > # global spam holds the frommet

Re: Inferring initial locals()

2007-06-24 Thread George Sakkis
On Jun 24, 10:52 pm, Scott David Daniels <[EMAIL PROTECTED]> wrote: > So, what should your code do about this: > > def someFunction(a, b, c=43, d=14, f=12): > print locals() > > import functools > > a_funct = functools.partial(someFunction, d=13, c=5) > b_funct = functools.partial(a_funct, 14

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-24 Thread Douglas Alan
Graham Breed <[EMAIL PROTECTED]> writes: > Another way is to decorate functions with their local variables: from strict import my @my("item") > ... def f(x=1, y=2.5, z=[1,2,4]): > ... x = float(x) > ... w = float(y) > ... return [item+x-y for item in z] Well, I suppose that

Re: regular expressions eliminating filenames of type foo.thumbnail.jpg

2007-06-24 Thread Justin Ezequiel
Why not ditch regular expressions altogether for this problem? [ p for p in os.listdir(dir) if os.path.isfile(os.path.join(dir,p)) and p.lower().find('.thumbnail.')==-1 ] -- http://mail.python.org/mailman/listinfo/python-list

regular expressions eliminating filenames of type foo.thumbnail.jpg

2007-06-24 Thread oscartheduck
Hi folks, I'm trying to alter a program I posted about a few days ago. It creates thumbnail images from master images. Nice and simple. To make sure I can match all variations in spelling of jpeg, and different cases, I'm using regular expressions. The code is currently: - #!/usr/bin/env

Identifying button pressed

2007-06-24 Thread Satyajeet Singh
Hi All, Am a newbie to GUI in python and is currently working on building a calculator with the help of python and glade. Now I want that the function which handles the pressing event of a numeric key is same for all the 10 buttons(0 to 9). But unfortunately I dont know how to recognize the button

Python-based event calendar?

2007-06-24 Thread Michael Hannon
Greetings. One of the research groups here has been using a PHP application on one of their own computers to publish their list of seminars: http://www.k5n.us/webcalendar.php They're now asking us to support this on our department web server (the guy that set it up is leaving the group). I'

Re: how to sorted by summed itemgetter(x)

2007-06-24 Thread Aldarion
Thanks for the reply,I got it. On 6 25 , 9 19 , Paul Rubin wrote: > Aldarion <[EMAIL PROTECTED]> writes: > > how to sorted by summed itemgetter(1)? > > maybe sorted(items,key = lambda x:sum(x[1])) > > can't itemgetter be used here? > > You really want function compositi

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Rustom Mody
Hi folks! Dont want to spoil the fun of a real flame war here but what I want to ask is directly relevant to emacs in python [And the answers may even add some light to the current heat :-) ] I will be training a bunch of kids for using python in a data-center linux-sysadmin context. I intend t

Re: try/except with multiple files

2007-06-24 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > On Jun 21, 9:00 pm, Robert Hicks <[EMAIL PROTECTED]> wrote: >> Is it good practice to do something like: >> >> try: >> f1 = file('file1') >> f2 = file('file2') >> except: >> # catch the exception > > If what you want is to make sure that resources will be rel

Re: Inferring initial locals()

2007-06-24 Thread Scott David Daniels
George Sakkis wrote: > On Jun 21, 4:42 pm, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: >> On Jun 21, 8:51 pm, George Sakkis <[EMAIL PROTECTED]> wrote: >> >>> I wonder if there is a (preferably not too-hackish) solution to the >>> following introspection problem: given a callable and a number o

Re: Help needed to solve this "NameError"

2007-06-24 Thread Gabriel Genellina
En Sun, 24 Jun 2007 23:17:25 -0300, senthil arasu <[EMAIL PROTECTED]> escribió: > Hi, > Iam new tp python programming. > > Iam getting compiler error when declaring frame instance as local > variable. > please find the code In Python, indentation (number of spaces at start of lines) is impor

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-24 Thread Graham Breed
Steven D'Aprano wote: > But if you really want declarations, you can have them. > > >>> import variables > >>> variables.declare(x=1, y=2.5, z=[1, 2, 4]) > >>> variables.x = None > >>> variables.w = 0 > Traceback (most recent call last): > File "", line 1, in > File "variables.py", line 15, i

Help needed to solve this "NameError"

2007-06-24 Thread senthil arasu
Hi, Iam new tp python programming. Iam getting compiler error when declaring frame instance as local variable. please find the code from Tkinter import * class App: def __init__(self, master): *frame = Frame(master) * frame.pack() self.button = Button(frame, text="QUIT", fg=

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Robert Uhl
Twisted <[EMAIL PROTECTED]> writes: > >> I have two frames open right now: one 80x70, the other around 180x70 >> (characters, not pixels). One isn't split at all; the other is split >> into four windows, horizontally and vertically. > > Then you're obviously not using the One True Emacs I am criti

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Robert Uhl
Twisted <[EMAIL PROTECTED]> writes: > >> > Really? None of [navigating a folder window analogue] happens if >> > you just do the straightforward file-open command, which should >> > obviously at least provide a navigable directory tree, but >> > definitely does not. >> >> The first does. Really, i

Re: something similar to shutil.copytree that can overwrite?

2007-06-24 Thread Justin Ezequiel
On Jun 22, 9:07 pm, Ben Sizer <[EMAIL PROTECTED]> wrote: > That's the easy bit to fix; what about overwriting existing files > instead of copying them? Do I have to explicitly check for them and > delete them? It seems like there are several different copy functions > in the module and it's not cle

Re: how to sorted by summed itemgetter(x)

2007-06-24 Thread Paul Rubin
Aldarion <[EMAIL PROTECTED]> writes: > how to sorted by summed itemgetter(1)? > maybe sorted(items,key = lambda x:sum(x[1])) > can't itemgetter be used here? You really want function composition, e.g. sorted(items, key=sum*itemgetter(1)) where * is a composition operator (doesn't exist in Py

Re: Portable general timestamp format, not 2038-limited

2007-06-24 Thread Robert Maas, see http://tinyurl.com/uh3t
> From: James Harris <[EMAIL PROTECTED]> > I have a requirement to store timestamps in a database. ... > 1) subsecond resolution - milliseconds or, preferably, more detailed How do you plan to deal with leap seconds? - Stick to astronomical time, which is absolutely consistent but which drifts

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread JackT
On Jun 25, 12:56 am, Cor Gest <[EMAIL PROTECTED]> wrote: > Some entity, AKA JackT <[EMAIL PROTECTED]> wrote this mindboggling stuff: > (selectively-snipped-or-not-p) No need to be insulting. > > > We don't care about the 1970 version ofEmacs, > > because of course back then there WAS NO GUI. > >

Re: Which XML?

2007-06-24 Thread kyosohma
On Jun 24, 7:04 pm, Bruno Barberi Gnecco <[EMAIL PROTECTED]> wrote: > I've found a lot of XML libraries for Python. Any advices on which > one to use (or *not* to use)? My requirements are: support for XPath, > stability (a must, segfaults are not an option), with DOM API and good > perform

how to sorted by summed itemgetter(x)

2007-06-24 Thread Aldarion
for example, let from operator import itemgetter items = [('a', [5, 2]), ('c', [1]), ('b', [6]), ('d', [7])] sorted(items, key = itemgetter(1)) get this back: [('c', [1]), ('a', [5, 2]), ('b', [6]), ('d', [7])] but sorted(items, key = sum(itemgetter(1))) raise a errer: 'operator.itemgetter' obje

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Cor Gest
Some entity, AKA JackT <[EMAIL PROTECTED]>, wrote this mindboggling stuff: (selectively-snipped-or-not-p) > We don't care about the 1970 version of Emacs, > because of course back then there WAS NO GUI. But if you are blind as bat, any 2007's GUI is useless. Cor -- (defvar MyComputer

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread JackT
On Jun 25, 12:32 am, Twisted <[EMAIL PROTECTED]> wrote: > > It looks like there are > several utterly different pieces of software that have one thing in > common - the name "emacs"... > > > When you start emacs in a text console, you see this: > > > > Welcome to GNUEmacs, one component of the GNU

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Twisted
On Jun 24, 7:19 pm, Robert Uhl <[EMAIL PROTECTED]> wrote: > Twisted <[EMAIL PROTECTED]> writes: > > > Of course, if emacs let you keep THREE windows open and visible at the > > same time, instead of being limited to one or a horizontally split two > > ... and a cramped 80x10 or so each, at that ...

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-24 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: >> You seem oblivious to the fact that one of the huge benefits of Python >> is its elegant and readable syntax. The problem with not having a >> "flexible syntax", is that a programming language can't provide >> off-the-shelf an elegant syntax for all

Re: Using PSE under Win32

2007-06-24 Thread Graham Dumpleton
On Jun 24, 1:13 am, Eduardo Dobay <[EMAIL PROTECTED]> wrote: > Hello, I've been playing around withmod_pythonthese days (using > Publisher and PSP), and it has been working smoothly under Windows XP > (using Apache 2.2). But when I installed PSE and went to use it > withmod_python, it didn't work.

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Twisted
On Jun 24, 6:52 pm, Robert Uhl <[EMAIL PROTECTED]> wrote: > > Really? None of [navigating a folder window analogue] happens if > > you just do the straightforward file-open command, which should > > obviously at least provide a navigable directory tree, but > > definitely does not. > > The first do

Which XML?

2007-06-24 Thread Bruno Barberi Gnecco
I've found a lot of XML libraries for Python. Any advices on which one to use (or *not* to use)? My requirements are: support for XPath, stability (a must, segfaults are not an option), with DOM API and good performance desirable. Thanks for any advice. -- Bruno Barberi Gnecco -

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Robert Uhl
Twisted <[EMAIL PROTECTED]> writes: > > Of course, if emacs let you keep THREE windows open and visible at the > same time, instead of being limited to one or a horizontally split two > ... and a cramped 80x10 or so each, at that ... I have two frames open right now: one 80x70, the other around 18

Re: Changing sound volume

2007-06-24 Thread kyosohma
On Jun 23, 7:47 am, simon kagwe <[EMAIL PROTECTED]> wrote: > Hi, > > I am playing sounds using the winsound module. Is there a way I can change the > volume? The docs don't mention anything about controlling the volume, so I doubt it's possible with winsound. However, I found this in the archives:

Re: WX call a pywx program from a program, and return values

2007-06-24 Thread kyosohma
On Jun 24, 10:02 am, Marcpp <[EMAIL PROTECTED]> wrote: > I need to call a pywx program(1) from an wxpy program(2) and return a > value to program(2). > Any example to do it? Yup. See links below: http://mail.python.org/pipermail/tutor/2005-May/038648.html http://www-pcmdi.llnl.gov/software-portal

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread [EMAIL PROTECTED]
On 25 Jun., 00:52, Robert Uhl <[EMAIL PROTECTED]> wrote: You guys are all in the wrong newsgroups. Please stay in comp.emacs when discussing Emacs. Don't cross post. Not everyone is interested in Emacs discussions. Thanks. Follow-up set to comp.emacs. -- http://mail.python.org/mailman/listinfo

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Robert Uhl
Twisted <[EMAIL PROTECTED]> writes: > On Jun 23, 8:35 pm, Robert Uhl <[EMAIL PROTECTED]> wrote: >> Twisted <[EMAIL PROTECTED]> writes: >> >> > For an example of the latter, consider opening a file. Can't remember >> > the exact spelling and capitalization of the file name? Sorry, bud, >> > you're

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-24 Thread Robert Brown
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Graham talks about 25% of the Viaweb code base being macros. Imagine how > productive his coders would have been if the language was not quite > so minimalistic, so that they could do what they wanted without the > _lack_ of syntax getting in the way.

Re: cx_oracle

2007-06-24 Thread Bernard Delmée
Hi Lukas, you will need a working oracle OCI client middleware before cx_oracle can talk to your database. The easiest nowadays is the so-called instant client, which must be available from the otn.oracle.com site (downloads might require a free registration). Try to get sql*plus working (the stan

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Andreas Eder
Hi Twisted, > "Twisted" == Twisted <[EMAIL PROTECTED]> writes: Twisted> * The operating system where you can do powerful stuff with a command Twisted> line and a script or two, but can also get by without either. (Windows Twisted> fails the former. Linux fails the latter.)

cx_oracle

2007-06-24 Thread Lukas Ziegler
Hi, I want to get an access to an oracle database. For that I found the module cx_oracle (http://www.python.net/crew/atuining/cx_Oracle/) and I have installed the version 'Windows Installer (Oracle 10g, Python 2.5)'. Now I tried to run the script in the readme file: -

Re: high performance/threaded applications in Python - your experiences?

2007-06-24 Thread Josiah Carlson
Ivan Voras wrote: > Jay Loden wrote: > >> I was hoping for some experiences that some of you on the list may have had >> in dealing with Python in a high performance and/or threaded environment. In >> essence, I'm wondering how big of a deal the GIL can be in a real-world >> scenario where you

Re: Accessing variable from a function within a function

2007-06-24 Thread Marcin Ciura
Nathan Harmston wrote: > Unfortunately this doesnt work since a,a1,b,b1 arent declared in the > function. Is there a way to make these variables accessible to the > euclid function. Or is there a better way to design this function? The canonical recommendations are: use attributes of the inner fun

Re: Adding method to a class on the fly

2007-06-24 Thread John Henry
On Jun 24, 12:40 pm, John Henry <[EMAIL PROTECTED]> wrote: > On Jun 24, 1:19 am, John Henry <[EMAIL PROTECTED]> wrote: > > > > > On Jun 23, 6:24 pm, Steven D'Aprano > > > <[EMAIL PROTECTED]> wrote: > > > On Sat, 23 Jun 2007 12:31:39 -0700, John Henry wrote: > > > > it works fine but PythonCard isn'

Re: Collections of non-arbitrary objects ?

2007-06-24 Thread Bruno Desthuilliers
walterbyrd a écrit : > On Jun 22, 11:43 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: > > >>Can you help us understand, by showing a use case that would in your >>estimation be improved by the feature you're describing? >> > > > Suppose you are sequentially processing a list with a routine that >

Re: automatical pdf generating

2007-06-24 Thread vasudevram
On Jun 24, 10:03 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-06-24, Jackie <[EMAIL PROTECTED]> wrote: > > > For each folder, I want to print the 4 pictures into a single-paged > > pdf file (letter sized; print horizontally). All together, I want to > > get 50 pdf files with names: 01.pdf

Re: newbie tcp/ip question

2007-06-24 Thread Stephen R Laniel
On Sun, Jun 24, 2007 at 02:52:25PM -0500, Zachary Manning wrote: > I want to send some hex characters as a string literal to port 7142 and > to a specific ip address. How do I do that in python? Does this cover what you want to do? http://docs.python.org/lib/socket-example.html -- Stephen R. La

Re: newbie tcp/ip question

2007-06-24 Thread Jacek Trzmiel
Hi, Zachary Manning wrote: > I'm having a hard time tracking down a way to open up a tcp/ip client > connection and simply sending a string to the port I've opened up. > > For instance > > I want to send some hex characters as a string literal to port 7142 and > to a specific ip address. How d

newbie tcp/ip question

2007-06-24 Thread Zachary Manning
Hello all, I'm having a hard time tracking down a way to open up a tcp/ip client connection and simply sending a string to the port I've opened up. For instance I want to send some hex characters as a string literal to port 7142 and to a specific ip address. How do I do that in python? than

Re: Accessing variable from a function within a function

2007-06-24 Thread James Stroud
James Stroud wrote: > Nathan Harmston wrote: > def exteuclid(m,n): > x = 0,1,1,0,m,n > def euclid(c,d,x=x): >a,a1,b,b1,c,d = x >q = c /d >r = c % d >if r == 0: >print a,b >return d >else: >print a1,a,b1,b,c,d,q,r >

Re: dealing with emf/wmf files

2007-06-24 Thread Michael Hoffman
Jackie Wang wrote: > I'd like to put some emf/wmf pictures into a pdf file > using 'reportlab', but the Python Imaging Library > cannot recognize emf files. The wmf files are said to > be 'identified only'. libwmf (not for Python) can convert WMF (not EMF) to SVG or EPS. http://wvware.sourceforge

Re: Adding method to a class on the fly

2007-06-24 Thread John Henry
On Jun 24, 1:19 am, John Henry <[EMAIL PROTECTED]> wrote: > On Jun 23, 6:24 pm, Steven D'Aprano > > <[EMAIL PROTECTED]> wrote: > > On Sat, 23 Jun 2007 12:31:39 -0700, John Henry wrote: > > > it works fine but PythonCard isn't calling this function when I > > > clicked on the button. > > > I think y

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Twisted
On Jun 24, 8:10 am, Martin Gregorie <[EMAIL PROTECTED]> wrote: > > Actually, what I prefer in (2D and 3D) visual design apps is the > > ability to snap to some kind of grid/existing vertices, and to zoom in > > close. Then small imprecisions in mouse movement can be rendered > > unimportant. > > Th

Re: Accessing variable from a function within a function

2007-06-24 Thread James Stroud
Nathan Harmston wrote: > Hi, > > I m playing around with extended euclids algorithm from Knuth. I m > trying to build a function with a function inside it. > > def exteuclid(m,n): > a,a1,b,b1,c,d = 0,1,1,0,m,n > def euclid(c,d): >q = c /d >r = c % d >if r == 0: >

Re: Do eval() and exec not accept a function definition? (like 'def foo: pass) ?

2007-06-24 Thread vasudevram
On Jun 24, 6:28 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Sun, 24 Jun 2007 11:17:40 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >On Sat, 23 Jun 2007 19:58:32 +, vasudevram wrote: > > >> Hi group, > > >> Question: Do eval() and exec not accept a function definition? (like >

dealing with emf/wmf files

2007-06-24 Thread Jackie Wang
I'd like to put some emf/wmf pictures into a pdf file using 'reportlab', but the Python Imaging Library cannot recognize emf files. The wmf files are said to be 'identified only'. Therefore, the following code does not work: from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import

Re: Accessing variable from a function within a function

2007-06-24 Thread Stefan Bellon
On Sun, 24 Jun, 7stud wrote: > ef outer(): > a = 10 > def inner(): > print a > > return inner > > > f = outer() > f() > > --output:-- > 10 > >>> def outer(): ... a = 10 ... def inner(): ... a = a + 1 ... print a ... return inner ... >>> f=oute

Re: Accessing variable from a function within a function

2007-06-24 Thread 7stud
On Jun 24, 11:55 am, "Nathan Harmston" <[EMAIL PROTECTED]> wrote: > Hi, > > I m playing around with extended euclids algorithm from Knuth. I m > trying to build a function with a function inside it. > > def exteuclid(m,n): > a,a1,b,b1,c,d = 0,1,1,0,m,n > def euclid(c,d): > q = c /d >

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-24 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 23 Jun 2007 14:56:35 -0400, Douglas Alan wrote: > >>> How long did it take you to write the macros, and use them, compared >>> to running Pylint or Pychecker or equivalent? >> An hour? Who cares? You write it once and then you have it for th

Re: Accessing variable from a function within a function

2007-06-24 Thread Michael Hoffman
Nathan Harmston wrote: > Hi, > > I m playing around with extended euclids algorithm from Knuth. I m > trying to build a function with a function inside it. > > def exteuclid(m,n): > a,a1,b,b1,c,d = 0,1,1,0,m,n > def euclid(c,d): >q = c /d >r = c % d >if r == 0: >

emacs for python

2007-06-24 Thread Rustom Mody
I wish to set up emacs for python usage. The specific questions are: 1. Which python mode should one use? It seems there is one from python and one from emacs and both are deliberately named so as to be confusable!! I would like one that gives... 2. Good support for debugging: I hear pdbtrack

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread David Golden
Thomas Bellman wrote: > I seem to recall that EMACS, the old TECO version on TOPS-20 and > ITS, only supported two windows ("panes" in Twisted's words). So > it's not *completely* false, just extremely outdated. > > Well, that's going back a bit. I somehow doubt he was using that, but I guess

Accessing variable from a function within a function

2007-06-24 Thread Nathan Harmston
Hi, I m playing around with extended euclids algorithm from Knuth. I m trying to build a function with a function inside it. def exteuclid(m,n): a,a1,b,b1,c,d = 0,1,1,0,m,n def euclid(c,d): q = c /d r = c % d if r == 0: print a,b return d

Re: smtp server simulation using Python

2007-06-24 Thread William Gill
Dave Borne wrote: >> I have a (web) development computer w/o an SMTP server and want to test >> form generated e-mail using a dummy SMTP server that delivers the mail >> message to a file, or better yet, to a text editor instead of actually >> sending it. > > Here's a quick and dirty script I us

Re: automatical pdf generating

2007-06-24 Thread Grant Edwards
On 2007-06-24, Jackie <[EMAIL PROTECTED]> wrote: > For each folder, I want to print the 4 pictures into a single-paged > pdf file (letter sized; print horizontally). All together, I want to > get 50 pdf files with names: 01.pdf,02.pdf,...,50.pdf. > > Is it possible to use Python to realized the ab

Re: automatical pdf generating

2007-06-24 Thread M��ta-MCI
> Is it possible to use Python to realized the above process? > I know there is a module named "reportlab". Possible? Yes! -- http://mail.python.org/mailman/listinfo/python-list

Re: automatical pdf generating

2007-06-24 Thread John Nagle
Jackie wrote: > Hi, all, > > There are 50 folders in my hard driver C: > C:\01.c:\02,...,c:\50 > > There are 4 pictures in each folder: > 1.jpg,2.jpg,3.jpg,4.jpg > > For each folder, I want to print the 4 pictures into a single-paged > pdf file (letter sized; print horizontally). All together, I

Re: is this a valid import sequence ?

2007-06-24 Thread Alex Martelli
Scott David Daniels <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > On Sat, 23 Jun 2007 21:11:42 -0700, Alex Martelli wrote a lot, with lots > > of YELLING. > > > > Given the amount of SHOUTING in your post, and the fact that you feel so > > strongly about the trivial question of the redu

Re: how to query/test the state of a qt widget?

2007-06-24 Thread David Boddie
On Sun Jun 24 02:20:55 CEST 2007, raacampbell wrote: > I'm writing a simple Python/Qt3 application and I am trying to write > some code in which the user presses a button and the program performs > action A or B depending upon the state of a pair of radio buttons. You would typically connect the

Re: visual gui ides for python/jythpn

2007-06-24 Thread Luis M . González
On 24 jun, 04:23, "Ethan Kennerly" <[EMAIL PROTECTED]> wrote: > Luis M. Gonzalez wrote: > > PythonCard is an extremely easy to use alternative. > > It's like a simplified Visual Basic or Delphi IDE. > > Check IT out:www.pythoncard.org > > I second that! PythonCard is a rapid way to prototype an ug

Re: database design help

2007-06-24 Thread Jim
It sounds to me that you want Subversion. There is a Python binding if you have anything you'd need to do beyond what already comes with the system (there are a variety of web interfaces already out there, for instance, so I don't know that you'd need to do anything extra). Just google "subversion

automatical pdf generating

2007-06-24 Thread Jackie
Hi, all, There are 50 folders in my hard driver C: C:\01.c:\02,...,c:\50 There are 4 pictures in each folder: 1.jpg,2.jpg,3.jpg,4.jpg For each folder, I want to print the 4 pictures into a single-paged pdf file (letter sized; print horizontally). All together, I want to get 50 pdf files with nam

Re: is this a valid import sequence ?

2007-06-24 Thread Scott David Daniels
Steven D'Aprano wrote: > On Sat, 23 Jun 2007 21:11:42 -0700, Alex Martelli wrote a lot, with lots > of YELLING. > > Given the amount of SHOUTING in your post, and the fact that you feel so > strongly about the trivial question of the redundant use of the global > statement that you would "fail a s

Re: pydoc with METH_VARGS

2007-06-24 Thread Stuart
I'm asking if there's some sort of commenting or input file or something to customize the output pydoc generates. Thanks. On Jun 23, 11:00 pm, 7stud <[EMAIL PROTECTED]> wrote: > On Jun 23, 2:13 pm, Stuart <[EMAIL PROTECTED]> wrote: > > > With my Python extension module all the function definitions

WX call a pywx program from a program, and return values

2007-06-24 Thread Marcpp
I need to call a pywx program(1) from an wxpy program(2) and return a value to program(2). Any example to do it? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to query/test the state of a qt widget?

2007-06-24 Thread raacampbell
> RTFM. The Qt-docs are extensive. And the QRadioButton-docs are pretty > straight forward: > > http://doc.trolltech.com/3.3/qradiobutton.html#checked-prop > > So your code above should be > > if self.polPlotRadioButton.isChecked(): print "blah" Thanks, that does indeed work. Also, sorry, I have

Re: how to query/test the state of a qt widget?

2007-06-24 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hi, > > I'm writing a simple Python/Qt3 application and I am trying to write > some code in which the user presses a button and the program performs > action A or B depending upon the state of a pair of radio buttons. I > would therefore like Python to read the state o

Re: Collections of non-arbitrary objects ?

2007-06-24 Thread Ben Finney
walterbyrd <[EMAIL PROTECTED]> writes: > Suppose you are sequentially processing a list with a routine that > expects every item to be of a certain type. Something in the list > that doesn't conform to the type could give you unexpected results, > maybe crash your application. A routine that dema

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Martin Gregorie
Twisted wrote: > On Jun 23, 10:36 am, Martin Gregorie <[EMAIL PROTECTED]> > wrote: > > Actually, what I prefer in (2D and 3D) visual design apps is the > ability to snap to some kind of grid/existing vertices, and to zoom in > close. Then small imprecisions in mouse movement can be rendered > unim

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Martin Gregorie
Twisted wrote: > At least Windows 3.1 had most apps have the same keys for the vast > majority of commands, and those were the right keys. Emacs has all the > applications have the vast majority of their commands use the same > WRONG keys. Including whatever you'd use to rebind them. And the help >

Re: is this a valid import sequence ?

2007-06-24 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > Perhaps you should consider writing a PEP to make the redundant use of the > global statement a compile-time error? Sometimes I wished that it would be a compile time error or at least triggering a warning when ``global`` is used at module level.

Re: is this a valid import sequence ?

2007-06-24 Thread Steven D'Aprano
On Sat, 23 Jun 2007 21:11:42 -0700, Alex Martelli wrote a lot, with lots of YELLING. Wow. What can I say? Given the amount of SHOUTING in your post, and the fact that you feel so strongly about the trivial question of the redundant use of the global statement that you would "fail a student" who

Re: Collections of non-arbitrary objects ?

2007-06-24 Thread Bjoern Schliessmann
7stud wrote: > On Jun 23, 11:45 am, walterbyrd <[EMAIL PROTECTED]> wrote: >> Suppose you are sequentially processing a list with a routine >> that expects every item to be of a certain type. Something in the >> list that doesn't conform to the type could give you unexpected >> results, maybe crash

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread David Golden
Timofei Shatrov wrote: > What an idiot. At least get yourt facts straight before posting such > bullshit. I think at this stage it's quite reasonable to assume he's trolling, and recycling old trolls, too. Certainly looks like someone very like him used to haunt rec.games.roguelike.development as

Re: Portable general timestamp format, not 2038-limited

2007-06-24 Thread Roedy Green
On Fri, 22 Jun 2007 13:33:04 -0700, James Harris <[EMAIL PROTECTED]> wrote, quoted or indirectly quoted someone who said : >1) subsecond resolution - milliseconds or, preferably, more detailed >2) not bounded by Unix timestamp 2038 limit >3) readable in Java >4) writable portably in Perl which see

Re: is this a valid import sequence ?

2007-06-24 Thread Kay Schluehr
On Jun 24, 2:51 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > Since that global statement is utterly useless > (it's impossible to read and understand any substantial amount of Python > code without realizing that accessing a variable not locally assigned > means you're accessing a global, so the

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Timofei Shatrov
On Sun, 24 Jun 2007 04:57:20 -, Twisted <[EMAIL PROTECTED]> tried to confuse everyone with this message: >On Jun 23, 2:04 am, Robert Uhl <[EMAIL PROTECTED]> wrote: >> Of course, emacs doesn't take years of mastery. It takes 30, 40 >> minutes. > >I gave it twice that, and it failed to grow on

Re: Adding method to a class on the fly

2007-06-24 Thread John Henry
On Jun 23, 6:24 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 23 Jun 2007 12:31:39 -0700, John Henry wrote: > > it works fine but PythonCard isn't calling this function when I > > clicked on the button. > > I think you need to take this question onto a PythonCard list. I have no > idea h

  1   2   >