Re: Problem with sets and Unicode strings

2006-06-29 Thread Robert Kern
Dennis Benzinger wrote: > Ok, I understand. > But isn't it a (minor) problem that using a set like this: > > # -*- coding: UTF-8 -*- > > FIELDS_SET = set(("Fächer", )) > > print u"Fächer" in FIELDS_SET > print u"Fächer" == "Fächer" > > shadows the error of not setting sys.defaultencoding()? Yo

Re: Database access through python using GUI(Tkinter)

2006-06-29 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, "arvind" <[EMAIL PROTECTED]> wrote: > hi all, > i am accessing sql+ database through python 2.4.3. > i am using Tkinter to build my screens. > how can i pass parameters on the click event of button from one > function to the another? What do you mean by this? If

Re: Problem with sets and Unicode strings

2006-06-29 Thread Dennis Benzinger
Robert Kern wrote: > Dennis Benzinger wrote: >> Ok, I understand. >> But isn't it a (minor) problem that using a set like this: >> >> # -*- coding: UTF-8 -*- >> >> FIELDS_SET = set(("Fächer", )) >> >> print u"Fächer" in FIELDS_SET >> print u"Fächer" == "Fächer" >> >> shadows the error of not settin

Re: Running DocTest on Strings

2006-06-29 Thread Paddy
notanotheridiot wrote: > Hi, > I have two strings - a docstring containing doctests and a code string > containing code to be tested with those doctests. I've been trying for > a day now to run the test without concatenating the two strings, > adding: > > import doctest > doctest.testmod > > to th

Re: struct.unpack on 64-bit platforms

2006-06-29 Thread Jorgen Grahn
On 22 Jun 2006 09:30:26 -0700, Nadav Samet <[EMAIL PROTECTED]> wrote: ... > But apparently, on 64-bit platforms it tries to read 64-bit unsigned > integer (since > that's what the C Type unsigned long means on 64-bit platforms). On /some/ 64-bit platforms. Others let unsigned long be 32-bit and in

small inaccuracy in the logging module documentation (Python Library Reference)

2006-06-29 Thread Petr Jakeš
Hi, I have found some inaccuracy in the Python Library Reference 6.29.5.4 TimedRotatingFileHandler (http://docs.python.org/lib/node349.html) 1) it is not really obvious from the documentation the "when" value has to be in the format "w0", "w1" ... "w6" if "Type of interval" is defined as a "week

Re: Problem with sets and Unicode strings

2006-06-29 Thread Robert Kern
Dennis Benzinger wrote: > Robert Kern wrote: >> Dennis Benzinger wrote: >>> Ok, I understand. >>> But isn't it a (minor) problem that using a set like this: >>> >>> # -*- coding: UTF-8 -*- >>> >>> FIELDS_SET = set(("Fächer", )) >>> >>> print u"Fächer" in FIELDS_SET >>> print u"Fächer" == "Fächer" >

Re: Python in a nutshell - new edition ?

2006-06-29 Thread John Salerno
Alex Martelli wrote: > End of July is our aggressive but still-achievable target: everything > was scheduled from the start to hit OSCON '06 (and the release of Python > 2.5 -- whether 2.5 final will be out at OSCON is still uncertain, > though). I guess we can be patient a little longer. :) I ha

Re: Problem with sets and Unicode strings

2006-06-29 Thread Jean-Paul Calderone
On Thu, 29 Jun 2006 21:19:30 +0200, Dennis Benzinger <[EMAIL PROTECTED]> wrote: >Robert Kern wrote: >> Dennis Benzinger wrote: >>> Ok, I understand. >>> But isn't it a (minor) problem that using a set like this: >>> >>> # -*- coding: UTF-8 -*- >>> >>> FIELDS_SET = set(("Fächer", )) >>> >>> print u"

Re: handling unicode data

2006-06-29 Thread Martin v. Löwis
Filipe wrote: >> Also, it appears that DB-Library (the API used by pymssql) always >> returns CP_ACP characters (unless ANSI-to-OEM conversion is enabled); >> so the "right" encoding to use is "mbcs". > > do you mean using something like the following line? > term = unicode(row[1], "mbcs") Correc

Re: Running DocTest on Strings

2006-06-29 Thread André
Paddy wrote: > notanotheridiot wrote: > > Hi, > > I have two strings - a docstring containing doctests and a code string > > containing code to be tested with those doctests. I've been trying for > > a day now to run the test without concatenating the two strings, > > adding: > > > > import doctes

Re: Bug reporting impossible

2006-06-29 Thread olsongt
> > I usually refrain from posting if I don't have anything to add to the > discussion, but that struck me as perverse and I was curious. > I certainly have no objection to having that bug fixed. : ) > If you find that sort of perversity strangely exciting, I would like to refer you to pages 67-

Re: Interprocess communication on multi-user machine

2006-06-29 Thread Martin v. Löwis
Michael Butscher wrote: > I'm wanting a method for interprocess communication which is OS- > independent (sockets would be the normal way to go), but which works if > multiple users use the machine at the same time so that one user has no > access to the communication of programs of another user.

Re: style question

2006-06-29 Thread Jorgen Grahn
On Mon, 26 Jun 2006 11:47:21 +0200, Fredrik Lundh <[EMAIL PROTECTED]> wrote: ... > assuming fixed-pitch fonts isn't very Pythonic, though; to get reliable > indentation > no matter what font you're using, you can write [...] Since when? I've always coded, in all languages I've ever used[1], unde

Re: sum fonction in gadfly

2006-06-29 Thread aaronwmail-usenet
Robert Hicks wrote: > I haven't been keeping up. Is Gadfly still in development? I always find this question a little irritating -- gadfly is perfect the way it is :). If it ain't broke don't fix it. At least until the python guys make another non-backwards-compatible change that makes a patch

pyGoogle - restrict by country doesn't seem to work

2006-06-29 Thread dananrg
If I want to restrict search results by country, what precisely do I need to include in searchTerm variable below? I've tried: searchTerm = 'restrict:countryUS blah blah' searchTerm = ' countryUS blah blah' Neither work. What am I doing wrong? import google data = google.doGoogleSearch(searchTe

Re: Problem with sets and Unicode strings

2006-06-29 Thread Fredrik Lundh
Dennis Benzinger wrote: >>> shadows the error of not setting sys.defaultencoding()? >> >> You can't set the default encoding. If you could, then scripts that run >> on your machine wouldn't run on mine. >> [...] > > As Serge Orlov wrote in one of his posts you _can_ set the default > encoding

Is it safe to shre a reg exp object among threads?

2006-06-29 Thread overly . crazy . steve
Let's say I construct a regular expression object r by: r = re.compile("some pattern") Is it safe to let multiple threads to use r concurrently (use r.search on different strings, etc.)? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: pyGoogle - restrict by country doesn't seem to work

2006-06-29 Thread dananrg
This worked for me: data = google.doGoogleSearch(searchTerm, restrict = 'countryUS') How does restrict results by country at Google.com? -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language [correction]

2006-06-29 Thread rossberg
Joe Marshall wrote: > Andreas Rossberg wrote: > > > > Which is why this actually is a very bad example to chose for dynamic > > typing advocacy... ;-) > > Actually, this seems a *good* example. The problem seems to be that > you end up throwing the baby out with the bathwater: your static type >

Re: style question

2006-06-29 Thread Fredrik Lundh
Jorgen Grahn wrote: >> assuming fixed-pitch fonts isn't very Pythonic, though; to get reliable >> indentation >> no matter what font you're using, you can write [...] > > Since when? I've always coded, in all languages I've ever used[1], under the > assumption that the reader will view it with

Re: Is it safe to shre a reg exp object among threads?

2006-06-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Let's say I construct a regular expression object r by: > > r = re.compile("some pattern") > > Is it safe to let multiple threads to use r concurrently (use r.search > on different strings, etc.)? yes. -- http://mail.python.org/mailman/listinfo/python-list

Re: Leo 4.4.1 beta 3 released

2006-06-29 Thread aum
On Thu, 29 Jun 2006 11:39:08 -0500, Edward K. Ream wrote: > Leo 4.4.1 beta 3 is now available at: > http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 > > This release corrects several long-standing bugs and adds optional flashing > of matching brackets. (snip) The aut

Re: Passing a Cookie with httplib

2006-06-29 Thread John J. Lee
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2006-06-28, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > From a shell script, I have used /usr/bin/curl to access a web site > > and pass a cookie > > I use ClientCookie for that. > > http://wwwsearch.sourceforge.net/ClientCookie/ Note that

Re: zipfile module doesn't allow append

2006-06-29 Thread Roger Miller
Ritesh Raj Sarraf wrote: > The line > filename = zipfile.ZipFile(zip_file_name, "a") > throws an exception if the given filename is not present already. > Shouldn't it create a file (in case one is not there) since it is > "append" mode ?? Perhaps it would be nicer that way, but it is working as

Re: style question

2006-06-29 Thread Scott David Daniels
Jorgen Grahn wrote: > On Mon, 26 Jun 2006 11:47:21 +0200, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > ... >> assuming fixed-pitch fonts isn't very Pythonic, though; to get reliable >> indentation >> no matter what font you're using, you can write [...] > > Since when? I've always coded, in all la

Re: Bug reporting impossible

2006-06-29 Thread Grant Edwards
On 2006-06-29, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Nick Maclaren wrote: > >> It's definitely worth fixing, but not as a high priority. Invoking a >> file spuriously is potentially serious, with very low probability. > > the traceback printer is reading the file (using a very robust reader),

Re: locating strings approximately

2006-06-29 Thread John Machin
On 29/06/2006 10:52 AM, John Machin wrote: > On 29/06/2006 10:07 AM, BBands wrote: >> On 6/28/06, John Machin <[EMAIL PROTECTED]> wrote: >>> On 29/06/2006 9:28 AM, BBands wrote: >>> > I'd like to see if a string exists, even approximately, in another. >>> For >>> > example if "black" exists in "bl

Reddit broke - should have remained on Lisp?

2006-06-29 Thread Alok
While posting a comment on http://www.reddit.com I got an error page with the following curious statement on it. "reddit broke (sorry)" "looks like we shouldn't have stopped using lisp..." See screenshot at http://photos1.blogger.com/blogger/1773/1980/1600/reddit-broke.jpg Whether they truly rep

Re: Reddit broke - should have remained on Lisp?

2006-06-29 Thread Luis M. González
Alok wrote: > While posting a comment on http://www.reddit.com I got an error page > with the following curious statement on it. > > "reddit broke (sorry)" > "looks like we shouldn't have stopped using lisp..." > > See screenshot at > http://photos1.blogger.com/blogger/1773/1980/1600/reddit-broke.

Re: Reddit broke - should have remained on Lisp?

2006-06-29 Thread Alok
Luis M. González wrote: > Alok wrote: > > While posting a comment on http://www.reddit.com I got an error page > > with the following curious statement on it. > > > > "reddit broke (sorry)" > > "looks like we shouldn't have stopped using lisp..." > > > > See screenshot at > > http://photos1.blogge

Re: Reddit broke - should have remained on Lisp?

2006-06-29 Thread K.S.Sreeram
Luis M. González wrote: > Alok wrote: >> While posting a comment on http://www.reddit.com I got an error page >> with the following curious statement on it. >> >> "reddit broke (sorry)" >> "looks like we shouldn't have stopped using lisp..." > > I don't know if this is true or not, but blaming a l

Re: Reddit broke - should have remained on Lisp?

2006-06-29 Thread Luis M. González
Alok wrote: > I was merely describing my experience and inviting others' response > about theirs. That's exactly what I'm doing. > Please don't misconstrue that as a blame on any language. I think it can be interpreted in many ways. Now if you're not ready to read other people's oppinions, don'

Re: Reddit broke - should have remained on Lisp?

2006-06-29 Thread Tin Gherdanarra
Luis M. González wrote: > Alok wrote: > >>I was merely describing my experience and inviting others' response >>about theirs. > > > That's exactly what I'm doing. > > >>Please don't misconstrue that as a blame on any language. > > > I think it can be interpreted in many ways. > Now if you're

Re: Reddit broke - should have remained on Lisp?

2006-06-29 Thread Luis M. González
K.S.Sreeram wrote: > Have people lost all sense of humor?? Its just reddit's attempt at > humor! I've rarely seen any server errors on reddit, but even when I do > see one.. its funny! > > Here's another one: > http://www.flickr.com/photos/pvera/sets/72057594050280833/ > > Check out their testimon

Re: decimal by default

2006-06-29 Thread Daniel
Alex Martelli wrote: > What about: > > c = compile(thestring, thestring, '') > > cc = new.code( ...all args from c's attributes, except the 5th > one, constants, which should instead be: > decimalize(c.co_consts)...) Wow, what an elegant solution

Re: Reddit broke - should have remained on Lisp?

2006-06-29 Thread Ken Tilton
Luis M. González wrote: > Alok wrote: > >>While posting a comment on http://www.reddit.com I got an error page >>with the following curious statement on it. >> >>"reddit broke (sorry)" >>"looks like we shouldn't have stopped using lisp..." >> >>See screenshot at >>http://photos1.blogger.com/blog

Re: Icono en wxpython

2006-06-29 Thread Philippe Martin
Try Sourceforge. (si j'ai bien compris) Regards, Philippe Bruno Desthuilliers wrote: > Gabriel wrote: >> Hola: >> He echo un programa en wxpython. Se trata de un programa para >> desarrollos con microcontroladores como PIC's etc. en cuanto a >> transmisión RS232 se refiere. >> >> El program

logging module question

2006-06-29 Thread s99999999s2003
hi i have defined a function def logger(logfile,msg): import logging logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)-8s %(message)s', datefmt='%a, %d %b %Y %H:%M:%S',

Re: decimal by default

2006-06-29 Thread Alex Martelli
Daniel <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > What about: > > > > c = compile(thestring, thestring, '') > > > > cc = new.code( ...all args from c's attributes, except the 5th > > one, constants, which should instead be: > > decimal

How to get indices of a two dimensional list

2006-06-29 Thread sramaswamy
I have a list x = [0] * 2 x = x * [2] x[1,1] = 7 This gives me the x value [[0,0] [0,0] [0,0] [0,7]] I want to get the indices of the value 7. i.e. something like i = a.index(max(a)) gives me '1' This only gives me the index in one dimension. Is there any method by which I can get (1,1) as the

No error while sending via TCP Socket

2006-06-29 Thread Martin Bürkle
Hi NG, I have writen a programm using TCP sockets. After i get the connection to another socket I cut the Ethernet cable. Then I send a message. The program doesnt raise any exception. Can somebody tell me why and give me a hint how to get an exception Thanks for your help. Martin -- http://m

Re: Event notification system - where to start ?

2006-06-29 Thread grahamd
[EMAIL PROTECTED] wrote: > We have been asked to develop and application for a client that is a > 'notification" system. We would like to use python, but are struggling > to find the right starting point. Any suggestions, tips or sample code > would be appreciated. > > Application outline; > > M

Re: logging module question

2006-06-29 Thread Martin Jürgens
Am Thu, 29 Jun 2006 20:22:28 -0700 schrieb ss2003: > hi > i have defined a function > def logger(logfile,msg): > import logging > > logging.basicConfig(level=logging.DEBUG, >format='%(asctime)s %(levelname)-8s > %(message)s', >

Re: Reddit broke - should have remained on Lisp?

2006-06-29 Thread Tim X
"Luis M. González" <[EMAIL PROTECTED]> writes: > Alok wrote: >> While posting a comment on http://www.reddit.com I got an error page >> with the following curious statement on it. >> >> "reddit broke (sorry)" >> "looks like we shouldn't have stopped using lisp..." >> >> See screenshot at >> http:/

Re: How to get indices of a two dimensional list

2006-06-29 Thread Simon Forman
[EMAIL PROTECTED] wrote: > I have a list > > x = [0] * 2 > x = x * [2] You're certainly not doing that. >>> x = [0] * 2 >>> x = x * [2] Traceback (most recent call last): File "", line 1, in ? TypeError: can't multiply sequence by non-int And even if you *do* do what it looks like you think y

Re: Reddit broke - should have remained on Lisp?

2006-06-29 Thread Fredrik Lundh
"Alok" wrote: > While posting a comment on http://www.reddit.com I got an error page > with the following curious statement on it. > > "reddit broke (sorry)" > "looks like we shouldn't have stopped using lisp..." > > See screenshot at > http://photos1.blogger.com/blogger/1773/1980/1600/reddit-brok

Import: Multiple modules with same name

2006-06-29 Thread Amit Khemka
Hello All, I have multiple modules with same name in different directories (well I guess thats may not be a good practise, but i needed it for debugging and working with various versions). Now how do I import a module with specifying a path. Few minutes of googling suggested: import ihooks impor

Re: XMLLIB

2006-06-29 Thread Fredrik Lundh
"Heavy" wrote: > I need to know if the 'xmllib' module have some method able to > transform a data structure in a xml file and viceversa, thanks define "data structure" and "xml file (format)". -- http://mail.python.org/mailman/listinfo/python-list

conecting with a MsAcces DB by dao

2006-06-29 Thread luis
Hi I'm using activestate python 2.4 on win xp 2 ed. and Ms Access 2002 (reading first http://starship.python.net/crew/bwilk/access.html) I have writed the following code def append_from_Access(self): try: import ... conn = win32com.client.Dispatch(r'ADODB.Connection') DSN = "P

Re: Bug reporting impossible

2006-06-29 Thread Fredrik Lundh
Nick Maclaren wrote: > |> Why would you have a file named '' in your current directory? > > Why would Python search for one? :-) > > In both cases, the normal answer is "Someone made a mistake" but, if > you have a script that creates a files of the same names specified in > the current directory,

<    1   2