Re: Dynamically created objects

2007-12-27 Thread Steven D'Aprano
On Fri, 28 Dec 2007 08:14:43 +0100, Michael Bernhard Arp Sørensen wrote: > Hi there. > > I need to create objects on the fly in my program. The names of the > objects must be unique, obviously, and I need to put them in a list for > later use. Why do you think they need names? If you have them i

Re: Dynamically created objects

2007-12-27 Thread Gabriel Genellina
En Fri, 28 Dec 2007 04:14:43 -0300, Michael Bernhard Arp Sørensen <[EMAIL PROTECTED]> escribió: > I need to create objects on the fly in my program. The names of the > objects must be unique, obviously, and I need to put them in a list for > later use. > > How do i set the name of an object if t

Re: Happy Christmas Pythoneers

2007-12-27 Thread Hendrik van Rooyen
"Steven D'Aprano" wrote: > On Thu, 27 Dec 2007 09:09:49 +0200, Hendrik van Rooyen wrote: > > > "Zentrader" wrote: > > > >> And if you're not a Christian it would be Type Error bug. Anyway, > >> happy New Years as well to all in the group. > > > > Followers of Shushla celebrate the new year

Dynamically created objects

2007-12-27 Thread Michael Bernhard Arp Sørensen
Hi there. I need to create objects on the fly in my program. The names of the objects must be unique, obviously, and I need to put them in a list for later use. How do i set the name of an object if the name is stored in another variable? I've looked in the O'Reiley Python Cookbook and on goo

Re: os.fork leaving processes behind

2007-12-27 Thread Gabriel Genellina
En Thu, 27 Dec 2007 21:36:36 -0300, Falcolas <[EMAIL PROTECTED]> escribió: > This may be more of a Linux question, but it relates to how Python > forks... Yes; every book describing how to use fork tells about zombie processes and the wait/waitpid functions. Just do the same thing in Python. >

Re: Happy Christmas Pythoneers

2007-12-27 Thread Aahz
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_opposite_sex attribute instead. Is this a new >> version?

Re: list in a tuple

2007-12-27 Thread Gabriel Genellina
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) >> > a[0].append(2) >> > >> > also doesn't throw an error, but this onl

Understanding tempfile.TemporaryFile

2007-12-27 Thread Brad
Wondering if someone would help me to better understand tempfile. I attempt to create a tempfile, write to it, read it, but it is not behaving as I expect. Any tips? >>> x = tempfile.TemporaryFile() >>> print x ', mode 'w+b' at 0xab364968> >>> print x.read() >>> print len(x.read()) 0 >>> x

Re: Python DLL in Windows Folder

2007-12-27 Thread Ross Ridge
Ross Ridge writes: > No, that doesn't follow from the requirements given. The only exception > for something that isn't a service or device driver is for backwards > compatibility. Also, pretty much any DLL supports side-by-side > installation. <[EMAIL PROTECTED]> wrote: >Hmm. How do I have to b

Re: Understanding tempfile.TemporaryFile

2007-12-27 Thread Shane Geiger
Yes, I knew this. Good call, it was just a bad copy and paste example of lines that showed up close together in a file. My apologies. >> import tempfile >> tmp = tempfile.mktemp() >> >> import os >> os.remove(tmp) >> > > Not only does that not answer the Original Poster's question, but I do

Re: Understanding tempfile.TemporaryFile

2007-12-27 Thread Steven D'Aprano
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 what you seem to think it does. >>> tmp = tempfile.mktemp() >>> tmp '/tmp/

Re: Understanding tempfile.TemporaryFile

2007-12-27 Thread byte8bits
On Dec 27, 10:12 pm, John Machin <[EMAIL PROTECTED]> wrote: > Check out the seek method. Ah yes... thank you: >>> import tempfile >>> x = tempfile.TemporaryFile() >>> x.write("test") >>> print x.read() >>> x.seek(0) >>> print x.read() test -- http://mail.python.org/mailman/listinfo/python-li

Re: Understanding tempfile.TemporaryFile

