Re: Python internal design

2005-04-26 Thread Terry Reedy
"Maurice LING" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> I am designing a tool, in which there are dynamic types and >> variables with these types. In this respect, it is more like an >> interpreted language design. >> >> I wonder how these issues are implemented in Python ar

Re: tkinter text width

2005-04-26 Thread Martin Franklin
James Stroud wrote: Hello All, I would like for a tkinter text widget to be aware of how big the frame that contains it is, then I would like for it to reset its width to the appropriate number of characters when this frame changes size. I can get a cget("width") for the text, but this does not

ADODB Currency type broken in Python win32?

2005-04-26 Thread Tim Roberts
It looks to me like the handling of the currency type in an ADODB connecction from Python is broken. Currency data in an Access database is stored as a 64-bit integer, scaled by 1. In an ADODB recordset, this is returned as a 2-tuple, where the second element is the currency value, but the va

Re: python equivalent of php implode

2005-04-26 Thread Ola Natvig
Maksim Kasimov wrote: in php-scripts, to insert data to database, i'm doing like this: ... $query_param = array( 'field0' => 1, 'field1' => 3, 'field2' => $var2, 'field3' => $var3, ); ... $sql = "INSERT INTO $table (".implode(", ", array_keys($query_param)).") VALUES ('

Re: parse tree has symbols not in the grammar?

2005-04-26 Thread Terry Reedy
"Chad Whitacre" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I've been playing around with the parser module, and based on the > documentation I would expect all symbols in a parse tree to be part of > the grammar.[1] For example, I find this line in the symbol module docs: > >

Re: bytecode non-backcompatibility

2005-04-26 Thread Terry Reedy
"Maurice LING" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > From a technical perspective, I can accept that .pyc files are private > and temporary. To a certain extend, it does helps development cycle. > Every time I amend my source codes, I just run it without having to > con

Re: bytecode non-backcompatibility

2005-04-26 Thread "Martin v. Löwis"
Maurice LING wrote: > technicalities are wrong but situation remains unchanged. For C modules, it is very likely that new versions of Python will continue to break the ABI, by changing the layout of structures. The most straight-forward way to deal with it as a sysadmin or user is to install mult

Re: bytecode non-backcompatibility

2005-04-26 Thread "Martin v. Löwis"
Maurice LING wrote: > Now I understand that Python bytecodes are only dealing with pure python > source codes. However, the same question lies, how can it (set of > bytecodes) be made stable, like Java bytecodes, which are pretty stable? > Perhaps a better question will be, what techniques Java VM

Re: Python internal design

2005-04-26 Thread Ville Vainio
> "Emre" == Emre Turkay <[EMAIL PROTECTED]> writes: Emre> Hi Folks, Emre> I am designing a tool, in which there are dynamic types and Emre> variables with these types. In this respect, it is more like Emre> an interpreted language design. Emre> I wonder how these issues a

Re: Getting into Python, comming from Perl.

2005-04-26 Thread Tim Roberts
Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > >I have had a similar experience. Actually it was Perl 6, and and >particular this chart > > http://www.ozonehouse.com/mark/blog/code/PeriodicTable.html > >that made me think that Perl was leaving the rails, and it was time to >jump ship (to mix my met

Re: Pythonic way to do static local variables?

2005-04-26 Thread Bengt Richter
On 26 Apr 2005 13:58:23 -0700, "Lonnie Princehouse" <[EMAIL PROTECTED]> wrote: >A quick, hackish way to keep a static variable is to declare it as a >parameter and give it a default value. The parameter list is evaluated >when the function is compiled, not when it is called. The underscores >ar

Re: Pythonic way to do static local variables?

