Re: How to display Chinese in a list retrieved from database via python

2008-12-24 Thread Chris Rebert
On Wed, Dec 24, 2008 at 11:29 PM, zxo102 wrote: > Hi, > I retrieve some info in Chinese from postgresql and assign it to a > variable 'info' defined in javascript of a html page: > var info = ['\xd6\xd0\xce\xc4','\xd6\xd0\xce\xc4','\xd6\xd0\xce > \xc4'] > But I want it to be > var info = [

How to display Chinese in a list retrieved from database via python

2008-12-24 Thread zxo102
Hi, I retrieve some info in Chinese from postgresql and assign it to a variable 'info' defined in javascript of a html page: var info = ['\xd6\xd0\xce\xc4','\xd6\xd0\xce\xc4','\xd6\xd0\xce \xc4'] But I want it to be var info = ['中文','中文','中文'] since in html pages (via javascript), the

RE: How to change a generator ? - resolved

2008-12-24 Thread Barak, Ron
Hi Gabriel, Your remarks fixed my problem. Now my code looks as below, and behaves as expected. Thanks Gabriel. Merry Christmas and Happy Hanukkah, Ron. $ cat generator.py #!/usr/bin/env python import gzip from Debug import _line as line class LogStream(): def __init__(self, filename)

Re: ctypes & strings

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 23:07:27 -0200, Red Rackham escribió: I would like to pass a string into a dll function.  I notice that to pass using ctypes, it has to be a ctypes type.  Looking at the ctypes doc page I don't see a c_string class.  Because the C language doesn't have a string type? Py

Re: Easy-to-use Python GUI

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 21:47:07 -0200, Joel Koltner escribió: Is there an easy-to-use, "function"-based cross-platform GUI toolkit for Python out there that's a little more sophisticated than EasyGui? Try Dabo http://dabodev.com/ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/

Re: PythonCard timer/thread tutorial

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 20:56:45 -0200, Sponge Nebson escribió: This is my first post. Nice to meet you all! Could one of you walk me through this code? It is from David McNab and Alex Tweedly's tutorial on timers and threads, which can be found here: Mike Driscoll has already answered your quest

Re: Easy-to-use Python GUI

2008-12-24 Thread Raven
On 25 дек, 06:47, "Joel Koltner" wrote: > Is there an easy-to-use, "function"-based cross-platform GUI toolkit for > Python out there that's a little more sophisticated than EasyGui?  EasyGui > looks good, but it's a little more restrictive than what I'd like to have, yet > I'm (stubbornly :-) ) r

www.iofferkicks.com china cheap wholesale nike shoes,air jordan shoes,air force one shoes.