2007-12-27 Thread Steven D'Aprano
On Thu, 27 Dec 2007 18:49:06 -0800, byte8bits wrote: > Wondering if someone would help me to better understand tempfile. I > attempt to create a tempfile, write to it, read it, but it is not > behaving as I expect. Any tips? You need to seek to the part of the file you want to read: >>> x = temp

Re: Taxicab Numbers

2007-12-27 Thread Steven D'Aprano
I hate having to correct myself... On Fri, 28 Dec 2007 02:31:50 +, Steven D'Aprano wrote: > You seem to be treating n as the number to be split into the sum of > cubes, Not quite... in your code, n appears to be the largest number to test. That is, if n is twelve, you test up to 12 cubed.

Re: Understanding tempfile.TemporaryFile

2007-12-27 Thread Shane Geiger
import tempfile tmp = tempfile.mktemp() import os os.remove(tmp) [EMAIL PROTECTED] wrote: > Wondering if someone would help me to better understand tempfile. I > attempt to create a tempfile, write to it, read it, but it is not > behaving as I expect. Any tips? > > x = tempfile.Temporar

Re: Understanding tempfile.TemporaryFile

2007-12-27 Thread John Machin
On Dec 28, 1:49 pm, [EMAIL PROTECTED] wrote: > Wondering if someone would help me to better understand tempfile. I > attempt to create a tempfile, write to it, read it, but it is not > behaving as I expect. Any tips? > > >>> x = tempfile.TemporaryFile() > >>> print x > > ', mode 'w+b' at 0xab364968

Re: Python DLL in Windows Folder

2007-12-27 Thread Martin v. Löwis
> No, that doesn't follow from the requirements given. The only exception > for something that isn't a service or device driver is for backwards > compatibility. Also, pretty much any DLL supports side-by-side > installation. Hmm. How do I have to build and install python25.dll exactly to make t

Re: Pivot Table/Groupby/Sum question

2007-12-27 Thread John Machin
On Dec 28, 11:48 am, John Machin <[EMAIL PROTECTED]> wrote: > On Dec 28, 10:05 am, [EMAIL PROTECTED] wrote: > > > > If you have any ideas about how to solve this pivot table issue, which > > seems to be scant on Google, I'd much appreciate it. I know I can do > > this in Excel easily with the auto

Understanding tempfile.TemporaryFile

2007-12-27 Thread byte8bits
Wondering if someone would help me to better understand tempfile. I attempt to create a tempfile, write to it, read it, but it is not behaving as I expect. Any tips? >>> x = tempfile.TemporaryFile() >>> print x ', mode 'w+b' at 0xab364968> >>> print x.read() >>> print len(x.read()) 0 >>> x.write(

Remove namespace declaration from ElementTree in lxml

2007-12-27 Thread Zero Piraeus
: 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. Is there a better way? -[]z. --

Re: Taxicab Numbers

2007-12-27 Thread Steven D'Aprano
On Thu, 27 Dec 2007 13:48:36 -0800, rgalgon wrote: > I'm new to Python and have been putting my mind to learning it over my > holiday break. I've been looking over the functional programming aspects > of Python and I'm stuck trying to come up with some concise code to find > Taxicab numbers (http:

Re: Python DLL in Windows Folder

2007-12-27 Thread Ross Ridge
<[EMAIL PROTECTED]> wrote: > I think Python perfectly meets the specification (i.e. is designed >for Windows XP) in this respect (*): >- python25.dll is a shared component >- it is not private to a single software vendor >- it is not a control panel item >- it is not a service or device driver >- i

Re: Python DLL in Windows Folder

2007-12-27 Thread Martin v. Löwis
> It's one of Microsoft guidelines. The "'Designed for Microsoft Windows > XP' Application Specification" only allows DLLs to be installed in the > system directory if it's required for backwards compatiblity. I guess you are referring to 2.6 here. I think Python perfectly meets the specification

Re: Dynamic DNS with a python script

2007-12-27 Thread Delta
Some registrars provide a Dynamic DNS service. The one I use (namecheap) provides it and I think all I had to do was edit my ddclient.conf to use it instead of dyndns once I got my domain. However, if you're going to use ipcheck you'll have to change some of the args to use the registrars utilities

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

