RE: Strange terminal behavior after quitting Tkinter application

2007-05-04 Thread Hamilton, William
> -Original Message- > From: Chris > Subject: Re: Strange terminal behavior after quitting Tkinter application > Clicking 'Quit' or on the window's 'x' causes the application to quit > without messing up the terminal. With root.mainloop() commented out, > though, no combination of root.quit

RE: Dict Copy & Compare

2007-05-01 Thread Hamilton, William
> -Original Message- > From: Steven D'Aprano > Sent: Monday, April 30, 2007 10:14 PM > To: python-list@python.org > Subject: RE: Dict Copy & Compare > > On Mon, 30 Apr 2007 12:50:58 -0500, Hamilton, William wrote: > > >> On quick question, h

RE: re-importing modules

2007-05-01 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of John Nagle > Sent: Monday, April 30, 2007 7:32 PM > To: python-list@python.org > Subject: Re: re-importing modules > > [EMAIL PROTECTED] wrote: > > >>In addition to the warning that reload() do

RE: Dict Copy & Compare

2007-04-30 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Robert Rawlins - > Think Blue > Sent: Monday, April 30, 2007 6:09 AM > To: 'Tim Golden' > Cc: python-list@python.org > Subject: RE: Dict Copy & Compare > > On quick question, how can I order a d

RE: import structures

2007-04-30 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of spohle > Sent: Monday, April 30, 2007 10:25 AM > To: python-list@python.org > Subject: Re: import structures > > On Apr 30, 8:16 am, "Hamilton, William " <

RE: import structures

2007-04-30 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of spohle > Sent: Monday, April 30, 2007 10:03 AM > To: python-list@python.org > Subject: Re: import structures > > On Apr 30, 8:00 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > > On Apr 30, 9:56 a

RE: Python keywords

2007-04-26 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of gtb > Sent: Thursday, April 26, 2007 1:50 PM > To: python-list@python.org > Subject: Re: Python keywords > > On Apr 26, 10:16 am, Larry Bates <[EMAIL PROTECTED]> wrote: > > http://docs.python.or

RE: Tutorial creates confusion about slices

2007-04-25 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Antoon Pardon > Sent: Tuesday, April 24, 2007 7:40 AM > To: python-list@python.org > Subject: Re: Tutorial creates confusion about slices > > On 2007-04-24, Michael Bentley <[EMAIL PROTECTED]> w

RE: Tutorial creates confusion about slices

2007-04-23 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Antoon Pardon > Sent: Monday, April 23, 2007 7:38 AM > To: python-list@python.org > Subject: Tutorial creates confusion about slices > > The following is part of the explanation on slices in the

RE: Iterate through a dictionary of lists one "line" at a time

