Re: converting file formats to txt

2006-07-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Gaurav Agarwal wrote: > Am looking for a python script that can convert fileformats to txt > format. Am unable to find anything in python. Currently the InfoCon > projects looks pretty good to use, but it is return in java. What do you mean by 'fileformats'? A script that

Re: simple script - Tkinter question.

2006-07-03 Thread Eric Brunel
On Tue, 04 Jul 2006 05:02:39 +0200, jkuo22 <[EMAIL PROTECTED]> wrote: > Hi everyone, > > Here is my simple Tkinter script: > > ## start of entry.py > from Tkinter import * > root=Tk() > e1=Entry(root, width=16) > e1.pack() > e2=Entry(root, width=16) > e2.pack() > mainloop() > ## end > > First, it

Re: my newsgroup base database. (test)

2006-07-03 Thread Netkiller
Netkiller 写道: > Netkiller 写道: > > > #!/usr/bin/python > > # -*- coding: utf-8 -*- > > """ > > Project: Network News Transport Protocol Server Program > > Description: > > 基于数据库的新闻组,实现BBS前端使用NNTP协议来访问贴子 > > Database SQL Script follow: -- phpMyAdmin SQL Dump -- version 2.7.0-rc1 -- http://www.ph

RE: ascii character - removing chars from string update

2006-07-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, bruce wrote: > here is a sample of the text i'm looking to do hte search/replace for... > > bgcolor="#ff" > ACCT 209 - SURVEY OF ACCT PRIN   > > i'm trying to figure out how to replace the " " with a ''. in html, the > ' ' char is not a valid

Re: my newsgroup base database. (test)

2006-07-03 Thread Netkiller
Netkiller 写道: > #!/usr/bin/python > # -*- coding: utf-8 -*- > """ > Project: Network News Transport Protocol Server Program > Description: > 基于数据库的新闻组,实现BBS前端使用NNTP协议来访问贴子 import sys,re import MySQLdb class NewsDB: conn = None cursor = None def connect(self): try:

Re: How can I access the 'Entry' string in another function?

2006-07-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, arvind wrote: > i've created the myclass instance and calles the "function second()". > i want to access the text entered in 'w' through Entry widget in > "function third()" > i am getting the 'fuction not having 'w' attribute error. > how to overcome it? Make `w` an attri

my newsgroup base database. (test)

2006-07-03 Thread Netkiller
#!/usr/bin/python # -*- coding: utf-8 -*- """ Project: Network News Transport Protocol Server Program Description: 基于数据库的新闻组,实现BBS前端使用NNTP协议来访问贴子 Reference: NNTP协议: http://www.mibsoftware.com/userkt/0099.htm 正则表达式: http://wiki.woodpecker.org.cn/moin/RegExpInPython#head-235876538484

converting file formats to txt

2006-07-03 Thread Gaurav Agarwal
Hi All, Am looking for a python script that can convert fileformats to txt format. Am unable to find anything in python. Currently the InfoCon projects looks pretty good to use, but it is return in java. Thanks and Regards, Gaurav Agarwal -- http://mail.python.org/mailman/listinfo/python-list

converting file formats to txt

2006-07-03 Thread Gaurav Agarwal
Hi All, Am looking for a python script that can convert fileformats to txt format. Am unable to find anything in python. Currently the InfoCon projects looks pretty good to use, but it is return in java. Thanks and Regards, Gaurav Agarwal -- http://mail.python.org/mailman/listinfo/python-list

How to specify default directory for saving files in IDLE

2006-07-03 Thread JohnJohnUSA
I am using Python IDLE 2.4.3 on Windows XP. I use File->New Window to create a new program. In the Save As dialog, it always takes me to the python program directory (where python is installed). Since this is not where I want to save my source file, I have to select the directory I want. Is there

Re: Controlling Windows Media Player from Python

2006-07-03 Thread Roger Upole
"Jeffrey Barish" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there a way to interact with Windows Media Player from Python? I would > like to be able to do things like tell WMP to play a given sound file or to > ask WMP for metadata about a sound file. > -- > Jeffrey Barish

Re: ascii character - removing chars from string

2006-07-03 Thread Simon Forman
bruce wrote: > simon... > > the ' ' is not to be seen/viewed as text/ascii.. it's a representation > of a hex 'u\xa0' if i recall... Did you not see this part of the post that you're replying to? > 'nbsp': '\xa0', My point was not that '\xa0' is an ascii character... It was that your initial re

Re: Can I do it using python?? about xterm and telnet

2006-07-03 Thread Marc Schoechlin
valpa schrieb: > Can I do it automatically by python? After that, there have 20 xterm > consoles opened and telneted to their corresponding servers. Then I > could start to type command in these xterms. Is there a framework/module to automate ssh-sessions/scp-filetransfers with python-programmi

Re: a question about "return"

2006-07-03 Thread Tim Roberts
"yaru22" <[EMAIL PROTECTED]> wrote: >In one of the examples in the book I'm reading, it says: > >def __init__(self): >... >... >... >return > >It has nothing after "return". I expected it to have some number like 0 >or 1. > >What does it mean to have nothing after return? It means

How can I access the 'Entry' string in another function?

2006-07-03 Thread arvind
hi all, i've created the myclass instance and calles the "function second()". i want to access the text entered in 'w' through Entry widget in "function third()" i am getting the 'fuction not having 'w' attribute error. how to overcome it? class myclass: senter='arvind' def __init__(self

Re: a question about "return"

2006-07-03 Thread Grant Edwards
On 2006-07-04, yaru22 <[EMAIL PROTECTED]> wrote: > What does it mean to have nothing after return? It means to return None. > Why do we even include "return" if we are not putting any > value after? If it's the last statement in the function, you don't need it. Some people do it just as a forma

"Next Generation Artificial Intelligence, Artificial Mind - Part One - Basic Architecture and Cognitive Structure"

2006-07-03 Thread tommak
It's a dream of human beings to build machines that can think and behave like human beings. The most important part of of such a machine is an artificial mind that can emulate the cognitive processing of human mind. This book, "Next Generation Artificial Intelligence, Artificial Mind - Part One

RE: ascii character - removing chars from string update

2006-07-03 Thread bruce
update... here is a sample of the text i'm looking to do hte search/replace for... ACCT 209 - SURVEY OF ACCT PRIN   i'm trying to figure out how to replace the " " with a ''. in html, the ' ' char is not a valid ascii char... in perl, i'd do 's / //' and be done with it

Re: sqlite3 in Python 2.5b1: my out-of-the-box experience

2006-07-03 Thread Avizoa
John Machin wrote: > Apologies in advance if this is a bit bloggy, but I'd like to get > comments on whether I've lost the plot (or, more likely, failed to > acquire it) before I start reporting bugs etc. These are not, in fact, bugs. One of SQLite's features is that it does not enforce type, mea

Best Python web-hosting?

2006-07-03 Thread Luis M. Gonzalez
Hi Walter,   I just read your message about "dollar-hosting.org" that you posted a couple months ago, and I wonder how was your experience with this service so far.   How does mod_python work? Are the basic handlers properly configured? (publisher, psp) Is it easy to use?   Is it possible to

Re: Out of the box database support

2006-07-03 Thread Alex Martelli
BartlebyScrivener <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > > http://www.gutenberg.org/etext/13 > > Leave it to the guy who can quote Borges and The Celestial Emporium of > Benevolent Knowledge while explaining multiple inheritance. > > See Cookbook 2nd Ed pg. 234 ...;-) Alex --

Re: Tkinter function variable passing

2006-07-03 Thread arvind
please send it to-[EMAIL PROTECTED] Fredrik Lundh wrote: > "arvind" <[EMAIL PROTECTED]> wrote: > > > thanx for replynig. > > but functios are independent > > and the button is inside one of the functions. > > will u please reshape ur code and send it to me? > > where do I send the invoice ?

Re: Threads and time.strptime()

2006-07-03 Thread John Machin
On 3/07/2006 6:57 PM, Maximilian Michel wrote: > Hi all, > > I have an interesting problem: > I have written code, that reads a logfile and parses it for date string > (Thu Jun 29 14:01:23 2006). > Standalone everthing works fine, all is recognized. > > But if I let the same code run in a thread,

RE: ascii character - removing chars from string

2006-07-03 Thread bruce
simon... the ' ' is not to be seen/viewed as text/ascii.. it's a representation of a hex 'u\xa0' if i recall... i'm looking to remove or replace the insances with a ' ' (space) -bruce -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Simon Forman Sent: Mond

Re: Out of the box database support

2006-07-03 Thread BartlebyScrivener
Alex Martelli wrote: > http://www.gutenberg.org/etext/13 Leave it to the guy who can quote Borges and The Celestial Emporium of Benevolent Knowledge while explaining multiple inheritance. See Cookbook 2nd Ed pg. 234 -- http://mail.python.org/mailman/listinfo/python-list

Re: inline metaclasses

2006-07-03 Thread K.S.Sreeram
Marc 'BlackJack' Rintsch wrote: > But why use a metaclass? If the meta class is only applied to *one* > class, can't you do at class level whatever the metaclass is doing!? The very fact that you can put a loop inside __metaclass__ may be reason enough for a one-off metaclass. Here's a contrived

a question about "return"

2006-07-03 Thread yaru22
In one of the examples in the book I'm reading, it says: def __init__(self): ... ... ... return It has nothing after "return". I expected it to have some number like 0 or 1. What does it mean to have nothing after return? Why do we even include "return" if we are not putting any

Re: Out of the box database support

2006-07-03 Thread Alex Martelli
Terry Hancock <[EMAIL PROTECTED]> wrote: ... > Although, I confess to ignorance on what a "snark" is or whether http://www.gutenberg.org/etext/13 Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: list comprehension

2006-07-03 Thread Terry Hancock
Andy Dingley <[EMAIL PROTECTED]> wrote: > Simon Forman wrote: > > > There's more to it, but that's the basic idea. > > This much I knew, but _why_ and _when_ would I choose to use list > comprehension (for good Python style), rather than using a simple > "traditional" loop ? They are a very co

simple script - Tkinter question.

2006-07-03 Thread jkuo22
Hi everyone, Here is my simple Tkinter script: ## start of entry.py from Tkinter import * root=Tk() e1=Entry(root, width=16) e1.pack() e2=Entry(root, width=16) e2.pack() mainloop() ## end First, it works on win2k. When I run it as 'python entry.py' on linux, both 'e1' and 'e2' appear perfectly e

sqlite3 in Python 2.5b1: my out-of-the-box experience

2006-07-03 Thread John Machin
Apologies in advance if this is a bit bloggy, but I'd like to get comments on whether I've lost the plot (or, more likely, failed to acquire it) before I start reporting bugs etc. From "What's new ...": """ # Create table c.execute('''create table stocks (date timestamp, trans varchar, symbol v

simple script - Tkinter question.

2006-07-03 Thread jkuo22
Hi everyone, Here is my simple Tkinter script: ## start of entry.py from Tkinter import * root=Tk() e1=Entry(root, width=16) e1.pack() e2=Entry(root, width=16) e2.pack() mainloop() ## end First, it works on win2k. When I run it as 'python entry.py' on linux, both 'e1' and 'e2' appear perfectly e

Re: Out of the box database support

2006-07-03 Thread Terry Hancock
BartlebyScrivener wrote: > > Thanks for the info. No thanks for the smarmy "pony" comment. > > Do you really want "smarmy" here? I don't think it works. Don't you > mean "flip" or "smart-alecky" or "facetious"? Hmm. I think the word we're looking for here is "snarky". ;-) Although, I confess to

Re: ascii character - removing chars from string

2006-07-03 Thread Simon Forman
bruce wrote: > hi... > > update. i'm getting back html, and i'm getting strings like " foo  " > which is valid HTML as the ' ' is a space. &, n, b, s, p, ; Those are all ascii characters. > i need a way of stripping/removing the ' ' from the string > > the   needs to be treated as a single char.

Re: Out of the box database support

2006-07-03 Thread BartlebyScrivener
> Thanks for the info. No thanks for the smarmy "pony" comment. Do you really want "smarmy" here? I don't think it works. Don't you mean "flip" or "smart-alecky" or "facetious"? Websters 3rd Unabridged Main Entry:smarmy Function:adjective Inflected Form:-er/-est 1 : SLEEK *smarmy-headed David Wa

Re: sending binary data over sockets

2006-07-03 Thread Simon Forman
Grant Edwards wrote: > On 2006-07-03, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > My problem now, is that I need to send certain binary data over a > > socket. That is, I want to make some bytes, and stuff them in a TCP > > packet, send them down the pipe, and then listen for a response. ...

RE: ascii character - removing chars from string

2006-07-03 Thread bruce
hi... update. i'm getting back html, and i'm getting strings like " foo  " which is valid HTML as the ' ' is a space. i need a way of stripping/removing the ' ' from the string the   needs to be treated as a single char... text = "foo cat  " ie ok_text = strip(text) ok_text = "foo cat" th

Re: Threads and time.strptime()

2006-07-03 Thread placid
Maximilian Michel wrote: > Hi all, > > I have an interesting problem: > I have written code, that reads a logfile and parses it for date string > (Thu Jun 29 14:01:23 2006). > Standalone everthing works fine, all is recognized. > > But if I let the same code run in a thread, with the same file as

Re: inline metaclasses

2006-07-03 Thread Alex Martelli
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, gangesmaster > wrote: > > > just something i thought looked nice and wanted to share with the rest > > of you: > > > class x(object): > > ... def __metaclass__(name, bases, dict): > > ... print "he

Re: ascii character - removing chars from string

2006-07-03 Thread Simon Forman
bruce wrote: > hi... > > i'm running into a problem where i'm seeing non-ascii chars in the parsing > i'm doing. in looking through various docs, i can't find functions to > remove/restrict strings to valid ascii chars. > > i'm assuming python has something like > > valid_str = strip(invalid_str) >

Re: ascii character - removing chars from string

2006-07-03 Thread Rune Strand
bruce wrote: > hi... > > i'm running into a problem where i'm seeing non-ascii chars in the parsing > i'm doing. in looking through various docs, i can't find functions to > remove/restrict strings to valid ascii chars. > > i'm assuming python has something like > > valid_str = strip(invalid_str) >

Re: Controlling Windows Media Player from Python

2006-07-03 Thread Lawrence Oluyede
Jeffrey Barish <[EMAIL PROTECTED]> wrote: > Is there a way to interact with Windows Media Player from Python? I would > like to be able to do things like tell WMP to play a given sound file or to > ask WMP for metadata about a sound file. Take a look at pywinauto, I attended the today talk at EP

Re: ascii character - removing chars from string

2006-07-03 Thread John Machin
On 4/07/2006 9:27 AM, bruce wrote: > hi... > > i'm running into a problem where i'm seeing non-ascii chars in the parsing > i'm doing. in looking through various docs, i can't find functions to > remove/restrict strings to valid ascii chars. > It's possible that you would be better off handling

Re: ascii character - removing chars from string

2006-07-03 Thread bearophileHUGS
bruce: > valid_str = strip(invalid_str) > where 'strip' removes/strips out the invalid chars... This isn't short but it is fast: import string valid_chars = string.lowercase + string.uppercase + \ string.digits + """|!'\\"£$%&/()=?^*é§_:;>+,.-<\n \t""" all_chars = "".join(map(

ascii character - removing chars from string

2006-07-03 Thread bruce
hi... i'm running into a problem where i'm seeing non-ascii chars in the parsing i'm doing. in looking through various docs, i can't find functions to remove/restrict strings to valid ascii chars. i'm assuming python has something like valid_str = strip(invalid_str) where 'strip' removes/strips

RE: Dictionary .keys() and .values() should return a set[withPython3000 in mind]

2006-07-03 Thread Delaney, Timothy (Tim)
Scott David Daniels wrote: > Delaney, Timothy (Tim) wrote: >> Plus copy-on-write isn't something you want in general - it's *much* >> slower since it needs to copy the internal data every time it's >> modified. The vast majority of uses of data structures does not >> involve concurrent modificatio

starting and stopping a program from inside a python script

2006-07-03 Thread dfaber
Aloha! I want to terminate a process/program from within a python script. For example, if I have a program say foo.sh that starts running, then I can run it from within a python script using os.popen('foo.sh') which starts a program/process say 'bar' At some point later, I want to kill 'bar'. C

Re: inline metaclasses

2006-07-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, gangesmaster wrote: > just something i thought looked nice and wanted to share with the rest > of you: > class x(object): > ... def __metaclass__(name, bases, dict): > ... print "hello" > ... return type(name, bases, dict) > ... > hello >>>

Re: Dictionary .keys() and .values() should return a set [withPython3000 in mind]

2006-07-03 Thread Scott David Daniels
Delaney, Timothy (Tim) wrote: > Plus copy-on-write isn't something you want in general - it's *much* > slower since it needs to copy the internal data every time it's > modified. The vast majority of uses of data structures does not involve > concurrent modification. But copy-on-write in the prese

Re: sending binary data over sockets

2006-07-03 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Greetings, since there was no reponse to my previous post about an > existing FastCGI server in python, I've taken to writing my own. (which > of course I'll share--*if* there's something to share ;) > > My problem now, is that I need to send certain binary data over a >

Re: Out of the box database support

2006-07-03 Thread Alex Biddle
On 7/3/06, Paul McGuire <[EMAIL PROTECTED]> wrote: > "Alex Biddle" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Hey, thanks for the reply Jean-Paul. > > > > That's pretty cool knowing that Python 2.5 will have it out of the > > box, however what about basic out-of-the-box funct

Re: sending binary data over sockets

2006-07-03 Thread thorley
> Are those not the four octets you wanted to send? Yes. My understanding of struct was broken. Sukanta corrected it for me. thank you -- matthew -- http://mail.python.org/mailman/listinfo/python-list

RE: Dictionary .keys() and .values() should return a set [withPython3000 in mind]

2006-07-03 Thread Delaney, Timothy (Tim)
Paul Rubin wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >> And a "view" of the dictionary is orders faster than creating a copy >> of it (which is required to keep k0 from changing in your example). >> If you're LUCKY, copying a dictionary is O(n), > > There are ways to do it so you

Re: sending binary data over sockets

2006-07-03 Thread thorley
> It will send the 4 bytes, binary, and not the string as you assumed. If > you want to satisfy yourself, run tcpdump (or ethereal) to observe what > is being sent. Thanks very much for the prompt reply. I'll take your word for it. I actually tried ethereal to verify my hypothesis before posting,

Re: sending binary data over sockets

2006-07-03 Thread thorley
> Python strings are binary data and can contain > - in oppostion to e.g. C-strings - null-bytes. > > So it is perfectly alright to send "only" strings over a socket. Agreed. I wasn't trying to imply it was 'wrong' just that the receiving application wouldn't interpret strings correctly. -- ht

RE: Dictionary .keys() and .values() should return a set[withPython3000 in mind]

2006-07-03 Thread Delaney, Timothy (Tim)
Paul Rubin wrote: > "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> writes: >> If you want an independent data set, you have to take a snapshot. >> For the above, that's doing: >> >> k0 = list(d.keys()) > > I don't understand. Why have .keys() at all, if it doesn't get you > an independent da

(Job) SF BAY AREA -- Python Expert

2006-07-03 Thread jscalisi
Taos is a professional IT Consulting Services firm that has been delivering technical excellence to its customers for more than 17 years. We have an immediate openning for a Unix System Administrator with excellent python scripting experience. Please contact [EMAIL PROTECTED] for immediate consid

Re: sending binary data over sockets

2006-07-03 Thread Grant Edwards
On 2006-07-03, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > My problem now, is that I need to send certain binary data over a > socket. That is, I want to make some bytes, and stuff them in a TCP > packet, send them down the pipe, and then listen for a response. > > socket.send, as best I can te

Re: sending binary data over sockets

2006-07-03 Thread Sukanta
[EMAIL PROTECTED] wrote: > Greetings, since there was no reponse to my previous post about an > existing FastCGI server in python, I've taken to writing my own. (which > of course I'll share--*if* there's something to share ;) > > My problem now, is that I need to send certain binary data over a >

Re: sending binary data over sockets

2006-07-03 Thread Diez B. Roggisch
Premature sending syndrome... Diez B. Roggisch schrieb: > [EMAIL PROTECTED] schrieb: >> Greetings, since there was no reponse to my previous post about an >> existing FastCGI server in python, I've taken to writing my own. (which >> of course I'll share--*if* there's something to share ;) >> >> My

Re: sending binary data over sockets

2006-07-03 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Greetings, since there was no reponse to my previous post about an > existing FastCGI server in python, I've taken to writing my own. (which > of course I'll share--*if* there's something to share ;) > > My problem now, is that I need to send certain binary data over a

sending binary data over sockets

2006-07-03 Thread thorley
Greetings, since there was no reponse to my previous post about an existing FastCGI server in python, I've taken to writing my own. (which of course I'll share--*if* there's something to share ;) My problem now, is that I need to send certain binary data over a socket. That is, I want to make some

Re: Classes and global statements

2006-07-03 Thread Sheldon
Scott David Daniels skrev: > Sheldon wrote: > > Hi, > > > > I have a series of classes that are all within the same file. Each is > > called at different times by the main script. Now I have discovered > > that I need several variables returned to the main script. Simple, > > right? I thought so

Re: Classes and global statements

2006-07-03 Thread Sheldon
Simon Forman skrev: > Sheldon wrote: > > Hi, > > > > I have a series of classes that are all within the same file. Each is > > called at different times by the main script. Now I have discovered > > that I need several variables returned to the main script. Simple, > > right? I thought so and sim

2006 ICFP Programming Contest registration opens

2006-07-03 Thread Tom 7
Language lovers: Registration is now open for the 9th Annual ICFP Programming Contest! http://icfpcontest.org/ The contest, associated with the International Conference on Functional Programming, will be held on the weekend of July 21-24. The contest task will be released at noon EDT on Frid

Re: Turning a callback function into a generator

2006-07-03 Thread Alex Martelli
Kirk McDonald <[EMAIL PROTECTED]> wrote: ... > > def func(callback): > > for i in [1, 2, 3, 4, 5]: > > callback(i) ... > Threads are probably a weak point of mine. I have little experience with > them, and so I am inclined to paranoia while using them. What Paranoia is the cor

inline metaclasses

2006-07-03 Thread gangesmaster
just something i thought looked nice and wanted to share with the rest of you: >>> class x(object): ... def __metaclass__(name, bases, dict): ... print "hello" ... return type(name, bases, dict) ... hello >>> instead of defining a separate metaclass function/class, you

Re: For a fast implementation of Python

2006-07-03 Thread Luis M. González
. wrote: > What is the fast way for a fast implementation of Python? > > -- > JavaScript implementation of Python > http://groups.google.it/group/JSython/ Check this out: http://codespeak.net/pypy/dist/pypy/doc/news.html -- http://mail.python.org/mailman/listinfo/python-list

Re: For a fast implementation of Python

2006-07-03 Thread John Roth
Alex Martelli wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Psyco does some JIT compiling of Python, supposedly making it faster. > > You do need to think a bit, however, beforehand. > > If you really thing that the "speed" of execution is important for your > > application, a script

Re: list comprehension

2006-07-03 Thread Simon Forman
[EMAIL PROTECTED] wrote: > I woulkdn't interate at the same time. zip takes two lists, and makes > a single list of tuples, not the other way around. The easilest > solution is > feed_list = [ix.url for ix in feeds_list_select] > feed_id = [ix.id for ix in feeds_list_select] The zip built-in fun

Re: Turning a callback function into a generator

2006-07-03 Thread Kirk McDonald
Alex Martelli wrote: > Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > > >>In article <[EMAIL PROTECTED]>, >> Kirk McDonald <[EMAIL PROTECTED]> wrote: >> >> >>>I want to somehow, in some way, provide an iteration interface to this >>>function. Thoughts? >> >>Run it in a separate thread/process?

Re: xpath question

2006-07-03 Thread Simon Forman
[EMAIL PROTECTED] wrote: > bruce wrote: > > is there anyone with XPath expertise here? i'm trying to figure out if > > there's a way to use regex expressions with an xpath query? i've seen > > references to the ability to use regex and xpath/xml, but i'm not sure how > > to do it... > > > > i have

Re: Turning a callback function into a generator

2006-07-03 Thread Alex Martelli
Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Kirk McDonald <[EMAIL PROTECTED]> wrote: > > >I want to somehow, in some way, provide an iteration interface to this > >function. Thoughts? > > Run it in a separate thread/process? Sounds best to me. Specifical

suggestion: adding weakattr to stdlib

2006-07-03 Thread gangesmaster
three-liner: reposted from python-dev for more feedback. it suggests to add the weakattr class to the standard weakref.py module. comments are welcome. [ http://article.gmane.org/gmane.comp.python.devel/81875 ] From: tomer filiba gmail.com> Subject: weakattr Newsgroups: gmane.comp.python.devel D

Re: Classes and global statements

2006-07-03 Thread Scott David Daniels
Sheldon wrote: > Hi, > > I have a series of classes that are all within the same file. Each is > called at different times by the main script. Now I have discovered > that I need several variables returned to the main script. Simple, > right? I thought so and simply returned the variables in a tup

Re: Classes and global statements

2006-07-03 Thread Simon Forman
Sheldon wrote: > Hi, > > I have a series of classes that are all within the same file. Each is > called at different times by the main script. Now I have discovered > that I need several variables returned to the main script. Simple, > right? I thought so and simply returned the variables in a tupl

Re: No error while sending via TCP Socket

2006-07-03 Thread Grant Edwards
On 2006-07-03, Ben Sizer <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: >> You're talking about the case where there's un-ACKed data. >> Breaking a link when there's no un-ACKed data (which is what >> the OP did) will require an hour or two to timeout _iff_ >> keepalive is enabled. If keepaliv

Re: Out of the box database support

2006-07-03 Thread Paul McGuire
"Alex Biddle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hey, thanks for the reply Jean-Paul. > > That's pretty cool knowing that Python 2.5 will have it out of the > box, however what about basic out-of-the-box functionality in 2.4 (or > even older)? > > In all my other experien

Re: Out of the box database support

2006-07-03 Thread BartlebyScrivener
I guess you looked here without finding what you want? http://www.python.org/doc/topics/database/ What's the big deal with "out of the box"? People have different tastes in dbs and ways to access them, why not just pick the one you want and download it? You didn't say if you are on Linux or Wind

Re: conecting with a MsAcces DB by dao

2006-07-03 Thread Tim Chase
>> , Access can retrieves a not empty recordset but my python code >> retrieves a empty recordset. > > Which is exactly what it _should_ return on that query, unless you have > records with "e*" in column field1. > > The proper SQL clause is: > > ... WHERE field1 LIKE 'e*' ... which would

Re: Out of the box database support

2006-07-03 Thread Alex Biddle
Ah, so separate downloads then. At least now I know. Ergh... I checked the version of Python my current host is running and its 2.2. ...ergh On 7/3/06, Alex Martelli <[EMAIL PROTECTED]> wrote: > Python 2.5's standard library includes pysqlite. For any other DB, or > any previous release of

Embedded python problem

2006-07-03 Thread Robin Becker
We have a client using a fully embedded python in a large DTP app. It used to be Mac OS 9/X only, but the MAC 9 support has gone away and we now have support for the PC with the embedding being used in C# via external DLL aliasing/marshalling etc etc. The embedding DLL has effectively a sing

Re: Out of the box database support

2006-07-03 Thread Alex Martelli
Alex Biddle <[EMAIL PROTECTED]> wrote: > Hey there. > > I was wondering whether Python had any support out-of-the-box for > database functionality, or database-like functionality. > > For instance a lot of shared hosts have Python installed, but not the > MySQL extension, the flexible of these w

Re: catching syntax errors via excepthook?

2006-07-03 Thread Alex Martelli
Hari Sekhon <[EMAIL PROTECTED]> wrote: > I've written an except hook into a script as shown below which works > well for the most part and catches exceptions. > > import sys > def myexcepthook(type,value,tb): > do something > > sys.excepthook=myexcepthook > rest of script (now protected

Re: For a fast implementation of Python

2006-07-03 Thread Alex Martelli
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Psyco does some JIT compiling of Python, supposedly making it faster. > You do need to think a bit, however, beforehand. > If you really thing that the "speed" of execution is important for your > application, a scripting language such as python may b

Re: conecting with a MsAcces DB by dao

2006-07-03 Thread Scott David Daniels
luis wrote: > My problem was opening a query (not a table) on mdb file > > 1) If the query includes a where clause type > field1="edf" and field2=3 > , for example, no problem, Access can retrieve a not empty recordset > and my python code too. > > 2) But if the Access's query includes a LIKE cl