2005-04-26 Thread Bengt Richter
On Tue, 26 Apr 2005 10:26:51 -0700, Michael Spencer <[EMAIL PROTECTED]> wrote: >Terry Reedy wrote: >> "Charles Krug" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> >>>Both of these techniques look promising here. >> >> >> Here a third, the closure approach (obviously not dir

Re: Problem with embedded python

2005-04-26 Thread ugodiggi
Tom Cocagne wrote: > From looking at your example, it looks like you're making the problem FAR > more difficult than it needs to be. The main thing to keep in mind is that > Python threads do not correspond to operating system threads. In an > application using a single OS-level thread, you can use

Lexicographical sort for numarray

2005-04-26 Thread Edward C. Jones
Suppose arr is a two dimensional numarray array. Suppose we do the following: def rowsort(arr): a = arr.tolist() a.sort() return numarray.array(a) Can this sort be done efficiently in numarray? This function is called "rowsort" in MatLab. -- http://mail.python.org/mailman/listinfo/py

Re: schedule a monthly ftp event

2005-04-26 Thread Peter Hansen
Jeremy Bowers wrote: ... On UNIX, use some "cron" varient, Windows has some sort of Scheduler built in but I've never done anything with it but turn it off Modern Windowsen also have the "AT" command line program which is sometimes a much more appropriate way to get at that capability than the "S

Re: bytecode non-backcompatibility

2005-04-26 Thread Maurice LING
Mike Meyer wrote: Maurice LING <[EMAIL PROTECTED]> writes: The idea of having to release the program or library as source files does ring alarms in many executives in corporate world. Less freezing the modules (which renders it platform dependent) or using Jython (which is not possible when C exte

Re: regex over files

2005-04-26 Thread Bengt Richter
On Mon, 25 Apr 2005 16:01:45 +0100, Robin Becker <[EMAIL PROTECTED]> wrote: >Is there any way to get regexes to work on non-string/unicode objects. I would >like to split large files by regex and it seems relatively hard to do so >without >having the whole file in memory. Even with buffers it s

parse tree has symbols not in the grammar?

2005-04-26 Thread Chad Whitacre
Hey all, I've been playing around with the parser module, and based on the documentation I would expect all symbols in a parse tree to be part of the grammar.[1] For example, I find this line in the symbol module docs: Refer to the file Grammar/Grammar in the Python distribution for the defi

Re: delete will assure file is deleted?

2005-04-26 Thread Jeremy Bowers
On Tue, 26 Apr 2005 21:24:06 -0500, Mike Meyer wrote: > Jeremy Bowers <[EMAIL PROTECTED]> writes: > >> On Tue, 26 Apr 2005 03:40:16 -0700, [EMAIL PROTECTED] wrote: >> os.remove, as the module name implies, tells the OS to do something. I >> would consider an OS that returned from a "remove" call,

Re: Problem with embedded python

2005-04-26 Thread Tom Cocagne
From looking at your example, it looks like you're making the problem FAR more difficult than it needs to be. The main thing to keep in mind is that Python threads do not correspond to operating system threads. In an application using a single OS-level thread, you can use as many Python threads a

PyKDE inside vim-python

2005-04-26 Thread Matej Cepl
Hi, did anybody tried %subj%? I have created really stupidly simple dialog-box in Qt-designer (it is available on ) and I would like to run it from vim-script in kvim (soon to be obsoleted and replaced by Gnome-vim; oh, well, I liked kvim). Of cou

Re: App suggestion please: blog / forum software in Python

2005-04-26 Thread [EMAIL PROTECTED]
thx Irmen. Frog is good at what it does, and of course it can't do everything (not yet, anyway! :-) ) But it's interesting to note your future directions for the project. S -- http://mail.python.org/mailman/listinfo/python-list

Re: How remove directories with the content in the platform independent way?

2005-04-26 Thread Jason Mobarak
There's also the shutil module, which is platform independant. http://docs.python.org/lib/module-shutil.html ...see the rmtree function -- http://mail.python.org/mailman/listinfo/python-list

Re: bytecode non-backcompatibility

2005-04-26 Thread Maurice LING
What can be done in PYAN is to encourage all 3rd party library developers to centralize their libraries in it, which I think all will gladly respond. All that is needed to be deposited in PYAN is a description file, like the simplest setup.py file. All that is needed in this description file is 1.

Re: python equivalent of php implode

2005-04-26 Thread Mike Meyer
Jeff Epler <[EMAIL PROTECTED]> writes: > items = query_param.items() > keys = [item[0] for item in items] > values = [item[1] for item in items] Is there some reason not to do: keys = query_params.keys() values = query_params.values() That would seem to be a lot more obvious a

Re: what is the best way to determine system OS?

2005-04-26 Thread Mike Meyer
Roel Schroeven <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >>>In that case, it seems to be a better idea to check the version of >>>vmstat that's on the system. At least, I presume that such differences >>>in behaviour can be deduced from the vmstat version string. >> Hmm. That doesn't seem to

Re: bytecode non-backcompatibility

2005-04-26 Thread Mike Meyer
Maurice LING <[EMAIL PROTECTED]> writes: > The idea of having to release the program or library as source files > does ring alarms in many executives in corporate world. Less freezing > the modules (which renders it platform dependent) or using Jython > (which is not possible when C extensions are

Re: bytecode non-backcompatibility

2005-04-26 Thread Mike Meyer
Maurice LING <[EMAIL PROTECTED]> writes: >>>5. Unstable bytecodes makes updating to a newer version of Python very >>>tedious and risk breaking old scripts, if they uses C modules. >> Unstable bytecodes have nothing to do with these problems. The >> current CPython installation process puts the py

Re: How remove directories with the content in the platform independent way?

2005-04-26 Thread Andy Leszczynski
Andy Leszczynski wrote: James Stroud wrote: Look at the os and os.path modules. http://docs.python.org/lib/module-os.html http://docs.python.org/lib/module-os.path.html On Tuesday 26 April 2005 07:27 pm, so sayeth Andy Leszczynski: How remove directories with the content in the platform independen

Re: How remove directories with the content in the platform independent way?

2005-04-26 Thread Andy Leszczynski
James Stroud wrote: Look at the os and os.path modules. http://docs.python.org/lib/module-os.html http://docs.python.org/lib/module-os.path.html On Tuesday 26 April 2005 07:27 pm, so sayeth Andy Leszczynski: How remove directories with the content in the platform independent way? Is the API for th

Re: Can .py be complied?

2005-04-26 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > I don't know the exact details, but try using the compiled Python > scripts (bytecode). I believe they are semi-optimized and platform > independent. They are the .pyc and .pyo files generated when the script > is run. Okay, I found this documentation

Re: delete will assure file is deleted?

2005-04-26 Thread Mike Meyer
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On 26 Apr 2005 03:40:16 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> Hello Mike, >> I have to know this topic otherwise my program has to check whether the >> file / files are already deleted and

Re: Can .py be complied?

2005-04-26 Thread [EMAIL PROTECTED]
I don't know the exact details, but try using the compiled Python scripts (bytecode). I believe they are semi-optimized and platform independent. They are the .pyc and .pyo files generated when the script is run. -- http://mail.python.org/mailman/listinfo/python-list

Re: How remove directories with the content in the platform independent way?

2005-04-26 Thread James Stroud
Look at the os and os.path modules. http://docs.python.org/lib/module-os.html http://docs.python.org/lib/module-os.path.html On Tuesday 26 April 2005 07:27 pm, so sayeth Andy Leszczynski: > How remove directories with the content in the platform independent way? > Is the API for that? > > Thx,

Re: delete will assure file is deleted?

2005-04-26 Thread Mike Meyer
Jeremy Bowers <[EMAIL PROTECTED]> writes: > On Tue, 26 Apr 2005 03:40:16 -0700, [EMAIL PROTECTED] wrote: > os.remove, as the module name implies, tells the OS to do something. I > would consider an OS that returned from a "remove" call, but still let you > access that file, highly broken. Um - n

How remove directories with the content in the platform independent way?

2005-04-26 Thread Andy Leszczynski
How remove directories with the content in the platform independent way? Is the API for that? Thx, A. -- http://mail.python.org/mailman/listinfo/python-list

Re: kdialog and unicode

2005-04-26 Thread dmbkiwi
John Machin wrote: > On 26 Apr 2005 13:39:26 -0700, [EMAIL PROTECTED] (dumbkiwi) wrote: > > >Peter Otten <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > >> Dumbkiwi wrote: > >> > >> >> Just encode the data in the target encoding before passing it to > >> >> os.popen(): > > > > >

Re: kdialog and unicode

2005-04-26 Thread dmbkiwi
Peter Otten wrote: > dumbkiwi wrote: > > > I'd be interested to see what your default encoding is, > > ascii > > > and why your output was different. > > If only I knew. > > > Anyway, from your post, I've done some more digging, and found the > > command: > > > > sys.setappdefaultencoding() > > Th

Re: What's do list comprehensions do that generator expressions don't?

2005-04-26 Thread Bengt Richter
On Tue, 26 Apr 2005 13:22:28 -0400, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > >"Mike Meyer" <[EMAIL PROTECTED]> wrote in message >> The question under these circumstances is then: do you want bare >> genexp to mean something? Right now, it's a syntax error. But there's >> no reason you couldn't h

Re: bytecode non-backcompatibility

2005-04-26 Thread Maurice LING
The same *can* be said for some decade-old .py files. Certainly, most everything written for 2.0 onward still works. The same will also be true for .pyc files as long as you run them with their corresponding binary and as long as the binary stills run. However, .pyc files are private, tempora

Re: App suggestion please: blog / forum software in Python

2005-04-26 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: thanks Kartic. I use Frog already at my office. For this particular application, its design may not be appropriate, since each user gets her own blog space. I'm actually after a community blog, where any one of the registered users can post an item, or discuss on a forum

ANN: Greasemonkey compiler

2005-04-26 Thread Adrian Holovaty
Greasemonkey (http://greasemonkey.mozdev.org/) is a Mozilla Firefox extension that allows you to write scripts, in JavaScript, that alter specific Web pages. I've written a "compiler" for these scripts. It's a Python module that takes a user script as input and creates a full-fledged Firefox exten

Re: schedule a monthly ftp event

2005-04-26 Thread Jeremy Bowers
On Tue, 26 Apr 2005 15:15:35 -0700, willitfw wrote: > Greetings, > I am looking for some guidance on a script. > > My goals are: > 1) have this script run automatically through a time set schedule. > 2) verify if a file is updated on an ftp site (usually on the 15th of > the month). > 3) If the u

Re: Python internal design

2005-04-26 Thread Maurice LING
Emre Turkay wrote: Hi Folks, I am designing a tool, in which there are dynamic types and variables with these types. In this respect, it is more like an interpreted language design. I wonder how these issues are implemented in Python are there any documents or articles about it, which I can read an

Re: App suggestion please: blog / forum software in Python

2005-04-26 Thread [EMAIL PROTECTED]
thanks Kartic. I use Frog already at my office. For this particular application, its design may not be appropriate, since each user gets her own blog space. I'm actually after a community blog, where any one of the registered users can post an item, or discuss on a forum. Drupal, from http://dr

Re: Can .py be complied?

2005-04-26 Thread Maurice LING
monkey wrote: Hi all, I am new to programming, already have a glace on introduction of c++, java and finally decided on python. But I found that the .py file is just like the source file, how can I make a program without revealing its source? (may be my question is a little bit stupid) It is gener

Re: compile shebang into pyc file

2005-04-26 Thread [EMAIL PROTECTED]
Is there some reason why you want to run the .pyc file, rather than the .py file? If you start the script with #! /usr/bin/env python Then if the file has the execution permission set, typing the file name (foo.py) will make the script call up the Python interpreter on its own. -- http://mail.p

ANN: wxPython 2.6.0.0

2005-04-26 Thread Robin Dunn
Announcing -- I'm pleased to announce the 2.6.0.0 release of wxPython, now available for download at http://wxpython.org/download.php. This release consists of one more round of stabalization work (bug fixes and such) since the 2.5 series, and a few minor new features. This first 2.6 rele

Re: Can .py be complied?

2005-04-26 Thread Harlin Seritt
Hi monkey, Not a stupid question especially if you're trying to create commercial software and don't want to reveal your source. At any rate, you can use py2exe to create a .exe file. It does have some cons to it since you are compiling an interpreted script but it works fine in this capacity. If

Re: Fwd: how to find the drive in python/cygwin?

2005-04-26 Thread Ivan Van Laningham
Hi All-- Use win32api to find drives: cut here #!/usr/bin/python # -*- coding: utf-8 -*- import os import os.path import win32api import sys def findAllDrives(): Drives=[] print "Searching for drives..." drives=win32api.GetLogicalDriveStrings().split(":") for i in drives

Fwd: how to find the drive in python/cygwin?

2005-04-26 Thread Kristian Zoerhoff
Forwarding to list, as you forgot to Reply-all (Don't worry, we all do it at least once!). -- Forwarded message -- From: Mayer Goldberg <[EMAIL PROTECTED]> Date: Apr 26, 2005 3:01 PM Subject: Re: how to find the drive in python/cygwin? To: Kristian Zoerhoff <[EMAIL PROTECTED]> De

ANN: KirbyBase 1.8.1

2005-04-26 Thread Jamey Cribbs
KirbyBase is a simple, plain-text, database management system written in Python. It can be used either embedded in a python script or in a client/server, multi-user mode. You use python code to express your queries instead of having to use another language such as SQL. KirbyBase is disk-base

Re: Python, Perl & PDF files

2005-04-26 Thread rbt
Cameron Laird wrote: In article <[EMAIL PROTECTED]>, rbt <[EMAIL PROTECTED]> wrote: . . . Read and search them for strings. If I could do that on windows, linux and mac with the *same* bit of Python code, I'd be very happy ;)

Re: Python, Perl & PDF files

2005-04-26 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, rbt <[EMAIL PROTECTED]> wrote: . . . >Read and search them for strings. If I could do that on windows, linux >and mac with the *same* bit of Python code, I'd be very happy ;) Textual content,

tkinter text width

2005-04-26 Thread James Stroud
Hello All, I would like for a tkinter text widget to be aware of how big the frame that contains it is, then I would like for it to reset its width to the appropriate number of characters when this frame changes size. I can get a cget("width") for the text, but this does not dynamically reflect

Re: Python or PHP?

2005-04-26 Thread JZ
PHP can do the same. For ADOdb (excelent database wrapper)it can be as the following: $conn->Execute('UPDATED foo SET bar=? WHERE id=?', array("foo'bar", 123)); -- http://mail.python.org/mailman/listinfo/python-list

Re: App suggestion please: blog / forum software in Python

2005-04-26 Thread Kartic
The Great 'Stewart Midwinter' uttered these words on 4/26/2005 6:18 PM: I'm starting up a new website for a small community of local sports enthusiasts. I want to be able to create pages of information easily (i.e. a content management system), but also allow for discussion on multiple topics (i.e

Re: Coding Standards (and Best Practices)

2005-04-26 Thread Terry Reedy
"Isaac Rodriguez" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Does anyone know where I can get some information about what > the community is doing? Are there any well defined guidelines > established? Besides PEP8, there is also the library code itself. When reading that th

Re: goto statement

2005-04-26 Thread jfouhy
Tim Daneliuk wrote: > OK - Here's some reasoning that may illuminate it. We could, in theory, > reduce any language to the minimal Boehm & Jacopini control structures > (iirc there were only four). In effect, anything beyond these is > syntactic sugar. IOW, feel free to use a minimalist Turing M

Can .py be complied?

2005-04-26 Thread monkey
Hi all, I am new to programming, already have a glace on introduction of c++, java and finally decided on python. But I found that the .py file is just like the source file, how can I make a program without revealing its source? (may be my question is a little bit stupid) -- http://mail.python.o

Re: bytecode non-backcompatibility

2005-04-26 Thread Terry Reedy
"Maurice LING" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > So there are currently 7 implementations or variations of the Python > language and you are suggesting I make another one? Perhaps you missed the winkie ;-) > The Pacman (binary executable) that I played on a 286 a de

Re: goto statement

2005-04-26 Thread jfouhy
Maxim Kasimov wrote: > > Maxim Kasimov <[EMAIL PROTECTED]> writes: > >>WOW, just greate! ... but i'd like to relax at some more > >>interesting way than to comment each of rows > but what if i just can't to do this becouse i'm working thrue ssh, and have to > use only installed editors (such as vi)

Re: kdialog and unicode

2005-04-26 Thread John Machin
On 26 Apr 2005 13:39:26 -0700, [EMAIL PROTECTED] (dumbkiwi) wrote: >Peter Otten <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... >> Dumbkiwi wrote: >> >> >> Just encode the data in the target encoding before passing it to >> >> os.popen(): > >Anyway, from your post, I've done som

Re: kdialog and unicode

2005-04-26 Thread Peter Otten
dumbkiwi wrote: > I'd be interested to see what your default encoding is, ascii > and why your output was different. If only I knew. > Anyway, from your post, I've done some more digging, and found the > command: > > sys.setappdefaultencoding() That is an alias for sys.setdefaultencoding()

schedule a monthly ftp event

2005-04-26 Thread willitfw
Greetings, I am looking for some guidance on a script. My goals are: 1) have this script run automatically through a time set schedule. 2) verify if a file is updated on an ftp site (usually on the 15th of the month). 3) If the updated file exists, ftp it to local drive. 4) e-mail other users when

App suggestion please: blog / forum software in Python

2005-04-26 Thread Stewart Midwinter
I'm starting up a new website for a small community of local sports enthusiasts. I want to be able to create pages of information easily (i.e. a content management system), but also allow for discussion on multiple topics (i.e. a forum). Numerous people should be able to log in and create or updat

Re: PyGTK vs. wxPython

2005-04-26 Thread Grant Edwards
On 2005-04-26, dcrespo <[EMAIL PROTECTED]> wrote: > Aparently, none of you has tried wxPython recently or properly. Not so. I'm using it currently and have been using it for a couple years now. > wxPython is a cross-platform toolkit. Currently supported platforms are > 32-bit Microsoft Windows,

Re: Komodo syntax checking for python2.4

2005-04-26 Thread George Sakkis
"Trent Mick" wrote: > George, > > My suspicion is that the difference is that you are using a Cygwin > Python and it is using Un*x-style process return values. What do the > following return for your Python. > > For me on Windows (with ActivePython 2.4): > >>> import os > >>> os.system("ex

Problem with embedded python

2005-04-26 Thread Ugo Di Girolamo
I have the following code, that seems to make sense to me. However, it crashes about 1/3 of the times. My platform is Python 2.4.1 on WXP (I tried the release version from the msi and the debug version built by me, both downloaded today to have the latest version). The crash happens whil

List comprehension and FieldStorage

2005-04-26 Thread Derek Basch
Given this FieldStorage object: FieldStorage(None, None, [MiniFieldStorage('Checkbox1', 'on'), MiniFieldStorage('Checkbox2', 'on')]) I am trying to cgi.urlencode the FieldStorage object to POST to another cgi script. The documentation for urlencode, http://docs.python.org/lib/module-urllib.html ,

Re: bytecode non-backcompatibility

2005-04-26 Thread Maurice LING
One difference between Java and Python is this: Java bytecodes are, as I understand it, part of the Java language definition. CPython bytecodes are intentionally not part of the language at all. Except maybe fore PyPy, other implementations do not use them. Jython translates Python source to

Re: cross platform printing - using a GUI ?

2005-04-26 Thread dcrespo
Had you used it? Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Progress Bar with urllib2

2005-04-26 Thread John A Ferguson
On Tue, 26 Apr 2005 20:28:43 GMT, Andrew Godwin wrote: > I'm trying to write a python script to download data (well, files) from a > HTTP server (well, a PHP script spitting them out, at least). > The file data is just the returned data from the request (the server script > echoes the file and t

Re: PyGTK vs. wxPython

2005-04-26 Thread dcrespo
Hi all... Thank you for your answers... wxPython, under Linux, tries to use GTK... A better way to say it is: wxPython uses whatever it needs: under Windows, his API; under Linux, his API (may imply the use of GTK or GNOME), etc... Aparently, none of you has tried wxPython recently or properly. w

Re: regex over files

2005-04-26 Thread Jeremy Bowers
On Tue, 26 Apr 2005 20:54:53 +, Robin Becker wrote: > Skip Montanaro wrote: > ... >> If I mmap() a file, it's not slurped into main memory immediately, though as >> you pointed out, it's charged to my process's virtual memory. As I access >> bits of the file's contents, it will page in only w

Re: bytecode non-backcompatibility

2005-04-26 Thread Maurice LING
Terry Reedy wrote: "Maurice LING" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Now I understand that Python bytecodes are only dealing with pure python source codes. Then stop blaming (machine-independent) CPython 'bytecodes' for any problems you have with compiled-to-machine-l

Re: Fast plotting?

2005-04-26 Thread Ron
Russell E. Owen wrote: Can anyone recommend a fast cross-platform plotting package for 2-D plots? Our situation: We are driving an instrument that outputs data at 20Hz. Control is via an existing Tkinter application (which is being extended for this new instrument) that runs on unix, mac and wi

Re: how to pass an array to a VB array via COM

2005-04-26 Thread jelle
Thomas, No, i went over the syntax extensively. The syntax is RS.AddCurve(points, degree), so 3 represents the degree of a bezier curve. I'm doing fine with all types of functions which use 2 x,y,z coords, but all arrays -tuple of tuples- fail. The odd thing is that when i use RS.GetPoints() which

Re: Progress Bar with urllib2

2005-04-26 Thread Trent Mick
> But some of these files are going to be really, really big, and I want > to get a progress bar going. I've tried doing a while loop like this: Here is a little snippet that I use occassionally: -- geturl.py --- import os import sys import urllib def _re

Re: Pythonic way to do static local variables?

2005-04-26 Thread Lonnie Princehouse
A quick, hackish way to keep a static variable is to declare it as a parameter and give it a default value. The parameter list is evaluated when the function is compiled, not when it is called. The underscores are added as per convention to indicate that the variable is special/private. Example

Re: [pygame] Very simple program fails. Why?

2005-04-26 Thread Lee Harr
On 2005-04-26, Brent W. Hughes <[EMAIL PROTECTED]> wrote: > I'm just starting to learn pygame. I write what I think is just about the > simplest program that should display a window and then quit. > #--- > import sys > import time > import pygame > > py

Python internal design

2005-04-26 Thread Emre Turkay
Hi Folks, I am designing a tool, in which there are dynamic types and variables with these types. In this respect, it is more like an interpreted language design. I wonder how these issues are implemented in Python are there any documents or articles about it, which I can read and get an idea. T

Re: Pythonic way to do static local variables?

2005-04-26 Thread Lonnie Princehouse
A quick, hackish way to keep a static variable is to declare it as a parameter and give it a default value. The parameter list is evaluated when the function is compiled, not when it is called. The underscores are added as per convention to indicate that the variable is special/private. Example

Re: regex over files

2005-04-26 Thread Robin Becker
Skip Montanaro wrote: ... If I mmap() a file, it's not slurped into main memory immediately, though as you pointed out, it's charged to my process's virtual memory. As I access bits of the file's contents, it will page in only what's necessary. If I mmap() a huge file, then print out a few bytes

Re: Python, Perl & PDF files

2005-04-26 Thread rbt
Cameron Laird wrote: In article <[EMAIL PROTECTED]>, rbt <[EMAIL PROTECTED]> wrote: . . . OK, I'm done seeking to provoke. So, it's official. Perl has *much*, *much* better support for dealing with PDF files than does Python.

Re: kdialog and unicode

2005-04-26 Thread dumbkiwi
Peter Otten <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Dumbkiwi wrote: > > >> Just encode the data in the target encoding before passing it to > >> os.popen(): > >> > >> test = os.popen('kdialog --inputbox %s' % data.encode("utf-8")) > > > I had tried that, but then the

Re: Getting the sender widget's name in function (Tkinter)

2005-04-26 Thread infidel
from Tkinter import Tk, Button def say_hello(event): print 'hello!' print event.widget['text'] root = Tk() button1 = Button(root, text='Button 1') button1.bind('', say_hello) button1.pack() button2 = Button(root, text='Button 2') button2.bind('', say_hello) button2.pack() root.mainloop()

Re: Python documentation moronicities (continued)

2005-04-26 Thread Steve Holden
Peter Hansen wrote: Steve Holden wrote: I still await the specified five emails preferring your version to the current documentation. So, for the record Steve, how many of those emails have you received to date? (And how many from *anyone*, not just regulars, proclaiming Xah's version better?) -

Progress Bar with urllib2

2005-04-26 Thread Andrew Godwin
I'm trying to write a python script to download data (well, files) from a HTTP server (well, a PHP script spitting them out, at least). The file data is just the returned data from the request (the server script echoes the file and then dies). I call the page using urllib2, like so: satelliteRe

Re: Getting the sender widget's name in function (Tkinter)

2005-04-26 Thread tiissa
Harlin Seritt wrote: I have the following script. Two widgets call the same function. How can I tell inside of the called function which button called it?: As far as I know you can't (but I can be proven wrong). You may try to define a class to solve this (not tested): class say_hello: def

Getting the sender widget's name in function (Tkinter)

2005-04-26 Thread Harlin Seritt
I have the following script. Two widgets call the same function. How can I tell inside of the called function which button called it?: def say_hello(): print 'hello!' print widget['text'] root = Tk() button1 = Button(root, text='Button 1', command=say_hello) button1.pack() button2 = Button(

Re: regex over files

2005-04-26 Thread Skip Montanaro
>> It's hard to imagine how sliding a small window onto a file within Python >> would be more efficient than the operating system's paging system. ;-) Robin> well it might be if I only want to scan forward through the file Robin> (think lexical analysis). Most lexical analyzers use

Re: Komodo syntax checking for python2.4

2005-04-26 Thread Trent Mick
[George Sakkis wrote] > I downloaded the latest Komodo (3.1) and configured it for python 2.4 > so that it doesn't show decorators and genexps as syntax errors, but > background syntax checking doesn't seem to work at all for python 2.4. > Even for correct files, it shows a "Syntax checking error:

Sniffing at two sockets

2005-04-26 Thread n00m
In a simple VB script I open ADODB.Connection and start sending some very simple T-SQL commands to a MS SQL Server. Like this: Set cn = CreateObject("ADODB.Connection") cn.Open _ "Provider=sqloledb;Data Source=127.0.0.1,1434;" & _ "Netw

Re: delete will assure file is deleted?

2005-04-26 Thread Jeremy Bowers
On Tue, 26 Apr 2005 21:24:30 +0200, andreas wrote: > On Tue, Apr 26, 2005 at 03:13:20PM -0400, Jeremy Bowers wrote: >> On Tue, 26 Apr 2005 03:40:16 -0700, [EMAIL PROTECTED] wrote: >> >> > Hello Mike, >> > I have to know this topic otherwise my program has to check whether the >> > file / files ar

Re: regex over files

2005-04-26 Thread Jeremy Bowers
On Tue, 26 Apr 2005 19:32:29 +0100, Robin Becker wrote: > Skip Montanaro wrote: >> Robin> So we avoid dirty page writes etc etc. However, I still think I >> Robin> could get away with a small window into the file which would be >> Robin> more efficient. >> >> It's hard to imagine how

Re: delete will assure file is deleted?

2005-04-26 Thread andreas
On Tue, Apr 26, 2005 at 03:13:20PM -0400, Jeremy Bowers wrote: > On Tue, 26 Apr 2005 03:40:16 -0700, [EMAIL PROTECTED] wrote: > > > Hello Mike, > > I have to know this topic otherwise my program has to check whether the > > file / files are already deleted and this is a little bit messy. > > I wo

Re: delete will assure file is deleted?

2005-04-26 Thread Jeremy Bowers
On Tue, 26 Apr 2005 03:40:16 -0700, [EMAIL PROTECTED] wrote: > Hello Mike, > I have to know this topic otherwise my program has to check whether the > file / files are already deleted and this is a little bit messy. I would be fairly confident in asserting that assuming the file is there, you hav

Re: Python, Perl & PDF files

2005-04-26 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, rbt <[EMAIL PROTECTED]> wrote: . . . >OK, I'm done seeking to provoke. So, it's official. Perl has *much*, >*much* better support for dealing with PDF files than does Python.

Re: python on mac keystroke

2005-04-26 Thread Ian A. York
In article <[EMAIL PROTECTED]>, Eric Texier <[EMAIL PROTECTED]> wrote: >I am testing python on a mac. In the python console, none of the >control as the arrow to scroll back to a preview line are >working. How can I fix this. If I understand what you're asking, you need to install readline, which

  1   2   3   >