Re: some OT: how to solve this kind of problem in our program?

2006-12-24 Thread Paul McGuire
"oyster" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 1. first of all, what is the English jargon (Optimize? But I think > this is not a very good keyword :( )for this problem? So I can use it > to search on the internet > 2. is there any free/open lib for this? > 3. I know for so

Re: Newbie: what is a usefull IDE for Python on Windows ?

2006-12-24 Thread Riquelme
Eclipse + Editplus -- http://mail.python.org/mailman/listinfo/python-list

Re: some OT: how to solve this kind of problem in our program?

2006-12-24 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, oyster wrote: > 1. first of all, what is the English jargon (Optimize? But I think > this is not a very good keyword :( )for this problem? So I can use it > to search on the internet > 2. is there any free/open lib for this? > 3. I know for some questions(case 1, case 2, an

Re: consequence and life

2006-12-24 Thread Lester Mosley
I alway wondered if you are smelling a flower in a dream while on some crazy herbal medication. are you smelling the flower that is in the drug or a a flower that you once smelled when you were three years old on your daddy's knee ofr when you were bent over in the park looking for your lost keys.

Re: split string with hieroglyphs

2006-12-24 Thread Belize
Steven, thanks! Very nice algorithm. Here is code: #!/usr/bin/env python # -*- coding: utf_8 -*- # Thanks Steven D'Aprano for hints import unicodedata import MySQLdb #MySQL variables mysql_host = "localhost" mysql_user = "dict" mysql_password = "passwd" mysql_db = "dictionary" try: my

Connection python with C

2006-12-24 Thread Χρυσάνθη Αϊναλή
Hi.. I want to connect a script in python with a source code in C. Any ideas about it? Thank you! Chrysanthi -- http://mail.python.org/mailman/listinfo/python-list

Re: Connection python with C

2006-12-24 Thread Fredrik Lundh
Χρυσάνθη Αϊναλή wrote: > I want to connect a script in python with a source code in C. Any > ideas about it? http://docs.python.org/lib/module-ctypes.html http://docs.python.org/ext/ext.html http://effbot.org/pyfaq/extending-index.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: some OT: how to solve this kind of problem in our program?

2006-12-24 Thread bearophileHUGS
Paul McGuire: > This little framework takes about 4.5 seconds, but with > psyco, cuts down to about 1.3 seconds. > > st = time.time() > result = [] > for p in permutations(range(1,10)): > aresult = func(p) > if aresult is not None and aresult not in result: > result.append(aresult)

Re: removing the header from a gzip'd string

2006-12-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Essentially, they note that the NCD does not always bevave like a > metric and one reason they put forward is that this may be due to the > size of the header portion (they were using the command line gzip and > bzip2 programs) compared to the strings being compressed (w

Re: Help please using telnetlib module

2006-12-24 Thread Birdman
Simplest explanation is that you can't do a 'show run' from global configuration mode try something like #exit global configuration mode tn.write('end\n') print tn.read_until('#') #disable pause after 24 lines tn.write('term len 0\n') tn.read_until('#') #now show the entire running-config t

Re: some OT: how to solve this kind of problem in our program?

2006-12-24 Thread BJörn Lindqvist
On 12/24/06, oyster <[EMAIL PROTECTED]> wrote: > 1. first of all, what is the English jargon (Optimize? But I think > this is not a very good keyword :( )for this problem? So I can use it > to search on the internet The first problem is a magic square. The general term for all your problems are co

[pyOpenGL]Demo cannot run on Python2.5

2006-12-24 Thread sweetmelon
(I'm a newbie in Python and pyOpenGL.) Environment: WinXP SP2 Python ver. 2.5 WingIDE easy_install is installed PIL, pyNum is installed Download PyOpenGL-3.0.0a5-py2.5.egg run: easy_install PyOpenGL-3.0.0a5-py2.5.egg pyOpenGL is installed in D:\Python25\Lib\site-packages\PyOpenGL-3.0.0a5-py2.5.egg\

Re: merits of Lisp vs Python

2006-12-24 Thread Juan R.
Fuzzyman ha escrito: > Perhaps only with the addendum that although 'Lisp roolz', no-one uses > for anything of relevance anymore and it is continuing it's geriatric > decline into obscurity. ;-) I do not think that i cannot agree with the contrary of this but i do not think the contrary neither.

problem with PIPE

2006-12-24 Thread Dhika Cikul
Hello, I'm new in Python, i don't know my subject is correct or wrong. I have problem with my script. I want to change password with passwd password in python without user submitted anything from keyboard. I get tutorial that i must use pipe to process this. And this is my code : [code] 1.

Help with small program

2006-12-24 Thread smartbei
Hello, I am a newbie with python, though I am having a lot of fun using it. Here is one of the excersizes I am trying to complete: the program is supposed to find the coin combination so that with 10 coins you can reach a certain amoung, taken as a parameter. Here is the current program: coins = (

Re: regular expression

2006-12-24 Thread Dustan
Kleine Aap wrote: > Asper Faner wrote: > > > I seem to always have hard time understaing how this regular expression > > works, especially how on earth do people bring it up as part of > > computer programming language. Natural language processing seems not > > enough to explain by the way. Why no

Re: regular expression

2006-12-24 Thread js
I'm a great fan of regexp because it has great power and flexibility. if you don't like it I suggest you to read "Mastering Regular Expressions". http://www.oreilly.com/catalog/regex3/ Yes, sometimes it might be hard to understand bites you but if you use it correctly, it works great. On 18 Dec 2

Re: Help with small program

2006-12-24 Thread Felix Benner
smartbei schrieb: > Hello, I am a newbie with python, though I am having a lot of fun using > it. Here is one of the excersizes I am trying to complete: > the program is supposed to find the coin combination so that with 10 > coins you can reach a certain amoung, taken as a parameter. Here is the >

Re: problem with PIPE

2006-12-24 Thread Felix Benner
Dhika Cikul schrieb: > Hello, > > I'm new in Python, i don't know my subject is correct or wrong. I have > problem with my script. I want to change password with passwd password > in python without user submitted anything from keyboard. I get > tutorial that i must use pipe to process this. And th

Re: some OT: how to solve this kind of problem in our program?

2006-12-24 Thread bearophileHUGS
Using Psyco this version is much faster, you can test it on your PC compared to the other one (the whole running time, Psyco compilation too): Psyco is unable to speed up generator functions, so you have to return true lists. Giving the func to the permutation function, you can avoid lot of list co

Re: Connection python with C

2006-12-24 Thread vasudevram
Fredrik Lundh wrote: > Χρυσάνθη Αϊναλή wrote: > > > I want to connect a script in python with a source code in C. Any > > ideas about it? > > http://docs.python.org/lib/module-ctypes.html > http://docs.python.org/ext/ext.html > http://effbot.org/pyfaq/extending-index.htm > > Just a suggestion: a

Re: regular expression

2006-12-24 Thread Stef Mientki
Dustan wrote: > Kleine Aap wrote: >> Asper Faner wrote: >> >>> I seem to always have hard time understaing how this regular expression >>> works, especially how on earth do people bring it up as part of >>> computer programming language. Natural language processing seems not >>> enough to explain b

Saw a possibly interesting Python PDF library - pyPDF

2006-12-24 Thread vasudevram
Saw a possibly interesting Python PDF library - pyPDF. For merging/splitting PDFs and related operations. It's at http://pybrary.net/pyPdf/ HTH Vasudev ~ Vasudev Ram Dancing Bison Enterprises http://www.dancingbison.com Check out the cool Snap.com link preview fea

file/directory format/size help

2006-12-24 Thread moishyyehuda
Hi I am writing a script to upload images. How do I check the format of the file? How can I tell if the file is an image, movie, or text file? I would also like to put a limit on how much a user can upload. So how can I check how many bits, bytes, mb, gb are in a folder. So that sums up to #1 Wh

Re: regular expression

2006-12-24 Thread Rad [Visual C# MVP]
On Sun, 24 Dec 2006 16:36:31 +0100, Stef Mientki wrote: > Dustan wrote: >> Kleine Aap wrote: >>> Asper Faner wrote: >>> I seem to always have hard time understaing how this regular expression works, especially how on earth do people bring it up as part of computer programming langua

Merry Christmas and a happy new year!

2006-12-24 Thread Thomas Ploch
I wish everybody a merry Christmas and a happy new year. Have a good and beautiful new year. Thomas -- http://mail.python.org/mailman/listinfo/python-list

turbogears app deployment

2006-12-24 Thread rick
I am trying to host a TuboGears app using Apache and mod_python on a machine running Windows XP SP2 Professional. Version info: apache_2.2.3-win32-x86-no_ssl.msi, python-2.4.4.msi, mod_python-3.2.10.win32-py2.4-apache2.2.exe, mpcp-1.5.tar.gz, turbogears-1.0b2-py2.4

Re: Help with small program

2006-12-24 Thread smartbei
Felix Benner wrote: > smartbei schrieb: > > Hello, I am a newbie with python, though I am having a lot of fun using > > it. Here is one of the excersizes I am trying to complete: > > the program is supposed to find the coin combination so that with 10 > > coins you can reach a certain amoung, take

Re: problem with PIPE

2006-12-24 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Felix Benner <[EMAIL PROTECTED]> wrote: >Dhika Cikul schrieb: >> Hello, >> >> I'm new in Python, i don't know my subject is correct or wrong. I have >> problem with my script. I want to change password with passwd password >> in python without user submitted anythi

terminology question - "foreign function library"

2006-12-24 Thread mirandacascade
I am prompted to make these inquiries after seeing the following link to ctypes: http://docs.python.org/lib/module-ctypes.html in which ctypes is described as a foreign function library. What is the definition of "foreign function library"? Is the concept different from a "package"? Is the conce

Re: Fall of Roman Empire

2006-12-24 Thread Dan Bishop
Dec 20, 10:36 am, Felix Benner <[EMAIL PROTECTED]> wrote: > static int main(int argc, char **argv) { > char *god_name; > if (argc) > god_name = argv[1]; > else > god_name = "YHWH"; > metaPower God = getGodByName(god_name); > u

Re: consequence and life

2006-12-24 Thread marika
Lester Mosley wrote: > I alway wondered if you are smelling a flower in a dream while on some > crazy herbal medication. are you smelling the flower that is in the > drug or a a flower that you once smelled when you were three years old > on your daddy's knee ofr when you were bent over in the par

Re: terminology question - "foreign function library"

2006-12-24 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I am prompted to make these inquiries after seeing the following link | to ctypes: | | http://docs.python.org/lib/module-ctypes.html | | in which ctypes is described as a foreign function library. | | What is the definition of "foreign

Re: Use a Thread to reload a Module?

2006-12-24 Thread Aahz
In article <[EMAIL PROTECTED]>, =?ISO-8859-1?Q?Gregory_Pi=F1ero?= <[EMAIL PROTECTED]> wrote: > >That module deals with accessing data from QuickBooks, marshaling it, >and providing methods to access the marshaled data. Having the server >program keep that module and all of its data in memory makes

thread and command-line communicating

2006-12-24 Thread Siamak
Hello, I'm a newbie to Python. How can I have a thread (say a Tkinter window) alongside with the command-line interpretor? I'd like to have my thread handling events and exceptions, while I do stuff in the command-line, possibly signaling the thread, or terminating it, etc. Is that possible? Thanks

Re: terminology question - "foreign function library"

2006-12-24 Thread Gary Herron
[EMAIL PROTECTED] wrote: > I am prompted to make these inquiries after seeing the following link > to ctypes: > > http://docs.python.org/lib/module-ctypes.html > > in which ctypes is described as a foreign function library. > > What is the definition of "foreign function library"? > Is the concept

module hierarchy snapshot

2006-12-24 Thread km
Hi, Is there any good tool get a snapshot of module hierarchy for custom python modules ? regards, KM -- http://mail.python.org/mailman/listinfo/python-list

Re: file/directory format/size help

2006-12-24 Thread Steven D'Aprano
On Sun, 24 Dec 2006 07:45:32 -0800, moishyyehuda wrote: > Hi > > I am writing a script to upload images. How do I check the format of > the file? How can I tell if the file is an image, movie, or text file? > I would also like to put a limit on how much a user can upload. So how > can I check how

Re: file/directory format/size help

2006-12-24 Thread Stef Mientki
>> #1 What type of file is the file? Is it a movie, image, or text >> document? > > In the Windows world, one simply looks at the file extension (e.g. .gif, > .avi, .txt, etc.) and hopes that it is correct. or simply use TRID: http://mark0.net/soft-trid-e.html Stef Mientki -- http://mail.python

Re: Multi-line docstrings

2006-12-24 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > >> The Python docs recommend the use of triple-quoted string literals for >> docstrings, e.g. >> >> def Meet(Alice, Bob) : >> """arranges a meeting between Alice and Bob. >>

method names in __slots__ ??

2006-12-24 Thread John Machin
I have stumbled across some class definitions which include all/most method names in a __slots__ "declaration". A cut-down and disguised example appears at the end of this posting. Never mind the __private_variables and the getter/setter approach, look at the list of methods in the __slots__. I n

Why does Python never add itself to the Windows path?

2006-12-24 Thread Ben Sizer
I've installed several different versions of Python across several different versions of MS Windows, and not a single time was the Python directory or the Scripts subdirectory added to the PATH environment variable. Every time, I've had to go through and add this by hand, to have something resembli

Re: Why does Python never add itself to the Windows path?

2006-12-24 Thread vbgunz
Ben Sizer wrote: > I've installed several different versions of Python across several > different versions of MS Windows, and not a single time was the Python > directory or the Scripts subdirectory added to the PATH environment > variable. Every time, I've had to go through and add this by hand,

Unescaping URLs in Python

2006-12-24 Thread John Nagle
Here's a URL from a link on the home page of a major company. About Us Yes, that "&" is in the source text of the page. This is, in fact, correct HTML. See http://www.htmlhelp.com/tools/validator/problems.html#amp What's the appropriate Python function to call to unescape

Re: Why does Python never add itself to the Windows path?

2006-12-24 Thread [EMAIL PROTECTED]
I don't seem to have any problem running python programs regardless of where they are. My platform is windows xp and I have run both 2.4 and 2.5 more details about what version of windows you are running might be helpfull https://sourceforge.net/project/showfiles.php?group_id=156455&package_id=17

Re: Help with small program

2006-12-24 Thread Paul Watson
smartbei wrote: > Felix Benner wrote: >> smartbei schrieb: >>> Hello, I am a newbie with python, though I am having a lot of fun using >>> it. Here is one of the excersizes I am trying to complete: >>> the program is supposed to find the coin combination so that with 10 >>> coins you can reach a ce

Re: Help with small program

2006-12-24 Thread Paul Watson
Better alternative. cointype = (100, 10, 5, 1, 0.5) def coins(fin): needed = {} for c in cointypes: v, r = divmod(fin, c) if v > 0: needed[c] = v fin = r return needed if __name__ == '__main__

Re: Unescaping URLs in Python

2006-12-24 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, John Nagle wrote: > Here's a URL from a link on the home page of a major company. > > About Us > > What's the appropriate Python function to call to unescape a URL > which might contain things like that? Just use any HTML-parsing library. I think the standard Pyt

Re: Why does Python never add itself to the Windows path?

2006-12-24 Thread MC
Hi! +1 -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

How to stop program when threads is sleeping

2006-12-24 Thread many_years_after
Hi, pythoners: There is a problem I couldn't dispose. I start a thread in the my program. The thread will do something before executing time.sleep(). When the user give a signal to the main thread (such as click the 'end' button or close the window), the thread should end it's running. But h

Website Capture

2006-12-24 Thread yoring
Hi, I want to capture a web site into gif image using Python. I installed the PIL if it can help. -- http://mail.python.org/mailman/listinfo/python-list

Re: textwrap.dedent replaces tabs?

2006-12-24 Thread Frederic Rentsch
Tom Plunket wrote: > Frederic Rentsch wrote: > > >> Following a call to dedent () it shouldn't be hard to translate leading >> groups of so many spaces back to tabs. >> > > Sure, but the point is more that I don't think it's valid to change to > tabs in the first place. > > E.g.: > > inpu

Re: Website Capture

2006-12-24 Thread Jonathan Curran
On Monday 25 December 2006 00:57, [EMAIL PROTECTED] wrote: > Hi, > > I want to capture a web site into gif image using Python. > I installed the PIL if it can help. It can't be done with just Python & PIL, that much is for sure. First of all you need some sort of module/program/(whatever you want