Re: list comprehension

2006-07-03 Thread Bruno Desthuilliers
a wrote: > hi simon thanks for your reply > what if i want to do this > feed_list=[] > feed_id=[] > for ix in feeds_list_select: > global feeds_list > global feeds_id Learn how to avoid globals first. -- bruno

Re: Program analysis (pseudocode if possible)

2006-07-03 Thread Bruno Desthuilliers
Paul McGuire wrote: > "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > >> >> >>BEGIN PROGRAM >> read_this('http://www.catb.org/~esr/faqs/smart-questions.html') >> do_your_homework() > > if (cant_figure_it_out) BEGIN >post_specifi

Re: No error while sending via TCP Socket

2006-07-03 Thread Ben Sizer
Grant Edwards wrote: > You're talking about the case where there's un-ACKed data. > Breaking a link when there's no un-ACKed data (which is what > the OP did) will require an hour or two to timeout _iff_ > keepalive is enabled. If keepalive has not been enabled, a > broken connection with no un-AC

Re: Out of the box database support

2006-07-03 Thread Alex Biddle
Hey, thanks for the reply Jean-Paul. That's pretty cool knowing that Python 2.5 will have it out of the box, however what about basic out-of-the-box functionality in 2.4 (or even older)? In all my other experiences Python comes with a lot of tools already available, it seems odd not to have basic

Re: Program analysis (pseudocode if possible)

2006-07-03 Thread Paul McGuire
"Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > BEGIN PROGRAM > read_this('http://www.catb.org/~esr/faqs/smart-questions.html') > do_your_homework() if (cant_figure_it_out) post_specific_question_on_relevant_newsgroup("comp.lang.c") > E

email.Message.get_payload() surprising behavior

2006-07-03 Thread lrotger
The behavior of get_payload() is different when the quoted-printable text has \n line endings or \r\n line endings. If it's \n and the last byte of a line in that file is 0x0D it confuses them for a \r\n line ending and strips both bytes. This behavior does not occur if the same file has \r\n l

Re: Program analysis (pseudocode if possible)

2006-07-03 Thread Bruno Desthuilliers
Vusi wrote: > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > #include "ipschema.h" > #include "ssrv/sockaddr.h" > > #ifndef lint > __RCSID("$Id: ethip.c 2314 2004-12-29 01:00

Re: Controlling Windows Media Player from Python

2006-07-03 Thread Avizoa
Jeffrey Barish wrote: > Is there a way to interact with Windows Media Player from Python? I would > like to be able to do things like tell WMP to play a given sound file or to > ask WMP for metadata about a sound file. > -- > Jeffrey Barish The fact of the matter is that python doesn't need to

