Re: is parameter an iterable?

2005-11-17 Thread Steven D'Aprano
Ah, found the right solution! Thanks to Fredrik Lundh for so gently pointing me at this post. Just one question, if I may:- Alex Martelli wrote: > It's not hard...: > > try: > _it = iter(whatever) > except TypeError: > print 'non-iterable' > else: > for i in _it: # etc, etc Alas

Re: How to write an API for a Python application?

2005-11-17 Thread Eric Brunel
On Wed, 16 Nov 2005 15:43:33 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: > "Eric Brunel" <[EMAIL PROTECTED]> writes: >> On 16 Nov 2005 06:18:05 -0800, Paul Boddie <[EMAIL PROTECTED]> wrote: >>> One technology that I used many years ago with Python, and which should >>> still do the job is CORBA -

Re: Creating (rather) generic plugin framework?

2005-11-17 Thread Edvard Majakari
Jean-Paul Calderone <[EMAIL PROTECTED]> writes: > You may want to look at a few existing Python plugin systems. To get you > started, here's a link to the Twisted plugin system documentation: > Thanks both to Bruno and Jea

Re: is parameter an iterable?

2005-11-17 Thread Steven D'Aprano
Roy Smith wrote: > Now you're assuming that the message is a constant for all TypeErrors > caused by attempting to iterate over a non-iterable object. Yes I am, and of course you are correct that that could change and so shouldn't be relied on. Seems that my crappy solution is not quite as fut

Re: Python obfuscation

2005-11-17 Thread Steven D'Aprano
The Eternal Squire wrote: > Plenty of case law exists behind judgements made to repair loss of > sales opportunites... these are called infringement upon sales > territories.. Is that supposed to impress me? There are plenty of lousy laws on the books being enforced. Oh yeah, that's right, they

newbie question: 'import site' failed; use -v for traceback

2005-11-17 Thread Tony Gill
Hi,   I've just downloaded and installed Python 2.4.2 for Windows and am having troubling getting started.   My system is: MS Windows XP Pro SP2   When I run 'python (command line)' from the start menu the first line in the CMD window is: 'import site' failed; use -v for traceback   This s

Re: newbie - How do I import automatically?

2005-11-17 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > I also checked in command prompt, and there it works!, but not in IDLE. > And it's in IDLE that I work all the time. Can anything be done to get > it to work there? According to command line help (run C:\Python24\Lib\idlelib>idle.py -h ) "idle -s" is what you're looki

Re: python-dev summary