2007-04-18 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of wswilson > Sent: Wednesday, April 18, 2007 1:39 PM > To: python-list@python.org > Subject: Iterate through a dictionary of lists one "line" at a time > > Here is my code: > > listing = {'id': [

RE: tuples, index method, Python's design

2007-04-11 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Chris Mellon > Sent: Wednesday, April 11, 2007 9:12 AM > To: python-list@python.org > Subject: Re: tuples, index method, Python's design > > > So, when you have a) a third party module that you c

RE: pop() clarification

2007-04-11 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Scott > > I understand all that. What I don't understand is why all the > documentation > I see says, "When removing a specific element from a list using pop() it > must be in this format: list

RE: passing class by reference does not work??

2007-04-11 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of wswilson > Sent: Wednesday, April 11, 2007 9:24 AM > To: python-list@python.org > Subject: passing class by reference does not work?? > > Here is my code: > > class A(): > val = 0 > > de

RE: tuples, index method, Python's design

2007-04-11 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Steven D'Aprano > Sent: Wednesday, April 11, 2007 7:49 AM > To: python-list@python.org > Subject: Re: tuples, index method, Python's design > > (There is one other option: you care that 32 is so

Re: Objects, lists and assigning values

2007-04-05 Thread Hamilton, William
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Manuel Graune Sent: Thursday, April 05, 2007 12:14 PM To: python-list@python.org Subject: Objects, lists and assigning values Hello, while trying to learn how to program using objects in python (up to now s

Re: Looping issues

2007-04-05 Thread Hamilton, William
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, April 05, 2007 1:01 PM To: python-list@python.org Subject: Looping issues What I am trying to do is compare two files to each other. If the 2nd file contains the same line t

Project organization and import redux

2007-04-05 Thread Hamilton, William
I apologize for bringing up something that's a month dead. But, I've been reading through the recent archives and came across this discussion, and want to make sure I understand a particular about the interactive prompt. "Martin Unsal" wrote: > I'm perfectly well aware that I'm not going to be a

Re: Using wildcards with Popen in the Subprocess module

2007-03-15 Thread William Hudspeth
Hello Mike, Thanks for responding. I need to pass multiple filenames to an executable. The filenames are similar to one another, but differ only slightly, hence the use of the wildcard. The executable works well from the command line if I pass in a wildcard filename, but Popen can't expand the wil

Using wildcards with Popen in the Subprocess module

2007-03-15 Thread William Hudspeth
Hello, I am needing to pass an argument to the Popen function of the Subprocess module that includes a wildcard in the filename. It seems that Popen is not able to expand wildcards, and treats a filename that includes a wildcard as a literal. EX. var1="/path_to_files/filnames*.doc" result=Popen

Re: Perl and Python, a practical side-by-side example.

2007-03-03 Thread William Heymann
On Saturday 03 March 2007, Ben Finney wrote: > Bjoern Schliessmann <[EMAIL PROTECTED]> writes: > > if not recs.has_key(piid): # [1] > Why not if piid not in recs: That is shorter, simpler, easier to read and very slightly faster. Plus you can change the data structure of recs later with

Re: asyncore DoS vulnerability

2007-02-02 Thread William Heymann
On Thursday 01 February 2007, billie wrote: > Here's the traceback: > > Traceback (most recent call last): > File "C:\Documents and Settings\root\Desktop\test.py", line 31, in ? > asyncore.loop(timeout=1) > File "C:\Python24\lib\asyncore.py", line 192, in loop > poll_fun(timeout, map)

Re: spidering script

2007-01-23 Thread William Park
In David Waizer <[EMAIL PROTECTED]> wrote: > Hello.. > > I'm looking for a script (perl, python, sh...)or program (such as wget) > that will help me get a list of ALL the links on a website. lynx -dump (look at the bottom) -- William Park <[EMAIL PROTECTED]&g

Re: maximum number of threads

2007-01-11 Thread William Heymann
On Wednesday 10 January 2007 7:11 am, Felipe Almeida Lessa wrote: > --- > $ python test.py > 50 > 100 > 150 > 200 > 250 > 300 > 350 > Exception raised: can't start new thread > > Biggest number of threads: 382 > --- > > The test.py script is attached. So you know I tried this on ubuntu edgy 64bit

Re: I want to learn

2007-01-07 Thread William Allison
Thomas Ploch wrote: > [EMAIL PROTECTED] schrieb: >> Hi, >> >> I have been "programming" in the .net environment and ide for a few >> years and I am looking to make the switch over to python. I have >> absolutely no python experience whatsoever. I am looking for a python >> guru who has instant mess

Re: merits of Lisp vs Python

2006-12-15 Thread William James
André Thieme wrote: > [EMAIL PROTECTED] schrieb: > William James schrieb: > >>> How would you solve this in Python? > >>> You could embed it inside a lambda and must somehow make the > >>> variable "it" visible in it, because in the context

Re: merits of Lisp vs Python

2006-12-15 Thread William James
André Thieme wrote: > William James schrieb: > > André Thieme wrote: > >> William James schrieb: > >> > >>> def nif num, pos, zero, neg > >>> send( num>0 ? pos : (num==0 ? zero : neg) ) > >>> end > >> btw, your nif body

Re: merits of Lisp vs Python

2006-12-15 Thread William James
André Thieme wrote: > Paul Rubin schrieb: > > André Thieme <[EMAIL PROTECTED]> writes: > >> and the Lisp version has only 9: > >> nth, 1+, truncate, signum, num, list, pos, zero, neg > > > > Oh come on, you have to count the parentheses too. > > We could define hundreds of way how to count tok

Re: merits of Lisp vs Python

2006-12-15 Thread William James
André Thieme wrote: > William James schrieb: > > > def nif num, pos, zero, neg > > send( num>0 ? pos : (num==0 ? zero : neg) ) > > end > > btw, your nif body is built out of 13 tokens, so more > complicated than the Python version. > > > André

Re: merits of Lisp vs Python

2006-12-15 Thread William James
André Thieme wrote: > greg schrieb: > > Ken Tilton wrote: > > > >> The reason I post macro expansions along with examples of the macro > >> being applied is so that one can see what code would have to be > >> written if I did not have the defskill macro to "write" them for me. > > > > It seems to m

Re: SPE website down?

2006-12-14 Thread William Allison
Laszlo Nagy wrote: > The home page of SPE (Stani's editor) is not available. > > http://pythonide.stani.be/ > > Is there a mailing list for this editor? > Where should I ask questions about it? > Where can I report bugs and make suggestions? > > Thanks, > > Laszlo > I seem to remember he was

Monitoring number of smtp bytes sent through python e-mail socket

2006-12-09 Thread William Connery
basic python sockets whilst having access to the number of bytes that have already been sent through the socket? Many thanks. William Connery #!/usr/bin/python import wx import smtplib from email import Encoders from email.MIMEMultipart import MIMEMultipart from email.Utils import COMMASPACE, forma

Monitoring number of smtp bytes sent through python e-mail socket

2006-12-04 Thread William Connery
using basic python sockets whilst having access to the number of bytes that have already been sent through the socket? Many thanks. William Connery #!/usr/bin/python import wx import smtplib from email import Encoders from email.MIMEMultipart import MIMEMultipart from email.Utils import COMMA

Re: Barry Warsaw giving Python talk at NASA

2006-11-08 Thread William Allison
A.M. Kuchling wrote: > This is at the Goddard campus: > > > --amk Thanks for the heads up on this. I managed to get escorted in to see it. Thought it was quite good. I was also informed that the webcast will be made available to

Re: Python memory usage

2006-11-07 Thread William Heymann
On Tuesday 07 November 2006 22:42, placid wrote: > Hi All, > > Just wondering when i run the following code; > > for i in range(100): > print i > > the memory usage of Python spikes and when the range(..) block finishes > execution the memory usage does not drop down. Is there a way of > f

Re: Best IDE?

2006-10-13 Thread William Heymann
On Friday 13 October 2006 08:29, Ahmer wrote: > What do you guys use? Kdevelop 3 > Why? It has good project management, good highlighting and since it is a kde app it supports ioslaves (means I can work with a resource from any location trasnparently like opening up files via sftp) > What do you

replacing all 'rng's in a buffer with consecutive r[1], r[2]'s

2006-10-04 Thread m g william
I read a file into a buffer and subject it to re.sub() I can replace every occurrence of a pattern with a fixed string but when I try to replace each occurrence with a string that changes (by having an incrementing number in it, (ie 'repTxt[1]','repTxt[2]'etc), I note that the incrementing number g

Re: PATCH: Speed up direct string concatenation by 20+%!

2006-09-29 Thread William Heymann
On Friday 29 September 2006 08:34, Larry Hastings wrote: > It would still blow up if you ran > s = "" > for i in range(1000): > s = "a" + s This is a pretty small change but I would suggest xrange instead of range. That way you don't allocate that large list just to throw all the ite

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-28 Thread William James
[EMAIL PROTECTED] wrote: > I would be interested in comments about how Common Lisp, Scheme, and > Haskell deal with the decorate-sort-dedecorate technique. %w(FORTRAN LISP COBOL).sort_by{|s| s.reverse} ==>["COBOL", "FORTRAN", "LISP"] -- Common Lisp did kill Lisp. Period. ... It is to Lisp

Re: Windows vs. Linux

2006-07-31 Thread William Witteman
>You might also like to look at running Cygwin under Windows. It's a >Unix-like command shell that provides nearly every command-line Unix >tool you could want on a Windows box. Can be a little awkward at times, >but it's a huge advantage over raw Windows. Ditto. -- yours, William woolgathering.cx -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows vs. Linux

2006-07-30 Thread William Witteman
home, on a completely different platform, and then take it to work and I know it'll Just Work(TM). As a Linux zealot, I'd say use Linux :-) As a pragmatist, use what you find more comfortable, and enjoy yourself. -- yours, William woolgathering.cx -- http://mail.python.org/mailman/listinfo/python-list

Parsing Digits in Strings, using RE

2006-06-26 Thread William Cellich
nt, then I get   XXX_XXX = 123456789000     When I use non-greedy ? or ., I get errors such as unscriptable, or other.   Any suggestions???   I am able to do this as two separate progs, but have been unsuccessful at getting it all together as a one-pass code.   Thanks!   William      

Re: BeautifulSoup error

2006-06-16 Thread William
;s the feed method implemented by SGMLParser and calling it will bypass Beautiful Soup and cause problems. Thanks for all the help ! -- William Thrashing is just virtual crashing. -- http://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup error

2006-06-16 Thread William Xu
Ben Finney <[EMAIL PROTECTED]> writes: > William Xu <[EMAIL PROTECTED]> writes: > >> >>> import urllib >> >>> from BeautifulSoup import BeautifulSoup >> >>> url = 'http://www.google.com' >> >>> port = urllib.

Re: BeautifulSoup error

2006-06-15 Thread William Xu
"Serge Orlov" <[EMAIL PROTECTED]> writes: [...] > Upgrading python-beautifulsoup is a good idea, since there were two bug > fix releases after 3.0.1 I just downloaded latest version 3.0.3 from its homepage, seems it still has the same problem. -- William PL/I

BeautifulSoup error

2006-06-15 Thread William Xu
565: ordinal not in range(128) >>> Any ideas to solve this? version info: Python 2.3.5 (#2, Mar 7 2006, 12:43:17) [GCC 4.0.3 20060212 (prerelease) (Debian 4.0.2-9)] on linux2 python-beautifulsoup: 3.0.1-1 -- William "I'd love to go out with you, but I have to floss my cat." -- http://mail.python.org/mailman/listinfo/python-list

Re: The Nature of the “Unix Philosophy”

2006-06-08 Thread William Ahern
On Thu, 08 Jun 2006 13:41:13 +, Richard Bos wrote: > Frank Silvermann <[EMAIL PROTECTED]> wrote: > >> Nils O. Selåsdal wrote: >> > Xah Lee wrote: >> >> The Nature of the “Unix Philosophy” >> >> > Perhaps you should take a peek at the ideas in Plan 9 from Bell Labs, >> > which is a cont

Re: Tabs are EVIL *and* STUPID, end of discussion. (Re: Tabs versus Spaces in Source Code)

2006-05-17 Thread William Studenmund
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On May 17, 2006, at 8:46 PM, Edward Elliott wrote: > Dave Hansen wrote: > >> On Wed, 17 May 2006 17:28:26 GMT in comp.lang.python, Edward Elliott >>> Just for the sake of completeness: >>> >>> cat file |sed 's/\t//g' >> >> That doesn't always work

Subclassing types in C

2006-05-16 Thread William Studenmund
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I used the embedding python guide to embed python in an application to let me easily script the app. It's all working rather well, and I've added a number of types which expose the internals to python. However I've gotten to the point where I want

subprocess freeze with rsync on windows

2006-04-07 Thread William Dode
the same script. thanks the complet script (doing rsync and cp -al on the remote side) is available freely here : http://flibuste.net/libre/snapy (but documentation is in french) -- William Dodé - http://flibuste.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Content Management System

2006-03-29 Thread William Tasso
gt; You will just be dumping files >> on another remote server. How will the users "find" what they want? > It's not a *dumping* files but publishing contents. One could be forgiven for misidentifying one for the other based on that which is to be found on the WWW.

build windows module for python-2.4

2006-03-04 Thread william
Does any one having working python 2.4 compiler can give some details on how to set it up ? I've read lot of different website, but some are outdated, others referencing dead links, ... I would just use an existing python 2.3 module (VC6) to python-2.4. I think the best is to recompile it with VC

Re: object's list index

2006-03-03 Thread William Meyer
Kent Johnson kentsjohnson.com> writes: > In either case enumerate() is your friend. To find an > item by identity: > > def index_by_id(lst, o): >for i, item in enumerate(lst): > if item is o: >return i >raise ValueError, "%s not in list" % o > > If you just want the index

Re: object's list index

2006-03-03 Thread William Meyer
Iain King gmail.com> writes: > what's wrong with: > > i = 0 > for object in list: > objectIndex = i > print objectIndex > i += 1 > > Iain > The issues with that is you might have a complex structure below the for object in list: with lots of continues or breaks and you don't want

object's list index

2006-03-03 Thread William Meyer
hi, I need to get the index of an object in a list. I know that no two objects in the list are the same, but objects might evaluate as equal. for example list = [obj1, obj2, obj3, obj4, obj5] for object in list: objectIndex = list.index(object) print objectIndex prints 0, 1, 2, 3, 2

Re: Shell Navigation

2006-03-02 Thread William Meyer
Simon Brunning brunningonline.net> writes: > Sounds like a readline problem. Your OS? How did you install Python? Yea, that was it. I just had to copy readline.so from another installation. Thanks for the quick reply -- http://mail.python.org/mailman/listinfo/python-list

Shell Navigation

2006-03-02 Thread William Meyer
I am having trouble with the python interactive shell. The arrow keys render as ^[[D, ^[[A, etc making line editing impossible. The arrow keys (and function keys) work fine in bash, but in the python shell they are printed. Any ideas what is going on? -- http://mail.python.org/mailman/listinfo/py

Re: comple list slices

2006-02-28 Thread William Meyer
gmail.com> writes: > Although I don't know if this is faster or more efficient than your > current solution, it does look cooler: > > def grouprows(inrows): > rows = [] > rows[:] = inrows # makes a copy because we're going to be > deleting > while len(rows) > 0: > rowspan

Re: comple list slices

2006-02-28 Thread William Meyer
gmail.com> writes: > > Python lets you iterate through a list using an integer index, too, > although if you do so we will make fun of you. You can accomplish it > with a while loop, as in: > > i = 0 > while i < len(rows): >if rows[i] == "This code looks like BASIC without the WEND, doesn

Re: comple list slices

2006-02-28 Thread William Meyer
gmail.com> writes: > > A couple questions: > > 1- what is j? > 2- what does the rows[x][y] object look like? I assume it's a dict > that has a "rowspan" key. Can rows[x][y]["rowspan"] sometimes be 0? > > Perhaps you're looking for something like this: > rowgroups = [] > rowspan = 0 > for i

comple list slices

2006-02-28 Thread William Meyer
Hi, I have a list of rows which contains a list of cells (from a html table), and I want to create an array of logical row groups (ie group rows by the rowspan). I am only concerned with checking the rowspan of specific columns, so that makes it easier, but I am having trouble implementing it in p

Re: warning for google api users

2006-02-22 Thread William
Isn't this because the index that the api uses is (a lot) older than the index used by www.google.com? total results are always estimated, so they are not reliable (seen the variance) Gabriel B. schreef: > the google webservices (aka google API) is not even close for any kind > of real use yet >

Re: Xah's Edu Corner: Unix damage: color names

2006-02-08 Thread William James
[EMAIL PROTECTED] wrote: > On AIX and Linux (SuSE 9.3) each color name which contains "gray" is > also aliased as "grey" for the benefit of both Yanks and Brits. Thus, Yankee, n. In Europe, an American. In the Northern States of our Union, a New Englander. In the Southern States the word is un

Re: batch tiff to jpeg conversion script

2006-01-29 Thread William Park
you tried ImageMagick utilities. For example, man convert -- William Park <[EMAIL PROTECTED]>, Toronto, Canada ThinFlash: Linux thin-client on USB key (flash) drive http://home.eol.ca/~parkw/thinflash.html BashDiff: Super Bash shell http://freshmeat.net/projects/bashdiff/ -- http://mail.python.org/mailman/listinfo/python-list

Re: csv format to DBase III format

2006-01-10 Thread William
Peter Otten wrote: > William wrote: > > > Peter Otten wrote: > >> [EMAIL PROTECTED] wrote: > >> > >> > I need to transfer csv format file to DBase III format file. > >> > How do i do it in Python language? > >> > >> http://

Re: Returning Values from Bash Scripts

2006-01-07 Thread William Park
text, GDBM, Python source format, etc) and read it back in Python. -- William Park <[EMAIL PROTECTED]>, Toronto, Canada ThinFlash: Linux thin-client on USB key (flash) drive http://home.eol.ca/~parkw/thinflash.html BashDiff: Super Bash shell http://freshmeat.net/pro

Re: csv format to DBase III format

2006-01-06 Thread William
Peter Otten wrote: > [EMAIL PROTECTED] wrote: > > > I need to transfer csv format file to DBase III format file. > > How do i do it in Python language? > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362715 > > Peter Hi, I create a dbf file, it can be opened by Excel but it cannot be

Re: urllib on windows machines

2005-12-03 Thread william
t; platform.python_build() (67, 'Sep 28 2005 12:41:11') > So off-hand, I'd suspect some firewall thingie is getting in the way. > Can you "bless" \Python24\python.exe and \Python24\pythonw.exe as > applications allowed to do net traffic? > Bingo! That's the problem: "Blocked outgoing TCP - Source Local: (1898) Destination: 67.18.1.164: http(80)" But why the "telnet www.google.com 80" is wroking ? Why Firefox is running ? Thanks. William -- http://mail.python.org/mailman/listinfo/python-list

urllib on windows machines

2005-12-03 Thread william
//www.google.com') " C:\Temp>python test.py Traceback (most recent call last): File "test.py", line 2, in ? g=urllib.urlopen('http://www.google.com') File "c:\william\tools\python24\lib\urllib.py", line 77, in urlopen return opener.open

Re: XML GUI

2005-11-09 Thread William Park
for Python projects...even > Jython. If you're talking about simple "dialog" thing, where you ask question and users respond, then take a look at http://home.eol.ca/~parkw/index.html#gtk Also, you may want to look at Glade which spits out the layout in XML. But, for more intricate t

Re: best way to replace first word in string?

2005-10-22 Thread William Park
Chris F.A. Johnson <[EMAIL PROTECTED]> wrote: > On 2005-10-22, William Park wrote: > > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >> I am looking for the best and efficient way to replace the first word > >> in a str, like this: > >> "aa

Re: best way to replace first word in string?

2005-10-21 Thread William Park
expressions > and I sure there is a lot ways, but I need realy efficient one I doubt you'll find faster than Sed. man sed -- William Park <[EMAIL PROTECTED]>, Toronto, Canada ThinFlash: Linux thin-client on USB key (flash) drive http://home.eol.ca/~parkw/thinflash.html

Re: need some advice on x y plot

2005-10-21 Thread William Park
s since january of 1970 doesn't make a neat chart. > > any suggestions? Python is capable of integer arithmetic, eg. >>> 2000 - 500 1500 -- William Park <[EMAIL PROTECTED]>, Toronto, Canada ThinFlash: Linux thin-client on USB key (flash) drive http:

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-11 Thread William Park
; > Yeah, "if C then A else B" is a ancient tradition stretching from > Algol-60 to OCAML, and who knows what all else in between. I'm not > sure what Guido saw in the "A if C else B" syntax but it's not a big > deal. Perhaps, he's preparing Python for

Re: Dynamic character substitution.

2005-09-29 Thread William Park
s > arrays data1(1000,2), data2(1000,2).. > > *vread,data%n%,filename%n%#fills arrays with data > from filename1,. I await English translation of the above. -- William Park <[EMAIL PROTECTED]>, Toronto, Canada ThinFlash: Linux thin-client on USB key (

Re: Simple Dialogs

2005-09-29 Thread William Park
If you must run it inside Python, then you should look into Python wrapper for GTK+, and write the code yourself. -- William Park <[EMAIL PROTECTED]>, Toronto, Canada ThinFlash: Linux thin-client on USB key (flash) drive http://home.eol.ca/~parkw/thinflash.html BashDiff: Su

How use Distutils for plugins ?

2005-09-24 Thread william
s installed place by using the Main.__file__ variable. Any ideas ? Thanks William --- http://www.opensource4you.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python CSV writer confusion.

2005-09-15 Thread William Park
googleboy <[EMAIL PROTECTED]> wrote: > Hi. I am trying to write out a csv file with | instead of comma, > because I have a field that may have many commas in it. I read in a > csv file, sort it, and want to write it out again. CSV can handle comma within the field. -- Willi

Re: Sorting Unix mailboxes

2005-09-15 Thread William Park
hon script, perhaps, you should look at man procmailrc man formail and take the relevant process and implement that in Python. -- William Park <[EMAIL PROTECTED]>, Toronto, Canada ThinFlash: Linux thin-client on USB key (flash) drive http://home.eol.ca/~parkw/thinflash.html

Re: dual processor

2005-09-04 Thread William Park
might be info from people trying to make > Python run 64-bit, on multiple processors? Thanks! Break up your problem into 2 independent parts, and run 2 Python processes. Your kernel should be SMP kernel, though. -- William Park <[EMAIL PROTECTED]>, Toronto, Canada ThinFlash: Linux thi

Re: scroll a frame to display several lines of widgets at a time

2005-09-02 Thread William Gill
>yscroll = Tkinter.Scrollbar( , orient=Tkinter.VERTICAL) >yscroll.grid( ... ) >yscroll['command'] = canvas.yview >canvas['yscrollcommand'] = yscroll.set > Probably, not needed now that I have re-thought the situation, but I do have several occasio

Re: graphical or flow charting design aid for python class development?

2005-09-01 Thread William Gill
Thanks everyone. I will explore all the suggestions, but it looks like SPE is the immediate answer. Bill William Gill wrote: > Being somewhat new to Python, and having a tendency to over complicate > things in my class design, I was wondering if anyone can suggest a > simple gra

scroll a frame to display several lines of widgets at a time

2005-09-01 Thread William Gill
I need to display a couple of labels and a checkbox from each entry in my database. Simple enough, but there are several hundred records, and I only want to display 5 or 10 at a time. Can this be accomplished by putting everything in a Frame(), using width, height, grid_propagate(0) , and a s

Re: graphical or flow charting design aid for python class development?

2005-08-31 Thread William Gill
On first glance Doxygen doesn't look like the ticket, but the screen shots of Eric3 look VERY promising. I have already downloaded it, and will try it. Thanks, Bill tooper wrote: > You may want to use Doxygen, which generates nice diagrams. It's > normally only for C++, but there are nice filt

Re: graphical or flow charting design aid for python class development?

2005-08-31 Thread William Gill
loring, thanks. Bill > > http://www.python.org/doc/2.0.1/lib/module-pyclbr.html > > William Gill wrote: > >>Being somewhat new to Python, and having a tendency to over complicate >>things in my class design, I was wondering if anyone can suggest a >>simple graphica

graphical or flow charting design aid for python class development?

2005-08-31 Thread William Gill
Being somewhat new to Python, and having a tendency to over complicate things in my class design, I was wondering if anyone can suggest a simple graphical or flowcharting tool that they use to organize their class and program design? Because of a 55 mph head-on accident a few years back, I ha

Re: File parser

2005-08-29 Thread William Park
Angelic Devil <[EMAIL PROTECTED]> wrote: > BAR > END BAR > > FOOBAR > END FOOBAR man csplit -- William Park <[EMAIL PROTECTED]>, Toronto, Canada ThinFlash: Linux thin-client on USB key (flash) drive http://home.eol.ca/~parkw/thinflash.html

a list of Checkbuttons

2005-08-29 Thread William Gill
OK I'm tired, I've got a cold, and my brain isn't working very well. I have a result set ( a tuple of tuples) from a db. Each element has two elements; classification number, and classification heading. i.e. result=((001,'heading one'),(002,'heading two'),...) classification numbers may not

Re: python xml DOM? pulldom? SAX?

2005-08-29 Thread William Park
TACK[2]} in title.page.*) title=$1 ;; text.revision.page) text=$1 ;; esac } end() # Usage: end tag { case $1 in page) echo "title=$title text=$text" ;; esac } expat -s start -d data -e end < f

Re: formal math ?

2005-08-28 Thread William Park
ther from a library or function imported from module. For simple cases, I use RPN calculator recently added to Bash shell, like rpn 'f(x)= 1 +' 0 1 secant = rpn 'f(x)= 1 +' 'fd(x)= 1' 0 newton = -- William Park <[EMAIL PROTECTED]>, Toronto, Can

Re: a question about tkinter StringVars()

2005-08-25 Thread William Gill
Eric Brunel wrote: > On Wed, 24 Aug 2005 15:07:27 GMT, William Gill <[EMAIL PROTECTED]> wrote: > >> Working with tkinter, I have a createWidgets() method in a class. >> Within createWidgets() I create several StringVars() and >> assign them to the textvari

prevent callback during initialization

2005-08-25 Thread William Gill
I am creating several tkinter widgets. In my classes they each have a change() method that is a callback to various IntVar, and StringVar objects. Everything works fine, but don't really want to trigger the callback when I am initializing each widget/control variable. I can use a "flag" like se

Re: a question about tkinter StringVars()

2005-08-24 Thread William Gill
Eric Brunel wrote: > On Wed, 24 Aug 2005 15:07:27 GMT, William Gill <[EMAIL PROTECTED]> wrote: > >> Working with tkinter, I have a createWidgets() method in a class. >> Within createWidgets() I create several StringVars() and >> assign them to the textvari

a question about tkinter StringVars()

2005-08-24 Thread William Gill
Working with tkinter, I have a createWidgets() method in a class. Within createWidgets() I create several StringVars() and assign them to the textvariable option of several widgets. Effectively my code structure is: def createWidgets(self): ... var = StringVar() Entry(master,textvar

Re: split function

2005-08-22 Thread William Park
input for each line, so the out put should look > like > 0 2 3 4 > and so on > 1 2 4 > 2 3 > 3 4 Use Python's dictionary (also known as associative array or hash). Read documentation. -- William Park <[EMAIL PROTECTED]>, Toronto, Canada ThinFlash: Linux thin-client

tkinter text widget question

2005-08-21 Thread William Gill
The tkinter text widget uses indexes to identify row:column offsets within the text, but it seems counter intuitive to have to convert row and column integers to a string like "0.1'. It's great that index can take a string, but what about looping through rows and columns? Am I missing a way t

Re: tkinter text widget question

2005-08-21 Thread William Gill
rafi wrote: > William Gill wrote: > >> The tkinter text widget uses indexes to identify row:column offsets >> within the text, but it seems counter intuitive to have to convert row >> and column integers to a string like "0.1'. It's great that inde

Re: Zope, Python 2.4 pythonScripts import problem

2005-08-17 Thread William Heymann
On Tuesday 16 August 2005 07:09 am, [EMAIL PROTECTED] wrote: > I see that Python 2.4.x does not work with Zope-2-7-6 properly. When I > start zope I get warning that I should recompile my pythonScripts by > executing manage_addProduct/PythonScripts/recompile. I do it and get > list of scripts whoos

Re: help with mysql cursor.execute()

2005-08-16 Thread William Gill
Dennis Lee Bieber wrote: > On Sun, 14 Aug 2005 19:28:04 GMT, William Gill <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >>I have been trying to pass parameters as indicated in the api. >>when I use: >> >> sql= 's

Re: help with mysql cursor.execute()

2005-08-15 Thread William Gill
Steve Holden wrote: > William Gill wrote: > >> I have been testing and it seems that: >> >> 1- Cursor.execute does not like '?' as a placeholder in sql >> > The particular format required by each DBI-compatible module should be > available as t

Re: help with mysql cursor.execute()

2005-08-14 Thread William Gill
rks. Between your comments re: column names and table names , and the notes in cursor.py, I was able to figure it out. FYI I wanted to create a tableHandler class that could be extended for individual tables. That's why the query needs to accept variables for tablename. Thanks. Bill S

<    1   2   3   4   5   6   >