Re: Turning a callback function into a generator

2006-07-03 Thread Kirk McDonald
[EMAIL PROTECTED] wrote: > Peter Otten wrote: > >>Kirk McDonald wrote: >> >> >>>Let's say I have a function that takes a callback function as a >>>parameter, and uses it to describe an iteration: >>> >>>def func(callback): >>> for i in [1, 2, 3, 4, 5]: >>> callback(i) >>> > > > Which

Controlling Windows Media Player from Python

2006-07-03 Thread Jeffrey Barish
Is there a way to interact with Windows Media Player from Python? I would like to be able to do things like tell WMP to play a given sound file or to ask WMP for metadata about a sound file. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: Time out question

2006-07-03 Thread Rune Strand
Grant Edwards wrote: > I just use signal.alarm(): > > import signal,sys > > def alarmHandler(signum, frame): > raise 'Timeout' > > signal.signal(signal.SIGALRM, alarmHandler) > > while 1: > try: > signal.alarm(5) > t = sys.stdin.readline() > signal.alarm(0) >

Re: Dictionary .keys() and .values() should return a set [with Python 3000 in mind]

2006-07-03 Thread Piet van Oostrum
> "Paddy" <[EMAIL PROTECTED]> (P) wrote: >P> [EMAIL PROTECTED] wrote: >>> This has been bothering me for a while. Just want to find out if it >>> just me or perhaps others have thought of this too: Why shouldn't the >>> keyset of a dictionary be represented as a set instead of a list? >P> I t

Re: Python CGI Scripting Documentation

2006-07-03 Thread per9000
Hi, I wanted to try this myself a few days ago, my first (working) try had this source code: --- #!/usr/bin/python print 'Content-Type: text/plain' print print 'hell o world' --- (the output is just "hell o world\n", but the first four lines are still required I guess, I don't know why, but it w

RE: Event objects Threading on Serial Port on Win32

2006-07-03 Thread el cintura partida
Muchas gracias Gabriel por haberme informado, vos si que es un profesional de la programación. Un saludo, David --- Gabriel <[EMAIL PROTECTED]> escribió: > David: > Tube el mismo problema que vos con el hilo del > ejemplo de pyserial. Me > paso que en Linux andaba bien, obvio, pero tenia un > p

  1   2   >