2008-12-24 Thread www.iofferkicks.com
Get Nike Shoes at Super Cheap Prices Discount Nike air jordans (www.iofferkicks.com) Discount Nike Air Max 90 Sneakers (www.iofferkicks.com) Discount Nike Air Max 91 Supplier (www.iofferkicks.com) Discount Nike Air Max 95 Shoes Supplier (www.iofferkicks.com) Discount Nike Air Max 97 Trainers (

contour in python

2008-12-24 Thread Ayat Rezaee
 Hello, I need your help,  I want to make a plot something like this program,    import Numeric as N    from contour import contour    x = N.arange(25) * 15.0 - 180.0    y = N.arange(13) * 15.0 - 90.0     data = N.outerproduct(N.sin(y*N.pi/360.), N.cos(x*N.pi/360.)) contour (data, x, y, title='Exa

RE: Python advocacy . HELP!

2008-12-24 Thread Sells, Fred
Prof. Kanabar (kanabar.bu.edu) is planning to offer a python course there soon. Perhaps he could help. Tell him you got his name from me (Fred Sells). > -Original Message- > From: python-list-bounces+frsells=adventistcare@python.org > [mailto:python-list-bounces+frsells=adventistcar

Re: Easy-to-use Python GUI

2008-12-24 Thread Daniel Fetchinson
> Is there an easy-to-use, "function"-based cross-platform GUI toolkit for > Python out there that's a little more sophisticated than EasyGui? EasyGui > looks good, but it's a little more restrictive than what I'd like to have, > yet > I'm (stubbornly :-) ) resistant to stepping up to a "full serv

www.iofferkicks.com china cheap wholesale nike shoes,air jordan shoes,air force one shoes.

2008-12-24 Thread www.iofferkicks.com
Get Nike Shoes at Super Cheap Prices Discount Nike air jordans (www.iofferkicks.com) Discount Nike Air Max 90 Sneakers (www.iofferkicks.com) Discount Nike Air Max 91 Supplier (www.iofferkicks.com) Discount Nike Air Max 95 Shoes Supplier (www.iofferkicks.com) Discount Nike Air Max 97 Trainers (

Re: Python 3 and my Mac (Leopard)

2008-12-24 Thread Mark
On Wed, Dec 24, 2008 at 5:11 PM, Dan wrote: > > Wanted to learn python, got Mark Summerfield's new book "Programming in > Python 3". Having a hard time getting python 3 and IDLE working on my Mac > with Leopard. The mac "resources" on the python.org site seem a bit out of > date, and don't re

Re: Easy-to-use Python GUI

2008-12-24 Thread ajaksu
On Dec 24, 9:47 pm, "Joel Koltner" wrote: >  Dim dlg As UserDialog > >  dlg.genDrill = 1 >  ReDim DrillStyle(1) >  DrillStyle(0) = "All Via Layers In One File" >  DrillStyle(1) = "One File Per Via Layer" >  dlg.drillStyle = 1 > >  func=Dialog(dlg) > > --- > > This is pretty darned easy for me und

www.iofferkicks.com china cheap wholesale nike shoes,air jordan shoes,air force one shoes.

2008-12-24 Thread www.iofferkicks.com
Get Nike Shoes at Super Cheap Prices Discount Nike air jordans (www.iofferkicks.com) Discount Nike Air Max 90 Sneakers (www.iofferkicks.com) Discount Nike Air Max 91 Supplier (www.iofferkicks.com) Discount Nike Air Max 95 Shoes Supplier (www.iofferkicks.com) Discount Nike Air Max 97 Trainers (

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-24 Thread John Machin
On Dec 24, 7:04 pm, "Malcolm Greene" wrote: > Hi Roger, > > By very large dictionary, I mean about 25M items per dictionary. Each > item is a simple integer whose value will never exceed 2^15. In Python-speak about dictionaries, an "item" is a tuple (key, value). I presume from the gross differen

Re: socket send help

2008-12-24 Thread greyw...@gmail.com
Chris & Gabriel, Thank you so much. My simple example now works. It was very frustrating that even the simple example didn't work, so your help is most appreciated. b'hello world' was the key. As for the error, I do still get it with 3.0 final so I'll go ahead and report it. John. On Dec 24,

ctypes & strings

2008-12-24 Thread Red Rackham
Hi friends;   I would like to pass a string into a dll function.  I notice that to pass using ctypes, it has to be a ctypes type.  Looking at the ctypes doc page I don't see a c_string class.    I tried to pass in byref("name of string") and got back "TypeError: byref() argument must be a ctype

Re: PythonCard timer/thread tutorial

2008-12-24 Thread Mike Driscoll
On Dec 24, 4:56 pm, Sponge Nebson wrote: > Hello all, > > This is my first post. Nice to meet you all! Could one of you walk me > through this code? > >    def myThread(*argtuple): >         """ >         A little thread we've added >         """ >         print "myThread: entered" >         q = a

Re: Easy-to-use Python GUI

2008-12-24 Thread Sponge Nebson
On Dec 24, 3:47 pm, "Joel Koltner" wrote: > Is there an easy-to-use, "function"-based cross-platform GUI toolkit for > Python out there that's a little more sophisticated than EasyGui?  EasyGui > looks good, but it's a little more restrictive than what I'd like to have, yet > I'm (stubbornly :-) )

Re: Easy-to-use Python GUI

2008-12-24 Thread Mike Driscoll
On Dec 24, 5:47 pm, "Joel Koltner" wrote: > Is there an easy-to-use, "function"-based cross-platform GUI toolkit for > Python out there that's a little more sophisticated than EasyGui?  EasyGui > looks good, but it's a little more restrictive than what I'd like to have, yet > I'm (stubbornly :-) )

Re: Python's popularity

2008-12-24 Thread Kevin Kelley
On Tue, Dec 23, 2008 at 10:38 AM, r wrote: > > School time son, > This forum is much more than a question answer session, son. Sure > people are welcome to ask a Python related question. But this forum is > really the main highway of Python development and future. If your a > n00b go to the "Pyth

www.iofferkicks.com china cheap wholesale nike shoes,air jordan shoes,air force one shoes.

2008-12-24 Thread www.iofferkicks.com
Get Nike Shoes at Super Cheap Prices Discount Nike air jordans (www.iofferkicks.com) Discount Nike Air Max 90 Sneakers (www.iofferkicks.com) Discount Nike Air Max 91 Supplier (www.iofferkicks.com) Discount Nike Air Max 95 Shoes Supplier (www.iofferkicks.com) Discount Nike Air Max 97 Trainers (

Re: Custom C Exception Subclasses

2008-12-24 Thread Ivan Illarionov
On Dec 24, 10:43 pm, "Gabriel Genellina" wrote: > En Wed, 24 Dec 2008 15:48:34 -0200, Gabriel Genellina   > escribió: > > > En Wed, 24 Dec 2008 15:00:36 -0200, Ivan Illarionov   > > escribió: > > >> When you raise an exception in C++ you can set it to ANY Python object > >> via PyErr_SetObject a

Easy-to-use Python GUI

2008-12-24 Thread Joel Koltner
Is there an easy-to-use, "function"-based cross-platform GUI toolkit for Python out there that's a little more sophisticated than EasyGui? EasyGui looks good, but it's a little more restrictive than what I'd like to have, yet I'm (stubbornly :-) ) resistant to stepping up to a "full service" GU

Re: Python's popularity

2008-12-24 Thread r
On Dec 24, 1:19 am, Steven D'Aprano wrote: > On Tue, 23 Dec 2008 08:06:35 -0800, the anonymous troll known only as "r" > replied to Thorsten Kampe and said: > > > Thats "Thurstan", thank you very much! :) > > I think Thorsten knows how to spell his own name. > > -- > Steven OK Steven, you caught

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-24 Thread Terry Reedy
Marc 'BlackJack' Rintsch wrote: On Wed, 24 Dec 2008 03:23:00 -0500, python wrote: collection, I don't see the advantage of using an iterator or a list. I'm sure I'm missing a subtle point here :) `keys()` creates a list in memory, `iterkeys()` does not. With ``set(dict.keys())`` there is a

PythonCard timer/thread tutorial

2008-12-24 Thread Sponge Nebson
Hello all, This is my first post. Nice to meet you all! Could one of you walk me through this code? def myThread(*argtuple): """ A little thread we've added """ print "myThread: entered" q = argtuple[0] print "myThread: starting loop" x =

Re: Using exceptions in defined in an extension module inside another extension module

2008-12-24 Thread Floris Bruynooghe
Christian Heimes wrote: > Floris Bruynooghe schrieb: > > What I can't work out however is how to then be able to raise this > > exception in another extension module. Just defining it as "extern" > > doesn't work, even if I make sure the first module -that creates the > > exception- gets loaded

Python 3 and my Mac (Leopard)

2008-12-24 Thread Dan
Wanted to learn python, got Mark Summerfield's new book "Programming in Python 3". Having a hard time getting python 3 and IDLE working on my Mac with Leopard. The mac "resources" on the python.org site seem a bit out of date, and don't really mention python 3. Are there any resources out th

Re: I always wonder ...

2008-12-24 Thread r
On Dec 22, 6:55 pm, John Machin wrote: > On Dec 23, 10:24 am, r wrote: > > > Because my balls are so big i walk around bow-legged! > > Have you considered that your alleged testicular enormity may in fact > be an illusion caused by a hernia? John i see some troll rated your post with one star, s

Lesbians cuple USA

2008-12-24 Thread kylefranki
Lesbi cuple want sex right now http://lesbicouple.pornblink.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: I always wonder ...

2008-12-24 Thread Craig Allen
this is one of the most subtle trolls I've ever read. you sir, are a master! On Dec 22, 7:53 am, s...@pobox.com wrote: > ... shouldn't people who spend all their time trolling be doing something > else: studying, working, writing patches which solve the problems they > perceive to exist in the t

Re: New Python 3.0 string formatting - really necessary?

2008-12-24 Thread r
On Dec 22, 7:26 pm, Steven D'Aprano wrote: > On Mon, 22 Dec 2008 06:58:06 -0800, walterbyrd wrote: > > On Dec 21, 12:28 pm, Bruno Desthuilliers > > wrote: > >> Strange enough, > >> no one seems to complain about PHP or Ruby's performances... > > > A few years back, there was a certain amount of c

Re: Doing set operation on non-hashable objects

2008-12-24 Thread Carl Banks
On Dec 24, 1:16 pm, 5lvqbw...@sneakemail.com wrote: > Hi, > > I'm writing an application which is structured roughly as follows: > > "db" is a dict, where the values are also dicts. > A function searches through db and returns a list of values, each of > which is a dict as described above. > I need

advt

2008-12-24 Thread sony
http://www.adztel.blogspot.com/ http://adztel.blogspot.com/2008/12/tatoo-niche-ebooks.html http://adztel.blogspot.com/2008/12/cpa-riches.html http://adztel.blogspot.com/2008/12/value-scan-profile.html http://adztel.blogspot.com/2008/12/keyword-elite-software.html http://adztel.blogspot.com/200

music maestro

2008-12-24 Thread sony
develops extraordinary music and heart touching sequences.To know about him and his works watch www.arrehmanfan.blogspot.com http://arrehmanfan.blogspot.com/2008/12/ar-rahman-on-golden-globe-list.html http://arrehmanfan.blogspot.com/2008/12/listen-to-ar-rahman-ft-mia-from-slumdog.html http://ar

mobiles

2008-12-24 Thread sony
Excellent Mobiles(Latest) http://latestmobii.blogspot.com/2008/11/blackberry-8800.html http://latestmobii.blogspot.com/2008/11/sony-ericsson-z555i.html http://latestmobii.blogspot.com/2008/11/motorola.html http://latestmobii.blogspot.com/2008/11/samsung.html http://latestmobii.blogspot.com/200

electronics

2008-12-24 Thread sony
http://allelectronicss.blogspot.com/2008/12/mobile-phone.html http://allelectronicss.blogspot.com/2008/12/electric-car.html http://allelectronicss.blogspot.com/2008/12/electric-vehicles.html http://allelectronicss.blogspot.com/2008/12/washing-machine.html http://allelectronicss.blogspot.com/200

Re: New Python 3.0 string formatting - really necessary?

2008-12-24 Thread Scott David Daniels
Bruno Desthuilliers wrote: ... Now improvements are always welcomes, and if you compare 1.5.2 with 2.5.1, you'll find out that the core developpers did improve Python's perfs. Cool, palindromic inverses as compatible versions! -- http://mail.python.org/mailman/listinfo/python-list

Re: Doing set operation on non-hashable objects

2008-12-24 Thread Scott David Daniels
5lvqbw...@sneakemail.com wrote: ... "db" is a dict, where the values are also dicts. A function searches through db and returns a list of values, each of which is a dict as described above. I need to perform set operations on these lists (intersection and union) However the objects themselves are

Re: Doing set operation on non-hashable objects

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 17:16:59 -0200, <5lvqbw...@sneakemail.com> escribió: I'm writing an application which is structured roughly as follows: "db" is a dict, where the values are also dicts. A function searches through db and returns a list of values, each of which is a dict as described above. I

Re: Iterating over objects of a class

2008-12-24 Thread Scott David Daniels
Kottiyath wrote: ... Having a registry inside the class instance and looping through them was the only clean thing I could think of. I understand that garbage collection would be an issue - but is there any way out? Search for weakref in the documentatione. In this case, I'd use a WeakValueDict

Re: Custom C Exception Subclasses

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 15:48:34 -0200, Gabriel Genellina escribió: En Wed, 24 Dec 2008 15:00:36 -0200, Ivan Illarionov escribió: When you raise an exception in C++ you can set it to ANY Python object via PyErr_SetObject and that object could store pointers to C++ classes. Remember that ex

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-24 Thread Scott David Daniels
Gabriel Genellina wrote: En Wed, 24 Dec 2008 06:23:00 -0200, escribió: ... k1 = set(dict1.iterkeys()) You've got an excelent explanation from Marc Rintsch. (Note that in Python 3.0 keys() behaves as iterkeys() in previous versions, so the above code is supposed to be written in Python 2.x)

Doing set operation on non-hashable objects

2008-12-24 Thread 5lvqbwl02
Hi, I'm writing an application which is structured roughly as follows: "db" is a dict, where the values are also dicts. A function searches through db and returns a list of values, each of which is a dict as described above. I need to perform set operations on these lists (intersection and union)

Re: [SPAM] VERY simple string comparison issue

2008-12-24 Thread MRAB
Brad Causey wrote: Python Version: Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 List, I am trying to do some basic log parsing, and well, I am absolutely floored at this seemingly simple problem. I am by no means a novice in python, but yet this is re

Re: Iterating over objects of a class

2008-12-24 Thread Kottiyath
On Dec 24, 11:48 pm, "Gabriel Genellina" wrote: > En Wed, 24 Dec 2008 16:18:55 -0200, Kottiyath   > escribió: > > >> The other thing to remember is that because the 'registry' contains > >> references to the instances, they won't be garbage collected. > > > Is there any other way out in this case

Re: String Comparison Testing

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 16:20:17 -0200, Brad Causey escribió: I am trying to do some basic log parsing, and well, I am absolutely floored at this seemingly simple problem. I am by no means a novice in python, but yet this is really stumping me. I have extracted the pertinent code snippets an

Re: Iterating over objects of a class

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 16:18:55 -0200, Kottiyath escribió: The other thing to remember is that because the 'registry' contains references to the instances, they won't be garbage collected. Is there any other way out in this case? I have factory methods - and I have to loop over them - sort of

VERY simple string comparison issue

2008-12-24 Thread Brad Causey
Python Version: Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 List, I am trying to do some basic log parsing, and well, I am absolutely floored at this seemingly simple problem. I am by no means a novice in python, but yet this is really stumping me. I have

Re: Custom C Exception Subclasses

2008-12-24 Thread Ross
On Dec 24, 9:24 am, "Gabriel Genellina" wrote: > In fact you can, you could store those pointers as attributes of the > exception object, using a PyCObject. Excellent. I was not aware of the PyCObject type. > Accessing those attributes isn't as easy as doing exc->field, but I think > it's easy

String Comparison Testing

2008-12-24 Thread Brad Causey
Python Version: Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 List, I am trying to do some basic log parsing, and well, I am absolutely floored at this seemingly simple problem. I am by no means a novice in python, but yet this is really stumping me. I have

Re: Iterating over objects of a class

2008-12-24 Thread Kottiyath
On Dec 24, 11:04 pm, MRAB wrote: > Diez B. Roggisch wrote: > > Kottiyath schrieb: > >> Hi, > >>    How can I iterate over all the objects of a class? > >>    I wrote the code like following: > >> class baseClass(object): > > > Consider adopting PEP 8  coding conventions. > > >>     __registry = []

Re: Iterating over objects of a class

2008-12-24 Thread Kottiyath
On Dec 24, 10:52 pm, "Diez B. Roggisch" wrote: > Kottiyath schrieb: > > > Hi, > >    How can I iterate over all the objects of a class? > >    I wrote the code like following: > > class baseClass(object): > > Consider adopting PEP 8  coding conventions. > > > > >     __registry = [] > > >     def

Re: Iterating over objects of a class

2008-12-24 Thread MRAB
Diez B. Roggisch wrote: Kottiyath schrieb: Hi, How can I iterate over all the objects of a class? I wrote the code like following: class baseClass(object): Consider adopting PEP 8 coding conventions. __registry = [] def __init__(self, name): self.__registry.append(se

Re: How to change a generator ?

2008-12-24 Thread MRAB
Gabriel Genellina wrote: En Wed, 24 Dec 2008 15:03:58 -0200, MRAB escribió: I have a generator whose aim is to returns consecutive lines from a file (the listing below is a simplified version). However, as it is written now, the generator method changes the text file pointer to end of file

Re: Iterating over objects of a class

2008-12-24 Thread Diez B. Roggisch
Kottiyath schrieb: Hi, How can I iterate over all the objects of a class? I wrote the code like following: class baseClass(object): Consider adopting PEP 8 coding conventions. __registry = [] def __init__(self, name): self.__registry.append(self) self.name = n

Re: Custom C Exception Subclasses

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 15:00:36 -0200, Ivan Illarionov escribió: On Dec 24, 6:42 pm, Ross wrote: For a project that I am doing, it would be useful to have an exception class that stores some additional data along with the message. However, I want to be able to store a couple pointers to C++ cl

Iterating over objects of a class

2008-12-24 Thread Kottiyath
Hi, How can I iterate over all the objects of a class? I wrote the code like following: class baseClass(object): __registry = [] def __init__(self, name): self.__registry.append(self) self.name = name def __iter__(self): baseClass.item = 0 return

Re: How to change a generator ?

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 15:03:58 -0200, MRAB escribió: I have a generator whose aim is to returns consecutive lines from a file (the listing below is a simplified version). However, as it is written now, the generator method changes the text file pointer to end of file after first invocation.

Re: Custom C Exception Subclasses

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 13:42:38 -0200, Ross escribió: For a project that I am doing, it would be useful to have an exception class that stores some additional data along with the message. However, I want to be able to store a couple pointers to C++ classes, so I can't just use an exception created

Re: Spam???

2008-12-24 Thread skip
Alvin> What's with all the spam on the list? Alvin> I humbly request that recaptcha or some other sort Alvin> of captcha be implemented on the registration page. Known issue. The spam filters are currently not applied to messages gatewayed to the mailing list from Usenet. I have bee

Re: Custom C Exception Subclasses

2008-12-24 Thread Ivan Illarionov
On Dec 24, 6:42 pm, Ross wrote: > For a project that I am doing, it would be useful to have an exception > class that stores some additional data along with the message. > However, I want to be able to store a couple pointers to C++ classes, > so I can't just use an exception created with PyExc_Ne

Re: How to change a generator ?

2008-12-24 Thread MRAB
Barak, Ron wrote: Hi, I have a generator whose aim is to returns consecutive lines from a file (the listing below is a simplified version). However, as it is written now, the generator method changes the text file pointer to end of file after first invocation. Namely, the file pointer change

Re: I always wonder ...

2008-12-24 Thread r
220 ratings and 1 star, WH!. I find this all quite amusing :D. Keep em coming. Oh, and FYI, I will always have 1 star! hahahahahha /"\ |\./| | | | | |>~<| | |

Spam???

2008-12-24 Thread Alvin ONeal
What's with all the spam on the list? I humbly request that recaptcha or some other sort of captcha be implemented on the registration page. AJ ONeal -- http://mail.python.org/mailman/listinfo/python-list

Re: python web programming for PHP programmers

2008-12-24 Thread D'Arcy J.M. Cain
On Wed, 24 Dec 2008 14:40:31 + (UTC) Nikola Skoric wrote: > a general python tutorial, I just need a tutorial on how to make a > hello world server side script with python. Any suggestions? #! /usr/bin/env python import sys, re colour = re.sub('=', '=#', ''.join(sys.argv[1:])) print """Con

Re: SyntaxError: encoding problem: with BOM

2008-12-24 Thread Diez B. Roggisch
NoName schrieb: On 25 дек, 00:37, "Diez B. Roggisch" wrote: NoName schrieb: i have 1.py in cp866 encoding: # -*- coding: cp866 -*- print ("ff") It's not work in Python 3.0 Error: File "", line 1 SyntaxError: encoding problem: with BOM what's wrong? I can only guess, but just because you writ

Python-URL! - weekly Python news and links (Dec 24)

2008-12-24 Thread Gabriel Genellina
QOTW: "Threads seem to be used only because mediocre programmers don't know what else to use." - Sturla Molden http://mail.python.org/pipermail/python-dev/2008-December/084265.html Python 2.4.6 and 2.5.3 were released this week: http://groups.google.com/group/comp.lang.p

Re: Using exceptions in defined in an extension module inside another extension module

2008-12-24 Thread Christian Heimes
Floris Bruynooghe schrieb: > What I can't work out however is how to then be able to raise this > exception in another extension module. Just defining it as "extern" > doesn't work, even if I make sure the first module -that creates the > exception- gets loaded first. Because the symbol is define

How to change a generator ?

2008-12-24 Thread Barak, Ron
Hi, I have a generator whose aim is to returns consecutive lines from a file (the listing below is a simplified version). However, as it is written now, the generator method changes the text file pointer to end of file after first invocation. Namely, the file pointer changes from 0 to 6623 on li

Re: object oriënted

2008-12-24 Thread skip
Dennis> I know that python is an Object Oriënted language but I was Dennis> wondering if it gets used as a non-OOP also (by a good amount of Dennis> people). Oh yeah. Works great for writing quick-n-dirty Unix filters which are a bit more complex than can comfortably be wrangled with

Re: no sign() function ?

2008-12-24 Thread ajaksu
On Dec 24, 5:59 am, pdora...@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) wrote: > > For me sign_0 is the simplest one to understood. > So in the domain of my little arcade game, this is what i'll use. > I don't need the accuraccy of sign_1, because in the application i just > need to know if th

object oriënted

2008-12-24 Thread Dennis van Oosterhout
I know that python is an Object Oriënted language but I was wondering if it gets used as a non-OOP also (by a good amount of people). -- http://mail.python.org/mailman/listinfo/python-list

Re: python web programming for PHP programmers

2008-12-24 Thread ajaksu
On Dec 24, 12:40 pm, Nikola Skoric wrote: > I0m a python newbie with PHP background. I've tried to make a web app > from one of my python scripts (which I haven't done before) and I > ended up with: > > echo shell_exec("python foobar.py"); > ?> > which works really nice :-D Clever :) Python can

Custom C Exception Subclasses

2008-12-24 Thread Ross
For a project that I am doing, it would be useful to have an exception class that stores some additional data along with the message. However, I want to be able to store a couple pointers to C++ classes, so I can't just use an exception created with PyExc_NewException. If I were to subclass the bu

Re: python web programming for PHP programmers

2008-12-24 Thread Federico Moreira
You can try also web2py (http://mdp.cti.depaul.edu/) but i think you may be interested on http://www.modpython.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: SyntaxError: encoding problem: with BOM

2008-12-24 Thread NoName
On 25 дек, 00:37, "Diez B. Roggisch" wrote: > NoName schrieb: > > > i have 1.py in cp866 encoding: > > > # -*- coding: cp866 -*- > > print ("ff") > > > It's not work in Python 3.0 > > Error: > > > File "", line 1 > > SyntaxError: encoding problem: with BOM > > > what's wrong? > > I can only guess,

Re: python web programming for PHP programmers

2008-12-24 Thread Diez B. Roggisch
Nikola Skoric schrieb: I0m a python newbie with PHP background. I've tried to make a web app from one of my python scripts (which I haven't done before) and I ended up with: which works really nice :-D For some reason I can't find no "quick and dirty python web programming tutorial for PHP pro

Using exceptions in defined in an extension module inside another extension module

2008-12-24 Thread Floris Bruynooghe
Hello If I have an extension module and want to use an exception I can do by declaring the exception as "extern PyObject *PyExc_FooError" in the object files if I then link those together inside a module where the module has them declared the same (but no extern) and then initialises them in the P

www.iofferkicks.com china cheap wholesale nike shoes,air jordan shoes,air force one shoes.

2008-12-24 Thread www.iofferkicks.com
Get Nike Shoes at Super Cheap Prices Discount Nike air jordans (www.iofferkicks.com) Discount Nike Air Max 90 Sneakers (www.iofferkicks.com) Discount Nike Air Max 91 Supplier (www.iofferkicks.com) Discount Nike Air Max 95 Shoes Supplier (www.iofferkicks.com) Discount Nike Air Max 97 Trainers (

python web programming for PHP programmers

2008-12-24 Thread Nikola Skoric
I0m a python newbie with PHP background. I've tried to make a web app from one of my python scripts (which I haven't done before) and I ended up with: which works really nice :-D For some reason I can't find no "quick and dirty python web programming tutorial for PHP programmers" on google. :-D

Re: SyntaxError: encoding problem: with BOM

2008-12-24 Thread Diez B. Roggisch
NoName schrieb: i have 1.py in cp866 encoding: # -*- coding: cp866 -*- print ("ff") It's not work in Python 3.0 Error: File "", line 1 SyntaxError: encoding problem: with BOM what's wrong? I can only guess, but just because you write the coding-header that doesn't mean that the editor yo

Re: Multi-dimension list

2008-12-24 Thread Steve Holden
James Stroud wrote: > Steven Woody wrote: >> Hi, >> >> In the book Python Essential Reference, Chapter 3, when talking about >> extended slicing, it gives an example: a = m[0:10, 3:20]. But I >> don't understand how the 'm' was defined. What should it looks like? > > m could be an instance of t

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-24 Thread bearophileHUGS
Peter Otten: > >>> a = dict(a=1, b=2, c=3) > >>> b = dict(b=2, c=30, d=4) > >>> dict(set(a.iteritems()) ^ set(b.iteritems())) For larger sets this may be better, may avoid the creation of the second set: dict(set(a.iteritems()).symmetric_difference(b.iteritems())) Bye, bearophile -- http://mail.

Re: Most efficient way to build very large dictionaries

2008-12-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin wrote: > I'd think he's talking about in memory SQLite Databases, this way you > should be quite fast _and_ could dump all that to a persistent > storage... I was just talking about regular on disk SQLite databases. In terms of priming the pum

Re: Most efficient way to build very large dictionaries

2008-12-24 Thread Martin
Hi, 2008/12/24 : > Hi Roger, > >> you may want to consider using SQLite > > Thank you for your suggestion about looking at SQLite. I haven't > compared the performance of SQLite to Python dictionaries, but I'm > skeptical that SQLite would be faster than in-memory Python dictionaries > for the ty

SyntaxError: encoding problem: with BOM

2008-12-24 Thread NoName
i have 1.py in cp866 encoding: # -*- coding: cp866 -*- print ("ff") It's not work in Python 3.0 Error: File "", line 1 SyntaxError: encoding problem: with BOM what's wrong? -- http://mail.python.org/mailman/listinfo/python-list

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-24 Thread Malcolm Greene
Hi Gabriel, > in Python 3.0 keys() behaves as iterkeys() in previous versions, so the above > code is supposed to be written in Python 2.x) I understand. Thank you. > note that dict comprehensions require Python 3.0 I'm relieved to know that I didn't miss that feature in my reading of Python's

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-24 Thread python
Hi Peter, If you are not interested in the intermediate results and the dictionary values are hashable you can get the difference by >>> a = dict(a=1, b=2, c=3) >>> b = dict(b=2, c=30, d=4) >>> dict(set(a.iteritems()) ^ set(b.iteritems())) {'a': 1, 'c': 3, 'd': 4} That's very cool! Thanks for

Re: Most efficient way to build very large dictionaries

2008-12-24 Thread python
Hi Roger, > The performance improvements you are seeing with Python over Oracle are > exactly the same range people see with SQLite over Oracle. One common usage > reported on the SQLite mailing list is people copying data out of Oracle and > running their analysis in SQLite because of the perf

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 06:23:00 -0200, escribió: Hi Gabriel, Thank you very much for your feedback! k1 = set(dict1.iterkeys()) I noticed you suggested .iterkeys() vs. .keys(). Is there any advantage to using an iterator vs. a list as the basis for creating a set? I You've got an excelent ex

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-24 Thread python
Hi James, > For the purpose of perpetuating the annoying pedantry that has made > usenet great: > > http://docs.python.org/dev/3.0/whatsnew/3.0.html#views-and-iterators-instead-of-lists Great tip! Thank you! Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-24 Thread James Stroud
Marc 'BlackJack' Rintsch wrote: On Wed, 24 Dec 2008 03:23:00 -0500, python wrote: Hi Gabriel, Thank you very much for your feedback! k1 = set(dict1.iterkeys()) I noticed you suggested .iterkeys() vs. .keys(). Is there any advantage to using an iterator vs. a list as the basis for creating a

