Re: unicode, bytes redux

2006-09-24 Thread Robert Kern
willie wrote: > (beating a dead horse) > > Is it too ridiculous to suggest that it'd be nice > if the unicode object were to remember the > encoding of the string it was decoded from? Yes. The unicode object itself is precisely the wrong place for that kind of information. Many (most?) unicode o

Re: gtk.Entry Colors

2006-09-24 Thread Tuomas
MonkeeSage wrote: > Tuomas wrote: > >>I would like to manipulate PyGTK Entry widget's background and >>foreground colors. Is it possible? How? > > > Yes, it is possible: > > # widget color > entry.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse("#FF")) > # frame color > entry.modify_bg(gt

unicode, bytes redux

2006-09-24 Thread willie
(beating a dead horse) Is it too ridiculous to suggest that it'd be nice if the unicode object were to remember the encoding of the string it was decoded from? So that it's feasible to calculate the number of bytes that make up the unicode code points. # U+270C # 11100010 10011100 10001100 buf =

Re: Daemonizing python

2006-09-24 Thread Andi Clemens
Hi, what is the main difference of running a python program as a daemon or as a cronjob? I have written a program at work that checks all internet connections of our failover sites and saves the results in a MySQL-database. The whole program is made with django (a webframework) so I had to be

Re: Talking to marketing people about Python

2006-09-24 Thread Steve Holden
Roy Smith wrote: > I'm working on a product which for a long time has had a Perl binding for > our remote access API. A while ago, I wrote a Python binding on my own, > chatted it up a bit internally, and recently had a (large) customer enquire > about getting access to it. > > I asked for per

Re: String Pattern Matching: regex and Python regex documentation

2006-09-24 Thread Steve Holden
Xah Lee wrote: > Xah Lee wrote: > « the Python regex documentation is available at: > http://xahlee.org/perl-python/python_re-write/lib/module-re.html ...» > > Jürgen Exner wrote: > «Yeah, sure, and the Perl regex documentation is available at 'perldoc > perlre'. So what? Is that anything new or

Re: One program in different GUI Toolkits

2006-09-24 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Actually due to lack of documentation and feedback from the mailing > list, I am fallen out of love with Pythoncard and in love with > Kiwi/Pygtk. Given the large groundswell support for pygtk, i dont think > I will be disappointed. > > PyQT looks ultra-slick, but the co

Re: SQL reports like in MS Access

2006-09-24 Thread Luis M. González
This isn't probably the answer you are looking for, but a good solution that worked for me is Cheetah. Cheetah is a template engine, which is mainly used for web applications, but that can be used for generating all kinds of text documents. For example, I use it for creating invoices in html form

Re: ruby %w equivalent

