Re: Tamil/Indian Languages Support in Tkinter

2007-06-13 Thread Eric Brunel
On Tue, 12 Jun 2007 19:32:38 +0200, reverse_gear <[EMAIL PROTECTED]> wrote: > hi, > Does Tkinter has support for tamil/Indian Languages?? > I tried this code > it is able to print both tamil and german text on console.. but on > Tkinter Label it is printing only the german code > Plz help > from

Re: Bytes/File Size Format Function

2007-06-13 Thread Tim Roberts
samuraisam <[EMAIL PROTECTED]> wrote: > >Quick file size formatting for all those seekers out there... > >import math > >def filesizeformat(bytes, precision=2): >"""Returns a humanized string for a given amount of bytes""" >bytes = int(bytes) >if bytes is 0: >return '0bytes' >

How to create a tuple quickly with list comprehension?

2007-06-13 Thread [EMAIL PROTECTED]
Hi all, I can use list comprehension to create list quickly. So I expected that I can created tuple quickly with the same syntax. But I found that the same syntax will get a generator, not a tuple. Here is my example: In [147]: a = (i for i in range(10)) In [148]: b = [i for i in range(10)] In

Re: Bytes/File Size Format Function

2007-06-13 Thread half . italian
On Jun 12, 8:47 pm, samuraisam <[EMAIL PROTECTED]> wrote: > Quick file size formatting for all those seekers out there... > > import math > > def filesizeformat(bytes, precision=2): > """Returns a humanized string for a given amount of bytes""" > bytes = int(bytes) > if bytes is 0: >

Re: Bytes/File Size Format Function

2007-06-13 Thread half . italian
On Jun 13, 12:48 am, [EMAIL PROTECTED] wrote: > On Jun 12, 8:47 pm, samuraisam <[EMAIL PROTECTED]> wrote: > > > > > Quick file size formatting for all those seekers out there... > > > import math > > > def filesizeformat(bytes, precision=2): > > """Returns a humanized string for a given amount

Re: Bytes/File Size Format Function

2007-06-13 Thread half . italian
On Jun 13, 12:48 am, [EMAIL PROTECTED] wrote: > On Jun 12, 8:47 pm, samuraisam <[EMAIL PROTECTED]> wrote: > > > > > Quick file size formatting for all those seekers out there... > > > import math > > > def filesizeformat(bytes, precision=2): > > """Returns a humanized string for a given amount

Re: a question about unicode in python

2007-06-13 Thread Andre Engels
2007/6/12, WolfgangZ <[EMAIL PROTECTED]>: > hzqij schrieb: > > i have a python source code test.py > > > > # -*- coding: UTF-8 -*- > > > > # s is a unicode string, include chinese > > s = u'张三' > > > > then i run > > > > $ python test.py > > UnicodeDecodeError: 'utf8' codec can't decode bytes in po

Re: Multiline lamba implementation in python.

