Re: getting n items at a time from a generator

2007-12-28 Thread Tim Roberts
Kugutsumen <[EMAIL PROTECTED]> wrote: > >I am relatively new the python language and I am afraid to be missing >some clever construct or built-in way equivalent to my 'chunk' >generator below. I have to say that I have found this to be a surprisingly common need as well. Would this be an appropri

Re: parallel processing in standard library

2007-12-28 Thread Robert Kern
Emin.shopper Martinian.shopper wrote: > On Dec 27, 2007 4:13 PM, Robert Kern <[EMAIL PROTECTED] > > wrote: > My recommendation to you is to pick one of the smaller > implementations that > solves the problems in front of you. Read and understand that module >

Re: i18n questions

2007-12-28 Thread Donn Ingle
Is there a group better suited to gettext/i18n questions of this sort? Just wondering because I have little time left to finish my "December" project! > How does one 'merge' gettext.translations objects together? Or is that > insane? > > What's the best way to handle a project with multiple domai

Re: parallel processing in standard library

2007-12-28 Thread Robert Kern
Stefan Behnel wrote: > Robert Kern wrote: >> The problem is that for SQL databases, there is a substantial API that they >> can >> all share. The implementations are primarily differentiated by other factors >> like speed, in-memory or on-disk, embedded or server, the flavor of SQL, etc. >> and on

Re: Cheat sheet

2007-12-28 Thread Alaric
Riccardo T. wrote: > > > I wrote a little cheat sheet for this wonderful language, but because of > my still little experience with it, I would like to have a feedback > Could you have a look at it and tell me what do you think about, please? > > http://greyfox.imente.org/index.php?id=73 > > -- > G

sqlobject issue/question...

2007-12-28 Thread bruce
hi i'm playing around, researching sqlobject, and i notice that it appears to require the use of "id" in each tbl it handles in the database. if i already have a db schema, and it doesn't use 'id' as an auto-generated field, does that mean that i can't use/implement sqlobject. is there a way

Re: Strange Behavior: csv module & IDLE

2007-12-28 Thread t_rectenwald
On Dec 28, 9:43 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Dec 29, 1:12 pm, t_rectenwald <[EMAIL PROTECTED]> wrote: > > > I've noticed an oddity when running a program, using the csv module, > > within IDLE.  I'm new to Python so am confused by what is happening. > > Here is what I'm doing: >

pipes python cgi and gnupg

2007-12-28 Thread byte8bits
I think this is more a GnuPG issue than a Python issue, but I wanted to post it here as well in case others could offer suggestions: I can do this from a python cgi script from a browser: os.system("gpg --version > gpg.out") However, I cannot do this from a browser: os.system("echo %s | gpg --b

Re: Strange Behavior: csv module & IDLE

2007-12-28 Thread John Machin
On Dec 29, 1:12 pm, t_rectenwald <[EMAIL PROTECTED]> wrote: > I've noticed an oddity when running a program, using the csv module, > within IDLE. I'm new to Python so am confused by what is happening. > Here is what I'm doing: > > 1) Open the IDLE Shell. > 2) Select File | Open... > 3) Choose my f

Re: Strange Behavior: csv module & IDLE

2007-12-28 Thread Marc 'BlackJack' Rintsch
On Fri, 28 Dec 2007 18:12:58 -0800, t_rectenwald wrote: > Within the program, the snippet where I use the csv module is below: > > == > csvfile = open('foo.csv', 'w') > writer = csv.writer(csvfile) > > for row in rows: > writer.writerow(row[0:3]) > > csvfile.clos

[no subject]

2007-12-28 Thread Avery Andrews
I'm having a problem similar to the query below, the problem being that the suggested method doesn't work because the win32gui.CreateFileDialog method seems produce a dialog with a read only attribute set, with no evident way to change it, in Python 2.4.  Setting the 4th argument to zero, for

Strange Behavior: csv module & IDLE

2007-12-28 Thread t_rectenwald
I've noticed an oddity when running a program, using the csv module, within IDLE. I'm new to Python so am confused by what is happening. Here is what I'm doing: 1) Open the IDLE Shell. 2) Select File | Open... 3) Choose my file, foo.py, opening it in a window. 4) From that window, I hit F5 to run

Re: unicode(s, enc).encode(enc) == s ?

2007-12-28 Thread Martin v. Löwis
> Wow, that's not easy to see why would anyone ever want that? Is there > any logic behind this? It's the pre-Unicode solution to the "we want to have many characters encoded in a single file" problem. Suppose you have pre-defined characters sets A, B, C, and you want text to contain characters f

Re: Pivot Table/Groupby/Sum question

2007-12-28 Thread patrick . waldo
Petr, thanks for the SQL suggestion, but I'm having enough trouble in Python. John would you mind walking me through your class in normal speak? I only have a vague idea of why it works and this would help me a lot to get a grip on classes and this sort of particular problem. The next step is to

Re: Python DLL in Windows Folder

2007-12-28 Thread Ross Ridge
<[EMAIL PROTECTED]> wrote: > I did, and determined that it's not possible. We would have to use > assembly manifests, and can't, as the tool chain doesn't support them. Ross Ridge writes: > Your choice to use a tool chain that doesn't support side-by-side > assemblies does not make it impossible.

Re: Cheat sheet

2007-12-28 Thread Scott David Daniels
Riccardo T. wrote: > Scott David Daniels ha scritto: >> Riccardo T. wrote: >>> Scott David Daniels ha scritto: [in the .png] > ... > Callable types >... >User-definet methods I personally prefer "User-defined methods" >>> That's a typo, thank you. >> Hope I didn't

Re: Very strange caching problem with python script run from apache

2007-12-28 Thread tinnews
[EMAIL PROTECTED] wrote: > I'm running a python script via the apache ExtFilterDefine directive, > it works basically as expected *except* that when I change the script > apache/firefox continue to run the old version of the python script > until I remove the script completely and then replace it.

Re: i18n questions

2007-12-28 Thread Donn Ingle
Thanks for taking the time to post those links. I have read most of them before. They don't seem to cover the basic issue in my OP, but i18n on Python is a dark art and maybe there's something I missed. \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Pivot Table/Groupby/Sum question

2007-12-28 Thread John Machin
On Dec 29, 9:58 am, [EMAIL PROTECTED] wrote: > What about to let SQL to work for you. The OP is "trying to learn how to make pivot tables from some excel sheets". You had better give him a clue on how to use ODBC on an "excel sheet" :-) [snip] > SELECT > NAME, > sum (AMOUNT) as TOTAL, > sum (case

Very strange caching problem with python script run from apache

2007-12-28 Thread tinnews
I'm running a python script via the apache ExtFilterDefine directive, it works basically as expected *except* that when I change the script apache/firefox continue to run the old version of the python script until I remove the script completely and then replace it. I.e. my script is called tl2html

Re: Tab indentions on different platforms?

2007-12-28 Thread John Machin
On Dec 29, 9:51 am, xkenneth <[EMAIL PROTECTED]> wrote: > I seem to be having problems with running my python code, written > on a Mac, on Linux and Windows boxes. So *what* problems do you seem to be having? More to the the point, what problems are you *actually* having? > It seems like the

Re: Pivot Table/Groupby/Sum question

2007-12-28 Thread petr . jakes . tpc
What about to let SQL to work for you. HTH Petr Jakes Tested on Python 2.5.1 8<-- #!/usr/bin/env python # -*- coding: utf-8 -*- import sqlite3 con = sqlite3.connect(":memory:") cur = con.cursor() inputData=( ('Bob', 'Morn', 240), ('Bob', 'Aft', 300), ('Joe', 'Morn', 70), ('

Re: Choosing a new language

2007-12-28 Thread George Neuner
On Fri, 28 Dec 2007 12:54:57 -0800, John Nagle <[EMAIL PROTECTED]> wrote: >Actually, the ability to "fix a running program" [in Lisp] isn't >that useful in real life. It's more cool than useful. Editing a >program from a break was more important back when computers were slower >and just rer

Tab indentions on different platforms?

2007-12-28 Thread xkenneth
All, I seem to be having problems with running my python code, written on a Mac, on Linux and Windows boxes. It seems like the problem has to do with tab indention, particularly I've noticed that my code will completely ignore try statements. Has anyone had a similar problem? Regards, Ken --

Re: Choosing a new language

2007-12-28 Thread Gary Scott
Rico Secada wrote: > Hi. > > First let me start by saying, please don't let this become a > flame-thing. > > Second, I need some advice. > > I am a 35 year old programmer, who program in C/C++, PHP and Bourne > Shell almost daily. > > I am currently going to start focusing on becoming more ski

Re: os.system question

2007-12-28 Thread stanleyxu
> > import subprocess > > output = subprocess.Popen('MD "' + new_folder + '"', shell=True, > stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0] > print output > > > Carl Banks Thanks Carl, it works ^^) -- ___ oo // \\ (_,\/ \_/ \ Xu, Qian \ \_/_\_/>

Re: os.system question

2007-12-28 Thread stanleyxu
Thanks again for your kindly tips. -- ___ oo // \\ (_,\/ \_/ \ Xu, Qian \ \_/_\_/> stanleyxu2005 /_/ \_\ -- http://mail.python.org/mailman/listinfo/python-list

Re: fiber(cooperative multi-threading)

2007-12-28 Thread Bjoern Schliessmann
Michael Sparks wrote: > Also, I'd be interested in hearing how your project gets on - it > sounds like the sort of thing that Kamaelia should be able to help > with. (If it doesn't/can't, then it's a bug IMO :) That was also my impression. :) My last tries had similarities to Axon, but I never was

Re: i18n questions

2007-12-28 Thread kyosohma
On Dec 28, 12:01 pm, Donn Ingle <[EMAIL PROTECTED]> wrote: > Hi, > A soon-to-be happy new year to everyone! > > I'm 100% new to this i18n lark and my approach so far has been to create > a .mo file per module in my app. > My thinking was, why load one huge .mo file when a single module only needs

Re: os.system question

2007-12-28 Thread kyosohma
On Dec 28, 1:32 pm, stanleyxu <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Dec 28, 12:57 pm, stanleyxu <[EMAIL PROTECTED]> wrote: > >> To note this problem occurs when debugging script in IDLE editor. > >> When I double click on my_script.py, all outputs will be printed in one > >>

http proxy question

2007-12-28 Thread scripteaze
I am tryin to grab a file from a site, however, this site limits me to one file per 15 minutes. What im tryin to do is use http profies in my script to just grab the file then change proxies so i can do it again back to back so that site site does not block me. This possible any example code out th

Re: Choosing a new language

2007-12-28 Thread John Nagle
Rico Secada wrote: > Hi. > > First let me start by saying, please don't let this become a > flame-thing. > > Second, I need some advice. > > I am a 35 year old programmer, who program in C/C++, PHP and Bourne > Shell almost daily. > > I am currently going to start focusing on becoming more ski

Re: Understanding tempfile.TemporaryFile

2007-12-28 Thread Karthik Gurusamy
On Dec 27, 7:36 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 27 Dec 2007 21:17:01 -0600, Shane Geiger wrote: > > import tempfile > > tmp = tempfile.mktemp() > > > import os > > os.remove(tmp) > > Not only does that not answer the Original Poster's question, but I don't > think it does w

Re: os.system question

2007-12-28 Thread Carl Banks
On Dec 28, 1:52 pm, stanleyxu <[EMAIL PROTECTED]> wrote: > Hi All, > > I am porting Perl script to Python script. Everything works fines until > calling os.system(). > > In my script, a number of DOS-commands will be executed. >for new_folder, old_folder in folder_array: >os.system('MD

Re: Cheat sheet

2007-12-28 Thread Riccardo T.
Scott David Daniels ha scritto: > Riccardo T. wrote: >> Scott David Daniels ha scritto: >>> [in the .png] ... Callable types ... User-definet methods >>> I personally prefer "User-defined methods" >> >> That's a typo, thank you. > > Hope I didn't offend (I was simply tryi

Re: fiber(cooperative multi-threading)

2007-12-28 Thread Michael Sparks
Duncan Booth wrote: > There are also problems where full blown coroutines are appropriate. The > example I quoted earlier of turning a parser from one which generates a > lot of callbacks to one which 'yields' tokens is the usual example given. For completeness, I looked at the other half of the

Re: os.system question

2007-12-28 Thread stanleyxu
[EMAIL PROTECTED] wrote: > On Dec 28, 12:57 pm, stanleyxu <[EMAIL PROTECTED]> wrote: >> To note this problem occurs when debugging script in IDLE editor. >> When I double click on my_script.py, all outputs will be printed in one >> console. >> >> -- >> ___ >>oo // \\ >> (_,\/ \_/ \

Re: Remove namespace declaration from ElementTree in lxml

2007-12-28 Thread Zero Piraeus
: > > I want to remove an unused namespace declaration from the root element > > of an ElementTree in lxml. > > > [...] I'm reduced to sticking the output through str.replace() ... > > which is somewhat inelegant. > > And also a bit error prone (unless you are sure the replaced string really > onl

Re: os.system question

2007-12-28 Thread kyosohma
On Dec 28, 12:57 pm, stanleyxu <[EMAIL PROTECTED]> wrote: > To note this problem occurs when debugging script in IDLE editor. > When I double click on my_script.py, all outputs will be printed in one > console. > > -- > ___ >oo // \\ > (_,\/ \_/ \ Xu, Qian > \ \_/_\_/> s

Re: distutils: troubles with install

2007-12-28 Thread Robert Kern
Vladimir Rusinov wrote: > Hello! > > I've written a small app, succesfully packaged it and trying to install. > I'm getting following error: > # python setup.py install -n > running install_data > error: can't copy 'f': doesn't exist or not a regular file > > What the 'f'??? > data_file

Re: Cheat sheet

2007-12-28 Thread Scott David Daniels
Riccardo T. wrote: > Scott David Daniels ha scritto: >> [in the .png] >>> ... >>> Callable types >>>... >>>User-definet methods >> I personally prefer "User-defined methods" > > That's a typo, thank you. Hope I didn't offend (I was simply trying to be cute). Some from a bit further along.

Re: fiber(cooperative multi-threading)

2007-12-28 Thread Michael Sparks
Bjoern Schliessmann wrote: > 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 l

Re: os.system question

2007-12-28 Thread stanleyxu
To note this problem occurs when debugging script in IDLE editor. When I double click on my_script.py, all outputs will be printed in one console. -- ___ oo // \\ (_,\/ \_/ \ Xu, Qian \ \_/_\_/> stanleyxu2005 /_/ \_\ -- http://mail.python.org/mailman/listinfo/py

os.system question

2007-12-28 Thread stanleyxu
Hi All, I am porting Perl script to Python script. Everything works fines until calling os.system(). In my script, a number of DOS-commands will be executed. for new_folder, old_folder in folder_array: os.system('MD "' + new_folder + '"'); os.system('XCOPY "' + old_folder + '" "

Re: OOP: How to implement listing al 'Employees'.

2007-12-28 Thread Bruno Desthuilliers
Petar a écrit : (snip) > should a class always > reference only on 'item'? ??? I'm afraid I didn't get this part of the question. -- http://mail.python.org/mailman/listinfo/python-list

Re: OOP: How to implement listing al 'Employees'.

2007-12-28 Thread Bruno Desthuilliers
Petar a écrit : > On 28 dec, 13:40, Bjoern Schliessmann [EMAIL PROTECTED]> wrote: > >>Petar wrote: >> >>>What is the better way of doing this? And should a class always >>>reference only on 'item'? >> >>It fully depends on what you want to do in your program. If you just >>want to have a list of

Re: Compiler or stg. to get exe!

2007-12-28 Thread Bruno Desthuilliers
SMALLp a écrit : > Hy! > I have question. After short goggling, I haven't found anything good. So > my question is: > I wrote a program in python and i Get .py files and some .pyc in working > folder. Now i want program tu run under windows, so i need to get exe > files or something. Strictly s

distutils: troubles with install

2007-12-28 Thread Vladimir Rusinov
Hello! I've written a small app, succesfully packaged it and trying to install. I'm getting following error: # python setup.py install -n running install running build running build_py running build_scripts running install_lib creating /usr/lib/python2.4/site-packages/logmanager creating /usr/lib/

i18n questions

2007-12-28 Thread Donn Ingle
Hi, A soon-to-be happy new year to everyone! I'm 100% new to this i18n lark and my approach so far has been to create a .mo file per module in my app. My thinking was, why load one huge .mo file when a single module only needs a few strings? Since then, it seems, I have made the wrong decision.

Re: convert pdf to png

2007-12-28 Thread Carl K
Diez B. Roggisch wrote: >> Seeing these options, I think it is much better to serve the PDFs >> directly, it's very simple, and very efficient on the server. If >> you're afraid that not everyone have PDF readers, direct them to >> Adobe's site or serve the installation files on the server. The >>

Re: Choosing a new language

2007-12-28 Thread Joachim Durchholz
I don't know all three languages, but I know you won't get a useful answer unless you say what purpose you want to learn any of these languages for. To expand your mental scope? To improve your CV? To use as a new workhorse for your daily work? If it's the latter: what kind of work do you do?

Re: Building Python statically on linux

2007-12-28 Thread Micah Elliott
On Dec 28, 5:44 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > Can you work on the topic and write a small howto for your wiki > (http://wiki.python.org/moin/)? Good idea. I've created a placeholder (with what I know so far, not much) to track this: http://wiki.python.org/moin/BuildStatica

Multiple keys?

2007-12-28 Thread katie smith
while repeat: for event in pygame.event.get(): if event.type == (QUIT): pygame.quit() if (event.type == KEYDOWN): if (event.key == K_ESCAPE): pygame.quit() if (event.key == K_

Re: parallel processing in standard library

2007-12-28 Thread Calvin Spealman
I think we are a ways off from the point where any of the solutions are well used, matured, and trusted to promote as a Python standard module. I'd love to see it happen, but even worse than it never happening is it happening too soon. On Dec 27, 2007 8:52 AM, Emin.shopper Martinian.shopper <[EMAI

Re: Cheat sheet

2007-12-28 Thread Riccardo T.
c james ha scritto: > On the svg version, as viewed on firefox, the sections "Simple > statements", "Definations" and "Comments"; there appears to be a problem > with text wrapping. I see, it has already been signaled by mail. I'm not sure about how to fix that, I'll have to ask someone who knows

Re: Python DLL in Windows Folder

2007-12-28 Thread Chris Mellon
On Dec 28, 2007 6:41 AM, Ross Ridge <[EMAIL PROTECTED]> wrote: > Ross Ridge writes: > > As I said before, I know how futile it is to argue that Python should > > change it's behaviour. I'm not going to waste my time telling you what > > to do. If you really want to know how side-by-side installat

Choosing a new language

2007-12-28 Thread Rico Secada
Hi. First let me start by saying, please don't let this become a flame-thing. Second, I need some advice. I am a 35 year old programmer, who program in C/C++, PHP and Bourne Shell almost daily. I am currently going to start focusing on becoming more skilled at a few key languages, rather than

Re: Python DLL in Windows Folder

2007-12-28 Thread Ross Ridge
Ross Ridge wrote: > Your choice to use a tool chain that doesn't support side-by-side > assemblies does not make it impossible. Christian Heimes <[EMAIL PROTECTED]> wrote: > I'm looking forward to your contribution to solve the problem. I find that highly unlikely. Regardless, as I said twice

Re: parallel processing in standard library

2007-12-28 Thread Emin.shopper Martinian.shopper
On Dec 27, 2007 4:13 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > Emin.shopper Martinian.shopper wrote: > > If not, is there any hope of something like > > the db-api for coarse grained parallelism (i.e, a common API that > > different toolkits can support)? > > The problem is that for SQL databas

Re: Cheat sheet

2007-12-28 Thread c james
Riccardo T. wrote: > I wrote a little cheat sheet for this wonderful language, but because of > my still little experience with it, I would like to have a feedback > Could you have a look at it and tell me what do you think about, please? > > http://greyfox.imente.org/index.php?id=73 > > -- > Gre

Re: documentation

2007-12-28 Thread Wildemar Wildenburger
cf29 wrote: > Which website would you recommend for a great documentation about > Python? > I am looking for a list of methods and properties of all the Python > elements with syntax examples. Any problem with the main source, http://docs.python.org/>? /W -- http://mail.python.org/mailman/listinf

Re: list in a tuple

2007-12-28 Thread vjktm
On Dec 28, 1:34 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 27 Dec 2007 16:38:07 -0300, <[EMAIL PROTECTED]> escribió: > > > > > On Dec 27, 8:20 pm, Wildemar Wildenburger > > <[EMAIL PROTECTED]> wrote: > > >> From that post: > >> > Ok, I do admit that doing > > >> > a = ([1], 2)

Re: parallel processing in standard library

2007-12-28 Thread Stefan Behnel
Christian Heimes wrote: > Stefan Behnel wrote: > > Well, there is one parallel processing API that already *is* part of > stdlib: >> the threading module. So the processing module would fit just nicely into the >> idea of a "standard" library. > > Don't you forget the select module and its siblin

Re: "Impure" Python modules

2007-12-28 Thread kyosohma
On Dec 27, 5:38 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Is there some way to get a list of "impure" Python modules/extensions > > from PyPI? > > Not easily. To create a full list, you will have to download all > packages, and check their respective setup.py files for occurrences > of E

Re: "Impure" Python modules

2007-12-28 Thread Mike Driscoll
James, In Python extension parlance, it means that the extension was not written completely in Python. Example include the mySQL module, wxPython, and one of the openGL modules. All of those have some C/C++ dependencies. I think numpy does too, now that I think about it. Anyway, I hope that answe

documentation

2007-12-28 Thread cf29
Which website would you recommend for a great documentation about Python? I am looking for a list of methods and properties of all the Python elements with syntax examples. -- http://mail.python.org/mailman/listinfo/python-list

Re: Compiler or stg. to get exe!

2007-12-28 Thread Martin Blume
"SMALLp" schrieb > I have question. After short goggling, I haven't found > anything good. So my question is: > I wrote a program in python and i Get .py files and some > .pyc in working folder. Now i want program tu run under > windows, so i need to get exe files or something. > If python is

Re: parallel processing in standard library

2007-12-28 Thread Christian Heimes
Stefan Behnel wrote: > Well, there is one parallel processing API that already *is* part of stdlib: > the threading module. So the processing module would fit just nicely into the > idea of a "standard" library. Don't you forget the select module and its siblings for I/O bound concurrency? Chris

Re: Building Python statically on linux

2007-12-28 Thread Christian Heimes
Micah Elliott wrote: > Doing that (or CFLAGS=-static, or LDFLAGS=-static, or other Makefile > tweaks) gets me linker errors. Sounds like there's not a simple > prescribed means to do this (that anyone has documented). So now I'm > open to hearing about other hacks people have done to get this to

Re: Compiler or stg. to get exe!

2007-12-28 Thread Christian Heimes
SMALLp wrote: > Hy! > I have question. After short goggling, I haven't found anything good. So > my question is: > I wrote a program in python and i Get .py files and some .pyc in working > folder. Now i want program tu run under windows, so i need to get exe > files or something. > And what do

Re: Cheat sheet

2007-12-28 Thread Michele Simionato
On Dec 28, 12:40 pm, "Riccardo T." <[EMAIL PROTECTED]> wrote: > > "file" objects are generally supposed to be built with the > > open function, not instantiated as shown. > > Since open() is just an alias for file(), changing the name should be > enough, right? It depends on the Python version: P

Re: OOP: How to implement listing al 'Employees'.

2007-12-28 Thread Bruno Desthuilliers
Bjoern Schliessmann a écrit : > Petar wrote: >> What is the better way of doing this? And should a class always >> reference only on 'item'? > > It fully depends on what you want to do in your program. If you just > want to have a list of employees, a list or dict will suffice. If > you need a ful

Re: comparing dictionaries to find the identical keys

2007-12-28 Thread Christian Heimes
Beema shafreen wrote: > hi everybody , > i need to compare two dictionary's key. I have written a script Use sets. Sets are easier to use and much faster: >>> d1 = {'a': 1, 'b': 2, 'c': 3} >>> d2 = {'b': 2, 'c': 3, 'd': 4} >>> d1.keys() ['a', 'c', 'b'] >>> d2.keys() ['c', 'b', 'd'] >>> s1 = set(

Re: Extracting images from a PDF file

2007-12-28 Thread writeson
On Dec 27, 2:17 pm, Max Erickson <[EMAIL PROTECTED]> wrote: > Doug Farrell <[EMAIL PROTECTED]> wrote: > > Hi all, > > > Does anyone know how to extract images from aPDFfile? What I'm > > looking to do is use pdflib_py to open largePDFfiles on our > > Linux servers, then use PIL to verify image data

Re: Python DLL in Windows Folder

2007-12-28 Thread Christian Heimes
Ross Ridge wrote: >> I did, and determined that it's not possible. We would have to use >> assembly manifests, and can't, as the tool chain doesn't support them. > > Your choice to use a tool chain that doesn't support side-by-side > assemblies does not make it impossible. I'm looking forward t

Re: Extracting images from a PDF file

2007-12-28 Thread writeson
On Dec 27, 10:13 am, writeson <[EMAIL PROTECTED]> wrote: > On Dec 27, 1:12 am, Carl K <[EMAIL PROTECTED]> wrote: > > > > > Doug Farrell wrote: > > > Hi all, > > > > Does anyone know how to extract images from aPDFfile? What I'm looking > > > to do is use pdflib_py to open largePDFfiles on our Linux

Re: OOP: How to implement listing al 'Employees'.

2007-12-28 Thread Petar
On 28 dec, 13:40, Bjoern Schliessmann wrote: > Petar wrote: > > What is the better way of doing this? And should a class always > > reference only on 'item'? > > It fully depends on what you want to do in your program. If you just > want to have a list of employees, a list or dict will suffice. If

Re: comparing dictionaries to find the identical keys

2007-12-28 Thread km
Hi On Dec 28, 2007 4:55 PM, Beema shafreen <[EMAIL PROTECTED]> wrote: > hi everybody , > i need to compare two dictionary's key. I have written a script > gene_symbol = {} > probe_id = {} > result = {} > def getGene(fname): > fh = open(fname , 'r') > for line in fh: >

Re: Pivot Table/Groupby/Sum question

2007-12-28 Thread patrick . waldo
Wow, I did not realize it would be this complicated! I'm fairly new to Python and somehow I thought I could find a simpler solution. I'll have to mull over this to fully understand how it works for a bit. Thanks a lot! On Dec 28, 4:03 am, John Machin <[EMAIL PROTECTED]> wrote: > On Dec 28, 11:4

Re: Python DLL in Windows Folder

2007-12-28 Thread Ross Ridge
Ross Ridge writes: > As I said before, I know how futile it is to argue that Python should > change it's behaviour. I'm not going to waste my time telling you what > to do. If you really want to know how side-by-side installation works, > you can try reading the Windows SDK documentation. <[EMAI

Compiler or stg. to get exe!

2007-12-28 Thread SMALLp
Hy! I have question. After short goggling, I haven't found anything good. So my question is: I wrote a program in python and i Get .py files and some .pyc in working folder. Now i want program tu run under windows, so i need to get exe files or something. And what do i need to do to make program

Re: OOP: How to implement listing al 'Employees'.

2007-12-28 Thread Bjoern Schliessmann
Petar wrote: > What is the better way of doing this? And should a class always > reference only on 'item'? It fully depends on what you want to do in your program. If you just want to have a list of employees, a list or dict will suffice. If you need a full-fledged employee database, an "Employees

Re: fiber(cooperative multi-threading)

2007-12-28 Thread [EMAIL PROTECTED]
Hi! Since your interest in fibers/coroutines is related to writing simulators, you should try the SimPy package (simpy.sf.net), which is a process-based discrete event simulator that uses generators as processes. On 22 dez, 09:10, Akihiro KAYAMA <[EMAIL PROTECTED]> wrote: > Hi all. > > I found co

OOP: How to implement listing al 'Employees'.

2007-12-28 Thread Petar
I was just wondering. What if you have a 'Employees' class and you want to list all the employees. Currenlty i'm seeing to possibilities: - create a 'listAll' function inside the class which returns all the employees in a array. - create multiple instances, putting them in a array, by calling the

Re: unicode(s, enc).encode(enc) == s ?

2007-12-28 Thread Marc 'BlackJack' Rintsch
On Fri, 28 Dec 2007 03:00:59 -0800, mario wrote: > On Dec 27, 7:37 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> Certainly. ISO-2022 is famous for having ambiguous encodings. Try >> these: >> >> unicode("Hallo","iso-2022-jp") >> unicode("\x1b(BHallo","iso-2022-jp") >> unicode("\x1b(JHallo","

Re: Cheat sheet

2007-12-28 Thread Riccardo T.
Scott David Daniels ha scritto: > [in the .png] >> ... >> Callable types >>... >>User-definet methods > > I personally prefer "User-defined methods" That's a typo, thank you. >>... >>Class instances > I'd try: > Class instances with a __call__ method. Yes, it's more clear

comparing dictionaries to find the identical keys

2007-12-28 Thread Beema shafreen
hi everybody , i need to compare two dictionary's key. I have written a script gene_symbol = {} probe_id = {} result = {} def getGene(fname): fh = open(fname , 'r') for line in fh: yield line fh.close() for line in getGene("symbol_hu133"): data1= line

Re: unicode(s, enc).encode(enc) == s ?

2007-12-28 Thread mario
On Dec 27, 7:37 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Certainly. ISO-2022 is famous for having ambiguous encodings. Try > these: > > unicode("Hallo","iso-2022-jp") > unicode("\x1b(BHallo","iso-2022-jp") > unicode("\x1b(JHallo","iso-2022-jp") > unicode("\x1b(BHal\x1b(Jlo","iso-2022-jp")

Re: Happy Christmas Pythoneers

2007-12-28 Thread Marc 'BlackJack' Rintsch
On Thu, 27 Dec 2007 22:38:44 -0800, Aahz wrote: > In article <[EMAIL PROTECTED]>, > Steven D'Aprano <[EMAIL PROTECTED]> wrote: >>On Wed, 26 Dec 2007 21:32:54 -0800, [EMAIL PROTECTED] wrote: >>> >>> Hey, my version of the person module doesn't have an is_appropriate_sex >>> attribute, but an is_o

Re: Python DLL in Windows Folder

2007-12-28 Thread Martin v. Löwis
> As I said before, I know how futile it is to argue that Python should > change it's behaviour. I'm not going to waste my time telling you what > to do. If you really want to know how side-by-side installation works, > you can try reading the Windows SDK documentation. I did, and determined tha

Re: convert pdf to png

2007-12-28 Thread Diez B. Roggisch
> Seeing these options, I think it is much better to serve the PDFs > directly, it's very simple, and very efficient on the server. If > you're afraid that not everyone have PDF readers, direct them to > Adobe's site or serve the installation files on the server. The > installation for the reader i

Re: how to generate html table from "table" data?

2007-12-28 Thread Bruno Desthuilliers
Ricardo Aráoz a écrit : > Bruno Desthuilliers wrote: (snip) >> FWIW, I just wrote a function generating an html table from a list >> of header and a list of rows. I wrote the most Q&D, straightforward, >> braindead way, it's 17 lines long, doesn't even need an import >> statement, and took me le

Re: parallel processing in standard library

2007-12-28 Thread Stefan Behnel
Robert Kern wrote: > The problem is that for SQL databases, there is a substantial API that they > can > all share. The implementations are primarily differentiated by other factors > like speed, in-memory or on-disk, embedded or server, the flavor of SQL, etc. > and only secondarily differentiate

Re: Remove namespace declaration from ElementTree in lxml

2007-12-28 Thread Stefan Behnel
Zero Piraeus wrote: > I want to remove an unused namespace declaration from the root element > of an ElementTree in lxml. > > There doesn't seem to be any documented way to do this, so at the > moment I'm reduced to sticking the output through str.replace() ... > which is somewhat inelegant. And

Re: interactive mode in python with ctypes???

2007-12-28 Thread digitnctu
On 12月27日, 下午10�r05分, [EMAIL PROTECTED] wrote: > On 12月27日, 下午4�r40分, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > > > En Wed, 26 Dec 2007 12:57:44 -0300, <[EMAIL PROTECTED]> escribió: > > > > libdll.dll is a third-party library. The below code segment will > > > run well under the b