2006-09-24 Thread MonkeeSage
Tim Chase wrote: > to give it that perl/ruby-ish feel of terseness and obscurity. Don't feel bad, you always have things like r'%s\%s' % (u'blah', u'blah') and so on. But of course, it's only the other guys who are evil / ugly / stupid. As the human torch says, "Flame On". :) [Full disclosure: I

Re: String Pattern Matching: regex and Python regex documentation

2006-09-24 Thread Xah Lee
Xah Lee wrote: « the Python regex documentation is available at: http://xahlee.org/perl-python/python_re-write/lib/module-re.html ...» Jürgen Exner wrote: «Yeah, sure, and the Perl regex documentation is available at 'perldoc perlre'. So what? Is that anything new or surprising?» It is of inter

Re: newbie IronPython compiled scripts speed question

2006-09-24 Thread Ravi Teja
In most cases, carefully examine why you need native code at all. Since a good number of performance sensitive CPython modules are in fact written in C to begin with, the improvements may not always be significant. I don't know about your application but here are some general observations. Beginer

Re: Unexpected behaviour of csv module

2006-09-24 Thread John Machin
Andrew McLean wrote: > I have a bunch of csv files that have the following characteristics: > > - field delimiter is a comma > - all fields quoted with double quotes > - lines terminated by a *space* followed by a newline > > What surprised me was that the csv reader included the trailing space in

Re: A critique of cgi.escape

2006-09-24 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> Making cgi.escape always escape the '"' character would not break >> anything, and would probably fix a few bugs in existing code. Yes, >> those bugs are not cgi.escape's fault, but that's no reason not to >> be helpful. It's a minor improveme

Re: A critique of cgi.escape

2006-09-24 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Georg Brandl wrote: >> Attributes can be quoted with either single or double quotes. That's what >> the HTML spec says. cgi.escape doesn't correctly allow for that. Ergo, >> cgi.escape is broken. QED. > > A function is broken if its implementation doesn't match the

Unexpected behaviour of csv module

2006-09-24 Thread Andrew McLean
I have a bunch of csv files that have the following characteristics: - field delimiter is a comma - all fields quoted with double quotes - lines terminated by a *space* followed by a newline What surprised me was that the csv reader included the trailing space in the final field value returned,

Re: Automatic import PEP

2006-09-24 Thread Robert Kern
Saizan wrote: > BTW what would the benefit of the form "lazily import A, B"? If you > name the modules why not import them directly? Maybe you are not sure > you would need them, but I don't think that the overhead of importing > them should matter.. It's primarily useful for large packages. scipy

Talking to marketing people about Python

2006-09-24 Thread Roy Smith
I'm working on a product which for a long time has had a Perl binding for our remote access API. A while ago, I wrote a Python binding on my own, chatted it up a bit internally, and recently had a (large) customer enquire about getting access to it. I asked for permission to distribute the Pyt

Re: Automatic import PEP

2006-09-24 Thread Saizan
I think this is obviously great in interactive mode and would also be very good in the early stages of developing if you have several sources files. A little error prone maybe, and should be avoided in "production" code I suppose. (I would like to track each name exactly, on each installation of py

Re: newbie IronPython compiled scripts speed question

2006-09-24 Thread dtlog
> Learning to use Psyco is very easy, for a basic usage you just have to > put in your code: > import psyco > psyco.full() > > For a better usage you can do: > psyco.bind(functioname) > for just the functions that you have seen can enjoy the compilation. > > For a smart usage you can learn few tric

Re: ruby %w equivalent

2006-09-24 Thread Tim Chase
>> is there a python equivalent for the ruby %w operator? >> %w{a b c} creates an array with strings "a", "b", and "c" in ruby... >> > > | >>> "a b c".split() > | ['a', 'b', 'c'] > > ... appears to match your single example. bah, far to easy to understand...add a little line-noise, man, and it

Re: ruby %w equivalent

2006-09-24 Thread John Machin
[EMAIL PROTECTED] wrote: > > Also Google was curiously resistant to telling me where Ruby's %w is > documented. > You would need to dig into your Google toolbar config and un-tick "YAGNI filter". -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie IronPython compiled scripts speed question

2006-09-24 Thread dtlog
On Sun, 24 Sep 2006 23:59:34 +0300, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: > I don't know what you heard but IronPython generates IL code which > happens to be the bytecode of the CLR (the runtime of .NET). So you are > not generating "native" stuff but a PE executable wrapping the .NET > st

Re: ruby %w equivalent

2006-09-24 Thread p . lavarre
> is there a python equivalent for the ruby %w operator? > %w{a b c} creates an array with strings "a", "b", and "c" in ruby... The expression 'a b c'.split() creates the ['a', 'b', 'c'] list of str, if that helps. Also dir('a b c') briefly lists much of what http://docs.python.org/lib/string-met

Re: ruby %w equivalent

2006-09-24 Thread John Machin
Antoine De Groote wrote: > > is there a python equivalent for the ruby %w operator? > %w{a b c} creates an array with strings "a", "b", and "c" in ruby... > | >>> "a b c".split() | ['a', 'b', 'c'] ... appears to match your single example. HTH, John -- http://mail.python.org/mailman/listinfo/p

Re: ruby %w equivalent

2006-09-24 Thread Robert Kern
Antoine De Groote wrote: > Hi everybody, > > is there a python equivalent for the ruby %w operator? > %w{a b c} creates an array with strings "a", "b", and "c" in ruby... I assume that ['a', 'b', 'c'] isn't what you are looking for. How does 'a b c'.split() strike you? -- Robert Kern

ruby %w equivalent

2006-09-24 Thread Antoine De Groote
Hi everybody, is there a python equivalent for the ruby %w operator? %w{a b c} creates an array with strings "a", "b", and "c" in ruby... Thanks a lot Regards, antoine -- http://mail.python.org/mailman/listinfo/python-list

Re: Reverse a String?

2006-09-24 Thread p . lavarre
> http://pyfaq.infogami.com/ Tell me more? Clueless newbie me, thru this door I'm at three deaths and counting. Does that Py Faq Wiki have a sandbox a la alt.test, and/or a tutorial? // Death One: http://pyfaq.infogami.com/_account/in?path=/ requires me to create a persisting ID "between 3 and

Re: Daemonizing python

2006-09-24 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > There is a good daemonization recipe on activstate: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66012 That is worth reading, including the long comment thread. -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE - Customizing output format

2006-09-24 Thread Robert Kern
Ilias Lazaridis wrote: > Steve Holden wrote: >> And I am wondering at your continual surprise when the rest of the world >> fails to share your perceptions. Doesn't this carry *any* information? > > not the rest of the world, but the rest of the python community. Remember back when you first cam

Re: Daemonizing python

2006-09-24 Thread Diez B. Roggisch
NinjaZombie schrieb: > Hi! > > I was wondering if it is possible to turn the current python proccess into > a unix daemon, but not doing it like this: > python myscript.py & > but from code programaticaly. There is a good daemonization recipe on activstate: http://aspn.activestate.com/ASPN/Coo

Re: Daemonizing python

2006-09-24 Thread NinjaZombie
Na dan Sun, 24 Sep 2006 14:35:31 -0700, Paul Rubin je napisao: > Try it this way: > > import os, sys > print "Entering program" > > if os.fork(): > sys.exit() # parent process exits so shell returns > > while (1): # child process continues

Re: Daemonizing python

2006-09-24 Thread Paul Rubin
NinjaZombie <[EMAIL PROTECTED]> writes: > Thanks guys, but I'm a little new to this. Take a look at this very simple > code: > > import os > print "Entering program" > os.fork() > while (1): > pass# some other work Try it this way: import os, sys print "Entering program"

Re: newbie IronPython compiled scripts speed question

2006-09-24 Thread bearophileHUGS
dtlog: > So the question is, should I switch to IronPython and compile > my scripts, or learn to use something like pyinline or Psyco? Learning to use Psyco is very easy, for a basic usage you just have to put in your code: import psyco psyco.full() For a better usage you can do: psyco.bind(funct

Re: Daemonizing python

2006-09-24 Thread NinjaZombie
Na dan Sun, 24 Sep 2006 23:19:12 +0200, Bjoern Schliessmann je napisao: > Paul Rubin wrote: >> NinjaZombie <[EMAIL PROTECTED]> writes: > >>> I was wondering if it is possible to turn the current python >>> proccess into a unix daemon, but not doing it like this: >>> python myscript.py & >>> but f

Re: Daemonizing python

2006-09-24 Thread Bjoern Schliessmann
Paul Rubin wrote: > NinjaZombie <[EMAIL PROTECTED]> writes: >> I was wondering if it is possible to turn the current python >> proccess into a unix daemon, but not doing it like this: >> python myscript.py & >> but from code programaticaly. > Yeah, os.fork and the parent process exits. Or littl

Re: IDLE - Customizing output format

2006-09-24 Thread Diez B. Roggisch
>> And I am wondering at your continual surprise when the rest of the world >> fails to share your perceptions. Doesn't this carry *any* information? > > not the rest of the world, but the rest of the python community. > > That's a big difference. > > So it looks that I have to code to change th

Re: Daemonizing python

2006-09-24 Thread Paul Rubin
NinjaZombie <[EMAIL PROTECTED]> writes: > I was wondering if it is possible to turn the current python proccess into > a unix daemon, but not doing it like this: > python myscript.py & > but from code programaticaly. Yeah, os.fork and the parent process exits. -- http://mail.python.org/mailman/

Re: Converting Perl Web Report to Python

2006-09-24 Thread [EMAIL PROTECTED]
Dennis, I was able to execute the Mysql command line code you created in "script1.py". I was not able to test the "preferred" method used in script2.py. I will do this later this week when I have more time to download and install the required MySQLdb module. In any event, I would like to know ho

Daemonizing python

2006-09-24 Thread NinjaZombie
Hi! I was wondering if it is possible to turn the current python proccess into a unix daemon, but not doing it like this: python myscript.py & but from code programaticaly. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie IronPython compiled scripts speed question

2006-09-24 Thread Lawrence Oluyede
dtlog <[EMAIL PROTECTED]> wrote: > I searched the faqs at python.org and didn't find an answer: > does using IronPython, instead of CPython, and compiling the > scripts into native windows executables (I heard IronPython > can do that) result in faster execution times? I don't know what you heard

SQL reports like in MS Access

2006-09-24 Thread [EMAIL PROTECTED]
Hi, what is the best unit for creating reports like in Microsoft Access, i.e. with page header / footer, grouping, group headers / footers etc., with Wysiwyg editor? Thanks a lot, Jakub -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE - Customizing output format

2006-09-24 Thread Ilias Lazaridis
Steve Holden wrote: > Ilias Lazaridis wrote: > > Ilias Lazaridis wrote: > > > >>IDLE has an output format like this: > >> > >> >>> object > >> > >> >>> type > >> > >> >>> object.__class__ > >> > >> >>> object.__bases__ > >> > >>How can I customize it to become like that: > >> > >> >>> object > >>

installation of python-dev

2006-09-24 Thread Dominik Müller
Hi !I am running Python2.4.3; I need to install Python-dev (or does anybody know an easier way to get distutils.core ? that's what I actually need...). All the versions of python-dev I can find don't match. I get always error message "error: Failed dependencies:    python = 2.4 is needed by py

Re: IDLE - Customizing output format

2006-09-24 Thread Steve Holden
Ilias Lazaridis wrote: > Ilias Lazaridis wrote: > >>IDLE has an output format like this: >> >> >>> object >> >> >>> type >> >> >>> object.__class__ >> >> >>> object.__bases__ >> >>How can I customize it to become like that: >> >> >>> object >> >> >>> type >> >> >>> object.__class__ >>

Re: QuoteSQL

2006-09-24 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Sybren Stuvel > wrote: > > >>Lawrence D'Oliveiro enlightened us with: >> >>>Why doesn't MySQLdb provide a function like this: >> >>Because generally you're able to pass newlines and the like just fine. >>You can even store binary data i

Re: newbe's re question

2006-09-24 Thread [EMAIL PROTECTED]
Frederic Rentsch wrote: > [EMAIL PROTECTED] wrote: > > These are csound files. Csound recently added python as a scripting > > language and is allowing also allowing csound calls from outside of > > csound. The nice thing about csound is that instead of worrying about > > virus and large files i

Re: Automatic import PEP

2006-09-24 Thread Robert Kern
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Connelly > Barnes wrote: > >> The main point of autoimp is to make usage of the interactive Python >> prompt more productive by including "from autoimp import *" in the >> PYTHONSTARTUP file. > > The main problem I have with your idea i

Re: What is the best way to "get" a web page?

2006-09-24 Thread Pete
> > Functionally they are the same, but third line included in Firefox. > > Opera View Source command produces the same result as Python. > [snip] > > It's better to compare with the result of a downloader-only (instead > of a parser), like wget on Unix. That way you'll get exactly the same > bytes

Re: help with debugging a ctypes problem

2006-09-24 Thread gap
[EMAIL PROTECTED] wrote: >> help figuring out how to debug ... ctypes ... >> a commercial dll. A certain function takes five arguments, foo(a, b, c, d, >> e). >> Can I view the appropriate stack? ... Any other ideas or advice? etc? > > Did you call the foo of _cdecl ctypes.cdll or the foo of _s

Re: +1 QOTW

2006-09-24 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: > Did anyone else crack up when Larry Wall described python with the > statement: > > Python, as the "anti-Perl," is heavily invested in maintaining Order. > > In the state of the onion address? > > http://www.perl.com/pub/a/2006/09/21/onion.html Think he's just too charmi

newbie IronPython compiled scripts speed question

2006-09-24 Thread dtlog
Hello, and sorry if this has been asked before... I searched the faqs at python.org and didn't find an answer: does using IronPython, instead of CPython, and compiling the scripts into native windows executables (I heard IronPython can do that) result in faster execution times? Or is it just a matt

Re: One program in different GUI Toolkits

2006-09-24 Thread metaperl . etc
Actually due to lack of documentation and feedback from the mailing list, I am fallen out of love with Pythoncard and in love with Kiwi/Pygtk. Given the large groundswell support for pygtk, i dont think I will be disappointed. PyQT looks ultra-slick, but the commercial nature of QT and the design

Re: One program in different GUI Toolkits

2006-09-24 Thread metaperl . etc
Franz Steinhaeusler wrote: > Hello NG, > > I have a suggestion. > > For simplifying learning or switching between different GUI > Toolkits, I could imagine to have one short clearly presented > program in different GUI Toolkits. > > What about for example wxProject? > > http://wiki.wxpython.org/in

Re: IDLE - Customizing output format

2006-09-24 Thread Ilias Lazaridis
Ilias Lazaridis wrote: > IDLE has an output format like this: > > >>> object > > >>> type > > >>> object.__class__ > > >>> object.__bases__ > > How can I customize it to become like that: > > >>> object > > >>> type > > >>> object.__class__ > > >>> object.__bases__ > >

Re: Re: ctypes question about call by reference

2006-09-24 Thread Oliver Andrich
After a walk outside, some fresh air around my nose and some time to relax, I finally found out how to do, what I want to do. First, define the argument types and the result type. _dll.MagickGetException.argtypes = (c_long, POINTER(c_long)) _dll.MagickGetException.restype = c_char_p Seco

python-list@python.org

2006-09-24 Thread Rob Williscroft
Nigel wrote in news:[EMAIL PROTECTED] in comp.lang.python: > from Tkinter import * > import pyTTS > Hi i am trying to get a button so that when i click on it i hear a > voice say "Hi Molly" this is my code so far.Can any one shed any light > on this for please. > Thanks Nige. Your problem appear

Re: ctypes question about call by reference

2006-09-24 Thread Lawrence Oluyede
Oliver Andrich <[EMAIL PROTECTED]> wrote: > Well, what I learned so far from the documentation, which I already > have read more then once today, is that there is no example for an > enum in this situation. But looking at pygame-sdl and another project, > it looks like the enum is just an c_int or

Re: Running Python script from C++ code(.NET)

2006-09-24 Thread Mc Osten
volcano <[EMAIL PROTECTED]> wrote: > A trivial question - I have a working Python script that I have to > invoke from C++ code. No fancy stuff - just run the whole script with > its parameters. No callbacks, no signalling - nada, just > stupid,primitive, straightforward call. In a unix based env

Re: gtk.Entry Colors

2006-09-24 Thread MonkeeSage
Tuomas wrote: > I would like to manipulate PyGTK Entry widget's background and > foreground colors. Is it possible? How? Yes, it is possible: # widget color entry.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse("#FF")) # frame color entry.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#00

Re: +1 QOTW

2006-09-24 Thread Georg Brandl
Michael J. Fromberger wrote: > In article <[EMAIL PROTECTED]>, > "Terry Reedy" <[EMAIL PROTECTED]> wrote: > >> <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> > Did anyone else crack up when Larry Wall described python with the >> > statement: >> > >> > Python, as the "anti-Per

Re: How to close the DOS Shell when starting a python script

2006-09-24 Thread Wildemar Wildenburger
Paddy wrote: > Rename the .py file with extension .pyw. > - Paddy. > To elaborate: This works because, by default, .py files are associated with python.exe and .pyw files are associated with pythonw.exe, the latter not opening a console window. You can actually run a .py file with pythonw.exe wi

Re: What is the best way to "get" a web page?

2006-09-24 Thread Felipe Almeida Lessa
24 Sep 2006 10:09:16 -0700, Rainy <[EMAIL PROTECTED]>: > Functionally they are the same, but third line included in Firefox. > Opera View Source command produces the same result as Python. [snip] It's better to compare with the result of a downloader-only (instead of a parser), like wget on Unix.

Re: What is the best way to "get" a web page?

2006-09-24 Thread Rainy
Pete wrote: > > > The file "temp.html" is definitely different than the first run, but > > > still not anything close to www.python.org . Any other suggestions? > > > > If you mean that the page looks different in a browser, for one thing > > you have to download the css files too. Here's the rele

Re: +1 QOTW

2006-09-24 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Did anyone else crack up when Larry Wall described python with the > > statement: > > > > Python, as the "anti-Perl," is heavily invested in maintaining Or

Re: Timeline for Python?

2006-09-24 Thread Blair P. Houghton
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Blair P. > Houghton wrote: > > > wesley chun wrote: > >> > >> 1. never write against older versions of Python... you will only > >> obsolete your book even faster (well, "sooner") > > > > I believe there is some market for documentat

Re: Ideal python idle

2006-09-24 Thread Rainy
Rainy wrote: > [snip] Oh, I see now that F9 designates output buffer. I usually use vim with a log file and open the log file in a new Vim tab. -Rainy -- http://mail.python.org/mailman/listinfo/python-list

Re: Ideal python idle

2006-09-24 Thread Rainy
Rainy wrote: > [snip] Oh, I see now that F9 designates output buffer. I usually use vim with a log file and open the log file in a new Vim tab. -- http://mail.python.org/mailman/listinfo/python-list

Re: Ideal python idle

2006-09-24 Thread Rainy
James Stroud wrote: > Hello, > > I decided that the ultimate python IDE would basically be a vim editor > with a hotkey or button that ran the currently edited module as > "__main__", allowing gui (tkinter, wx) windows to spawn etc. [snip] Hi James, I'm sure I'm missing something here, but doesn't

Re: RSS aggregator with curses and feedparser

2006-09-24 Thread James Graham
Roberto Bechtlufft wrote: > And another thing: feedparser returns the result entries as > dictionaries. What's the best approach to create my cache file? I see > that the cache file in liferea is an xml file. Should I try to create > my own xml file based on the results from feedparser? Well you c

Re: What is the best way to "get" a web page?

2006-09-24 Thread Pete
> > Can anyone point me to a tutorial or other reference on how to "get" all > > of the html contents at a particular page? > > Why not use httrack? > > http://www.satzbau-gmbh.de/staff/abel/httrack-py/ > > Sincerely, > > Wolfgang Keller > > -- > My email-address is correct. > Do NOT remove ".nospa

Re: What is the best way to "get" a web page?

2006-09-24 Thread Pete
> > The file "temp.html" is definitely different than the first run, but > > still not anything close to www.python.org . Any other suggestions? > > If you mean that the page looks different in a browser, for one thing > you have to download the css files too. Here's the relevant extract > from the

Re: Re: ctypes question about call by reference

2006-09-24 Thread Oliver Andrich
On 9/24/06, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: > Oliver Andrich <[EMAIL PROTECTED]> wrote: > > - ExceptionType is an enum > > - MagickWand is somewhat strange, but so far it works fine without any > > type mangling. > > > > How would I wrap this thing using ctypes? Can anybody help me with

Re: HTTP GET Explodes...

2006-09-24 Thread Pete
> > > > Python 2.4.3 (#1, Jun 13 2006, 11:46:08) > > > > [GCC 4.1.1 20060525 (Red Hat 4.1.1-1)] on linux2 > > > > Type "help", "copyright", "credits" or "license" for more information. > > > > >>> import httplib > > > > >>> conn = httplib.HTTPConnection("www.python.org") > > > > >>> conn.request("G

Re: ctypes question about call by reference

2006-09-24 Thread Lawrence Oluyede
Oliver Andrich <[EMAIL PROTECTED]> wrote: > - ExceptionType is an enum > - MagickWand is somewhat strange, but so far it works fine without any > type mangling. > > How would I wrap this thing using ctypes? Can anybody help me with that? First thing first: you have to identify how ExceptionType a

ctypes question about call by reference

2006-09-24 Thread Oliver Andrich
Hi, hopefully someone with some ctypes experience can help me. I guess this is a trivial task again, but I have been googling, reading, experimenting the whole afternoon without any success. I have a given C function signature: char *MagickGetException(MagickWand *wand,ExceptionType *severity)

python-list@python.org

2006-09-24 Thread Nigel
from Tkinter import * import pyTTS Hi i am trying to get a button so that when i click on it i hear a voice say "Hi Molly" this is my code so far.Can any one shed any light on this for please. Thanks Nige. class MyApp: def __init__(self, parent): self.myContainer1 = Frame(p

Re: webbrowser module's Firefox support

2006-09-24 Thread Dustan
> > This is a bug, and has now been fixed in SVN. As a workaround, you can > edit the webbrowser.py file and remove the close_fds and preexec_fn arguments > to Popen. > > Georg Finally! It's working. Thank you so much! -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange __future__ behavior in Python 2.5

2006-09-24 Thread Avizoa
Georg Brandl wrote: > This is a bug and has now been fixed in the SVN repo. > Thanks for bringing it up. Ouch, I feel bad now. I've been noticing this behavior since 2.5B1 but I didn't realize it was a bug. -- http://mail.python.org/mailman/listinfo/python-list

Re: Verify an e-mail-adress - syntax and dns

2006-09-24 Thread Tim Williams
On 24/09/06, Ingo Linkweiler <[EMAIL PROTECTED]> wrote: > Has anyone a function/script to verify an e-mail-address? > > It should: > a) check the syntax > b) verify an existing mailserver or DNS/MX records > b) is problematical. A domain with MX records may not really have a mail server at all.

Re: RSS aggregator with curses and feedparser

2006-09-24 Thread Roberto Bechtlufft
And another thing: feedparser returns the result entries as dictionaries. What's the best approach to create my cache file? I see that the cache file in liferea is an xml file. Should I try to create my own xml file based on the results from feedparser? Thanks for your help. Roberto Bechtlufft wr

Re: QuoteSQL

2006-09-24 Thread Anders J. Munch
Lawrence D'Oliveiro wrote: >>> elif Ch == "'" or Ch == "\"" or Ch == "\\" : >>> Ch = "\\" + Ch >> Always sad to see an SQL DBMS willfully violate the SQL standard. > > Why is that a violation of SQL? Taking another look, I might be wrong: Your code uses double quotes, and sin

Re: QuoteSQL

2006-09-24 Thread Anders J. Munch
Robert Kern wrote: > Anders J. Munch wrote: > >> Always sad to see an SQL DBMS willfully violate the SQL standard. > > You must be a constantly depressed person, then. :-) Nah, I just look the other way most of the time *g* - Anders -- http://mail.python.org/mailman/listinfo/python-list

Re: QuoteSQL

2006-09-24 Thread Sybren Stuvel
Lawrence D'Oliveiro enlightened us with: > Yes, I have done blobs. Still need a quoting function for the > specials, though. Why? What makes your data so different from mine? I can store newlines and the likes just fine in a regular text field. Sybren -- Sybren Stüvel Stüvel IT - http://www.st

gtk.Entry Colors

2006-09-24 Thread Tuomas
I would like to manipulate PyGTK Entry widget's background and foreground colors. Is it possible? How? Tuomas -- http://mail.python.org/mailman/listinfo/python-list

RSS aggregator with curses and feedparser

2006-09-24 Thread Roberto Bechtlufft
Hi, I'm new around here... I'm a Python hobbyist, and I'm far from being a professional programmer, so please be patient with me... I'm working on my first Python program: a curses based RSS Aggregator. It's basically a clone of snownews, one of my very favorite programs. But I want to add some fu

CSV mailing list moved to python.org

2006-09-24 Thread skip
The csv mailing list originally hosted on mojam.com has been moved intact to a new home on mail.python.org. Thanks to Brad Knowles for turning the necessary knobs on mail.python.org. The list info page is at: http://mail.python.org/mailman/listinfo/csv For a fairly short period of time the

AttributeError Question

2006-09-24 Thread Javier Subervi
Hi;I'm new to troubleshooting scripts. This came up when trying to load a Zope product:    * Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__  __traceback_info__: field.Vocabulary(here)    * Module Python _expression_ "field.Vocabulary(here)", line 1, in <_expression_>    * Modu

PersistenceDict Question

2006-09-24 Thread Javier Subervi
Hi;I'm trying to get a module to work in a Plone product. I am running Python 2.3.5. Here is the error I'm getting:2006-09-23T14:11:43 ERROR(200) Zope Could not import Products.ExternalSiteCatalogTraceback (most recent call last):  File "/usr/local/zope/278/lib/python/OFS/Application.py", line 673,

Re: Question about decorators (with context?)

2006-09-24 Thread Duncan Booth
"Oliver Andrich" <[EMAIL PROTECTED]> wrote: > I will have to wrap a lot of methods to get all the functionality I > need. And the checking for an exception looks always the same. So I > want to write short methods, which are decorated by my_funky_decorator > which handles the error checking and ex

Re: Strange __future__ behavior in Python 2.5

2006-09-24 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > My understanding of the __future__ statement is that you may say > something like: > > from __future__ import foo, bar > > to enable more than one feature. However, this does not seem to be > working properly in 2.5; it behaves as expected when typed into the > interac

Question about decorators (with context?)

2006-09-24 Thread Oliver Andrich
Hi, sorry for the vague subject, but I can't come up with a better one so far. I am currently writing a wrapper around ImageMagicks MagickWand library using the ctypes module. During this development i have to handle exceptions in an slightly different way, then python normally handles them. I a

Re: Verify an e-mail-adress - syntax and dns

2006-09-24 Thread Bjoern Schliessmann
Ben Finney wrote: > I believe Ingo is checking for the case where the user intended to > enter a valid email address, and made a typing error resulting in > a trivially invalid one. Ah. Good intention, but the same applies: Typos in the localpart are not detectable. Typos in the domain part could

Re: Verify an e-mail-adress - syntax and dns

2006-09-24 Thread Ben Finney
Bjoern Schliessmann <[EMAIL PROTECTED]> writes: > Ingo Linkweiler wrote: > > > yes, I do this allready. But it would be nice to do some checks > > before to avoid wrong user inputs. > > What do you do if the user inputs a "wrong" address? If you reject > with an error message, the medium intellige

Re: What is the best way to "get" a web page?

2006-09-24 Thread Wolfgang Keller
> Can anyone point me to a tutorial or other reference on how to "get" all > of the html contents at a particular page? Why not use httrack? http://www.satzbau-gmbh.de/staff/abel/httrack-py/ Sincerely, Wolfgang Keller -- My email-address is correct. Do NOT remove ".nospam" to reply. -- ht

Re: HTTP GET Explodes...

2006-09-24 Thread MonkeeSage
Pete wrote: > So, I looked at my search path under the account that was experiencing > the problem. That wasn't it... Then I'm thinking there's an > environmental variable causing this. Too many to work right now. Will > investigate later. You can see all environment variables with the declare com

Re: Regular expression confusion

2006-09-24 Thread Fredrik Lundh
York wrote: > I have two backslash - a. and I want to replace them with one backslash, > but I failed: > > >>> import re > >>> a = '' > >>> re.sub(r'', '\\', '') John has already sorted the RE-specific part of the problem, but it's also worth noting that using the RE engine for

Re: Verify an e-mail-adress - syntax and dns

2006-09-24 Thread Bjoern Schliessmann
Ingo Linkweiler wrote: > yes, I do this allready. But it would be nice to do some checks > before to avoid wrong user inputs. What do you do if the user inputs a "wrong" address? If you reject with an error message, the medium intelligent user will enter something like [EMAIL PROTECTED] as next

Re: assignment hook

2006-09-24 Thread Fredrik Lundh
Georg Brandl wrote: > This is not possible. Assignments in the form > > name = value > > (also called "binding a name") are not overloadable. footnote: unless you execute the code in a controlled environment: class mydict(dict): def __setitem__(self, key, value): pri

Re: grabbing random words

2006-09-24 Thread MonkeeSage
Steven D'Aprano wrote: > That isn't 5.75e30 words, it is the number of possible haikus. There > aren't that many words in all human languages combined. Doh! This is why _I'm_ not a computer scientist. I'm kinda slow. ;) > (Note however that there are languages like Finnish which allow you to > st

Re: Verify an e-mail-adress - syntax and dns

2006-09-24 Thread Ingo Linkweiler
> The usual way to cope with this is sending out confirmation mails. No > need to check if the address is syntactically correct beforehand. yes, I do this allready. But it would be nice to do some checks before to avoid wrong user inputs. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >