Re: wxpython tutorials

2005-02-24 Thread Harlin Seritt
Here is the old one... http://www.wxpython.org/tutorial.php It truly is a short tutorial though. This one's even better: http://wiki.wxpython.org/index.cgi/FrontPage I am not a wxPython enthusiast. I like Tkinter much better. If you have an interest, take a look at: http://www.pythonware.com/lib

Re: Default value for Listbox (Tkinter)

2005-02-24 Thread Jørgen Cederberg
Harlin Seritt wrote: Whenever I set up something similar: vals = ['1', '2','3'] for v in vals: listbox.inset(END, v) I notice that when this listbox is displayed, there is never a default value. How can I make sure that one of the indices is selected by default? Hi Harlin, you must use the selec

Re: web status display for long running program

2005-02-24 Thread Paul Rubin
"Kamilche" <[EMAIL PROTECTED]> writes: > I was inspired to enhance your code, and perform a critical bug-fix. > Your code would not have sent large files out to dialup users, because > it assumed all data was sent on the 'send' command. I added code to > check for the number of bytes sent, and loop

Re: Converting HTML to ASCII

2005-02-24 Thread HC Hörsch
Try Beautiful Soup! 1) Be able to handle badly formed, or illegal, HTML, as best as possible. From the description: "It won't choke if you give it ill-formed markup: it'll just give you access to a correspondingly ill-formed data structure." Can anyone direct me to something which could help me

Re: Best IDe

2005-02-24 Thread Ville Vainio
> "Jaime" == Jaime Wyant <[EMAIL PROTECTED]> writes: Jaime> What wing does have going for it is a REALLY good Jaime> auto-completion system. Yeah it's slow, but its good. You Jaime> wing hints as to what objects are by using isinstance(). Jaime> For example, the code below te

Re: web status display for long running program

2005-02-24 Thread Kamilche
Cute! Thanks for posting that. I too like the 'web interface' concept, it has made SmoothWall a pleasure to use, even on older machines. I was inspired to enhance your code, and perform a critical bug-fix. Your code would not have sent large files out to dialup users, because it assumed all data w

Re: wanted: C++ parser written in Python

2005-02-24 Thread mep
"mep" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Try ANTLR with python code generation: > http://www.antlr.org/ > > And C++ grammers: > http://www.antlr.org/grammar/cpp > > You can generate a c++ parser in python with the above. ^ Sorry. Haven't look into the stu

Re: wanted: C++ parser written in Python

2005-02-24 Thread mep
Try ANTLR with python code generation: http://www.antlr.org/ And C++ grammers: http://www.antlr.org/grammar/cpp You can generate a c++ parser in python with the above. -- Best Regards, Wang Kebo http://www.huihoo.org/~mep "Franz Steinhaeusler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL

Re: Nevow examples

2005-02-24 Thread Ed Suominen
Travis, that's a very nice use of Nevow. I'm going to look into using it for documenting my own stuff. Here's another example, my boss's web site, which uses Twisted/Nevow to implement virtual hosting, dynamic image generation with caching, dynamically-updated parsing of a site-wide config file th

Re: [perl-python] generic equivalence partition

2005-02-24 Thread Michael Spencer
David Eppstein wrote: In article <[EMAIL PROTECTED]>, "Xah Lee" <[EMAIL PROTECTED]> wrote: given a list aList of n elements, we want to return a list that is a range of numbers from 1 to n, partition by the predicate function of equivalence equalFunc. In the worst case, this is going to have to

Unit testing - one test class/method, or test class/class

2005-02-24 Thread Edvard Majakari
Hi, I just found py.test[1] and converted a large unit test module to py.test format (which is actually almost-no-format-at-all, but I won't get there now). Having 348 test cases in the module and huge test classes, I started to think about splitting classes. Basically you have at least three obv

Re: Output File

2005-02-24 Thread Samantha
Thanks Steve. Appreciate it! S "Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Samantha wrote: >> input = open(r'C:\Documents and >> Settings\Owner\Desktop\somefile.html','r') >> L = input.readlines() >> input.close >> >> output = open(r'C:\Documents and >> Setting

Re: Python Online Programming Contest

2005-02-24 Thread Jack Diederich
On Thu, Feb 24, 2005 at 06:18:09PM -0800, Varun wrote: > Hi, > It is open for anyone across the world. All times are local ( GMT > +5:30). The contest will be on Feb 27 (this sunday) and i will ensure > that the times are clearly specified. How long is the contest? ICFP is three days (first 24 ho

Re: Interesting decorator use.

2005-02-24 Thread Steven Bethard
Tom Willis wrote: Getting back to your recipe. Through the explanation of how to get parameters in there, I see how it is possible to get a logger in there. Cool. But credit where it's due, the recipe's Scott David Daniels's. =) STeVe -- http://mail.python.org/mailman/listinfo/python-list

Re: Output File

2005-02-24 Thread Steven Bethard
Samantha wrote: input = open(r'C:\Documents and Settings\Owner\Desktop\somefile.html','r') L = input.readlines() input.close output = open(r'C:\Documents and Settings\Owner\Desktop\somefile_test.html','w') for t in range(len(L)): output.writelines(L[t]) output.close I think you want to do [1]: in

Trees

2005-02-24 Thread Alex Le Dain
Is there a generic "tree" module that can enable me to sort and use trees (and nodes). Basically having methods such as .AddNode(), .GetAllChildren(), .FindNode() etc. Is this handled natively with any of the core modules? cheers, Alex. -- Poseidon Scientific Instruments Pty Ltd 1/95 Queen Victo

Re: More newbie macosx user questions

2005-02-24 Thread Kevin Walzer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 This link might help: http://www.astro.washington.edu/owen/AquaEnvVar.html Timothy Grant wrote: | I think I'm mis-understanding something about how PYTHONPATH works (at | least on OSX I didn't have this trouble on Linux). | | I have a directory where I

Re: [perl-python] generic equivalence partition

2005-02-24 Thread David Eppstein
In article <[EMAIL PROTECTED]>, David Eppstein <[EMAIL PROTECTED]> wrote: > def parti(aList,equalFunc): > eqv = [] > for i in range(len(aList)): > print i,eqv > for L in eqv: > if equalFunc(aList[i],aList[L[0]]): > L.append(i) >

wxpython tutorials

2005-02-24 Thread Raghul
hi, I want to learn Wxpython to work in windows.Is there any tutorials available?Pls specify the link that will be easy to learn for beginers like me -- http://mail.python.org/mailman/listinfo/python-list

Output File

2005-02-24 Thread Samantha
Is there a limit on the size of the file Python will read then output. I am reading a file of 433 lines and when I output the same file it only will output 421 lines. The last line is cut off also. This is the code I am using as a test. input = open(r'C:\Documents and Settings\Owner\Desktop\som

Re: Pythoncard - Mistake in walkthrough?

2005-02-24 Thread It's me
No, those are old still. "Deltones" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > As stated in the on-line WalkThrough, the information there was written for > > an older version of the program. > > > > > Hi, > > I understand, but the walkthrough I'm doing comes from the doc fo

Re: [perl-python] generic equivalence partition

2005-02-24 Thread David Eppstein
In article <[EMAIL PROTECTED]>, "Xah Lee" <[EMAIL PROTECTED]> wrote: > parti(aList, equalFunc) > > given a list aList of n elements, we want to return a list that is a > range of numbers from 1 to n, partition by the predicate function of > equivalence equalFunc. (a predicate function is a funct

Re: Trace exceptions

2005-02-24 Thread Peter Hansen
gf gf wrote: Is there anyway to do something like this: try: ... except Exception: print the Exception message (and maybe other info) import traceback traceback.print_exc() See the docs on that module for how that works and many other possibilities. -Peter -- http://mail.python.org/mailma

Trace exceptions

2005-02-24 Thread gf gf
Is there anyway to do something like this: try: ... except Exception: print the Exception message (and maybe other info) __ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail --

Re: Converting HTML to ASCII

2005-02-24 Thread William Park
gf gf <[EMAIL PROTECTED]> wrote: > Hi. I'm looking for a Python lib to convert HTML to > ASCII. Of course, a quick Google search showed > several options (although, I must say, less than I > would expect, considering how easy this is to do in > *other* languages... :| ), but, I have 2 requirement

Re: [perl-python] generic equivalence partition

2005-02-24 Thread John Machin
On Thu, 24 Feb 2005 17:48:47 -0800, Bryan <[EMAIL PROTECTED]> wrote: >Xah Lee wrote: >> another functional exercise with lists. >> >> Here's the perl documentation. I'll post a perl and the translated >> python version in 48 hours. >> >> =pod >> >> parti(aList, equalFunc) >> >> given a list aL

Re: Threading and consuming output from processes

2005-02-24 Thread Simon Wittber
> 1) How should I solve this problem? I'm an experienced Java programmer > but new to Python, so my solution looks very Java-like (hence the use of > the threading module). Any advice on the right way to approach the > problem in Python would be useful. In the past, I have used the select module t

Threading and consuming output from processes

2005-02-24 Thread Jack Orenstein
I am developing a Python program that submits a command to each node of a cluster and consumes the stdout and stderr from each. I want all the processes to run in parallel, so I start a thread for each node. There could be a lot of output from a node, so I have a thread reading each stream, for a t

Re: Python Online Programming Contest

2005-02-24 Thread Kartic
Harlin Seritt said the following on 2/24/2005 8:30 PM: Actually MIT is an abbreviation and not an acronym in the true sense of the word :) Yes...I was caught unawares by the previous poster. But in a strange way I was using the abbreviation MIT to talk about the acronym MIT (M* Institute of Tech

Re: web status display for long running program

2005-02-24 Thread Paul Rubin
[EMAIL PROTECTED] (Brian Roberts) writes: > - I don't want to embed a full web server into the application or > require any special PC setup. That's not a big deal, just use the standard library's http server class. > - I think I know how to listen on a socket, but not sure how to send > stuff to

Re: web status display for long running program

2005-02-24 Thread Peter Hansen
Brian Roberts wrote: I have a command line Python program ... I think an optional web page would be convenient interface. The Python program would listen on some port, and if queried (by me browsing to localhost:12345 for example) would return a pretty status display. Hitting reload would update

Re: web status display for long running program

2005-02-24 Thread John Lenton
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian Roberts wrote: | I have a command line Python program that sometimes takes a bit | (several minutes) to run. I want to provide an optional method for an | impatient user (me!) to check the status of the program. The type and | amount of status i

Default value for Listbox (Tkinter)

2005-02-24 Thread Harlin Seritt
Whenever I set up something similar: vals = ['1', '2','3'] for v in vals: listbox.inset(END, v) I notice that when this listbox is displayed, there is never a default value. How can I make sure that one of the indices is selected by default? Thanks, Harlin -- http://mail.python.org/mailman

Re: Flushing print()

2005-02-24 Thread Daniel Yoo
gf gf <[EMAIL PROTECTED]> wrote: : Is there any way to make Python's print() flush : automatically, similar to...mmm...that other : language's $|=1 ? Hello gf gf, Yes; you can use the '-u' command line option to Python, which will turn off stdout/stderr buffering. : If not, how can I flush it

Re: Best IDe

2005-02-24 Thread Jaime Wyant
I demo'd wing ide and have to say it's the best commercial offering. The only other one I'm aware of is Komodo and it really can't touch Wing. But for me, wingide was slugish. I have a 1/2 gig of memory and a pretty hefty CPU - i think its a 1.6 Pentium M [it's a company issued laptop -- so im n

Re: Shift Confusion

2005-02-24 Thread Kamilche
> Quite. Although you can sort of see how one might naively arrive at this > conclusion: one 7-bit char takes 0...127, which when you put it into an > 8-bit byte leaves 128...255 unused for a second char > > James Yep, that's what I was doing. Guess I was too tired to program usefully last nig

Re: Python Online Programming Contest

2005-02-24 Thread Varun
Hi, It is open for anyone across the world. All times are local ( GMT +5:30). The contest will be on Feb 27 (this sunday) and i will ensure that the times are clearly specified. -Varun -- http://mail.python.org/mailman/listinfo/python-list

Re: A few q's on python files.

2005-02-24 Thread Peter Hansen
Tim Roberts wrote: There are packages (like py2exe) that can convert your script into an executable, but they are essentially installers. They package your script, and all the scripts and libraries it needs, into a single file along with the interpreter. When the .exe is executed, it extracts the

Flushing print()

2005-02-24 Thread gf gf
Is there any way to make Python's print() flush automatically, similar to...mmm...that other language's $|=1 ? If not, how can I flush it manually? sys.stdout.flush() didn't seem to work. __ Do you Yahoo!? Yahoo! Mail - now with 250MB free stor

Re: [perl-python] generic equivalence partition

2005-02-24 Thread Bryan
Xah Lee wrote: another functional exercise with lists. Here's the perl documentation. I'll post a perl and the translated python version in 48 hours. =pod parti(aList, equalFunc) given a list aList of n elements, we want to return a list that is a range of numbers from 1 to n, partition by the pred

Re: user interface for python

2005-02-24 Thread Peter Hansen
Mike Meyer wrote: "There are no portable programs, only ported programs." -- John Gilmore (?) This doesn't really ring true, unless one insists on defining "portable" to include the idea of "universally". I've got dozens of Python utilities that run equally well on my Linux machines and my W

web status display for long running program

2005-02-24 Thread Brian Roberts
I have a command line Python program that sometimes takes a bit (several minutes) to run. I want to provide an optional method for an impatient user (me!) to check the status of the program. The type and amount of status information doesn't fit nicely into a --verbose or logger -- either too litt

Re: Best IDe

2005-02-24 Thread Harlin Seritt
IDLE, PytonWin and SPE are all free and offer all of the important features you'll see even in commercial IDE's. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Online Programming Contest

2005-02-24 Thread Harlin Seritt
Actually MIT is an abbreviation and not an acronym in the true sense of the word :) -- http://mail.python.org/mailman/listinfo/python-list

Best IDe

2005-02-24 Thread Jubri Siji
Please i am new to python , whats the best IDE to start with -- http://mail.python.org/mailman/listinfo/python-list

Converting HTML to ASCII

2005-02-24 Thread gf gf
Hi. I'm looking for a Python lib to convert HTML to ASCII. Of course, a quick Google search showed several options (although, I must say, less than I would expect, considering how easy this is to do in *other* languages... :| ), but, I have 2 requirements, which none of them seem to meet: 1) Be

Re: searching pdf files for certain info

2005-02-24 Thread Follower
rbt <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Not really a Python question... but here goes: Is there a way to read > the content of a PDF file and decode it with Python? I'd like to read > PDF's, decode them, and then search the data for certain strings. I've had succes

Nevow examples

2005-02-24 Thread Travis Oliphant
There was a request for nevow examples. Nevow is a fantastic web-development framework for Python. I used nevow to create http://www.scipy.org/livedocs/ This site uses nevow and self introspection to produce (live) documentation for scipy based on the internal docstrings. It would be nice to

Re: duplicate file finder

2005-02-24 Thread Lowell Kirsh
It looks pretty good, but I'll have to take a better look later. Out of curiosity, why did you convert the first spaces to pipes rather than add the code as an attachment? Lowell Christos TZOTZIOY Georgiou wrote: On Wed, 23 Feb 2005 01:56:02 -0800, rumours say that Lowell Kirsh <[EMAIL PROTECTED

Re: Interesting decorator use.

2005-02-24 Thread Tom Willis
On Thu, 24 Feb 2005 15:20:30 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: > Tom Willis wrote: > >>> Question on decorators in general. Can you parameterize those? > > > > Wow thanks for the explanation!! Some of it is a bit mind bending to > > me at the moment , but I'm going to mess with it a

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread John Machin
On Thu, 24 Feb 2005 16:51:22 -0500, Christopher De Vries <[EMAIL PROTECTED]> wrote: [snip] >I think this is a definite improvement... especially putting the buffer size >and line terminators as optional arguments, and handling empty files. I think, >however that the if splitstr[-1]: ... else: ...

Re: Python Online Programming Contest

2005-02-24 Thread Kartic
Will Stuyvesant said the following on 2/24/2005 5:10 PM: [Varun] For details about samhita http://www.samhita.info/ "The Madras Institute of Technology (MIT)" it says there. The MIT acronym is taken already guys.. Will - It is a local acronym! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and "Ajax technology collaboration"

2005-02-24 Thread Evan Simpson
John Willems wrote: Interesting GUI developments, it seems. Anyone developed a "Ajax" application using Python? Very curious Not what you meant, perhaps, but http://weboggle.shackworks.com has a Javascript/HTML/CSS one-page client that uses XMLHttpRequest to talk to a Python back-end. The re

Re: Python and "Ajax technology collaboration"

2005-02-24 Thread Valentino Volonghi aka Dialtone
Chris <[EMAIL PROTECTED]> wrote: > Does anyone else have any Nevow examples? Nevow SVN is full of examples ranging from a simple hello world to a complete blog engine with xml-rpc, smtp and web interfaces for adding new posts and an atom feed, or even a live chat or a pastebin or an image uploade

Re: pyGoogle is fun and easy to use, and thinks Python is the best programming language

2005-02-24 Thread Andy Robinson
Regrettably, inserting "Visual Basic" into the list produces a different winner. I think you want some very subtle hard coding which limits it to on-space-delimited languages :-( - Andy -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting decorator use.

2005-02-24 Thread Steven Bethard
Tom Willis wrote: Question on decorators in general. Can you parameterize those? Wow thanks for the explanation!! Some of it is a bit mind bending to me at the moment , but I'm going to mess with it a bit. Oh, I also should have mentioned that there's some explanation at: http://www.python.org/peps

Re: Python Online Programming Contest

2005-02-24 Thread Terry Reedy
"Varun" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi Friends, > Department of Information Technology, Madras Institute of Technology, > Anna University, India > is conducting a technical symposium, Samhita. As a part of samhita, an > Online Programming Contest is scheduled on

Re: Python Online Programming Contest

2005-02-24 Thread Will Stuyvesant
> [Varun] > For details about samhita http://www.samhita.info/ "The Madras Institute of Technology (MIT)" it says there. The MIT acronym is taken already guys.. -- no scheme no glory -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting decorator use.

2005-02-24 Thread Tom Willis
On Thu, 24 Feb 2005 15:00:46 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: > Tom Willis wrote: > > Question on decorators in general. Can you parameterize those? > > > > If I wanted to something and after the function call for example, I > > would expect something like this would work. > > > > d

Re: update images inside a mysql database

2005-02-24 Thread Jonas Meurer
On 24/02/2005 Gabriel Cooper wrote: > I've never tried extensively to use images inside a database (too slow > for most of my uses), but I thought I'd drop in to point out that you > should, for security reasons, be using place holders on your sql. It > might just fix your image problem as well,

Re: Interesting decorator use.

2005-02-24 Thread Steven Bethard
I wrote: Tom Willis wrote: Question on decorators in general. Can you parameterize those? [snip] If you want to call prepostdecorator with 2 arguments, you need to write it this way. A few options: Sorry, I forgot my favorite one: (4) Use a class and functional.partial: py> class prepostdecorato

Re: Interesting decorator use.

2005-02-24 Thread Steven Bethard
Tom Willis wrote: Question on decorators in general. Can you parameterize those? If I wanted to something and after the function call for example, I would expect something like this would work. def prepostdecorator(function,pre,post): def wrapper(*args,**kwargs): pre() result =

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Christopher De Vries
On Fri, Feb 25, 2005 at 07:56:49AM +1100, John Machin wrote: > Try this: > !def readweird(f, line_end='\0', bufsiz=8192): > !retain = '' > !while True: > !instr = f.read(bufsiz) > !if not instr: > !# End of file > !break > !splitstr = ins

Re: [perl-python] exercise: partition a list by equivalence

2005-02-24 Thread Paul McGuire
A slightly better version, only walks the set of cumulative list of sets once per pairing. -- Paul .import sets . .input = [[1, 2], [3, 4], [2, 3], [4, 5]] .input = [[1, 2], [3, 4], [4, 5]] .input = [[1, 2],[2,1], [3, 4], [4, 5],[2,2],[2,3],[6,6]] . .def merge(pairings): .ret

Re: Python and "Ajax technology collaboration"

2005-02-24 Thread Chris
Does anyone else have any Nevow examples? In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > aurora <[EMAIL PROTECTED]> wrote: > > > It was discussed in the last Bay Area Python Interest Group meeting. > > > > Thursday, February 10, 2005 > > Agenda: Developing Responsive GUI Applicati

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread John Machin
On Thu, 24 Feb 2005 14:51:07 -0500, Christopher De Vries <[EMAIL PROTECTED]> wrote: > >The other modification would be an option to ignore multiple nulls in a row, >rather than returning empty strings, which could be done in a similar way. > Why not leave this to the caller? Efficiency?? Filterin

Re: Mapping operator tokens to special methods

2005-02-24 Thread jamesthiele . usenet
John Machin wrote: >>> eval('1+2') 3 -- Yeah, that's what I decided to do. -- http://mail.python.org/mailman/listinfo/python-list

More newbie macosx user questions

2005-02-24 Thread Timothy Grant
I think I'm mis-understanding something about how PYTHONPATH works (at least on OSX I didn't have this trouble on Linux). I have a directory where I store libraries that I'm playing around with. However, for some reason python can't find the library. Since I'm using PyQt, I use pythonw, but the re

Re: Mapping operator tokens to special methods

2005-02-24 Thread John Machin
On 24 Feb 2005 10:57:58 -0800, [EMAIL PROTECTED] wrote: >I was starting to write a dictionary to map operator strings to their >equivalent special methods such as: >{ > '+' : 'add', > '&' : 'and_' >} > >The idea is to build a simple interactive calculator. > >and was wondering if there is alread

Python Online Programming Contest

2005-02-24 Thread Varun
Hi Friends, Department of Information Technology, Madras Institute of Technology, Anna University, India is conducting a technical symposium, Samhita. As a part of samhita, an Online Programming Contest is scheduled on Sunday, 27 Feb 2005. This is the first Online Programming Contest in India to s

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread John Machin
On Thu, 24 Feb 2005 11:53:32 -0500, Christopher De Vries <[EMAIL PROTECTED]> wrote: >On Wed, Feb 23, 2005 at 10:54:50PM -0500, Douglas Alan wrote: >> Is there a canonical way of iterating over the lines of a file that >> are null-separated rather than newline-separated? > >I'm not sure if there is

Re: Interesting decorator use.

2005-02-24 Thread Tom Willis
On Thu, 24 Feb 2005 11:15:07 -0800, Scott David Daniels <[EMAIL PROTECTED]> wrote: > > I have started doing the following to watch for exceptions in wxPython. > I'd like any input about (A) the interface, and (B) the frame before I > throw it in the recipes book. > > import wx, os, sys >

Re: Trouble with mysql-python 1.2.0 on Solaris 8 sparc

2005-02-24 Thread Alec Wysoker
Do you mean the python glue code? I am having this problem when python is not in the picture at all, just running mysql command-line client. Presumably my client is 4.1.10, as it came in a built package along with the 4.1.10 server. In fact, the following seems to indicate that it is the righ

Re: Trouble with mysql-python 1.2.0 on Solaris 8 sparc

2005-02-24 Thread Steve Holden
Alec Wysoker wrote: Hi Steve, Thanks for the response. I don't think this is the problem. When I connect to the remote machine, it says this: Your MySQL connection id is 58 to server version: 4.1.0-alpha-standard When I connect to the local server, I get this: Your MySQL connection id is 6 to se

Re: Shift Confusion

2005-02-24 Thread Steve Holden
Dennis Lee Bieber wrote: On Thu, 24 Feb 2005 14:22:59 -, "Richard Brodie" <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: "John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Essentially, it should be possible to use a 'packed string' format in Python, wh

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Christopher De Vries
On Thu, Feb 24, 2005 at 02:03:52PM -0500, Douglas Alan wrote: > Thanks for the generator. It returns an extra blank line at the end > when used with "find -print0", which is probably not ideal, and is > also not how the normal file line iterator behaves. But don't worry > -- I can fix it. Sorry.

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Scott David Daniels
Douglas Alan wrote: ... In any case, as a suggestion to the whomever it is that arranges for stuff to be put into the standard library, there should be something like this there, so everyone doesn't have to reinvent the wheel (even if it's an easy wheel to reinvent) for something that any sysadmin

Re: Mapping operator tokens to special methods

2005-02-24 Thread Steven Bethard
[EMAIL PROTECTED] wrote: I was starting to write a dictionary to map operator strings to their equivalent special methods such as: { '+' : 'add', '&' : 'and_' } The idea is to build a simple interactive calculator. and was wondering if there is already something like this builtin? Or is there a

Interesting decorator use.

2005-02-24 Thread Scott David Daniels
I have started doing the following to watch for exceptions in wxPython. I'd like any input about (A) the interface, and (B) the frame before I throw it in the recipes book. import wx, os, sys errorframe = None def watcherrors(function): '''function decorator to display Exception

[ANN] TamTam collaboration software

2005-02-24 Thread Aleksandar Erkalovic
Hi, on address (temporary): http://tamtam.mi2.hr:/NoviTam/ you can find TamTam collaborative software. This is new version (rewrite) using Twisted and Nevow. This is not official announcement just a small notice for people who are interested to check it, give me some critics, help in id

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Douglas Alan
Christopher De Vries <[EMAIL PROTECTED]> writes: > I'm not sure if there is a canonical method, but I would > recommending using a generator to get something like this, where 'f' > is a file object: Thanks for the generator. It returns an extra blank line at the end when used with "find -print0"

Mapping operator tokens to special methods

2005-02-24 Thread jamesthiele . usenet
I was starting to write a dictionary to map operator strings to their equivalent special methods such as: { '+' : 'add', '&' : 'and_' } The idea is to build a simple interactive calculator. and was wondering if there is already something like this builtin? Or is there a better way to do what

[ANN] dateutil 0.9

2005-02-24 Thread Gustavo Niemeyer
https://moin.conectiva.com.br/DateUtil Description --- The dateutil module provides powerful extensions to the standard datetime module, available in Python 2.3+. Features - Computing of relative deltas (next month, next year, next monday, last week of month, etc); - Comp

Re: Trouble with mysql-python 1.2.0 on Solaris 8 sparc

2005-02-24 Thread Steve Holden
Alec Wysoker wrote: Hi Andy, Thanks for your message. It turned out that I had installed 64-bit mySql on a 32-bit machine. I'm amazed it worked at all. Anyway, I finally got mysql-python built, but I'm unable to connect to a machine on a remote host. The problem doesn't seem to be with the pyth

Re: update images inside a mysql database

2005-02-24 Thread Gabriel Cooper
Jonas Meurer wrote: def i_update(image, imgid): image = "%s" % (image) sql_exec = """UPDATE Images SET Image='%s' WHERE ImgID = '%s' """ % (image, imgid) o = open("/tmp/file.jpg", "w") o.write(image) o.close() db_connect.cursor.execute(sql_e

Re: Need some Python help

2005-02-24 Thread Roger Upole
There's a bug in python's tokenizer that's triggered when the generated wrapper code for a COM object has lines longer than 512. See below link for a workaround: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1085454&group_id=78018 Roger "Matt Upton" <[EMAIL PROTECTED]> wr

Re: Shift Confusion

2005-02-24 Thread James Kew
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 23 Feb 2005 22:06:54 -0800, "Kamilche" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> >> Essentially, it should be possible to use a 'packed string' format in >> Python, where as long as t

Re: what is wrong?

2005-02-24 Thread neutrinman
I appreciate all of your help. I learned a lot form your adovice. Thanks. Mr. Bieber, it worked fine. Thanks again. -- http://mail.python.org/mailman/listinfo/python-list

update images inside a mysql database

2005-02-24 Thread Jonas Meurer
hello, i develop a project with a mysql interface. one mysql table holds all the images for my project. everything works quite well so far, except i'm not able to upload images into the database. the following function does the mysql UPDATE, it requires the image and the image ID as arguments. a

Re: arrow keys bug

2005-02-24 Thread Daniel Alexandre
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there, On Feb 24, 2005, at 16:25, A.T. Hofkamp wrote: and for home, end, etc. Does anyone here knows how I can strip those keys? Thanks in advance. One solution is to read the input yourself character by character, and delete anything that is not pri

Re: Vectors in Visual Python

2005-02-24 Thread FLChamp
Thanks for all your help everyone, if only it had addressed what I had asked I may have actually learned something about Python!! If anything was addressed to my problem then it has completely passed me by as most points were clearly made by a computer scientist and I am not one of those in the sl

Re: Selective HTML doc generation

2005-02-24 Thread Brian van den Broek
Graham Ashton said unto the world upon 2005-02-24 04:54: Thanks Brian, much appreciated. Looks quite straightforward. Graham Hi Graham, glad it helped -- I think this marks the first time I've given a useful answer to a non-trivial question on comp.lang.python. :-) G: Hi. I'm looking for a docum

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Scott David Daniels
Douglas Alan wrote: Is there a canonical way of iterating over the lines of a file that are null-separated rather than newline-separated? Sure, I can implement my own iterator using read() and split(), etc., but considering that using "find -print0" is so common, it seems like there should be a mo

Re: what is wrong?

2005-02-24 Thread TZOTZIOY
On 24 Feb 2005 08:34:09 -0800, rumours say that [EMAIL PROTECTED] might have written: >I cannot find out why the following code generates the error: >Traceback (most recent call last): > File "D:/a/Utilities/python/ptyhon22/test.py", line 97, in ? >main() > File "D:/a/Utilities/python/ptyhon

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Christopher De Vries
On Wed, Feb 23, 2005 at 10:54:50PM -0500, Douglas Alan wrote: > Is there a canonical way of iterating over the lines of a file that > are null-separated rather than newline-separated? I'm not sure if there is a canonical method, but I would recommending using a generator to get something like this

Re: what is wrong?

2005-02-24 Thread deelan
[EMAIL PROTECTED] wrote: (B(...) (B> self.feed = feed# I wrote this (B> AttributeError: can't set attribute (B> (B> I add some codes to a program on a book. The lines that have "I wrote (B> this" comment is the added codes. Could anyone tell me what is worng (B> here? (B (

Re: duplicate file finder (was: how can I make this script shorter?)

2005-02-24 Thread TZOTZIOY
On Wed, 23 Feb 2005 01:56:02 -0800, rumours say that Lowell Kirsh <[EMAIL PROTECTED]> might have written: >Good idea about hashing part of the file before comparing entire files. >It will make the script longer but the speed increase will most likely >make it worth it. My dupefind module was on

what is wrong?

2005-02-24 Thread neutrinman
I cannot find out why the following code generates the error: (BTraceback (most recent call last): (B File "D:/a/Utilities/python/ptyhon22/test.py", line 97, in ? (Bmain() (B File "D:/a/Utilities/python/ptyhon22/test.py", line 60, in main (Bcrit = Critter(crit_name) (B File "D:/a/U

what is wrong?

2005-02-24 Thread neutrinman
I cannot find out why the following code generates the error: (BTraceback (most recent call last): (B File "D:/a/Utilities/python/ptyhon22/test.py", line 97, in ? (Bmain() (B File "D:/a/Utilities/python/ptyhon22/test.py", line 60, in main (Bcrit = Critter(crit_name) (B File "D:/a/U

Re: Font size

2005-02-24 Thread Tobiah
from random import randint rand = randint(0,36) print rand Don't forget about the double zero slot. Tobiah -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >