ANN: PyEnchant 1.3.1

2007-09-19 Thread Ryan Kelly
Hi All, I'm pleased to announce the release of PyEnchant version 1.3.1. This release brings several minor enhancements over the previous version, and includes upgrades to the bundled components (glib, hunspell, dictionary files) in the Windows version. Cheers, Ryan About: --

Leo 4.4.4 beta 2 released

2007-09-19 Thread Edward K Ream
Leo 4.4.4 beta 2 is available at: http://sourceforge.net/project/showfiles.php?group_id=3458package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html The highlights of Leo 4.4.4: - A

[ANN] Underscode 0.1.0 released

2007-09-19 Thread Ivan Vilata i Balaguer
Hi people, I'm really happy to announce the first public version of Underscode, a Python identifier-like encoding. I took it mainly as a hobby so its development in time has been very irregular, but I think it's already time to release and enjoy it! Now the announcement text: ==

Drag image

2007-09-19 Thread ndoe
i want show image from button? and the image can be drag and rezise ? any body help me!!! i try to make it but is not sucsseful yet -- http://mail.python.org/mailman/listinfo/python-list

Re: Processing drag drop on the desktop

2007-09-19 Thread Pierre Quentel
On 17 sep, 17:08, Larry Bates [EMAIL PROTECTED] wrote: Pierre Quentel wrote: Hi all, I would like to create an application on a Windows machine, such that when a document is dragged and dropped on the application icon on the desktop, the document is processed by the application For

Puzzled in the coding of Chinese

2007-09-19 Thread Xing
Dear list members, I am a newcomer in the world of Python. But I am attracted by Python's power in handling text! Now I apply it to handle Chinese but the Chinese character cann't be displayed on the screen. What displayed on the screen is the 16bits codes. I am so puzzled! I believe

Re: Web Programming thru python

2007-09-19 Thread Tim Roberts
python_lover [EMAIL PROTECTED] wrote: Please help how to execute a py file with xitami. I installed xitami , downloaded lrwp file. accessing the first web application program ... through browser like http://localhost/first.py it is dispaying the source code of the first.py. Please help me how

Re: Deserializing specific objects from a file

2007-09-19 Thread Marc 'BlackJack' Rintsch
On Tue, 18 Sep 2007 16:02:38 -0700, Aaron J. M. wrote: There are many objects that I want be able to move in and out of memory at runtime; namely the game levels. I only want one level in memory at a time, so I want to be able to unpickle specific Level objects as the player moves between

Re: [ANN] Metatest 0.1.0

2007-09-19 Thread Jonathan Fine
Ben Finney wrote: [Jonathan, please don't send me copies of messages sent to the discussion thread. I follow comp.lang.python via a non-mail interface, and it's irritating to get unwanted copies of messages via email.] [Thank you for letting me know your preference. For myself, I often

Re: super() doesn't get superclass

2007-09-19 Thread Paul Rudin
Ben Finney [EMAIL PROTECTED] writes: Possibly the name 'next_in_mro', while ugly, would at least match the actual behaviour of this function. In common lisp there's (call-next-method ...) -- http://mail.python.org/mailman/listinfo/python-list

Re: Using python to create windows apps that everyone can use?

2007-09-19 Thread exhuma.twn
On Sep 18, 9:22 pm, Matt McCredie [EMAIL PROTECTED] wrote: On 9/18/07, Thomas Harding [EMAIL PROTECTED] wrote: Hi guys, sorry to post another topic on this, as I am aware that it has already been posted a few times, but not with specifically what I am looking for. I want an app that makes

Re: Sets in Python

2007-09-19 Thread Paddy
On Sep 19, 1:59 am, Raymond Hettinger [EMAIL PROTECTED] wrote: On Sep 18, 5:39 pm, sapsi [EMAIL PROTECTED] wrote: I recently tried using the set function in Python and was surprised to find that a=[ 1, 2,3, [1,2] ] doesn't work with 'set', throwing TyperError (unhashable exception). I

Re: Tutorial or Example (or Tutorial) of Using Canvas to Produce a Plot

2007-09-19 Thread exhuma.twn
On Sep 18, 11:58 pm, Richard Townsend [EMAIL PROTECTED] wrote: On Tue, 18 Sep 2007 13:18:36 -0700, W. Watson [EMAIL PROTECTED] wrote: Tk is it. I'm really not interested in the others at this point. John Grayson's book 'Python and Tkinter Programming' has a chapter on plotting Graphs and

Re: Troubleshooting installing new package

2007-09-19 Thread nickel_and_dime_2death
On Sep 13, 8:10 pm, Gheorghe Postelnicu [EMAIL PROTECTED] wrote: Hi, I have Python 2.5 installed on WinXP and I am trying to install a new package. I ran thesetup.pybuild and I get the following message: C:\packages\reedsolomon-0.1setup.pybuild running build running build_ext error:

Re: Using python to create windows apps that everyone can use?

2007-09-19 Thread exhuma.twn
On Sep 18, 9:22 pm, Matt McCredie [EMAIL PROTECTED] wrote: On 9/18/07, Thomas Harding [EMAIL PROTECTED] wrote: Hi guys, sorry to post another topic on this, as I am aware that it has already been posted a few times, but not with specifically what I am looking for. I want an app that makes

Re: super() doesn't get superclass

2007-09-19 Thread Hrvoje Niksic
Ben Finney [EMAIL PROTECTED] writes: Hrvoje Niksic [EMAIL PROTECTED] writes: class X(Y): def foo(self): super(X, self).foo() ...there is in fact no guarantee that super() calls a superclass of X. However, it is certainly guaranteed that it will call a superclass of type(self).

Re: Sets in Python

2007-09-19 Thread Francesco Guerrieri
On 9/19/07, Paddy [EMAIL PROTECTED] wrote: frozenset over turning the embedded list into a tuple? The tuple would preserve order in the item (1,2) a = set([1,2,3, (1,2)]) The OP was probably thinking in mathematical terms as in the set of all the possible subsets of the set composed by 1,

Re: super() doesn't get superclass

2007-09-19 Thread Hrvoje Niksic
Ben Finney [EMAIL PROTECTED] writes: Evan is claiming that the next class in the MRO _is_ a superclass, apparently by his definition or some other that I've not seen. The definition of superclass is not the issue, the issue is superclass *of which class*? You expect super(A, self) to iterate

Re: Extracting xml from html

2007-09-19 Thread Stefan Behnel
George Sakkis wrote: Given that you can do in 2 lines what took you around 15 with lxml, I wouldn't think it twice. Don't judge a tool by beginner's code. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Help, I'm going mad with this

2007-09-19 Thread Peter Otten
azrael wrote: Help, I'm going mad with this Is Otsu threshold algorithm to boring as a subject? Meanwhile I tried about 5 different implementations of the otsu threshold algorithm. I'll go mad. Please help me. I don't know what to do. I even tried to implement it from c and java, but no

help, I'll go crazy

2007-09-19 Thread azrael
Some time ago I started a thread about the Otsu Threshold. Well I didn' manage to make any progress to acomplish this task. I tried to implement it from other Languages including Java and C. Well, this is the example list. histogram=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

Re: Pseudo-Private Class Attributes

2007-09-19 Thread Bruno Desthuilliers
Ricardo Aráoz a écrit : That is self.__attributes Been reading about the reasons to introduce them and am a little concerned. As far as I understand it if you have a class that inherits from two other classes which have both the same name for an attribute then you will have a name clash

Re: Creating OpenOffice doc's

2007-09-19 Thread hemanth
Go to http://ooolib.sourceforge.net/ and download the Python version and unzip the file. There are a few examples illustrating various features. I have used this to create simple OO spreadsheets. Regards, Hemanth Sethuram -- http://mail.python.org/mailman/listinfo/python-list

Re: Extracting xml from html

2007-09-19 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : On Sep 18, 1:56 am, Stefan Behnel [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I am attempting to extract some XML from an HTML document that I get returned from a form based web page. For some reason, I cannot figure out how to do this. Here's a sample of

lxml codespeak pages empty ?

2007-09-19 Thread Laurent Pointal
I can no longer get codespeak's lxml page at http://codespeak.net/lxml/ (get an empty HTML document !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//ENhtmlheadtitle/title/headbody/body/html)... Am-I alone in this case ? Any codespeaker reading ? A+ Laurent. --

Re: Extracting xml from html

2007-09-19 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: Does this make sense? It works pretty well, but I don't really understand everything that I'm doing. def Parser(filename): It's uncommon to give a function a capitalised name, unless it's a factory function (which this isn't). parser = etree.HTMLParser()

Re: lxml codespeak pages empty ?

2007-09-19 Thread Stefan Behnel
Laurent Pointal wrote: I can no longer get codespeak's lxml page at http://codespeak.net/lxml/ (get an empty HTML document !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//ENhtmlheadtitle/title/headbody/body/html)... Am-I alone in this case ? Any codespeaker reading ? Hmm, it's

Re: lxml codespeak pages empty ? Come back.

2007-09-19 Thread Laurent Pointal
Laurent Pointal a écrit : I can no longer get codespeak's lxml page at http://codespeak.net/lxml/ (get an empty HTML document !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//ENhtmlheadtitle/title/headbody/body/html)... Am-I alone in this case ? Any codespeaker reading ? It

Re: The meaning of a = b in object oriented languages

2007-09-19 Thread Roel Schroeven
Lew schreef: Roel Schroeven wrote: Laurent Pointal schreef: Summercool a écrit : The meaning of a = b in object oriented languages. zip Oups, reading the subject I thought it was a Xah Lee post. me too ... Nah, this dude's all

Re: Using pseudonyms

2007-09-19 Thread Paddy
On Sep 19, 5:07 am, [EMAIL PROTECTED] (Alex Martelli) wrote: Aahz [EMAIL PROTECTED] wrote: For that matter, there are plenty of people who are better known by some nickname that is not their legal name. Yep. For example, some people whose legal name is Alessandro (which no American is

How to know the starting point

2007-09-19 Thread Raj kumar
Hi, I need help regarding the starting point in python project, As we can find main() function in java class to know the starting class in java, what is the starting point in python project? How to find the starting point. Thank you - Get the freedom to

Re: How to know the starting point

2007-09-19 Thread Francesco Guerrieri
On 9/19/07, Raj kumar [EMAIL PROTECTED] wrote: Hi, I need help regarding the starting point in python project, As we can find main() function in java class to know the starting class in java, what is the starting point in python project? How to find the starting point. Thank you There is

AttributeError: How to list existing attributes?

2007-09-19 Thread Thomas Guettler
Hi, how can you list the attributes of an object if you catch an AttributeError? I couldn't find a reference in the exception object, which points to the object. I want to call dir() on the object to list the user the known attributes. Is there a way to find the object by inspecting the

Re: How can I know how much to read from a subprocess

2007-09-19 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: ... how can I know if the process wrote something to its output, and how much it wrote? Others have mentioned using one-byte reads. To tell if something is available for reading, use select http://docs.python.org/lib/module-select.html.

Quick shallow-copy idiom

2007-09-19 Thread Lawrence D'Oliveiro
y = type(x)(x) -- http://mail.python.org/mailman/listinfo/python-list

Re: AttributeError: How to list existing attributes?

2007-09-19 Thread Diez B. Roggisch
Thomas Guettler wrote: Hi, how can you list the attributes of an object if you catch an AttributeError? I couldn't find a reference in the exception object, which points to the object. I want to call dir() on the object to list the user the known attributes. Is there a way to find

Re: Help, I'm going mad with this

2007-09-19 Thread azrael
I didn't found this one. Looks interesting and complex because I ran away from C to Python because of the developing speed and pointers. Thanks mate, I'll try it. Other C implementations I found were much shorter, at least this is going to be a little challenge. :D --

still get a defunct using a python script in the crontab

2007-09-19 Thread martijn
H! I have made a program that is checking if a program is running or not. If the program is not running then it must start the program again. in the /etc/crontab: * * * * * root/usr/sbin/ program_prgchk in the /usr/sbin/program_prgchk: /usr/local/bin/python

Re: Metatest 0.1.0

2007-09-19 Thread Kay Schluehr
On 19 Sep., 01:30, Jonathan Fine [EMAIL PROTECTED] wrote: there is no fundamental reason why it can't be separated from eeconsole.py. OK. That might be a good idea. Ironically, I liked the idea of having more expressive assert statements - a discussion you brought up. But this requires

Re: Metatest 0.1.0

2007-09-19 Thread Kay Schluehr
On 19 Sep., 01:30, Jonathan Fine [EMAIL PROTECTED] wrote: there is no fundamental reason why it can't be separated from eeconsole.py. OK. That might be a good idea. Ironically, I liked the idea of having more expressive assert statements - a discussion you brought up. But this requires

HTTP Protocol Client

2007-09-19 Thread welcomestocontact
Hi, I am writing http protocol to get some data from servers. If i was using my localhost, getting replay from local and if want access other remote sites, i am getting error. Please reply it My localhost client script::: Code: ( python ) import httplib h = httplib.HTTP('localhost',80)

HTTP Protocol Client

2007-09-19 Thread welcomestocontact
Hi, I am writing http protocol to get some data from servers. If i was using my localhost, getting replay from local and if want access other remote sites, i am getting error. Please reply it My localhost client script::: Code: ( python ) import httplib h = httplib.HTTP('localhost',80)

Re: super() doesn't get superclass

2007-09-19 Thread Bruno Desthuilliers
Ben Finney a écrit : Bruno Desthuilliers [EMAIL PROTECTED] writes: Ben Finney a écrit : Evan Klitzke [EMAIL PROTECTED] writes: On Tue, 2007-09-18 at 14:15 +1000, Ben Finney wrote: [the 'super' function] doesn't return the superclass, it returns the next class in the MRO, whether that's a

Re: super() doesn't get superclass

2007-09-19 Thread Michele Simionato
On Sep 19, 12:36 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: The next class in the MRO *is* a superclass of the *instance*. Else it wouldn't be in the MRO !-) Bruno, there is no such a thing as a superclass in a multiple inheritance world, and it is a very bad idea to continue to

Help for Otsu implementation from C

2007-09-19 Thread azrael
Can somone look at this def otsu(hi): fmax=-1.0 border=len(hi) for i in range(border): if hi[i]!=0:break for j in range(border-1,0-1,-1): if hi[j] != 0:break s = sum([k*hi[k] for k in range(border)]) n = sum(hi) # product(im.size) n1=n2=csum=0.0 for

Re: super() doesn't get superclass

2007-09-19 Thread Hrvoje Niksic
Michele Simionato [EMAIL PROTECTED] writes: On Sep 19, 12:36 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: The next class in the MRO *is* a superclass of the *instance*. Else it wouldn't be in the MRO !-) Bruno, there is no such a thing as a superclass in a multiple inheritance

Re: uninstall python2.5 on debian

2007-09-19 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], dimitri pater wrote: I would like to uninstall Python2.5 which was installed from source (make install) and keep 2.3. How about doing the make install again, and making a note of which files were installed, and removing those? --

Re: super() doesn't get superclass

2007-09-19 Thread Michele Simionato
On Sep 19, 1:16 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote: Your arguments against the superclass term seem to assume that there is only a single superclass to a particular class. If you say the superclass, then you also assume it is unique. But the big issue is that the order of the methods

lambda-funcs problem

2007-09-19 Thread dmitrey . kroshko
hi all, I need to create a Python list of lambda-funcs that are dependent on the number of the ones, for example F = [] for i in xrange(N): F.append(lambda x: x + i) however, the example don't work - since i in end is N-1 it yields x+ (N-1) for any func. So what's the best way to make it

UTF-8 characters in doctest

2007-09-19 Thread Bzyczek
Hello, I have problems with running doctests if I use czech national characters in UTF-8 encoding. I have Python script, which begin with encoding definition: # -*- coding: utf-8 -*- I have this function with doctest: def get_inventary_number(block): t = u'''28. České královské

Re: super() doesn't get superclass

2007-09-19 Thread Bruno Desthuilliers
Michele Simionato a écrit : On Sep 19, 12:36 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: The next class in the MRO *is* a superclass of the *instance*. Else it wouldn't be in the MRO !-) Bruno, there is no such a thing as a superclass in a multiple inheritance May I disagree

Re: lambda-funcs problem

2007-09-19 Thread Marc 'BlackJack' Rintsch
On Wed, 19 Sep 2007 04:39:44 -0700, dmitrey.kroshko wrote: I need to create a Python list of lambda-funcs that are dependent on the number of the ones, for example F = [] for i in xrange(N): F.append(lambda x: x + i) however, the example don't work - since i in end is N-1 it yields

Re: Help for Otsu implementation from C

2007-09-19 Thread Peter Otten
azrael wrote: Can somone look at this def otsu(hi): fmax=-1.0 border=len(hi) for i in range(border): if hi[i]!=0:break for j in range(border-1,0-1,-1): if hi[j] != 0:break s = sum([k*hi[k] for k in range(border)]) n = sum(hi) # product(im.size)

RE: lambda-funcs problem

2007-09-19 Thread Ryan Ginstrom
On Behalf Of [EMAIL PROTECTED] F = [] for i in xrange(N): F.append(lambda x: x + i) however, the example don't work - since i in end is N-1 it yields x+ (N-1) for any func. How about: def make_adder(i): def adder(x): return x+i return adder funcs =

Re: super() doesn't get superclass

2007-09-19 Thread Hrvoje Niksic
Michele Simionato [EMAIL PROTECTED] writes: On Sep 19, 1:16 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote: Your arguments against the superclass term seem to assume that there is only a single superclass to a particular class. If you say the superclass, then you also assume it is unique. FWIW,

Re: lambda-funcs problem

2007-09-19 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : hi all, I need to create a Python list of lambda-funcs that are dependent on the number of the ones, for example F = [] for i in xrange(N): F.append(lambda x: x + i) however, the example don't work - since i in end is N-1 it yields x+ (N-1) for any func.

Re: UTF-8 characters in doctest

2007-09-19 Thread Peter Otten
Bzyczek wrote: So my question is: Is it possible to run doctests with UTF-8 characters? And if your answer will be YES, tell me please how... Use raw strings in combination with explicit decoding and a little try-and-error. E. g. this little gem passes ;) # -*- coding: utf8 -*- r

stdout and embedding into Windows apps

2007-09-19 Thread Thomas Schreiner
Hi, I'm extending a windows application (C++) by embedding Python calls. It seems to be a known problem that windows applications detach immediately from the calling console, so that all output to stdout (from both C++ and Python) doesn't get shown anywhere. A workaround seems to be the

cannot create my own dict

2007-09-19 Thread A.T.Hofkamp
Hello all, This morning I tried to create my own read-only dictionary, and failed miserably. I don't understand why, can somebody enlighten me? Below is a brute-force experiment that cannot deal with x in obj, plz read the explanation below the code: class

Re: How can I know how much to read from a subprocess

2007-09-19 Thread A.T.Hofkamp
On 2007-09-18, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Sep 18, 1:48 pm, A.T.Hofkamp [EMAIL PROTECTED] wrote: On 2007-09-17, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: It seems that another solution is gobject.io_add_watch, but I don't see how it tells me how much I can read from the

re question

2007-09-19 Thread Dan Bar Dov
I'm trying to construct a regular expression to match valid IP address, without leading zeroes (i.e 1.2.3.4, 254.10.0.0, but not 324.1.1.1, nor 010.10.10.1) This is what I come up with, and it does not work. r'(^[12]?\d{0,2}\.){3,3}[12]?\d{0,2}' What am I doing wrong? Any common knowledge IP

Odd files; just left behind?

2007-09-19 Thread Robin Becker
I see a folder .python-eggs in my home directory on one of our servers with various .so files ~/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so are these just left behind from some install process? -- Robin Becker --

Re: How to know the starting point

2007-09-19 Thread Steve Holden
Raj kumar wrote: Hi, I need help regarding the starting point in python project, As we can find main() function in java class to know the starting class in java, what is the starting point in python project? How to find the starting point. Thank you The starting point is the top of the

Re: super() doesn't get superclass

2007-09-19 Thread Neil Cerutti
On 2007-09-19, Hrvoje Niksic [EMAIL PROTECTED] wrote: Ben Finney [EMAIL PROTECTED] writes: Hrvoje Niksic [EMAIL PROTECTED] writes: class X(Y): def foo(self): super(X, self).foo() ...there is in fact no guarantee that super() calls a superclass of X. However, it is certainly

Re: HTTP Protocol Client

2007-09-19 Thread Steve Holden
[EMAIL PROTECTED] wrote: Hi, I am writing http protocol to get some data from servers. If i was using my localhost, getting replay from local and if want access other remote sites, i am getting error. Please reply it My localhost client script::: Code: ( python ) import httplib

Re: HTTP Protocol Client

2007-09-19 Thread [EMAIL PROTECTED]
On Sep 19, 6:10 am, [EMAIL PROTECTED] wrote: Hi, I am writing http protocol to get some data from servers. If i was using my localhost, getting replay from local and if want access other remote sites, i am getting error. Please reply it My localhost client script::: Code: ( python )

Re: cannot create my own dict

2007-09-19 Thread Steve Holden
A.T.Hofkamp wrote: Hello all, This morning I tried to create my own read-only dictionary, and failed miserably. I don't understand why, can somebody enlighten me? Below is a brute-force experiment that cannot deal with x in obj, plz read the explanation below the code:

Re: cannot create my own dict

2007-09-19 Thread Peter Otten
A.T.Hofkamp wrote: This morning I tried to create my own read-only dictionary, and failed miserably. I don't understand why, can somebody enlighten me? Below is a brute-force experiment that cannot deal with x in obj, plz read the explanation below the code:

Re: super() doesn't get superclass

2007-09-19 Thread Robin Becker
Michele Simionato wrote: ... interesting stuff ommitted super seems to return an object of type super, but I cannot seem to find any documention on this type except for 3.4.2.3 Super Binding If a is an instance of super, then the binding super(B, obj).m() searches obj.__class__.__mro__ for

Re: Tutorial or Example (or Tutorial) of Using Canvas to Produce a Plot

2007-09-19 Thread W. Watson
I'm just trying to get some feel for how canvas works. I'm about to modify a program I use for meteor work. It uses canvas to display images, and I plan to draw on the image. For example, I plan to draw compass headings on a circle every 30 degrees. Just warming up to the task. exhuma.twn

Re: Tutorial or Example (or Tutorial) of Using Canvas to Produce a Plot

2007-09-19 Thread W. Watson
Here seems to be another good source. http://effbot.org/tkinterbook/canvas.htm W. Watson wrote: Ah, I missed your link to Chap 11. That looks very helpful. W. Watson wrote: Thanks. I've arranged for an inter-library loan(ILL), and probably will not get his book for several days yet. I've

Re: Sets in Python

2007-09-19 Thread Sion Arrowsmith
sapsi [EMAIL PROTECTED] wrote: Why can't lists be hashed? Several people have answered because they're mutable without explaining why mutability precludes hashing. So: Consider a dict (dicts have been in Python a *lot* longer than sets, and have the same restriction) which allowed lists as

Re: super() doesn't get superclass

2007-09-19 Thread Sion Arrowsmith
Ben Finney [EMAIL PROTECTED] wrote: If a function is named 'super' and operates on classes, it's a pretty strong implication that it's about superclasses. But it doesn't (under normal circumstances) operate on classes. It operates on an *instance*. And what you get back is a (proxy to) a

Re: Puzzled in the coding of Chinese

2007-09-19 Thread Carsten Haese
On Wed, 2007-09-19 at 13:57 +0800, Xing wrote: Dear list members, I am a newcomer in the world of Python. But I am attracted by Python's power in handling text! Now I apply it to handle Chinese but the Chinese character cann't be displayed on the screen. What displayed on the screen is

Keeping a database connection with a Singleton?

2007-09-19 Thread exhuma.twn
I remember reading about the Singleton pattern in python and how it's an unpythonic pattern and all. At the time I did not need the Singleton anyways, so I just glanced over the document. But, setting this aside: I have an application where I have a connection to a database. At some point in the

Re: lambda-funcs problem

2007-09-19 Thread Stéphane Larouche
Ryan Ginstrom software at ginstrom.com writes: How about: def make_adder(i): def adder(x): return x+i return adder funcs = [make_adder(i) for i in xrange(10)] print [func(10) for func in funcs] [10, 11, 12, 13, 14, 15, 16, 17, 18, 19] Or if you want a

Re: Keeping a database connection with a Singleton?

2007-09-19 Thread Jason
On Sep 19, 7:26 am, exhuma.twn [EMAIL PROTECTED] wrote: I remember reading about the Singleton pattern in python and how it's an unpythonic pattern and all. At the time I did not need the Singleton anyways, so I just glanced over the document. But, setting this aside: I have an application

Find the ID, but how to select/copy the whole string by ID?

2007-09-19 Thread Leon
Hi everybody, I am a beginer for Python, hope can get help from you guys. What I want to do is : Input an ID - find the ID in the file - copy the whole string str id='xxx'y/str stringID = str(raw_input('Enter the string ID : ')) file = open('strings.txt') sourcefile = file.read()

Re: super() doesn't get superclass

2007-09-19 Thread Michele Simionato
On Sep 19, 3:22 pm, Sion Arrowsmith [EMAIL PROTECTED] wrote: Ben Finney [EMAIL PROTECTED] wrote: If a function is named 'super' and operates on classes, it's a pretty strong implication that it's about superclasses. But it doesn't (under normal circumstances) operate on classes. It

Re: Keeping a database connection with a Singleton?

2007-09-19 Thread Peter Otten
exhuma.twn wrote: I remember reading about the Singleton pattern in python and how it's an unpythonic pattern and all. At the time I did not need the Singleton anyways, so I just glanced over the document. But, setting this aside: I have an application where I have a connection to a

Re: Keeping a database connection with a Singleton?

2007-09-19 Thread exhuma.twn
On Sep 19, 3:45 pm, Peter Otten [EMAIL PROTECTED] wrote: exhuma.twn wrote: [...] By the way, there is a pythonic (near) singleton: the module. So if you go with option 2, just move the connection setup into a separate module that you can import into client code. Peter You say (near)

Re: Keeping a database connection with a Singleton?

2007-09-19 Thread Peter Otten
exhuma.twn wrote: On Sep 19, 3:45 pm, Peter Otten [EMAIL PROTECTED] wrote: exhuma.twn wrote: [...] By the way, there is a pythonic (near) singleton: the module. So if you go with option 2, just move the connection setup into a separate module that you can import into client code. Peter

Re: Extracting xml from html

2007-09-19 Thread kyosohma
On Sep 19, 3:13 am, Stefan Behnel [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Does this make sense? It works pretty well, but I don't really understand everything that I'm doing. def Parser(filename): It's uncommon to give a function a capitalised name, unless it's a factory

Re: Keeping a database connection with a Singleton?

2007-09-19 Thread exhuma.twn
On Sep 19, 4:03 pm, Peter Otten [EMAIL PROTECTED] wrote: exhuma.twn wrote: On Sep 19, 3:45 pm, Peter Otten [EMAIL PROTECTED] wrote: exhuma.twn wrote: [...] By the way, there is a pythonic (near) singleton: the module. So if you go with option 2, just move the connection setup into a

Re: Drag image

2007-09-19 Thread kyosohma
On Sep 19, 1:06 am, ndoe [EMAIL PROTECTED] wrote: i want show image from button? and the image can be drag and rezise ? any body help me!!! i try to make it but is not sucsseful yet Please post some code so we can see what you're up to. Mike --

Re: super() doesn't get superclass

2007-09-19 Thread Neil Cerutti
On 2007-09-19, Michele Simionato [EMAIL PROTECTED] wrote: On Sep 19, 3:22 pm, Sion Arrowsmith [EMAIL PROTECTED] wrote: Ben Finney [EMAIL PROTECTED] wrote: If a function is named 'super' and operates on classes, it's a pretty strong implication that it's about superclasses. But it

ONYX

2007-09-19 Thread korovev76
Hi everybody! Is there anything out there that can validate and parse some onyx-style xml? I searched the web, but coulnd't find nothing really interesting about it... thank you! korovev -- http://mail.python.org/mailman/listinfo/python-list

Re: Using python to create windows apps that everyone can use?

2007-09-19 Thread Larry Bates
Matt McCredie wrote: On 9/18/07, Thomas Harding [EMAIL PROTECTED] wrote: Hi guys, sorry to post another topic on this, as I am aware that it has already been posted a few times, but not with specifically what I am looking for. I want an app that makes a gui interface for python (similar to

Re: Find the ID, but how to select/copy the whole string by ID?

2007-09-19 Thread Francesco Guerrieri
On 9/19/07, Leon [EMAIL PROTECTED] wrote: stringID = str(raw_input('Enter the string ID : ')) file = open('strings.txt') sourcefile = file.read() file.close() sourcefile.find (stringID) but how can I select and copy the specific string from str to /str with id I input? If the file you are

Re: Find the ID, but how to select/copy the whole string by ID?

2007-09-19 Thread Zentrader
sourcefile.find(stringID) returns the start location. You can use print to see this. You can then slice from start+len(stringID) and print it out. That should give you enough info to figure out how to find and extract to the end of the string tag as well. There are other ways to do this, but

Re: still get a defunct using a python script in the crontab

2007-09-19 Thread Zentrader
If I run the command /usr/sbin/program_prgchk everything works (no defunct process) But when I use it in the crontab I get a defunct process The crontabs file on my system is stored in /var/spool/cron/ crontabs/. It appears you are checking the wrong file. Try a crontab -e from the command

Re: Find the ID, but how to select/copy the whole string by ID?

2007-09-19 Thread Carsten Haese
On Wed, 2007-09-19 at 16:41 +0200, Francesco Guerrieri wrote: On 9/19/07, Leon [EMAIL PROTECTED] wrote: stringID = str(raw_input('Enter the string ID : ')) file = open('strings.txt') sourcefile = file.read() file.close() sourcefile.find (stringID) but how can I select and copy the

Re: Metatest 0.1.0

2007-09-19 Thread Jonathan Fine
Kay Schluehr wrote: On 19 Sep., 01:30, Jonathan Fine [EMAIL PROTECTED] wrote: there is no fundamental reason why it can't be separated from eeconsole.py. OK. That might be a good idea. Ironically, I liked the idea of having more expressive assert statements - a discussion you brought

Re: still get a defunct using a python script in the crontab

2007-09-19 Thread martijn
On 19 sep, 16:50, Zentrader [EMAIL PROTECTED] wrote: If I run the command /usr/sbin/program_prgchk everything works (no defunct process) But when I use it in the crontab I get a defunct process The crontabs file on my system is stored in /var/spool/cron/ crontabs/. It appears you are

psycopg2 or pygresql?

2007-09-19 Thread exhuma.twn
Plain and simple. What would you use? So far I have written everything with psycopg2. One thing that annoys me is that I cannot easily access the column names from a query. I know that this is not part of the DBAPI2 so I cannot expect the model to suport it. I quite like the mogrify method of

Re: AttributeError: How to list existing attributes?

2007-09-19 Thread Thomas Guettler
Diez B. Roggisch wrote: Thomas Guettler wrote: Hi, how can you list the attributes of an object if you catch an AttributeError? I couldn't find a reference in the exception object, which points to the object. I want to call dir() on the object to list the user the known attributes.

Re: Find the ID, but how to select/copy the whole string by ID?

2007-09-19 Thread Francesco Guerrieri
On 9/19/07, Carsten Haese [EMAIL PROTECTED] wrote: , then looking for id 12 is going to match on the wrong ID. Besides, that code only tells you where something that looks like the ID you're looking for is in the file. There is no guarantee that the match actually occurs inside an ID

Re: Using pseudonyms (was Re: Python 3K or Python 2.9?)

2007-09-19 Thread Aahz
In article [EMAIL PROTECTED], Bruno Desthuilliers [EMAIL PROTECTED] wrote: Aahz a écrit : In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: Aahz wrote: In article [EMAIL PROTECTED], Bruno Desthuilliers [EMAIL PROTECTED] wrote: Aahz a écrit : In article [EMAIL

Re: The meaning of a = b in object oriented languages

2007-09-19 Thread Ken Bloom
On Tue, 18 Sep 2007 18:02:59 -0400, Lew wrote: Summercool wrote: when a writing or a book reads a is a Hash object; a is an Array object; or a is an Animal object it is just a short form to say that a is a reference to that object. b = a means whatever a is referencing to, now b is

Re: psycopg2 or pygresql?

2007-09-19 Thread jay graves
On Sep 19, 10:06 am, exhuma.twn [EMAIL PROTECTED] wrote: And before someone says: Use the DictCursor-factory to access column names. Yes I can do that. But a dict does not guarantee the same order of keys as the columns were specified in the query. But you can iterate over the

  1   2   3   >