Re: Most efficient way to build very large dictionaries

2008-12-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 pyt...@bdurham.com wrote: > Thank you for your suggestion about looking at SQLite. I haven't > compared the performance of SQLite to Python dictionaries, but I'm > skeptical that SQLite would be faster than in-memory Python dictionaries > for the type

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-24 Thread Peter Otten
Gabriel Genellina wrote: > En Wed, 24 Dec 2008 05:16:36 -0200, escribió: [I didn't see the original post] >> I'm looking for suggestions on the best ('Pythonic') way to >> determine the difference between 2 very large dictionaries >> containing simple key/value pairs. >> By difference, I mean a

Re: Multi-dimension list

2008-12-24 Thread James Stroud
Steven Woody wrote: Hi, In the book Python Essential Reference, Chapter 3, when talking about extended slicing, it gives an example: a = m[0:10, 3:20]. But I don't understand how the 'm' was defined. What should it looks like? m could be an instance of the Krayzee class. py> class Krayzee(

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-24 Thread python
Hi Marc, > `keys()` creates a list in memory, `iterkeys()` does not. With > ``set(dict.keys())`` there is a point in time where the dictionary, the > list, and the set co-exist in memory. With ``set(dict.iterkeys())`` > only the set and the dictionary exist in memory. Perfect explanation. Than

Re: Most efficient way to build very large dictionaries

2008-12-24 Thread python
Hi Roger, > you may want to consider using SQLite Thank you for your suggestion about looking at SQLite. I haven't compared the performance of SQLite to Python dictionaries, but I'm skeptical that SQLite would be faster than in-memory Python dictionaries for the type of analysis I'm doing. Prior

  1   2   >