Re: Python DLL in Windows Folder

2007-12-24 Thread Tim Roberts
Ross Ridge <[EMAIL PROTECTED]> wrote: >Chris Mellon <[EMAIL PROTECTED]> wrote: >>What the python installer is doing is the Right Thing for making the >>standard python dll available to third party applications. >>Applications that want a specific version of a specific DLL should use >>the mechanis

Re: convert pdf to png

2007-12-24 Thread Carl K
Jaap Spies wrote: > Carl K wrote: >> Grant Edwards wrote: >>> On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >>> > If it is a multi page pdf Imagemagick will do: > > convert file.pdf page-%03d.png I need python code to do this. It is going to be run on a someone else's shar

Re: convert pdf to png

2007-12-24 Thread Carl K
Andrew MacIntyre wrote: > Grant Edwards wrote: >> On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >> If it is a multi page pdf Imagemagick will do: convert file.pdf page-%03d.png >>> I need python code to do this. It is going to be run on a >>> someone else's shared host web server

Re: Converting old "shelve" databases to gdbm

2007-12-24 Thread Istvan Albert
On Dec 24, 7:38 pm, [EMAIL PROTECTED] wrote: > Any tips welcome. pickling has a text protocol that should be compatible across python versions. Pickle each of your database entries to a different file, then read them in the newer version of the script. i. -- http://mail.python.org/mailman/list

$

2007-12-24 Thread khaled
http://www.AWSurveys.com/HomeMain.cfm?RefID=khaled231 -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there *any* real documentation to PyWin32?

2007-12-24 Thread Gilles Ganault
On Fri, 21 Dec 2007 17:56:25 -0800 (PST), sturlamolden <[EMAIL PROTECTED]> wrote: >If Benoit is having trouble using PyWin32, I think he is having >trouble using the Windows API. I wouldn't blame him :-) Besides, the point of writing Windows apps directly in Python, ie. without relying on an extra

Re: Pexpect and a Linux Terminal

2007-12-24 Thread Michael Bentley
On Dec 24, 2007, at 7:06 PM, [EMAIL PROTECTED] wrote: > hello, > > I'm new in Python and i would like to use Pexpect to execute a root > command (i want to mount via a Pyhton script a drive) > > so that's my script for the moment : > > from os import * > import pexpect > import os > cmd1="su -" >

Re: Pexpect and a Linux Terminal

2007-12-24 Thread Karthik Gurusamy
On Dec 24, 6:06 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > hello, > > I'm new in Python and i would like to use Pexpect to execute a root > command (i want to mount via a Pyhton script a drive) > > so that's my script for the moment : > > from os import * > import pexpect > import os > cm

Pexpect and a Linux Terminal

2007-12-24 Thread [EMAIL PROTECTED]
hello, I'm new in Python and i would like to use Pexpect to execute a root command (i want to mount via a Pyhton script a drive) so that's my script for the moment : from os import * import pexpect import os cmd1="su -" cmd2="mount -o loop /home/user/my.iso /mnt/disk" pwd="mypassword" child = p

Re: list in a tuple

2007-12-24 Thread Raymond Hettinger
On Dec 24, 8:22 am, [EMAIL PROTECTED] wrote: > Recently, I got into a debate on programming.reddit.com about > what should happen in the following case: > > >>> a = ([1], 2) > >>> a[0] += [3] > > Currently, Python raises an error *and* changes the first element of > the tuple. Now, this seems like

Re: Happy Christmas Pythoneers

2007-12-24 Thread Michael Bentley
On Dec 24, 2007, at 9:30 AM, [EMAIL PROTECTED] wrote: > On Dec 24, 12:17�am, Paddy <[EMAIL PROTECTED]> wrote: >> After quite enjoying participating in the group in 2007, I'd like to >> wish you all a Merry Xmas. >> >> - Paddy. > > Shouldn't that be 0Xmas? >>> msg = ['Merry', '0Xmas'] >>> for m

Re: convert pdf to png

2007-12-24 Thread Andrew MacIntyre
Grant Edwards wrote: > On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: > >>> If it is a multi page pdf Imagemagick will do: >>> >>> convert file.pdf page-%03d.png >> I need python code to do this. It is going to be run on a >> someone else's shared host web server, security and >> performance is

Re: convert pdf to png

2007-12-24 Thread Jaap Spies
Carl K wrote: > Grant Edwards wrote: >> On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >> If it is a multi page pdf Imagemagick will do: convert file.pdf page-%03d.png >>> I need python code to do this. It is going to be run on a >>> someone else's shared host web server, security

Converting old "shelve" databases to gdbm

2007-12-24 Thread RayOsborn
I have some old "shelve" databases created in Python 2.2 that use the old bsddb format, whereas the version of Python 2.4 installed by my web hosting service doesn't have bsddb available at all (or at least, it has, but probably not linked properly to the more recent Sleepy Cat versions of the Ber

Re: fiber(cooperative multi-threading)

2007-12-24 Thread Bjoern Schliessmann
Michael Sparks wrote: > All that said, my personal primary aim for kamaelia is to try and > make it into a general toolkit for making concurrency easy & > natural (as well as efficient) to work with. If full blown > coroutines turn out to be part of that c'est le vie :-) I must admit I mostly did

Re: Python DLL in Windows Folder

2007-12-24 Thread Ross Ridge
Chris Mellon <[EMAIL PROTECTED]> wrote: >What the python installer is doing is the Right Thing for making the >standard python dll available to third party applications. >Applications that want a specific version of a specific DLL should use >the mechanisms available for doing so, instead of relyin

Re: Python DLL in Windows Folder

2007-12-24 Thread Lie
On Dec 25, 3:04 am, "Markus Gritsch" <[EMAIL PROTECTED]> wrote: > On 24/12/2007, Chris Mellon <[EMAIL PROTECTED]> wrote: > > > > > On Dec 23, 2007 12:27 PM, Markus Gritsch <[EMAIL PROTECTED]> wrote: > > > On 23/12/2007, Christian Heimes <[EMAIL PROTECTED]> wrote: > > > > Markus Gritsch wrote: > > >

Re: very newbie question about exception handling

2007-12-24 Thread Ricardo Aráoz
[EMAIL PROTECTED] wrote: > code sample: > -- > i=input() > try: > x=int(i) > print "you input an integer" > except ValueError: > print "you must input an integer" > > when I input a value like,

very newbie question about exception handling

2007-12-24 Thread Louis . Soninhu
code sample: -- i=input() try: x=int(i) print "you input an integer" except ValueError: print "you must input an integer" when I input a value like, b I got the traceback message instead of prop

Re: 5 queens

2007-12-24 Thread George Sakkis
On Dec 23, 7:04 am, Steven D'Aprano wrote: > def combinations(seq, n): > if n == 0: > yield [] > else: > for i in xrange(len(seq)): > for cc in combinations(seq[i+1:], n-1): > yield [seq[i]]+cc > > >>> for c in combinations(range(4), 3): > > ...

Re: convert pdf to png

2007-12-24 Thread Carl K
Grant Edwards wrote: > On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: > >>> If it is a multi page pdf Imagemagick will do: >>> >>> convert file.pdf page-%03d.png >> I need python code to do this. It is going to be run on a >> someone else's shared host web server, security and >> performance is

Re: Python DLL in Windows Folder

2007-12-24 Thread Markus Gritsch
On 24/12/2007, Chris Mellon <[EMAIL PROTECTED]> wrote: > On Dec 23, 2007 12:27 PM, Markus Gritsch <[EMAIL PROTECTED]> wrote: > > On 23/12/2007, Christian Heimes <[EMAIL PROTECTED]> wrote: > > > Markus Gritsch wrote: > > > > why does the Python installer on Windows put the Python DLL into the > > >

Re: Happy Christmas Pythoneers

2007-12-24 Thread James Matthews
Happy Holidays Y'all! On Dec 24, 2007 5:50 PM, Nabeel Ali Memon <[EMAIL PROTECTED]> wrote: > :-) sure if we had machines addressing above hexa... > > > On Dec 24, 2007 9:30 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote: > > > On Dec 24, 1Ha2:17�am, Paddy < [EMAIL PROTECTED]> wrote: > > > After

Re: Python DLL in Windows Folder

2007-12-24 Thread Markus Gritsch
On 24/12/2007, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > * Markus Gritsch (Sun, 23 Dec 2007 18:28:41 +0100) > > On 23/12/2007, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > > * Markus Gritsch (Sun, 23 Dec 2007 15:52:50 +0100) > > > > why does the Python installer on Windows put the Python DLL int

SWbemObjectEx not found

2007-12-24 Thread jmgmail
I have a working VBScript and failed to convert it to Python. Can someone help? ==VBScript:== Set locator = CreateObject("WbemScripting.SWbemLocator") Set Services = locator.ConnectServer("smsroot1","root/SMS/site_A") Set instCollection = Services.Get("SMS_Collection.CollectionID='A000D9'") 'Crea

Re: Python DLL in Windows Folder

2007-12-24 Thread Chris Mellon
On Dec 23, 2007 12:27 PM, Markus Gritsch <[EMAIL PROTECTED]> wrote: > On 23/12/2007, Christian Heimes <[EMAIL PROTECTED]> wrote: > > Markus Gritsch wrote: > > > why does the Python installer on Windows put the Python DLL into the > > > Windows system32 folder? Wouldn't it be more clean to place it

Re: list in a tuple

2007-12-24 Thread Arnaud Delobelle
On Dec 24, 4:13 pm, [EMAIL PROTECTED] wrote: > Like I said, it is clear *why* this happens, what I > am concerned is if this what we *want* to happen, i.e., > if the current situation is satisfying. Your mytuple class > would be something that resembles a solution, my question > is what the people

Re: Happy Christmas Pythoneers

2007-12-24 Thread Nabeel Ali Memon
:-) sure if we had machines addressing above hexa... On Dec 24, 2007 9:30 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Dec 24, 12:17�am, Paddy <[EMAIL PROTECTED]> wrote: > > After quite enjoying participating in the group in 2007, I'd like to > > wish you all a Merry Xmas. > > > > - Padd

Re: convert pdf to png

2007-12-24 Thread Grant Edwards
On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >> If it is a multi page pdf Imagemagick will do: >> >> convert file.pdf page-%03d.png > > I need python code to do this. It is going to be run on a > someone else's shared host web server, security and > performance is an issue. So I would rathe

Re: Happy Christmas Pythoneers

2007-12-24 Thread [EMAIL PROTECTED]
On Dec 24, 12:17�am, Paddy <[EMAIL PROTECTED]> wrote: > After quite enjoying participating in the group in 2007, I'd like to > wish you all a Merry Xmas. > > - Paddy. Shouldn't that be 0Xmas? -- http://mail.python.org/mailman/listinfo/python-list

Re: list in a tuple

2007-12-24 Thread Arnaud Delobelle
On Dec 24, 4:08 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: [...] > class mytuple(tuple): >     "It's ok to do t[i] = obj as long as t[i] was already obj" >     def __setitem__(self, i, val): >         if self[i] is not val: >             raise TypeError("'mytuple' object is immutable") > > So:

Re: list in a tuple

2007-12-24 Thread montyphyton
Like I said, it is clear *why* this happens, what I am concerned is if this what we *want* to happen, i.e., if the current situation is satisfying. Your mytuple class would be something that resembles a solution, my question is what the people on this group think about it. On Dec 24, 5:08 pm, Arna

Re: list in a tuple

2007-12-24 Thread Arnaud Delobelle
On Dec 24, 3:22 pm, [EMAIL PROTECTED] wrote: > Recently, I got into a debate on programming.reddit.com about > what should happen in the following case: > > >>> a = ([1], 2) > >>> a[0] += [3] > > Currently, Python raises an error *and* changes the first element of > the tuple. Now, this seems like

Re: Releasing malloc'd memory using ctypes?

2007-12-24 Thread Chris Mellon
On Dec 23, 2007 12:36 PM, <[EMAIL PROTECTED]> wrote: > I am starting to experiment with ctypes. I have a function which returns a > pointer to a struct allocated in heap memory. There is a corresponding free > function for that sort of struct, e.g.: > > from ctypes import * > > cdll.Load

Re: fiber(cooperative multi-threading)

2007-12-24 Thread Michael Sparks
Duncan Booth wrote: [ snip sections about why the single layer aspect can be helpful ] > I'm happy with generators as they are: they're a great solution to a > problem that most of us didn't realise we had until the solution came > along. That doesn't mean that I wouldn't also like to have a separ

ANN: Axon.STM 1.0.1 (release) Minimalistic Software Transactional Memory (with examples)

2007-12-24 Thread Michael Sparks
Hi, I've received some great feedback since the initial beta release of the minimalistic STM code I discussed and released 2 weeks ago. I've incorporated the feedback, and created a couple of examples based on the canonical dining philosophers example. (One based on normal python threads, one bas

list in a tuple

2007-12-24 Thread montyphyton
Recently, I got into a debate on programming.reddit.com about what should happen in the following case: >>> a = ([1], 2) >>> a[0] += [3] Currently, Python raises an error *and* changes the first element of the tuple. Now, this seems like something one would want to change - why raise an error *an

Re: missing pydoc gui

2007-12-24 Thread JimG
On Dec 24, 9:23 am, JimG <[EMAIL PROTECTED]> wrote: > I just read about the pydoc gui in "Learning Python." But it's > mysteriously absent from my Fedora 8 Python installation. Searching > the filesystem exhaustively turns up no pydocgui script anywhere, and > not only does "pydoc -g" not work, m

Re: Releasing malloc'd memory using ctypes?

2007-12-24 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > I am starting to experiment with ctypes. I have a function which returns a > pointer to a struct allocated in heap memory. There is a corresponding free > function for that sort of struct, e.g.: > > from ctypes import * > > cdll.LoadLibrary("libthing.so") >

missing pydoc gui

2007-12-24 Thread JimG
I just read about the pydoc gui in "Learning Python." But it's mysteriously absent from my Fedora 8 Python installation. Searching the filesystem exhaustively turns up no pydocgui script anywhere, and not only does "pydoc -g" not work, my Python documentation has no mention of it, it describes py

Re: convert pdf to png

2007-12-24 Thread Carl K
Jaap Spies wrote: > Carl K wrote: >> I need to take the take the pdf output from reportlab and create a >> preview image for a web page. so png or something. I am sure >> ghostscript will be involved. I am guessing PIL or ImageMagic ? >> >> all sugestions welcome. >> > > If it is a multi page

Re: 5 queens

2007-12-24 Thread Steven D'Aprano
On Mon, 24 Dec 2007 00:18:29 -0800, cf29 wrote: > On Dec 23, 2:04 pm, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: >> def combinations(seq, n): >>     if n == 0: >>         yield [] >>     else: >>         for i in xrange(len(seq)): >>             for cc in combinations(seq[i+1:

Re: Damn error!

2007-12-24 Thread Tim Chase
> def print_tabela(tabela): > print "Tabela 1 | Tabela 2" > for linha in tabela: > tmp = linha.split(":") in here, insert this: print len(tmp), > print tmp[0] + " | " + tmp[1], I also think you may not want the tra

Re: Damn error!

2007-12-24 Thread Steven D'Aprano
On Mon, 24 Dec 2007 04:30:50 -0800, Vaurdan wrote: > Hello, > I've this code: > def print_tabela(tabela): > print "Tabela 1 | Tabela 2" > for linha in tabela: > tmp = linha.split(":") > print tmp[0] + " | " + tmp[1], > > But give me this err

Re: Damn error!

2007-12-24 Thread Guilherme Polo
Em 24/12/07, Vaurdan<[EMAIL PROTECTED]> escreveu: > Hello, > I've this code: > def print_tabela(tabela): > print "Tabela 1 | Tabela 2" > for linha in tabela: > tmp = linha.split(":") > print tmp[0] + " | " + tmp[1], > > But give me thi

Re: Damn error!

2007-12-24 Thread Florencio Cano
One linha in tabela doesn't have the syntax "something:something" so split() returns a 0 or 1 sized list and tmp[0] or tmp[1] points outside the list. 2007/12/24, Vaurdan <[EMAIL PROTECTED]>: > Hello, > I've this code: > def print_tabela(tabela): > print "Tabela 1 | Tabela 2" > for

Re: Bug writing/reading to file.

2007-12-24 Thread Lars Johansen
text.txt is only read when you open the file, that means that your read statement, doesnt now of what has been written to the file, since it was opened.. under if if option == "1": you should add, then it will be re-read for every read abc = open('text.txt')

Re: Bug writing/reading to file.

2007-12-24 Thread Arne
On Dec 24, 12:53 pm, [EMAIL PROTECTED] wrote: > Hi! :) > > Im new to python, and I have made a electronic diary - its just a > task. Here is the code:http://pastebin.com/m49391798 > > The bug is (feel free to download and test it) that i can't see what i > wrote in the diary without restarting the

Damn error!

2007-12-24 Thread Vaurdan
Hello, I've this code: def print_tabela(tabela): print "Tabela 1 | Tabela 2" for linha in tabela: tmp = linha.split(":") print tmp[0] + " | " + tmp[1], But give me this error: Tabela 1 | Tabela 2 Traceback (most recent call last): F

Re: Bug writing/reading to file.

2007-12-24 Thread Guilherme Polo
2007/12/24, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Hi! :) > > Im new to python, and I have made a electronic diary - its just a > task. Here is the code: > http://pastebin.com/m49391798 > > The bug is (feel free to download and test it) that i can't see what i > wrote in the diary without restart

Re: Inter-process communication, how? Part 2

2007-12-24 Thread Guilherme Polo
2007/12/24, Bjoern Schliessmann <[EMAIL PROTECTED]>: > Hendrik van Rooyen wrote: > > <[EMAIL PROTECTED]> wrote: > > >> What I don't like about FIFO, is that on Unix they are persistent > >> files. So whatever happens to Manager they would stay there... > >> I was just wondering if there's another w

Re: Inter-process communication, how? Part 2

2007-12-24 Thread Bjoern Schliessmann
Hendrik van Rooyen wrote: > <[EMAIL PROTECTED]> wrote: >> What I don't like about FIFO, is that on Unix they are persistent >> files. So whatever happens to Manager they would stay there... >> I was just wondering if there's another way of doing the above >> and if not, I would probably go with F

Bug writing/reading to file.

2007-12-24 Thread arne . k . h
Hi! :) Im new to python, and I have made a electronic diary - its just a task. Here is the code: http://pastebin.com/m49391798 The bug is (feel free to download and test it) that i can't see what i wrote in the diary without restarting the program. Here is an example: 1: I start the program 2: (

how to protect directory traversal in mod_python based custom apps

2007-12-24 Thread Ravi Kumar
hi :) I was trying to develop a custom mod_python based web-site, just today. the problem I got though i liked the mod_python's feature of mapping and calling functions in python script by parsing the url. I mean, http://localhost/site/member/list?no=100 would call site/member.py page's function l

Re: convert pdf to png

2007-12-24 Thread Jaap Spies
Carl K wrote: > I need to take the take the pdf output from reportlab and create a > preview image for a web page. so png or something. I am sure > ghostscript will be involved. I am guessing PIL or ImageMagic ? > > all sugestions welcome. > If it is a multi page pdf Imagemagick will do: co

Re: fiber(cooperative multi-threading)

2007-12-24 Thread Duncan Booth
Michael Sparks <[EMAIL PROTECTED]> wrote: > To be clear - I REALLY didn't like the fact that generators were > single layer when I first saw them - it seemed a huge limitation. > (Indeed as huge a limitation as only having single level function > calls, or only single layer of nesting for namespac

Re: convert pdf to png

2007-12-24 Thread Ramsey Nasser
On Dec 24, 2007 7:53 AM, Carl K <[EMAIL PROTECTED]> wrote: > I need to take the take the pdf output from reportlab and create a preview > image > for a web page. so png or something. I am sure ghostscript will be involved. > I am guessing PIL or ImageMagic ? > > all sugestions welcome. > > Carl

Re: why does a disabled button respond to clicks

2007-12-24 Thread Ronnie van 't Westeinde
Hi, Your code doesn't work because you're directly binding to a mouse click event. The proper (high-level) way of configuring which command is called when the button is pressed is simply to configure the button with the command parameter: button.configure(command=some_function) Your application m

Re: Python DLL in Windows Folder

2007-12-24 Thread Thorsten Kampe
* Markus Gritsch (Sun, 23 Dec 2007 18:28:41 +0100) > On 23/12/2007, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > * Markus Gritsch (Sun, 23 Dec 2007 15:52:50 +0100) > > > why does the Python installer on Windows put the Python DLL into the > > > Windows system32 folder? > > > > Are you sure it does

Re: 5 queens

2007-12-24 Thread cf29
On Dec 23, 2:04 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > def combinations(seq, n): >     if n == 0: >         yield [] >     else: >         for i in xrange(len(seq)): >             for cc in combinations(seq[i+1:], n-1): >                 yield [seq[i]]+cc > > >>> for c

Re: Inter-process communication, how? Part 2

2007-12-24 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > What I don't like about FIFO, is that on Unix they are persistent > files. So whatever happens to Manager they would stay there... > I was just wondering if there's another way of doing the above and if > not, I would probably go with FIFO. Thanks! The persistence bit