2007-12-27 Thread Gabriel Genellina
QOTW: "However, inspection of a vast corpus of code might lead one to believe that any commenting capability was completely unnecessary." - Jim B. Wilson "The Python people also piped [up] to say 'everything's just fine here', but then they always do; I really must learn that language." - Tim Bra

Re: Taxicab Numbers

2007-12-27 Thread Paul Hankin
On Dec 27, 9:48 pm, rgalgon <[EMAIL PROTECTED]> wrote: > I'm new to Python and have been putting my mind to learning it over my > holiday break. I've been looking over the functional programming > aspects of Python and I'm stuck trying to come up with some concise > code to find Taxicab numbers (ht

Re: Taxicab Numbers

2007-12-27 Thread Terry Jones
> "rgalgon" == rgalgon <[EMAIL PROTECTED]> writes: rgalgon> I'm new to Python and have been putting my mind to learning it rgalgon> over my holiday break. I've been looking over the functional rgalgon> programming aspects of Python and I'm stuck trying to come up with rgalgon> some concise co

Re: Pivot Table/Groupby/Sum question

2007-12-27 Thread John Machin
On Dec 28, 10:05 am, [EMAIL PROTECTED] wrote: > On Dec 27, 10:59 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > On Dec 28, 4:56 am, [EMAIL PROTECTED] wrote: > > > > from itertools import groupby > > > You seem to have overlooked this important sentence in the > > documentation: "Generally, the it

os.fork leaving processes behind

2007-12-27 Thread Falcolas
Hi all, This may be more of a Linux question, but it relates to how Python forks... Today, I implemented a pretty simple listener script using os.fork. The script runs fine, and performs as expected, but the process table is left with an odd entry for every fork called. I'm running on Slackware

Re: Dynamic DNS with a python script