2005-11-17 Thread Tony Meyer
On 17/11/2005, at 7:20 PM, Titus Brown wrote: >> [The HTML version of this Summary is available at >> http://www.python.org/dev/summary/2005-09-01_2005-09-15.html] > > no... no, it's not ;) Sorry; I should amend the copy that's posted to say "will be available". The summaries get posted here,

Re: pySonic - writing a sample to a file

2005-11-17 Thread Serge Orlov
netspeed.com.au wrote: > Hi all: > > Hopefully a simple question. I have been putting together an application > using pySonic. I find the documentaion fine with plenty of examples but I > cant see how to save a sample (or any recorded audio) to a file. > > Am I missing something obvious? Python c

Re: Addressing the last element of a list

2005-11-17 Thread Duncan Booth
Mike Meyer wrote: > Wouldn't one.__dict__ = dict(**two.__dict__) be a bit better? > Those stars are redundant here. It would be cleaner to write: one.__dict__ = dict(two.__dict__) -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-17 Thread Serge Orlov
Jack Diederich wrote: > Electric Fence[1] uses the LD_PRELOAD method. I've successfully used it to > track down leaks in a python C extension. If you look at the setup.py in > probstat[2] you'll see > #libraries = ["efence"] # uncomment to use ElectricFence > which is a holdover from developin

Re: PyExcelerator - mishandling of formulas?

2005-11-17 Thread Serge Orlov
Marco Aschwanden wrote: > Hi, > > Yesterday I placed a bug report on PyExcelerators-Sourceforge-page... but > I am not so sure anymore, whether this is really a bug - I could imagine > that I missed something, but I don't see what. Please confirm that my bug > is due to mishandling and I will gladl

Python Library Reference - question

2005-11-17 Thread bobueland
The "Python LIbrary Reference" at http://docs.python.org/lib/contents.html seems to be an important document. I have two questions Q1. How do you search inside "Python LibraryReference" ? Does it exist in pdf or chm form? Q2. In some other languages (for instance PHP if I recall correctly) reader

IDLE question

2005-11-17 Thread bobueland
IDLE doesn't seem to honor PYTHONSTARTUP environment variable nor sitecustomize.py How do you then customize in IDLE? (basically I want to execute the statement from btools import * each time I restart IDLEs Python Shell) -- http://mail.python.org/mailman/listinfo/python-list

Re: Addressing the last element of a list

2005-11-17 Thread Antoon Pardon
Op 2005-11-16, Mike Meyer schreef <[EMAIL PROTECTED]>: > Antoon Pardon <[EMAIL PROTECTED]> writes: >> Op 2005-11-15, Mike Meyer schreef <[EMAIL PROTECTED]>: >>> Antoon Pardon <[EMAIL PROTECTED]> writes: >> Like having an assignment operator (let use @= for it) next to a >> (re)bind operator

Re: newbie - How do I import automatically?

2005-11-17 Thread Claudio Grondi
Thanks to "Serge Orlov" for the hint: "run C:\Python24\Lib\idlelib>idle.py -h" Following works for me now if I start IDLE by following console command: C:\Python24\pythonw.exe C:\Python24\Lib\idlelib\idle.py -c "import os;from path import path" The IDLE console prompt appears in the second li

Re: newbie - How do I import automatically?

2005-11-17 Thread bobueland
I tried to do it on my computer (win XP). I put an extra line in PyShell.py #! /usr/bin/env python import os import os.path import sys import string import getopt import re import socket import time import threading import traceback import types import exceptions # test sys.modules['__main__']._

Re: Python obfuscation

2005-11-17 Thread Ben Sizer
Mike Meyer wrote: > > Are you claiming therefore that it's more acceptable to you to have to > > access the data remotely every time you use the software than once per > > install? > > Alex's solution doesn't require special treatment for disaster > recovery and/or planning, and as such is a valid

Re: is parameter an iterable?

2005-11-17 Thread Duncan Booth
Steven D'Aprano wrote: > What should I do when I can't rely on functions that > don't exist in older versions of Python? > Ideally: if 'iter' not in dir(__builtins__): import sys sys.exit('Archaic Python not supported, please upgrade') Alternatively fill in the blanks with app

Re: IDLE question

2005-11-17 Thread Claudio Grondi
<[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > IDLE doesn't seem to honor PYTHONSTARTUP environment variable nor > sitecustomize.py > > How do you then customize in IDLE? > > (basically I want to execute the statement >from btools import * > each time I restart IDLEs Pytho

Re: GTK for windows and Linux

2005-11-17 Thread Renato
You'll need to install the libglade/gtk/pygtk packages from: http://www.pcpm.ucl.ac.be/~gustin/win32_ports/ When your app is complete you can package it with py2exe -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie - How do I import automatically?

2005-11-17 Thread Claudio Grondi
"Mikael Olofsson" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > [EMAIL PROTECTED] wrote: > > I tried to put the line > > from btools import * > > in several places in PyShell.py > > but to now avail. It does not work, IDLE does not execute it??? > > IDLE definitely executes Py

Re: newbie - How do I import automatically?

2005-11-17 Thread Mikael Olofsson
[EMAIL PROTECTED] wrote: > I tried to do it on my computer (win XP). I put an extra line in > PyShell.py > [snip] > # test > sys.modules['__main__'].__dict__['os'] = os > [snip] > Then when I start idle I get > > IDLE 1.1.1 > dir() > > ['__builtins__', '__doc__', '__name__'] > > > So I don

Re: IDLE question

2005-11-17 Thread bobueland
Okey I tried what you recommended My C:\Python24\sitecustomize.py looks like this: # sitecustomize.py import os from btools import * When I enter C:\Python24>C:\Python24\pythonw.exe C:\Python24\Lib\idlelib\idle.py -r C:\Python24\sitecustomize.py in commad propmt IDLE starts up and automatically

Simulating call-by-reference

2005-11-17 Thread Rikard Bosnjakovic
I'm tidying up some code. Basically, the code runs a bunch of regexp-searches (> 10) on a text and stores the match in a different variable. Like this: re1 = r' ..(.*).. ' re2 = r' ' re3 = r' .(.*).. ' ... m = re.search(re1, data) if m: myclass.bar = m.g

Re: newbie - How do I import automatically?

2005-11-17 Thread Claudio Grondi
The only difference I can see is, that you are on Python 2.3.4 and I use Python 2.4.2: "Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 - IDLE 1.1.2" So maybe if you upgrade ... this will become obsolete? Claudio "Mikael Olofsson" <[EMAIL PROTECTED]> schrieb im Ne

Re: GTK for windows and Linux

2005-11-17 Thread Antoon Pardon
Op 2005-11-17, Ask schreef <[EMAIL PROTECTED]>: > Hi All, > > Can someone please tell me what I need to use GTK with python for windows > and Linux? > > Any links to the appropriate installations would be greatly appreciated as I > don't know what I need... GIMP... GTK+ etc Well I think if you v

Re: newbie - How do I import automatically?

2005-11-17 Thread bobueland
There is one C:\Python24\Lib\site-packages\sitecustomize.py but no C:\Python24\Lib\sitecustomize.py However I created one as you suggested but then I started IDLE nothing showed up. Have you tested that it works on your computer? Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: Simulating call-by-reference

2005-11-17 Thread [EMAIL PROTECTED]
Rikard Bosnjakovic wrote: > I'm tidying up some code. Basically, the code runs a bunch of > regexp-searches (> 10) on a text and stores the match in a different variable. > > Like this: > > re1 = r' ..(.*).. ' > re2 = r' ' > re3 = r' .(.*).. ' > ... > m = re.search(re

Re: IDLE question

2005-11-17 Thread Claudio Grondi
now a patch fixing it I have no good feeling about, but it works: in PyShell.py in def restart_subprocess(self): insert in section: " console.showprompt() # restart subprocess debugger # (-Patch) # making additional modules available in IDLE directly after re-

Re: newbie - How do I import automatically?

2005-11-17 Thread Mikael Olofsson
[EMAIL PROTECTED] wrote: >> I tried to do it on my computer (win XP). I put an extra line in >> PyShell.py >> [snip] >> # test >> sys.modules['__main__'].__dict__['os'] = os >> [snip] >> Then when I start idle I get >> >> IDLE 1.1.1 >> > dir() >> >> >> ['__builtins__', '__doc__', '__name__'] >>

Re: HTML generation vs PSP vs Templating Engines

2005-11-17 Thread Luis M. Gonzalez
With Karrigell (http://karrigell.sf.net/), all you need to know is Python and HTML. No templates, no python-like or special languages, only pure and simple python. You can embedd python into html or, if it better suits your programming tyle, you can embed html into python. Why don't you give it a

Re: IDLE question

2005-11-17 Thread bobueland
I did as you suggested, however after I make a new File (File/New Window) and save and then run (F5) I get the following alert The Python Shell is already executing a command; please waith until it is finished I also get the error message Traceback (most recent call last): File "", line 1, in

Re: Simulating call-by-reference

2005-11-17 Thread Dan Sommers
On Thu, 17 Nov 2005 10:03:50 GMT, Rikard Bosnjakovic <[EMAIL PROTECTED]> wrote: > What I want is to rewrite it to something like this: > l = [ (re1, myclass.bar), > (re2, myclass.foo), > (re3, myclass.baz), > ] > for (x,y) in l: > m = re.search(x, y) >

Re: Python Library Reference - question

2005-11-17 Thread bobueland
I found the answer to Q1. One can download all Python docs in pdf from http://www.python.org/doc/current/download.html -- http://mail.python.org/mailman/listinfo/python-list

Re: python-mysqldb__debian_to_freebsd

2005-11-17 Thread Cousin Stanley
> > For the interested, the OP (Stanley Kitching), wants to use a > python-mysqldb module on his web host running FreeBSD. They don't have > the that installed, so he tried getting the Debian binary distrubtion > of the library to work, and failed. He's wondering if this is at all > possible.

install python2.4 on FreeBSD and keep using python2.3

2005-11-17 Thread Ksenia Marasanova
Hi, I have python2.3, installed from port /lang/python long time ago. The current version is 2.4, but I'd rather have two python versions, instead of upgrading. Is there maybe a way to somehow link installed python to /lang/python2.3 port, and then upgrade ports and install /lang/python as a new (

Re: IDLE question

2005-11-17 Thread Claudio Grondi
<[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > I did as you suggested, however > > after I make a new File (File/New Window) and save and then run (F5) I > get the following alert > > The Python Shell is already executing a command; please waith until it > is finished > > I al

sqlite utf8 encoding error

2005-11-17 Thread Greg Miller
I have an application that uses sqlite3 to store job/error data. When I log in as a German user the error codes generated are translated into German. The error code text is then stored in the db. When I use the fetchall() to retrieve the data to generate a report I get the following error: Trac

Re: Python Library Reference - question

2005-11-17 Thread limodou
17 Nov 2005 00:53:59 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > The "Python LIbrary Reference" at > http://docs.python.org/lib/contents.html seems to be an important > document. I have two questions > > Q1. How do you search inside "Python LibraryReference" ? Does it exist > in pdf or chm form

Re: IDLE question

2005-11-17 Thread Claudio Grondi
Here a correction of the code snippet: console.text.mark_gravity("restart", "left") # (-Patch) # making additional modules available in IDLE directly after re-start of it: self.runsource("import os; from path import path") time.sleep(0.1) # (Patch-)

Re: strange file.write() behavior on windows: $ConvertToNonresident, $ReplaceAttribute2

2005-11-17 Thread Fredrik Lundh
"welch" <[EMAIL PROTECTED]> wrote: > while taking some rough disk performance measures on windows machines, > and snooping with FileMon, i've noticed some odd behavior > sometimes, depending on the phase of the moon, instead of > $ReplaceAttribute2 the write goes to $ConvertToNonresident. within

Re: sqlite utf8 encoding error

2005-11-17 Thread Fredrik Lundh
Greg Miller wrote: > UnicodeDecodeError: 'utf8' codec can't decode bytes in position 13-18: > unsupported Unicode code range > > does anyone have any idea on what could be going wrong? The string > that I store in the database table is: > > 'Keinen Text für Übereinstimmungsfehler gefunden' $ mor

Re: running functions

2005-11-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Gorlon the Impossible <[EMAIL PROTECTED]> wrote: . . . >the fly' so to speak. I checked out the threading module and its >working for what I am trying to do at the moment, but I am open to >sugg

Re: How to write an API for a Python application?

2005-11-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, dwelch <[EMAIL PROTECTED]> wrote: >Gary Kshepitzki wrote: >> Hello >> I would like to create an API for a piece of Python code. The API is for use >> by non Python code. >> It should support interaction in both directions, both accessing functions >> on the API an

Re: Python Library Reference - question

2005-11-17 Thread [EMAIL PROTECTED]
See this nice tool for Firefox. It's like a chm form live updated. :) http://projects.edgewall.com/python-sidebar []'s Luciano Pacheco -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE question

2005-11-17 Thread bobueland
This works! Thanks Claudio For complete happiness I would also like to know what's hapening. Is there anywhere I can read about PyShell.py. Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: Python gui

2005-11-17 Thread Sybren Stuvel
batfree enlightened us with: > Now GTK can use the local theme.You can choose the local theme to > make your application windows style on Winodws and Mac likely on mac > os. But why do that yourself, when you can use a GUI toolkit that does it for you? Sybren -- The problem with the world is stu

Re: Python obfuscation

2005-11-17 Thread Chris Mellon
On 17 Nov 2005 01:29:23 -0800, Ben Sizer <[EMAIL PROTECTED]> wrote: > Mike Meyer wrote: > > > Are you claiming therefore that it's more acceptable to you to have to > > > access the data remotely every time you use the software than once per > > > install? > > > > Alex's solution doesn't require sp

Re: Python gui

2005-11-17 Thread Chris Mellon
On 11/16/05, batfree <[EMAIL PROTECTED]> wrote: > Now GTK can use the local theme.You can choose the local theme to make > your application windows style on Winodws and Mac likely on mac os. > -- > http://mail.python.org/mailman/listinfo/python-list > This is true only in an very, very loose sense

Re: Proposal for adding symbols within Python

2005-11-17 Thread Kay Schluehr
Steven Bethard wrote: > Pierre Barbier de Reuille wrote: > > Proposal > > > > > > First, I think it would be best to have a syntax to represent symbols. > > Adding some special char before the name is probably a good way to > > achieve that : $open, $close, ... are $ymbols. > > How about

Re: sqlite utf8 encoding error

2005-11-17 Thread Sybren Stuvel
Greg Miller enlightened us with: > 'Keinen Text für Übereinstimmungsfehler gefunden' You posted it as "Keinen Text fr ...", which is Latin-1, not UTF-8. > I thought that all strings were stored in unicode in sqlite. Only if you put them into the DB as such. Make sure you're inserting UTF-8 text,

searching for files on Windows with Python

2005-11-17 Thread Shane
I've been giving Google a good workout with no luck. I would like to be able to search a Windows filesystem for filenames, returning a list off absolute paths to the found files, something like: def findFiles(filename, pathToSearch): ... ... return foundFileNames Is the os module

Re: IDLE question

2005-11-17 Thread Claudio Grondi
<[EMAIL PROTECTED]> wrote > This works! > > Thanks Claudio I am glad, that the time I put into it was not wasted. > For complete happiness I would also like to know what's hapening. > Is there anywhere I can read about PyShell.py. Not that I would know about (except reading the source code). May

Re: How to write an API for a Python application?

2005-11-17 Thread Paul Boddie
Cameron Laird wrote: > You guys work too hard. I beg to differ. ;-) > My reaction is this: Mr. Kshepitzki asks for an IPC choice, > says that COM looks like a bit too much, and respondents > start by loading him with even *heavier* technical alternatives, such as > CORBA. Well, my relatively l

How to - import code not in current directory

2005-11-17 Thread py
I have a python script that I want to test/debug. It contains a class which extends from some other class which is located in some other python file in a different directory. For example: [script to test] c:\python_code\foo.py [needed python files] c:\some\other\directory\bar.py ...so I want t

Re: How to - import code not in current directory

2005-11-17 Thread Carsten Haese
On Thu, 2005-11-17 at 08:41, py wrote: > Claudio Grondi wrote: > > so this should work in your case: > > > > import sys > > sys.path.append("C:\some\other\directory") > > import bar > > ...that will certainly work. Only issue is that each time I start up > foo.py in the python shell I have to ret

Re: How to - import code not in current directory

2005-11-17 Thread Claudio Grondi
"py" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Claudio Grondi wrote: > > so this should work in your case: > > > > import sys > > sys.path.append("C:\some\other\directory") > > import bar > > ...that will certainly work. Only issue is that each time I start up > foo.py in

Re: How to - import code not in current directory

2005-11-17 Thread Claudio Grondi
This question seems to come up in this newsgroup quite often, so looking through past threads will sure provide more details. Here from "Re: how to import a module from a arbitraty path?" posted to comp.lang.python by Simon Brunning on May 26, 2005 09:20 : " > I have a program which is going to

Re: searching for files on Windows with Python

2005-11-17 Thread Dennis Benzinger
Shane schrieb: > I've been giving Google a good workout with no luck. I would like to be able > to search a Windows filesystem for filenames, returning a list off absolute > paths to the found files, something like: > > def findFiles(filename, pathToSearch): > ... > ... > return f

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-17 Thread Scott Tsai
libgtop has python bindings and supports most modern unixes including linux, BSD, solaris, and AIX. You probably already has it installed on your linux box. ftp://ftp.gnome.org/pub/GNOME/sources/libgtop/ ftp://ftp.gnome.org/pub/GNOME/sources/gnome-python-extras/ -- http://mail.python.org/mailman

Re: How to - import code not in current directory

2005-11-17 Thread py
PYTHONPATH is perfectcheck out this link for more info.. http://docs.python.org/tut/node8.html#searchPath I just added the environment variable (on windows) named "PYTHONPATH" and set it to "C:\some\other\directory" :) -- http://mail.python.org/mailman/listinfo/python-list

RE: How to - import code not in current directory

2005-11-17 Thread Dmytro Lesnyak
Yes, you can. Try this: import sys sys.path.append('c:\some\other\directory\') import bar Good luck! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of py Sent: 17. marraskuuta 2005 15:19 To: python-list@python.org Subject: How to - import code not in cur

Re: How to - import code not in current directory

2005-11-17 Thread py
Claudio Grondi wrote: > so this should work in your case: > > import sys > sys.path.append("C:\some\other\directory") > import bar ...that will certainly work. Only issue is that each time I start up foo.py in the python shell I have to retype those three lineskind of why I was hoping for a e

Re: is parameter an iterable?

2005-11-17 Thread Roy Smith
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Alas and alack, I have to write code which is backwards > compatible with older versions of Python: > [...] > NameError: name 'iter' is not defined > > What should I do when I can't rely on functions that > don't exist in older versions of Python? I

Re: searching for files on Windows with Python

2005-11-17 Thread Fredrik Lundh
Shane wrote: > I've been giving Google a good workout with no luck. I would like to be > able to search a Windows filesystem for filenames, returning a list off > absolute > paths to the found files, something like: maybe some variation of http://article.gmane.org/gmane.comp.python.general/

PyQt layout question: QScrollView and QGridLayout?

2005-11-17 Thread Volker Lenhardt
For a QApplication (PyQt) on the small screen of my Zaurus 5500 PDA I try to layout my data output in a QScrollView as the central widget. I'd prefer to use QGridLayout, but cannot add it to the scroll view. sc=QScrollView(self) layout=QGridLayout(..., sc.viewport()) sc.addChild(layout) results

Why is "if fileitem.file:" (almost) never false?

2005-11-17 Thread mark
How do I detect that a particular form element is a file upload or if the file upload has worked? In the Python cgi module documentation I found suggested code... form = cgi.FieldStorage() fileitem = form["userfile"] if fileitem.file: # It's an uploaded file; count lines I've tried somethin

Current execution frame of another thread?

2005-11-17 Thread skip
I would like to try a sampling approach to profiling. My thought is to have a profiling thread that samples the execution frame of all the other started threads. I don't see any path from the threads returned by threading.enumerate() to their current frames. Am I missing something? Thx, Skip

Re: Newb ?

2005-11-17 Thread Paul Watson
Chad Everett wrote: > Hey guys, > > Thanks for the hint. > I found that info last night but I could never get it to print more than > just the last letter. > or it would only print partially. > I was using just a single colon, the double colon did it. If you were using a single colon, then it w

get just one character

2005-11-17 Thread Sinan Nalkaya
hello everybody, how can i just get 1 character ? i`ve done a search but just found getch() for windows, i need same for unix and raw_input has any option that is not documented ? thanks. -- http://mail.python.org/mailman/listinfo/python-list

PyDev 0.9.8.5 released

2005-11-17 Thread Fabio Zadrozny
Hi All, PyDev - Python IDE (Python Development Enviroment for Eclipse) version 0.9.8.5 has been released. Check the homepage (http://pydev.sourceforge.net/) for more details. Details for Release: 0.9.8.5 Major highlights: --- * Removed the dependency on packages 'sun..

Re: install python2.4 on FreeBSD and keep using python2.3

2005-11-17 Thread Paul Watson
Ksenia Marasanova wrote: > Hi, > > I have python2.3, installed from port /lang/python long time ago. The > current version is 2.4, but I'd rather have two python versions, > instead of upgrading. > Is there maybe a way to somehow link installed python to > /lang/python2.3 port, and then upgrade po

Re: is parameter an iterable?

2005-11-17 Thread Micah Elliott
On Nov 17, Duncan Booth wrote: > Steven D'Aprano wrote: > > What should I do when I can't rely on functions that > > don't exist in older versions of Python? > sys.exit('Archaic Python not supported, please upgrade') +1 QOTW. I recently gave up on trying to support (backport to) pre-2.2 i

Re: get just one character

2005-11-17 Thread Paul Watson
Sinan Nalkaya wrote: > hello everybody, > how can i just get 1 character ? i`ve done a search but just found > getch() for windows, i need same for unix and raw_input has any option > that is not documented ? > thanks. Please use Google. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/1

Re: get just one character

2005-11-17 Thread Sinan Nalkaya
Paul Watson wrote: >Sinan Nalkaya wrote: > > >>hello everybody, >>how can i just get 1 character ? i`ve done a search but just found >>getch() for windows, i need same for unix and raw_input has any option >>that is not documented ? >>thanks. >> >> > >Please use Google. > >http://aspn.acti

Re: creating package question

2005-11-17 Thread erick_bodine
Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : > > I think I have an answer to my own question. In the > > WindowsComponents/__init__.py file, I have the following, that feels > > like a better answer for the problem. Is there a better answer than > > this? > > > > import os, sys > > s

Re: PyExcelerator - mishandling of formulas?

2005-11-17 Thread Marco Aschwanden
On Thu, 17 Nov 2005 09:27:26 +0100, Serge Orlov <[EMAIL PROTECTED]> wrote: >> ws_summary.write(0,0, pyExcelerator.Formula('Data:A1')) >> ws_data.write(0, 0, '4000') > I think you're doing it wrong. ":" character means range, to refer to a > sheet use "!" charater: Data!A1 > Right you are. It

Re: install python2.4 on FreeBSD and keep using python2.3

2005-11-17 Thread Micah Elliott
On Nov 17, Ksenia Marasanova wrote: > I have python2.3, installed from port /lang/python long time ago. The > current version is 2.4, but I'd rather have two python versions, > instead of upgrading. > Is there maybe a way to somehow link installed python to > /lang/python2.3 port, and then upgrade

Re: GTK for windows and Linux

2005-11-17 Thread batfree
all you need are GTK+ envirement and the pygtk module.You can get more information in www.pygtk.org. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is "if fileitem.file:" (almost) never false?

2005-11-17 Thread Peter
I think: form = cgi.FieldStorage() fileitem = form["userfile"] if fileitem.filename: data = form.getfirst("userfile") if data: #do somethinfg with it FieldStorage objects always have a filename attribute which is the filename that the user used to upload

Re: get just one character

2005-11-17 Thread Micah Elliott
On Nov 17, Sinan Nalkaya wrote: > how can i just get 1 character ? i`ve done a search but just found > getch() for windows, i need same for unix and raw_input has any > option that is not documented ? Get all the characters one at a time: >>> inp = raw_input('enter a string> ') enter a st

Re: Python obfuscation

2005-11-17 Thread Anton Vredegoor
Alex Martelli wrote: > Modern equivalent of serialization (publishing one chapter at a time on > the web, the next chapter to come only if the author receives enough > payment for the previous one) have been attempted, but without much > success so far; however, the holy grail of "micropayments" m

Re: PyQt layout question: QScrollView and QGridLayout?

2005-11-17 Thread Phil Thompson
On Thursday 17 November 2005 2:56 pm, Volker Lenhardt wrote: > For a QApplication (PyQt) on the small screen of my Zaurus 5500 PDA I > try to layout my data output in a QScrollView as the central widget. I'd > prefer to use QGridLayout, but cannot add it to the scroll view. > > sc=QScrollView(self)

test_locale & test_pty fail for 2.4 SVN on Solaris 8/10

2005-11-17 Thread skip
We are getting a couple test failures at work when building Python 2.4.2 or the 2.4 Subversion branch on Solaris 8 and Solaris 10 (both on PC hardware). test_pty fails and test_locale is unexpectedly skipped. The locale environment is LC_ALL=C LC_CTYPE=iso_8859_1 I also tried test_local

Re: IDLE question

2005-11-17 Thread bobueland
I made bat file called startidle.bat which I put in C:\Python24 directory. This is how it looks @echo off start C:\Python24\pythonw.exe C:\Python24\Lib\idlelib\idle.py -r C:\Python24\sitecustomize.py exit Now I put a shortcut of startidle.bat in Quick Launch. The only thing I have to do now is to

Re: A way for closing an app monitor

2005-11-17 Thread Daniel Crespo
Ok. Thanks for your answer :-) I have implemented this and works correctly. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Current execution frame of another thread?

2005-11-17 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > I would like to try a sampling approach to profiling. My thought is to have > a profiling thread that samples the execution frame of all the other > started threads. I don't see any path from the threads returned by > threading.enumerate() to their current frames. Am I

Re: How to write an API for a Python application?

2005-11-17 Thread Mike Meyer
"Eric Brunel" <[EMAIL PROTECTED]> writes: > On Wed, 16 Nov 2005 15:43:33 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: > >> "Eric Brunel" <[EMAIL PROTECTED]> writes: >>> On 16 Nov 2005 06:18:05 -0800, Paul Boddie <[EMAIL PROTECTED]> wrote: One technology that I used many years ago with Python,

Re: Current execution frame of another thread?

2005-11-17 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > I would like to try a sampling approach to profiling. My thought is to have > a profiling thread that samples the execution frame of all the other > started threads. I don't see any path from the threads returned by > threading.enumerate() to their current frames. Am I

Re: Python obfuscation

2005-11-17 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, The Eternal Squire <[EMAIL PROTECTED]> writes >My point exactly. A good application of moderate to large size (100K >lines of code) is about as large as a single person can write without >automation, You have not been working with the right people. They do exist,

Re: Python Library Reference - question

2005-11-17 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > The "Python LIbrary Reference" at > http://docs.python.org/lib/contents.html seems to be an important > document. I have two questions > > Q1. How do you search inside "Python LibraryReference" ? Does it exist > in pdf or chm form? One other option. Go to google and us

Re: Python obfuscation

2005-11-17 Thread Mike Meyer
Chris Mellon <[EMAIL PROTECTED]> writes: > Your rights are anything you can do that is not forbidden - the US > constitution is explicitly designed in this way, something that people > often forget. There is no difference between an "explicit" and an > "inferred" right, by design. If you read the t

Any help with PLY?

2005-11-17 Thread mark . green
Hi folks, I've been trying to write a PLY parser and have run into a bit of bother. At the moment, I have a RESERVEDWORD token which matches all reserved words and then alters the token type to match the reserved word that was detected. I also have an IDENTIFIER token which matches identifiers t

Re: is parameter an iterable?

2005-11-17 Thread Roy Smith
Micah Elliott <[EMAIL PROTECTED]> wrote: > I recently gave up on trying to support (backport to) pre-2.2 in my > projects. It's been ~3 years since 2.2 released and that seem like a > pretty reasonable support window. It depends on what you're doing. If you're developing for in-house use, you h

Re: install python2.4 on FreeBSD and keep using python2.3

2005-11-17 Thread Mike Meyer
Ksenia Marasanova <[EMAIL PROTECTED]> writes: > Hi, > > I have python2.3, installed from port /lang/python long time ago. The > current version is 2.4, but I'd rather have two python versions, > instead of upgrading. > Is there maybe a way to somehow link installed python to > /lang/python2.3 port

catch dbi.program-error ?

2005-11-17 Thread Brian Herbert Withun
I'm having difficulty catching dbi.program-error which occurs this way: import dbi, odbc [...] self.__cur.execute(sql) >>> dbi.program-error: [Sybase][ODBC Driver][Adaptive Server Anywhere]Table >>> 'depfile' not found in EXEC but try: self.__cur.execute(sql) except dbi.program-error,e:

Re: How to write an API for a Python application?

2005-11-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paul Boddie <[EMAIL PROTECTED]> wrote: . . . >meaning that callbacks and other things just work. Rolling your own >solution, on the other hand, can end in a long road discovering what >those CORB

Re: Python obfuscation

2005-11-17 Thread Alex Martelli
Anton Vredegoor <[EMAIL PROTECTED]> wrote: ... > Maybe this micropayment thing is already working and active. What is > the cost of a mouseclick and what is the monetarial value of the fact > that someone is clicking on a link? Someone bought virtual property for I believe that all of the curre

how to organize a module that requires a data file

2005-11-17 Thread Steven Bethard
Ok, so I have a module that is basically a Python wrapper around a big lookup table stored in a text file[1]. The module needs to provide a few functions:: get_stem(word, pos, default=None) stem_exists(word, pos) ... Because there should only ever be one lookup table, I feel lik

  1   2   3   >