2007-06-13 Thread Duncan Booth
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > But you already have "multiline" lambdas right now in that sense, no > need to add anything. I think you were talking about lambdas *with* > statements inside. > > bin = lambda x:((x&8 and '*' or '_') + > (x&4 and '*' or '_') + >

Re: userinteraction for a webspider

2007-06-13 Thread Chris
James Stroud schrieb: > > There are sweatshops in developing countries that provide this service. > > James But since this is for fun/convenience for me only Id rather not make anyone break asweat... Great advice, helpful too -- http://mail.python.org/mailman/listinfo/python-list

Re: How to save python codes in files?

2007-06-13 Thread why?
Evan Klitzke wrote: > On 6/12/07, why? <[EMAIL PROTECTED]> wrote: > > Im working with Python 2.2 on my red hat linux system. Is there any > > way to write python codes in separate files and save them so that i > > can view/edit them in the future? Actually I've just started with > > python and wou

Re: How to create a tuple quickly with list comprehension?

2007-06-13 Thread markacy
On 13 Cze, 09:45, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi all, > > I can use list comprehension to create list quickly. So I expected that I > can created tuple quickly with the same syntax. But I found that the > same syntax will get a generator, not a tuple. Here is my example: > > In

Re: How to save python codes in files?

2007-06-13 Thread Evan Klitzke
On 6/13/07, why? <[EMAIL PROTECTED]> wrote: > > Evan Klitzke wrote: > > On 6/12/07, why? <[EMAIL PROTECTED]> wrote: > > > Im working with Python 2.2 on my red hat linux system. Is there any > > > way to write python codes in separate files and save them so that i > > > can view/edit them in the fut

Re: How to create a tuple quickly with list comprehension?

2007-06-13 Thread Diez B. Roggisch
markacy wrote: > On 13 Cze, 09:45, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> Hi all, >> >> I can use list comprehension to create list quickly. So I expected that I >> can created tuple quickly with the same syntax. But I found that the >> same syntax will get a generator, not a tuple. Her

Re: questions about solving equations in scipy

2007-06-13 Thread [EMAIL PROTECTED]
Hi Robert, Thanks a lot for your kindness. Robert Kern wrote: > [EMAIL PROTECTED] wrote: >> Hi all, >> >> I have two questions about scipy. > > You're likely to get a better response from the scipy mailing list. Here, you'll > primarily get me, and I have to rush out right now. > > http://www.

Re: How to save python codes in files?

2007-06-13 Thread markacy
On 13 Cze, 10:06, why? <[EMAIL PROTECTED]> wrote: > Evan Klitzke wrote: > > On 6/12/07, why? <[EMAIL PROTECTED]> wrote: > > > Im working with Python 2.2 on my red hat linux system. Is there any > > > way to write python codes in separate files and save them so that i > > > can view/edit them in the

Re: a question about unicode in python

2007-06-13 Thread Evan Klitzke
On 6/13/07, Andre Engels <[EMAIL PROTECTED]> wrote: > 2007/6/12, WolfgangZ <[EMAIL PROTECTED]>: > > hzqij schrieb: > > > i have a python source code test.py > > > > > > # -*- coding: UTF-8 -*- > > > > > > # s is a unicode string, include chinese > > > s = u'张三' > > > > > > then i run > > > > > > $

Re: cgi.FieldStorage() not working on Windows

2007-06-13 Thread Graham Dumpleton
On Jun 13, 12:58 pm, arorap <[EMAIL PROTECTED]> wrote: > Thanks for your reply. > > The reason I want to run it as CGI (even though mod_php is available > on my local computer Why do you keep mentioning mod_php, surely you mean mod_python. > is that the target machine to which I will > finally be

Re: MS Word parser

2007-06-13 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hi all, > I'm currently using antiword to extract content from MS Word files. > Is there another way to do this without relying on any command prompt > application? Well you haven't given your environment, but is there anything to stop you from controlling Word itself vi

Dive into Python 5.5

2007-06-13 Thread james_027
Hi, class UserDict: def __init__(self, dict=None): self.data = {} if dict is not None: self.update(dict) I just don't understant this code, as it is not also mention in the book. the update is a method of a dict right? in my understanding the last statement should be self.data

How to format a string from an array?

2007-06-13 Thread Allen
a = range(256) I want to output the formated string to be: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f f0 f1 f2 f3 f4 f5 6 f7 f8 f9 fa fb fc fd fe ff How to do it? --

Re: Postpone creation of attributes until needed

2007-06-13 Thread Frank Millman
On Jun 13, 1:24 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Tue, 12 Jun 2007 08:53:11 -0700, Frank Millman wrote: > > Ah, if I had ever read that there were two instances involved, I hadn't > noticed. Sorry! > No problem - I really appreciate your input. I snipped the rest of your post, a

Re: updating db with csv

2007-06-13 Thread Captain Paralytic
On 13 Jun, 06:35, Tim Roberts <[EMAIL PROTECTED]> wrote: > Captain Paralytic <[EMAIL PROTECTED]> wrote: > >On 11 Jun, 07:37, Tim Roberts <[EMAIL PROTECTED]> wrote: > >| Not in standard SQL. MySQL supports a REPLACE extension that does > >| an UPDATE if the key already exists, and an INSERT if it d

Re: In C extension .pyd, sizeof INT64 = 4?

2007-06-13 Thread Allen
On 6 13 , 11 55 , "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > I used INT64 and initialize its value from PyArg_ParseTuple. > > The code is PyArg_ParseTuple(args, "l", &nValue). > > It should be PyArg_ParseTuple(args, "L", &nValue). > > That's still incorrect. For the L format flag, use PY_LO

Re: Where can I suggest an enchantment for Python Zip lib?

2007-06-13 Thread durumdara
> On my 3 year old 3Ghz Pentium III it takes about 8 seconds to zip 20Mb file. > So what is the problem? Not updating the process for 8-10 seconds > should be just fine for most applications. > > -Larry The problem, that: - I want to process 100-200 MB zip files. - I want to abort in process -

Re: Bytes/File Size Format Function

2007-06-13 Thread Ben Finney
samuraisam <[EMAIL PROTECTED]> writes: > Quick file size formatting for all those seekers out there... > > import math > > def filesizeformat(bytes, precision=2): > """Returns a humanized string for a given amount of bytes""" > bytes = int(bytes) > if bytes is 0: > return '0byt

Re: List sequential initialization

2007-06-13 Thread Dave Baum
In article <[EMAIL PROTECTED]>, HMS Surprise <[EMAIL PROTECTED]> wrote: > I thought if I could do this: > >>> a = b = '' a and b refer to the same object (the empty string) > >>> a = 'a' You are assigning a new value to a - it now refers to the string 'a', while b refers to the same thing it

Is there any way to catch expections when call python method in C++

2007-06-13 Thread Allen
I use try catch, but cannot catch the execeptions of execution python method. PYCALL_API void PyCall(const char * pszModule, const char * pszFunc, void * pArg) { if (pszModule == NULL || pszFunc == NULL) { return; } Py_Initialize(); PyObjec

Re: Dive into Python 5.5

2007-06-13 Thread Ben Finney
james_027 <[EMAIL PROTECTED]> writes: > class UserDict: > def __init__(self, dict=None): > self.data = {} > if dict is not None: self.update(dict) The code confusingly shadows the builtin 'dict' type with a poorly-chosen parameter name. See if this makes things less confusing:

Re: Dive into Python 5.5

2007-06-13 Thread Daniel Nogradi
> class UserDict: > def __init__(self, dict=None): > self.data = {} > if dict is not None: self.update(dict) > > I just don't understant this code, as it is not also mention in the > book. the update is a method of a dict right? in my understanding the > last statement should be

Re: How to create a tuple quickly with list comprehension?

2007-06-13 Thread Ben Finney
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I can use list comprehension to create list quickly. So I expected > that I can created tuple quickly with the same syntax. Nope. The list comprehension syntax creates lists. > But I found that the same syntax will get a generator, not a > tuple.

Re: cStringIO change in 2.4 vs 2.5. Regression?

2007-06-13 Thread Markus Schöpflin
Terry Reedy wrote: > "Markus Schöpflin" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | Hello, > | > | I just stumbled accross a difference between cStringIO in Python 2.4 > | and 2.5. You can no longer feed arrays to cStringIO. > [snip] > | Has this change been done on purpose

Re: Dive into Python 5.5

2007-06-13 Thread 7stud
On Jun 13, 2:40 am, james_027 <[EMAIL PROTECTED]> wrote: > Hi, > > class UserDict: > def __init__(self, dict=None): > self.data = {} > if dict is not None: self.update(dict) > > I just don't understant this code, as it is not also mention in the > book. the update is a method of

Re: cStringIO change in 2.4 vs 2.5. Regression?

2007-06-13 Thread Markus Schöpflin
Markus Schöpflin wrote: [...] > I think I'll file a bug at SF... maybe someone else will spot something. Should have checked the bugtracker first... it was reported the day after my original post: http://sourceforge.net/tracker/index.php?func=detail&aid=1730114&group_id=5470&atid=105470 And i

Focus to be removed

2007-06-13 Thread munashkrar03
Hi Dear I'm very pleased to have your help about to solve a technical issue related to HTML Editlet Editor. In this I' m facing the problem that I'm getting unable to find the particular coding which lets this HTML Editor to be focused after loading on the page. Actually I'm using this HTML Edit

Re: In C extension .pyd, sizeof INT64 = 4?

2007-06-13 Thread Tommy Nordgren
On 12 jun 2007, at 12.03, Allen wrote: > My C extension works wrong, and debug it, found that sizeof (INT64) = > 4, not 8. > I compile on Windows XP platform. > Please tell me how to fix it to support INT64? > Thanks. > > -- > http://mail.python.org/mailman/listinfo/python-list On compi

Re: SimplePrograms challenge

2007-06-13 Thread Steve Howell
--- Steven Bethard <[EMAIL PROTECTED]> wrote: > Stefan Behnel wrote: > > Steven Bethard wrote: > >> If you want to parse invalid HTML, I strongly > encourage you to look into > >> BeautifulSoup. Here's the updated code: > >> > >> import ElementSoup # > http://effbot.org/zone/element-soup.htm

Re: Convert String to Int and Arithmetic

2007-06-13 Thread bearophileHUGS
Kay Schluehr: > >>> int(cpuSpeed.split(":")[1].strip()) Probably this suffices: int(cpuSpeed.split(":")[1]) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create a tuple quickly with list comprehension?

2007-06-13 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Diez B. Roggisch wrote: > No need to create the intermediate list, a generator expression works just > fine: > > a = tuple(i for i in range(10)) But `range()` creates the intermediate list anyway. ;-) a = tuple(xrange(10)) Ciao, Marc 'BlackJack' Rintsch -- ht

Re: How to create a tuple quickly with list comprehension?

2007-06-13 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi all, > > I can use list comprehension to create list quickly. So I expected that I > can created tuple quickly with the same syntax. But I found that the > same syntax will get a generator, not a tuple. Here is my example: > > In [147]: a = (i for i in range(10))

Re: How to format a string from an array?

2007-06-13 Thread rocksportrocker
On Jun 13, 11:11 am, Allen <[EMAIL PROTECTED]> wrote: > a = range(256) > I want to output the formated string to be: > 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f > 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f > > f

Re: Why can't easy_install Django

2007-06-13 Thread Paul Boddie
On 13 Jun, 03:21, kernel1983 <[EMAIL PROTECTED]> wrote: > I look it up in PyPI [...] > Django is a big project. Why no one maintain this? Did the guy lost > his password? Who knows? But then, if you're running a GNU/Linux distribution like Debian, it's quite possible to use a system package, any

Re: How to create a tuple quickly with list comprehension?

2007-06-13 Thread Dustan
On Jun 13, 5:37 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Diez B. Roggisch wrote: > > > No need to create the intermediate list, a generator expression works just > > fine: > > > a = tuple(i for i in range(10)) > > But `range()` creates the intermediate list

Re: SimplePrograms challenge

2007-06-13 Thread Rob Wolfe
Steve Howell wrote: > I suggested earlier that maybe we post multiple > solutions. That makes me a little nervous, to the > extent that it shows that the Python community has a > hard time coming to consensus on tools sometimes. We agree that BeautifulSoup is the best for parsing HTML. :) > Th

Re: Is there any way to catch expections when call python method in C++

2007-06-13 Thread cptnwillard
One way is to create an intermediate python function, which returns a special value when an exception is caught. def ExceptionCatcher(FunctionToCall): def F(): try: FunctionToCall() except: return -1 return 0 return F Then instead of calling your function, you woul

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-13 Thread Neil Cerutti
On 2007-06-12, Anders J. Munch <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: >> Steven D'Aprano <[EMAIL PROTECTED]> writes: Not tail calls, in general, no. >>> Sorry, how does that work? You're suggesting that there is an >>> algorithm which the compiler could follow to optimize away >>> tail

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-13 Thread Neil Cerutti
On 2007-06-13, Steve Howell <[EMAIL PROTECTED]> wrote: > You would just change the language definition to say that once > you enter f(), any call to f() from within f() behaves as if > the recursively called f() still points to the originally bound > version of f. To want any other behavior would

ANN: xlrd 0.6.1 final is now available

2007-06-13 Thread John Machin
The final release of version 0.6.1 of xlrd is now available from http://www.lexicon.net/sjmachin/xlrd.htm and from the Cheeseshop (http://cheeseshop.python.org/pypi/xlrd). What is xlrd? It's a small (download approx 0.1 Mb) pure-Python library for extracting information from Microsoft Excel (tm)

Re: How to format a string from an array?

2007-06-13 Thread Gerard Flanagan
On Jun 13, 11:11 am, Allen <[EMAIL PROTECTED]> wrote: > a = range(256) > I want to output the formated string to be: > 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f > 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f > > f

shape recognition

2007-06-13 Thread madprocessor
hi there, does anybody know about shape / gesture recognition librarys for python? like cali: http://immi.inesc-id.pt/cali/ thx joerg -- http://mail.python.org/mailman/listinfo/python-list

Convert binary string to something meaningful??

2007-06-13 Thread supercooper
I have this string that is being returned from a query on a DBISAM database. The field must be some sort of blob, and when I connect to the database thru ODBC in MS Access, the field type comes thru as OLE Object, and Access cannot read the field (it usually crashes Access). I can sorta pick out th

Re: cgi.FieldStorage() not working on Windows

2007-06-13 Thread arorap
OOps .. yes I mean mod_python. I've been using PHP way too long :P .. hence the typo On Jun 13, 4:01 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Jun 13, 12:58 pm,arorap<[EMAIL PROTECTED]> wrote: > > > Thanks for your reply. > > > The reason I want to run it as CGI (even though mod_php is

Re: Convert binary string to something meaningful??

2007-06-13 Thread Grant Edwards
On 2007-06-13, supercooper <[EMAIL PROTECTED]> wrote: > I have this string that is being returned from a query on a DBISAM > database. The field must be some sort of blob, and when I connect to > the database thru ODBC in MS Access, the field type comes thru as OLE > Object, and Access cannot read

passing arguments to tcpserver classes

2007-06-13 Thread Eric Spaulding
Is there an easy way to pass arguments to a handler class that is used by the standard TCPServer? normally --> srvr =SocketServer.TCPServer(('',port_num), TCPHandlerClass) I'd like to be able to: srvr =SocketServer.TCPServer(('',port_num), TCPHandlerClass, (arg1,arg2)) And have arg1, arg2 avai

Re: httplib / connection

2007-06-13 Thread rhXX
> The > httplib.HTTP class that you were using is very old and deprecated for > several years now. > > -- > Gabriel Genellina :-( oh , tks! i took it from www.ug.it.usyd.edu.au/~comp5315/lec-09.html which class must i use? tks in advance -- http://mail.python.org/mailman/listinfo/python

Re: Postpone creation of attributes until needed

2007-06-13 Thread Steven D'Aprano
On Wed, 13 Jun 2007 02:15:11 -0700, Frank Millman wrote: > Thanks very much for all your attempts to help me, Steven. You have > succeeded in getting me to think properly about my problem and come up > with a much cleaner solution. I really appreciate it. Glad to be of help. -- Steven. -- ht

Re: Is there any way to catch expections when call python method in C++

2007-06-13 Thread Robert Bauck Hamar
Allen wrote: > I use try catch, but cannot catch the execeptions of execution python > method. > > PYCALL_API void PyCall(const char * pszModule, const char * pszFunc, > void * pArg) > { > if (pszModule == NULL || pszFunc == NULL) > { > return; > } > > Py_Initialize(); > > PyObject * pModule =

Optimizing constants in loops

2007-06-13 Thread Michael Hoffman
The peephole optimizer now takes things like if 0: do_stuff() and optimizes them away, and optimizes away the conditional in "if 1:". What if I had a function like this? def func(debug=False): for index in xrange(100): if debug: print index do_stuff(i

Python Job Opportunity

2007-06-13 Thread Brettmf
My company : EWT, LLC EWT is a proprietary securities trading company and is a member firm of major stock and futures exchanges. Founded in 2002, EWT was formed to capitalize on the shift of the securities industry towards electronic platforms in the United States and abroad. Location: Beverly Hi

Re: SimplePrograms challenge

2007-06-13 Thread Steven Bethard
Rob Wolfe wrote: > Steve Howell wrote: > >> I suggested earlier that maybe we post multiple >> solutions. That makes me a little nervous, to the >> extent that it shows that the Python community has a >> hard time coming to consensus on tools sometimes. > > We agree that BeautifulSoup is the bes

Re: Optimizing constants in loops

2007-06-13 Thread Thomas Heller
Michael Hoffman schrieb: > The peephole optimizer now takes things like > > if 0: > do_stuff() > > and optimizes them away, and optimizes away the conditional in "if 1:". > > What if I had a function like this? > > def func(debug=False): > for index in xrange(100): > if de

problem on waiting exit thread and write on file

2007-06-13 Thread Flyzone
I have a list of parameters. I need to run in thread a command, one thread for one parameter. So i made a for loop, creating 5 threads and waiting their stop with: for parameter in parameters Thread{ write on BW2 } Main { open file BW2 for write . (creating list of

Re: MS Word parser

2007-06-13 Thread [EMAIL PROTECTED]
On Jun 13, 1:28 am, Tim Golden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi all, > > I'm currently using antiword to extract content from MS Word files. > > Is there another way to do this without relying on any command prompt > > application? > > Well you haven't given your environ

Re: Bytes/File Size Format Function

2007-06-13 Thread samuraisam
Haha, you guys. Use it however you want. But trust me, if you put MiB and GiB instead of the more-common mb and gb [MB and GB] in your applications, your users will probably have a harder time understanding what you mean. -- http://mail.python.org/mailman/listinfo/python-list

Cretins.

2007-06-13 Thread Dr. Pastor
Please do not do business with those cretins who without authorization attaching the following text to my postings: == Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News== http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups = East and

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-13 Thread Anders J. Munch
Neil Cerutti wrote: > On 2007-06-12, Anders J. Munch <[EMAIL PROTECTED]> wrote: >> Converting tail-recursion to iteration is trivial, and >> perfectly reasonable for a human to do by hand. > > For simple recursive tail calls, yeah, it can be. Translating a > tail-recursive Factorial function int

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-13 Thread Anders J. Munch
Alexander Schmolck wrote: > "Anders J. Munch" <[EMAIL PROTECTED]> writes: > >> Like Steven said, tail-call optimisation is not necessary as you can always >> hand-optimise it yourself. > > Care to demonstrate on some code written in CPS (a compiler or parser, say)? I meant tail recursion, not ta

Re: Windows build of PostgreSQL library for 2.5

2007-06-13 Thread Ben Sizer
On 30 May, 16:20, Ben Sizer <[EMAIL PROTECTED]> wrote: > On 30 May, 15:42, Frank Millman <[EMAIL PROTECTED]> wrote: > > > On May 30, 4:15 pm,BenSizer<[EMAIL PROTECTED]> wrote: > > > > I've been looking for a Windows version of a library to interface to > > > PostgreSQL, but can only find ones compi

Re: Bytes/File Size Format Function

2007-06-13 Thread Avell Diroll
Ben Finney wrote: > The symbol for "bit" is 'b'. The symbol for "byte" is 'B'. 'kb' is > 'kilobit', i.e. 1000 bits. 'mb' is a "metre-bit", a combination of two > units. And so on. The SI units have definitions that are only muddied > by misusing them this way. I have to disagree: 'mb' should stand

Re: Python Help!!!

2007-06-13 Thread Nathan Harmston
Hi, you could try this: def parse(self, ifile): id="" seq="" for line in open(ifile, 'r'): if '>'==line[0]: if id!="" and len(seq)>0: yield id,seq seq = "" id=line[1:].strip("\n")

Re: Optimizing constants in loops

2007-06-13 Thread Michael Hoffman
Thomas Heller wrote: > Just use the builtin __debug__ variable for that purpose. > __debug__ is 'True' if Python is run normally, and 'False' > if run with the '-O' or '-OO' command line flag. > The optimizer works in the way you describe above (which > it will not if you use a custom variable).

Re: Windows build of PostgreSQL library for 2.5

2007-06-13 Thread George Sakkis
On Jun 13, 12:57 pm, Ben Sizer <[EMAIL PROTECTED]> wrote: > On 30 May, 16:20, Ben Sizer <[EMAIL PROTECTED]> wrote: > > > On 30 May, 15:42, Frank Millman <[EMAIL PROTECTED]> wrote: > > > > On May 30, 4:15 pm,BenSizer<[EMAIL PROTECTED]> wrote: > > > > > I've been looking for a Windows version of a li

Re: Focus to be removed

2007-06-13 Thread Gabriel Genellina
En Wed, 13 Jun 2007 07:13:18 -0300, <[EMAIL PROTECTED]> escribió: > I'm very pleased to have your help about to solve a technical issue > related to HTML Editlet Editor. In this I' m facing the problem that You should ask the author - I don't think this product has anything to do with Python.

Re: problem on waiting exit thread and write on file

2007-06-13 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Flyzone wrote: > I need to run in thread a command, one thread for one parameter. > So i made a for loop, creating 5 threads and waiting their stop with: > Main { >open file BW2 for write >. (creating list of thread with a counter) >Stopped=False >wh

Re: Python Help!!!

2007-06-13 Thread Christof Winter
Elfine Peterson Tjio wrote: > I'm trying to make a program that reads Fasta file and print it out. I used > the SeqIO module and the results is: > > 'ATGGTCATSingleAlphabet()' > > For this purpose, should I use SeqIO or Fasta? > > for example: > > from Bio import SeqIO > > or > > from Bio

Re: logging module and threading

2007-06-13 Thread Vinay Sajip
On Jun 13, 1:28 am, "James T. Dennis" <[EMAIL PROTECTED]> wrote: > This sounds like a job for the Queue class/module to me. > Could you create a Queue such that all your worker threads > are producers to it and you have one dedicated thread as a > consumer that relays log entries from the Queue

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-13 Thread Neil Cerutti
On 2007-06-13, Anders J. Munch <[EMAIL PROTECTED]> wrote: > General tail-call optimisation is of course completely > out-of-bounds for Python, because it ruins tracebacks. Unlike > tail recursion, which could use recursion counters. Is it really ruined? To use a similar example: def foo(x):

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-13 Thread Carsten Haese
On Wed, 2007-06-13 at 18:22 +, Neil Cerutti wrote: > On 2007-06-13, Anders J. Munch <[EMAIL PROTECTED]> wrote: > > General tail-call optimisation is of course completely > > out-of-bounds for Python, because it ruins tracebacks. Unlike > > tail recursion, which could use recursion counters. >

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-13 Thread Neil Cerutti
On 2007-06-13, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-06-13, Anders J. Munch <[EMAIL PROTECTED]> wrote: >> General tail-call optimisation is of course completely >> out-of-bounds for Python, because it ruins tracebacks. Unlike >> tail recursion, which could use recursion counters. > > I

Goto

2007-06-13 Thread HMS Surprise
How does one effect a goto in python? I only want to use it for debug. I dasn't slap an "if" clause around the portion to dummy out, the indentation police will nab me. Thanx, jh -- http://mail.python.org/mailman/listinfo/python-list

Build EXE on Mac OsX 10.4

2007-06-13 Thread Tempo
Has anyone sucesfully built a *.exe file on a mac operating system before from a *.py file? I have been trying to do this with pyinstaller, but I keep getting errors and I don't know how to install UPX properly. I tried putting the linux UPX folder in my python 2.4 directory, but that didn't work.

Re: Goto

2007-06-13 Thread Daniel Nogradi
> How does one effect a goto in python? I only want to use it for debug. > I dasn't slap an "if" clause around the portion to dummy out, the > indentation police will nab me. http://entrian.com/goto/ -- http://mail.python.org/mailman/listinfo/python-list

Re: SimplePrograms challenge

2007-06-13 Thread Rob Wolfe
Steven Bethard <[EMAIL PROTECTED]> writes: >> I vote for example with ElementTree (without xpath) >> with a mention of using ElementSoup for invalid HTML. > > Sounds good to me. Maybe something like:: > > import xml.etree.ElementTree as etree > dinner_recipe = ''' > > 24slicesbaguette > 2+tbspol

mapping subintervals

2007-06-13 Thread Lee Sander
hi, I have the following problem which is turning out to be non-trivial. I realize that this is not exactly a python problem but more of an algorithm problem -- but I post it here because I want to implement this in python. I want to write a code that given an interval (integer tuple: start,stop)

Re: In C extension .pyd, sizeof INT64 = 4?

2007-06-13 Thread Gabriel Genellina
On 12 jun, 17:06, "Martin v. Lo"wis" <[EMAIL PROTECTED]> wrote: > > What *is*INT64? It's not a builtin type of standard C, it isn't > defined by Microsoft C, and it isn't predefined by Python. > > So it must be something that you have defined, and apparently > incorrectly. How did you define it? I

Re: SimplePrograms challenge

2007-06-13 Thread Steven Bethard
Rob Wolfe wrote: > Steven Bethard <[EMAIL PROTECTED]> writes: > >>> I vote for example with ElementTree (without xpath) >>> with a mention of using ElementSoup for invalid HTML. >> Sounds good to me. Maybe something like:: >> >> import xml.etree.ElementTree as etree >> dinner_recipe = ''' >> >>

Re: Goto

2007-06-13 Thread Carsten Haese
On Wed, 2007-06-13 at 12:20 -0700, HMS Surprise wrote: > How does one effect a goto in python? One doesn't. > I only want to use it for debug. > I dasn't slap an "if" clause around the portion to dummy out, the > indentation police will nab me. If you want to disable a code block without indent

wx Listbox event

2007-06-13 Thread Marcpp
Hi, I need to charge a list when starts the program. I've tried a few events like: self.llistatids = wx.ListBox(self, -1, choices=['a'], style=wx.LB_SINGLE|wx.LB_ALWAYS_SB) self.llistatids.SetBackgroundColour(wx.Colour(255, 255, 220)) self.llistatids.Bind(wx.EVT_LISTBOX, self.carrega_llistatids)

Re: Build EXE on Mac OsX 10.4

2007-06-13 Thread Paul McNett
Tempo wrote: > Has anyone sucesfully built a *.exe file on a mac operating system > before from a *.py file? I have been trying to do this with > pyinstaller, but I keep getting errors and I don't know how to install > UPX properly. I tried putting the linux UPX folder in my python 2.4 > directory,

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-13 Thread Terry Reedy
"Steve Howell" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | | You would just change the language definition to say | that once you enter f(), any call to f() from within | f() behaves as if the recursively called f() still | points to the originally bound version of f. I am pret

Re: Goto

2007-06-13 Thread HMS Surprise
Thanks folks! jh -- http://mail.python.org/mailman/listinfo/python-list

Re: Build EXE on Mac OsX 10.4

2007-06-13 Thread -b
Okay. Great. Thanks for clarifying that for me. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create a tuple quickly with list comprehension?

2007-06-13 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I can use list comprehension to create list quickly. So I expected that I | can created tuple quickly with the same syntax. But I found that the | same syntax will get a generator, not a tuple. Here is my example: | | In [147]: a = (i f

Re: mapping subintervals

2007-06-13 Thread Matteo
On Jun 13, 2:32 pm, Lee Sander <[EMAIL PROTECTED]> wrote: > hi, > I have the following problem which is turning out to be non-trivial. I > realize that this is not > exactly a python problem but more of an algorithm problem -- but I > post it here because > I want to implement this in python. > > I

Re: SimplePrograms challenge

2007-06-13 Thread infidel
# writing/reading CSV files, tuple-unpacking, cmp() built-in import csv writer = csv.writer(open('stocks.csv', 'wb')) writer.writerows([ ('GOOG', 'Google, Inc.', 505.24, 0.47, 0.09), ('YHOO', 'Yahoo! Inc.', 27.38, 0.33, 1.22), ('CNET', 'CNET Networks, Inc.', 8.62, -0.13, -1.49) ]) sto

Re: Windows XP timezone language issue

2007-06-13 Thread MRAB
On Jun 13, 7:31 am, Paul Sijben <[EMAIL PROTECTED]> wrote: > I ran into an internationalization issue. I need a consistent idea about > the timezone my application is running on. However when I run the following: > >>> import time > >>> time.tzname > > I get back ('West-Europa (standaardtijd)', '

one-time initialization of class members

2007-06-13 Thread James Turk
Hi, I have a situation where I have some class members that should only be done once. Essentially my problem looks like this: class Base(object): dataset = None def __init__(self, param): if type(self).dataset is None: # code to load dataset based on param, expensive

Re: Build EXE on Mac OsX 10.4

2007-06-13 Thread Kevin Walzer
Paul McNett wrote: > Tempo wrote: >> Has anyone sucesfully built a *.exe file on a mac operating system >> before from a *.py file? I have been trying to do this with >> pyinstaller, but I keep getting errors and I don't know how to install >> UPX properly. I tried putting the linux UPX folder in m

Re: mapping subintervals

2007-06-13 Thread Nis Jørgensen
Matteo skrev: > OK - I'm going to assume your intervals are inclusive (i.e. 34-51 > contains both 34 and 51). > > If your intervals are all really all non-overlapping, one thing you > can try is to put all the endpoints in a single list, and sort it. > Then, you can use the bisect module to searc

Re: one-time initialization of class members

2007-06-13 Thread Steven Bethard
James Turk wrote: > Hi, > > I have a situation where I have some class members that should only be > done once. Essentially my problem looks like this: > > class Base(object): > dataset = None > > def __init__(self, param): > if type(self).dataset is None: > # code t

Re: Bytes/File Size Format Function

2007-06-13 Thread Ben Finney
Avell Diroll <[EMAIL PROTECTED]> writes: > I have to disagree: 'mb' should stand for "milli-bit" :) Yes, you're right. My "metre-bit" was wrong. -- \ "Whenever you read a good book, it's like the author is right | `\ there, in the room talking to you, which is why I don't like to |

  1   2   >