2007-12-27 Thread Marcelo de Moraes Serpa
Thank you! What if I would like to use my own DNS server for this (considereing I've got my own domain names)? On Dec 27, 2007 3:58 PM, Shane Geiger <[EMAIL PROTECTED]> wrote: > Marcelo de Moraes Serpa wrote: > > Hello list, > > > > I'd like to set up ssh access to my home computer so that I wil

Re: "Impure" Python modules

2007-12-27 Thread Martin v. Löwis
> 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 Extension. A subset can probably be found by looking at all packages classif

Re: mysqldb SELECT COUNT reurns 1

2007-12-27 Thread Ian Clark
On 2007-12-27, SMALLp <[EMAIL PROTECTED]> wrote: > connectionString = {"host":"localhost", "user":"root", > "passwd":"pofuck", "db":"fileshare"} > dataTable = "files" > conn = mysql.connect(host=connectionString["host"], > user=connectionString["user"], passwd=connectionString["passwd"], > db=conn

Re: Python DLL in Windows Folder

2007-12-27 Thread Ross Ridge
Ross Ridge writes: > Whatever you want to call it, the Python DLL is not part of the operating > system, it's not a driver and doesn't belong in the system directory. <[EMAIL PROTECTED]> wrote: >Is that just your personal opinion, or a guideline from the operating >system vendor? It's one of Micr

Re: Pivot Table/Groupby/Sum question

2007-12-27 Thread patrick . waldo
On Dec 27, 10:59 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Dec 28, 4:56 am, [EMAIL PROTECTED] wrote: > > > from itertools import groupby > > You seem to have overlooked this important sentence in the > documentation: "Generally, the iterable needs to already be sorted on > the same key functi

Re: list in a tuple

2007-12-27 Thread montyphyton
Carl Banks wrote: > On Dec 27, 12:38 pm, [EMAIL PROTECTED] wrote: >> After some tought I must agree that this is a wart more than >> a bug and that it will probably be best not to mess with it. >> However, what do you guys think about the print wart in Py3k >> described >> athttp://filoxus.blogspo

Re: Cheat sheet

2007-12-27 Thread James Matthews
Looks good thanks! On Dec 27, 2007 11:06 PM, Scott David Daniels <[EMAIL PROTECTED]> wrote: > 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

Re: "Impure" Python modules

2007-12-27 Thread James Matthews
I don't quite understand what the word "impure" means here! On Dec 27, 2007 10:53 PM, <[EMAIL PROTECTED]> wrote: > Hi, > > Is there some way to get a list of "impure" Python modules/extensions > from PyPI? I know the mySQL module is a good example, but I am > working on creating some decent inst

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

2007-12-27 Thread Ricardo Aráoz
Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : > > Vasudev Ram wrote: >>> Why not try writing your own code for this first? >>> If nothing else, it'll help you learn more, and may also help you >>> understand better, the other options. >>> >> Thanks for your reply even it was not really

Re: Cheat sheet

2007-12-27 Thread Scott David Daniels
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: Performance on local constants?

2007-12-27 Thread Matthew Franz
Thanks, that makes more sense. I got tripped up by the function returning a function thing and (for a while) thought _ was some sort of spooky special variable. - mdf > On Dec 28, 7:53 am, "Matthew Franz" <[EMAIL PROTECTED]> wrote: > > I get class Searcher(object) but can't for the life of me see

Re: Pivot Table/Groupby/Sum question

2007-12-27 Thread John Machin
On Dec 28, 4:56 am, [EMAIL PROTECTED] wrote: > from itertools import groupby You seem to have overlooked this important sentence in the documentation: "Generally, the iterable needs to already be sorted on the same key function" -- http://mail.python.org/mailman/listinfo/python-list

"Impure" Python modules

2007-12-27 Thread kyosohma
Hi, Is there some way to get a list of "impure" Python modules/extensions from PyPI? I know the mySQL module is a good example, but I am working on creating some decent instructions on how to create Windows installers from impure modules and am having a hard time finding them. Thanks! Mike --

Taxicab Numbers

2007-12-27 Thread rgalgon
I'm new to Python and have been putting my mind to learning it over my holiday break. I've been looking over the functional programming aspects of Python and I'm stuck trying to come up with some concise code to find Taxicab numbers (http://mathworld.wolfram.com/ TaxicabNumber.html). "Taxicab(n),

Re: Performance on local constants?

2007-12-27 Thread John Machin
On Dec 28, 7:53 am, "Matthew Franz" <[EMAIL PROTECTED]> wrote: > I get class Searcher(object) but can't for the life of me see why > (except to be intentionally obtuse) one would use the def > searcher(rex) pattern which I assure you would call with > searcher(r)(t) right? > The whole point of the

Re: Building Python statically on linux

2007-12-27 Thread Micah Elliott
On Dec 27, 8:32 am, Zentrader <[EMAIL PROTECTED]> wrote: > I think you can just add -static to the gcc Flag line in the > makefile. 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 (th

Re: Python for web...

2007-12-27 Thread Steve Lianoglou
It's also worthwhile to note that the apress django book listed is also accessible free online here: http://www.djangobook.com/en/1.0/ -steve -- http://mail.python.org/mailman/listinfo/python-list

Re: parallel processing in standard library

2007-12-27 Thread Robert Kern
Emin.shopper Martinian.shopper wrote: > Dear Experts, > > Is there any hope of a parallel processing toolkit being incorporated > into the python standard library? I've seen a wide variety of toolkits > each with various features and limitations. Unfortunately, each has its > own API. For coarse-g

Re: Happy Christmas Pythoneers

2007-12-27 Thread Robert Kern
Gabriel Genellina wrote: > En Thu, 27 Dec 2007 02:32:54 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribió: > >> On Dec 26, 9:43 pm, Steven D'Aprano >> <[EMAIL PROTECTED]> wrote: > >>> watch_fireworks() >>> try: >>> champagne >>> except NameError: >>> champagne = any_fizzy_alcoholi

Re: Cheat sheet

2007-12-27 Thread Riccardo T.
Carl Banks ha scritto: > On Dec 27, 12:38 pm, "Riccardo T." <[EMAIL PROTECTED]> 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 abou

Re: Performance on local constants?

2007-12-27 Thread Matthew Franz
I get class Searcher(object) but can't for the life of me see why (except to be intentionally obtuse) one would use the def searcher(rex) pattern which I assure you would call with searcher(r)(t) right? - mdf > > > > 'Most flexible' in a different way is > > > > def searcher(rex): > > crex =

Re: mysqldb SELECT COUNT reurns 1

2007-12-27 Thread John Machin
On Dec 28, 7:03 am, SMALLp <[EMAIL PROTECTED]> wrote: > Hy! I nave another problem I can't solve! > > > import MySQLdb as mysql > > connectionString = {"host":"localhost", "user":"root", > "passwd":"pofuck", "db":"fileshare"} > dataTable = "files" > conn = mysql.connect(host=connectionStri

Removing compile option in distutils

2007-12-27 Thread jeremito
Hello all, I am using distutils for building/compiling my Python extensions. The default configuration tells the compiler to generate debug information with the "-g" flag. I don't want this, but I can't seem to figure out how to get rid of it. Does anyone now how? Thanks, Jeremy -- http://mai

Re: Cheat sheet

2007-12-27 Thread Carl Banks
On Dec 27, 12:38 pm, "Riccardo T." <[EMAIL PROTECTED]> 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://greyfo

Re: mysqldb SELECT COUNT reurns 1

2007-12-27 Thread SMALLp
Rob Williscroft wrote: > SMALLp wrote in news:[EMAIL PROTECTED] in comp.lang.python: > >> Hy! I nave another problem I can't solve! >> >> >> import MySQLdb as mysql > >> cursor = conn.cursor() >> sql = "SELECT COUNT(*) FROM " + dataTable >> res = cursor.execute(sql) > > I think you need to

Re: mysqldb SELECT COUNT reurns 1

2007-12-27 Thread Rob Williscroft
SMALLp wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Hy! I nave another problem I can't solve! > > > import MySQLdb as mysql > cursor = conn.cursor() > sql = "SELECT COUNT(*) FROM " + dataTable > res = cursor.execute(sql) I think you need to do: res = cursor.fetchone()[0] > pri

Re: Cheat sheet

2007-12-27 Thread Riccardo T.
Markus Gritsch ha scritto: > On Dec 27, 11:38 am, "Riccardo T." <[EMAIL PROTECTED]> 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

mysqldb SELECT COUNT reurns 1

2007-12-27 Thread SMALLp
Hy! I nave another problem I can't solve! import MySQLdb as mysql connectionString = {"host":"localhost", "user":"root", "passwd":"pofuck", "db":"fileshare"} dataTable = "files" conn = mysql.connect(host=connectionString["host"], user=connectionString["user"], passwd=connectionString["p

Re: Cheat sheet

2007-12-27 Thread Markus Gritsch
On Dec 27, 11:38 am, "Riccardo T." <[EMAIL PROTECTED]> 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://greyfo

Re: Cheat sheet

2007-12-27 Thread kyosohma
On Dec 27, 1:44 pm, "Riccardo T." <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] ha scritto: > > > Looks cool, but you might find these interesting too: > > >http://www.limsi.fr/Individu/pointal/python/pqrc/ > >http://mail.python.org/pipermail/python-list/2006-June/386662.html > > > Mike > > Thanks

Re: list in a tuple

2007-12-27 Thread Carl Banks
On Dec 27, 12:38 pm, [EMAIL PROTECTED] wrote: > After some tought I must agree that this is a wart more than > a bug and that it will probably be best not to mess with it. > However, what do you guys think about the print wart in Py3k > described > athttp://filoxus.blogspot.com/2007/12/python-3000

Re: standalone python web server

2007-12-27 Thread Jason Earl
eric <[EMAIL PROTECTED]> writes: > Hi all, > > I want to setup simple python web server and I want it to just unzip > and run, without any installation steps (have no right to do it). > > I've tried to write by myself, however, I find I am getting into more > details like processing image file, di

Re: Cheat sheet

2007-12-27 Thread Riccardo T.
[EMAIL PROTECTED] ha scritto: > Looks cool, but you might find these interesting too: > > http://www.limsi.fr/Individu/pointal/python/pqrc/ > http://mail.python.org/pipermail/python-list/2006-June/386662.html > > Mike Thanks :) I'll read them to improve my python knowledge, but I prefere to have

ANNOUNCE: Spiff Integrator 0.1

2007-12-27 Thread Samuel
Introduction Spiff Integrator is a small but powerful library for adding plugin support to Python applications. It is in some ways comparable to Debian's dpkg and handles packing/unpacking, installation/updates/removal, and dependency management and provides a bus over which plugins

Re: list in a tuple

2007-12-27 Thread montyphyton
On Dec 27, 8:20 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > > > > From that post: > > Ok, I do admit that doing > > > > a = ([1], 2) > > a[0].append(2) > > > > also doesn't throw an error, but this only confuses me more. > > > Why? You mutate thelist, but thetupledoes not chan

Re: list in a tuple

2007-12-27 Thread Wildemar Wildenburger
Subject: Re: list in a tuple To: Cc: Bcc: Reply-To: Newsgroup: comp.lang.python -=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=- [EMAIL PROTECTED] wrote: > After some tought I must agree that this is a wart more than > a bug and that it will probably be best not to mess with it.

Re: Extracting images from a PDF file

2007-12-27 Thread Max Erickson
Doug Farrell <[EMAIL PROTECTED]> wrote: > Hi all, > > Does anyone know how to extract images from a PDF file? What I'm > looking to do is use pdflib_py to open large PDF files on our > Linux servers, then use PIL to verify image data. I want to do > this in order to find corrupt images in the PDF

SDTimes - Trends From 2007: "Dynamic languages are on the rise."

2007-12-27 Thread walterbyrd
This according to SDTimes: http://www.sdtimes.com/article/story-20071215-13.html They don't specifically mention Python. But, I think Python qualifies as a dynamic language. "1. Dynamic languages are on the rise. We went into 2007 knowing that Ruby would be a popular topic, thanks to Ruby on Rai

Re: Cheat sheet

2007-12-27 Thread kyosohma
On Dec 27, 11:38 am, "Riccardo T." <[EMAIL PROTECTED]> 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://greyfo

Blasting new year

2007-12-27 Thread sfrabe
Wishes for the new year http://newyearcards2008.com/ -- http://mail.python.org/mailman/listinfo/python-list

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

2007-12-27 Thread Martin v. Löwis
> Given no UnicodeErrors, are there any cases for the following not to > be True? > > unicode(s, enc).encode(enc) == s 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-

Re: Bug in htmlentitydefs.py with Python 3.0?

2007-12-27 Thread Martin v. Löwis
>> I would not write it this way, but as >> >> for name,codepoint in htmlentitydefs.name2codepoint: >> entity_map[name] = unichr(codepoint) > > has dictionary iteration changed in 3.0? if not, your code doesn't > quite work. Right - I forgot to add .items(). > and even if you fix that, it doe

Pivot Table/Groupby/Sum question

2007-12-27 Thread patrick . waldo
Hi all, I tried reading http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/334695 on the same subject, but it didn't work for me. I'm trying to learn how to make pivot tables from some excel sheets and I am trying to abstract this into a simple sort of example. Essentially I want to take in

Re: Dynamic DNS with a python script

2007-12-27 Thread Shane Geiger
Marcelo de Moraes Serpa wrote: > Hello list, > > I'd like to set up ssh access to my home computer so that I will be > able to access it from work - for this no problem, installing sshd is > straightforward. > > The issue here is that I don't have a fixed IP connection at home. > Also, I wouldn't l

RE: I want to set up a simple web server

2007-12-27 Thread lloyd
Hi, Try Karrigell (http://karrigell.sourceforge.net/) > I want to setup simple python web server and I want it to just unzip > and run, without any installation steps (have no right to do it). > I've tried to write by myself, however, I find I am getting into more > details like processing

Re: Dynamic DNS with a python script

2007-12-27 Thread Jean-Paul Calderone
On Thu, 27 Dec 2007 15:27:37 -0200, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> wrote: >Hello list, > >I'd like to set up ssh access to my home computer so that I will be able to >access it from work - for this no problem, installing sshd is >straightforward. > >The issue here is that I don't have

Re: list in a tuple

2007-12-27 Thread montyphyton
After some tought I must agree that this is a wart more than a bug and that it will probably be best not to mess with it. However, what do you guys think about the print wart in Py3k described at http://filoxus.blogspot.com/2007/12/python-3000-how-mutable-is-immutable.html#links (im not trying to

Cheat sheet

2007-12-27 Thread Riccardo T.
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 -- GreyFox -- http://mail.python.org/mai

Dynamic DNS with a python script

2007-12-27 Thread Marcelo de Moraes Serpa
Hello list, I'd like to set up ssh access to my home computer so that I will be able to access it from work - for this no problem, installing sshd is straightforward. The issue here is that I don't have a fixed IP connection at home. Also, I wouldn't like to use services such as no-ip or similar.

Re: Python mouse EVT_COMMAND_LEFT_CLICK, EVT_LEFT_DOWN

2007-12-27 Thread kyosohma
On Dec 27, 10:59 am, SMALLp <[EMAIL PROTECTED]> wrote: > Hy! > I'm not able to tu bind mouse click event. Code: > > class MouseClass(wx.Panel): > def __init__(self, parent, id): > > wx.Panel.__init__(self, parent, id, size=(500, 300)) > self.SetBackgroundColo

Python mouse EVT_COMMAND_LEFT_CLICK, EVT_LEFT_DOWN

2007-12-27 Thread SMALLp
Hy! I'm not able to tu bind mouse click event. Code: class MouseClass(wx.Panel): def __init__(self, parent, id): wx.Panel.__init__(self, parent, id, size=(500, 300)) self.SetBackgroundColour("WHITE") sizer = wx.BoxSizer(wx.VERTICAL)

Re: Building Python statically on linux

2007-12-27 Thread Zentrader
On Dec 27, 8:21 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > Micah Elliott wrote: > > I'm ./configure-ing with "--disable-shared" (because this must mean > > "enable static", right?) I think you can just add -static to the gcc Flag line in the makefile. "man gcc" should also be helpful but t

Re: Building Python statically on linux

2007-12-27 Thread Christian Heimes
Micah Elliott wrote: > I'm ./configure-ing with "--disable-shared" (because this must mean > "enable static", right?), and (based on some other posts here) tried > adding "*static*" near the top of Modules/Setup. I'd like to see ldd > tell me "not a dynamic executable", but alas, it's presently:

Building Python statically on linux

2007-12-27 Thread Micah Elliott
Are there instructions somewhere on how to build Python (on linux) statically? This seems like a common thing to do want to do, but my searching isn't turning up much. If it is common, it would be nice to see a configure option like I've seen in other tools: --enable-all-static Build compl

Re: interactive mode in python with ctypes???

2007-12-27 Thread ajaksu
You should get it to work with this loop (from run()): while libbuf != "quit": lib.libCallCommand(libinf,libbuf,0,pointer(result)) print "result: ",result.value if libbuf == "Exit": break libbuf = raw_input("lib>") -- http://mail.python.

Re: Bug in htmlentitydefs.py with Python 3.0?

2007-12-27 Thread Fredrik Lundh
Martin v. Löwis wrote: >> entity_map = htmlentitydefs.entitydefs.copy() >> for name, entity in entity_map.items(): >> if len(entity) != 1: >> entity_map[name] = unichr(int(entity[2:-1])) >> >> (entitydefs is pretty unusable as it is, but it was added to Python >> before

Re: getting n items at a time from a generator

2007-12-27 Thread Shane Geiger
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496958 from itertools import * def group(lst, n): """group([0,3,4,10,2,3], 2) => iterator Group an iterable into an n-tuples iterable. Incomplete tuples are padded with Nones e.g. >>> list(group(range(10), 3)) [(0, 1,

Re: Writing Oracle Output to a File

2007-12-27 Thread Ralf Schönian
t_rectenwald schrieb: > Hello, > > I attempting to execute an Oracle query, and write the results to a > file in CSV format. To do so, I've done the following: > > import cx_Oracle > db = cx_Oracle.connect('user/[EMAIL PROTECTED]') > cursor = db.cursor() > cursor.arraysize = 500 > cursor.execute

Re: Writing Oracle Output to a File

2007-12-27 Thread Ralf Schönian
Ralf Schönian schrieb: > t_rectenwald schrieb: >> Hello, >> >> I attempting to execute an Oracle query, and write the results to a >> file in CSV format. To do so, I've done the following: >> >> import cx_Oracle >> db = cx_Oracle.connect('user/[EMAIL PROTECTED]') >> cursor = db.cursor() >> cursor.

Re: Extracting images from a PDF file

2007-12-27 Thread writeson
On Dec 27, 1:12 am, Carl K <[EMAIL PROTECTED]> wrote: > Doug Farrell wrote: > > Hi all, > > > Does anyone know how to extract images from a PDF file? What I'm looking > > to do is use pdflib_py to open large PDF files on our Linux servers, > > then use PIL to verify image data. I want to do this in

Re: convert pdf to png

2007-12-27 Thread Lie
On Dec 27, 7:33 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Good point.  Not that I am willing to risk it (just using the pdf is not > > such a bad option)  but I am wondering if it would make sense to create > > a ramdrive for something like this.  if memory is needed, swap would > > hap

Re: Python DLL in Windows Folder

2007-12-27 Thread Martin v. Löwis
>> Instead of being upset about cutting your word (which was not my >> intention, sorry about that), it would be nice if you could make a >> statement concerning the problem I mentioned: Having an object being >> created by one MSVC runtime, msvcr80.dll and passing it to another >> one, msvcr71.dll

Re: Python DLL in Windows Folder

2007-12-27 Thread Martin v. Löwis
> Whatever you want to call it, the Python DLL is not part of the operating > system, it's not a driver and doesn't belong in the system directory. Is that just your personal opinion, or a guideline from the operating system vendor? Regards, Martin -- http://mail.python.org/mailman/listinfo/pyth

Re: standalone python web server

2007-12-27 Thread Markus Gritsch
On 27/12/2007, eric <[EMAIL PROTECTED]> wrote: > Hi all, > > I want to setup simple python web server and I want it to just unzip > and run, without any installation steps (have no right to do it). > > I've tried to write by myself, however, I find I am getting into more > details like processing i

Re: standalone python web server

2007-12-27 Thread Tim Chase
> Actually, I've considered to use django, however it required to run > command (which I don't have right to do it) > python setup.py install > > Btw, is it possible to use without running setup.py ? Yes, it's quite possible...Django is pure Python, so you just have to have its directory in

Re: Subject changed: Bug in combining htmlentitydefs.py and ElementTree?

2007-12-27 Thread Martin v. Löwis
> Sorry for the top posting - I found out that the problem I encountered > was not something new in Python 3.0. See Fredrik's message. The problem is not with htmlentitydefs, but with your usage of ElementTree - in ElementTree, the .entity dictionary values are not again parsed, apparently causing

Re: Bug in htmlentitydefs.py with Python 3.0?

2007-12-27 Thread Martin v. Löwis
> entity_map = htmlentitydefs.entitydefs.copy() > for name, entity in entity_map.items(): > if len(entity) != 1: > entity_map[name] = unichr(int(entity[2:-1])) > > (entitydefs is pretty unusable as it is, but it was added to Python > before Python got Unicode strings, a

Re: interactive mode in python with ctypes???

2007-12-27 Thread digitnctu
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 batch mode(ie. python test.py 11060) > > but when I type se

parallel processing in standard library

2007-12-27 Thread Emin.shopper Martinian.shopper
Dear Experts, Is there any hope of a parallel processing toolkit being incorporated into the python standard library? I've seen a wide variety of toolkits each with various features and limitations. Unfortunately, each has its own API. For coarse-grained parallelism, I suspect I'd be pretty happy

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

2007-12-27 Thread mario
I have checks in code, to ensure a decode/encode cycle returns the original string. Given no UnicodeErrors, are there any cases for the following not to be True? unicode(s, enc).encode(enc) == s mario -- http://mail.python.org/mailman/listinfo/python-list

Re: getting n items at a time from a generator

2007-12-27 Thread Kugutsumen
On Dec 27, 7:24 pm, Terry Jones <[EMAIL PROTECTED]> wrote: > > "Kugutsumen" == Kugutsumen  <[EMAIL PROTECTED]> writes: > > Kugutsumen> On Dec 27, 7:07 pm, Paul Hankin <[EMAIL PROTECTED]> wrote: > > >> On Dec 27, 11:34 am, Kugutsumen <[EMAIL PROTECTED]> wrote: > > >> > I am relatively new the py

  1   2   >