Re: Happy Christmas Pythoneers

2007-12-27 Thread Gabriel Genellina
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_alcoholic_drink_will_do() >> champagne.drink() >

Re: standalone python web server

2007-12-27 Thread Panos Laganakos
On Dec 27, 7:41 am, 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 process

Re: [newbie] Read file, and append?

2007-12-27 Thread Gilles Ganault
On Wed, 26 Dec 2007 14:33:15 -0800, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >Works for me, as long as one uses a seek() call when switching >between read and write... Thanks, Dennis. Worked :-) I just changed the access mode from binary to text so that Python handles the EOL character correct

106 EXTREMELY UNIQUE NUMERICAL EQUASIONS!

2007-12-27 Thread Stephen Sparkman
These equasions require all ten numerals (attachment). Stephen Sparkman. In MULTIPLICATION/DIVISION, there are 22 equations, 13 NUMERAL {3, 7, 4 & 6} X 4-digit numbers & 9 2-digit numbers X 3-digit numbers.3 X 5,694 = 17,082, 3 X 6,819 = 20,457, 3 X 6,918 = 20,754, 3 X 8,169 = 24,507, 3 X 9,16

Re: interactive mode in python with ctypes???

2007-12-27 Thread Gabriel Genellina
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 sequencially it doesn't work as usual. Can any > give me a hand?? Define "doe

Re: Problem with parsing email message with extraneous MIME information

2007-12-27 Thread Gabriel Genellina
En Fri, 21 Dec 2007 10:22:53 -0300, Steven Allport <[EMAIL PROTECTED]> escribió: > I am working on processing eml email message using the email module > (python > 2.5), on files exported from an Outlook PST file, to extract the > composite > parts of the email. In most instances this works f

Re: standalone python web server

2007-12-27 Thread Bjoern Schliessmann
eric wrote: > 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). Which OS? You might run into authorisation problems if you want it to listen on port 80 TCP. Regards, Björn -- BOFH excuse #303: fractal ra

Re: Python DLL in Windows Folder

2007-12-27 Thread Markus Gritsch
On 27/12/2007, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Indeed, pywin32 stops working :( I installed Python "just for me", > > then I installed pywin32-210, and now Pythonwin.exe is not able to > > start. So for this scenario it seems to be necessary, that the Python > > DLL is installed

Re: How to detect when a user switches between windows (in WinXP)?

2007-12-27 Thread Tim Golden
Tim Roberts wrote: > [EMAIL PROTECTED] wrote: >> I'm a beginning-to-intermediate Python programmer with some experience >> in other languages. At the moment I am trying to write a Python >> program that will run in the background and execute a series of >> commands whenever I switch between windows

Re: readlines() reading incorrect number of lines?

2007-12-27 Thread Gabriel Genellina
En Fri, 21 Dec 2007 16:42:21 -0300, Gerry <[EMAIL PROTECTED]> escribió: > whitespace = ' \t\n\r\v\f' > lowercase = 'abcdefghijklmnopqrstuvwxyz' > uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' > letters = lowercase + uppercase > ascii_lowercase = lowercase > ascii_uppercase =

Re: Performance on local constants?

2007-12-27 Thread Gabriel Genellina
En Sun, 23 Dec 2007 03:55:07 -0300, John Machin <[EMAIL PROTECTED]> escribió: > On Dec 23, 2:39 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: >> I will presume you are merely joking, but for the benefit of any >> beginning >> programmers reading this, the closure above is a standard functional

Re: Local variables in classes and class instantiation

2007-12-27 Thread Gabriel Genellina
En Sun, 23 Dec 2007 08:05:18 -0300, Peter Otten <[EMAIL PROTECTED]> escribió: >> Still, when I execute all three methods, I get two instances that are >> equal and the third is different. >> Is there some circomstance that makes two object creations result in the >> same object? >> >> ==

Re: standalone python web server

2007-12-27 Thread Jarek Zgoda
eric napisał(a): > 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). Look at SimpleHTTPServer in standard library. > I've tried to write by myself, however, I find I am getting into more > details like process

Re: Problem with parsing email message with extraneous MIME information

2007-12-27 Thread sandipm
I think I faced same problem quite sometime back... but in our case, due to some settings in Microsoft outlook , forwarded emails were also coming as an attachment to email. so That attachement itself has same format as email's format, so to get information from attachment we needed to treat atta

Re: Big-endian binary data to/from Python ints?

2007-12-27 Thread William McBrine
On Wed, 26 Dec 2007 16:50:53 -0800, Dennis Lee Bieber wrote: > your code might (I've not actually checked it) be incorrect if ported > to another machine. Nope. :-) > If the problem is that you have the four bytes as a character string, > use the struct module to interpret it as a binary integer

Re: standalone python web server

2007-12-27 Thread eric
On Dec 27, 6:22 pm, Bjoern Schliessmann wrote: > eric wrote: > > 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). > > Which OS? You might run into authorisation problems if you want it > to listen on port

Re: SWbemObjectEx not found

2007-12-27 Thread Tim Golden
jmgmail wrote: > 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

Re: standalone python web server

2007-12-27 Thread eric
On Dec 27, 4:52 pm, Panos Laganakos <[EMAIL PROTECTED]> wrote: > On Dec 27, 7:41 am, 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 wri

Re: Bug in htmlentitydefs.py with Python 3.0?

2007-12-27 Thread Fredrik Lundh
Martin v. Löwis wrote: >> In trying to parse html files using ElementTree running under Python >> 3.0a1, and using htmlentitydefs.py to add "character entities" to the >> parser, I found that I needed to create a customized version of >> htmlentitydefs.py to make things work properly. > > Can you

Re: getting n items at a time from a generator

2007-12-27 Thread 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 python language and I am afraid to be missing > > some clever construct or built-in way equivalent to my 'chunk' > > generator below. > > > def c

Re: getting n items at a time from a generator

2007-12-27 Thread Steven D'Aprano
On Thu, 27 Dec 2007 03:34:57 -0800, Kugutsumen 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. > > def chunk(size, items): > """generate N items from a generator.""" [snip code

Re: getting n items at a time from a generator

2007-12-27 Thread Paul Hankin
On Dec 27, 11:34 am, 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. > > def chunk(size, items): >     """generate N items from a generator.""" >     chu

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

Re: Big-endian binary data to/from Python ints?

2007-12-27 Thread Nikolas Karalis
How do you connect to the socket to receive the 4 byte packet? I'm trying to do that, but then the struct.unpack code above is not working... Nikolas On Dec 27, 2007 1:14 PM, William McBrine <[EMAIL PROTECTED]> wrote: > On Wed, 26 Dec 2007 16:50:53 -0800, Dennis Lee Bieber wrote: > > > your cod

Re: convert pdf to png

2007-12-27 Thread Diez B. Roggisch
> > 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 > happen, which should be better than creating files. > You mean perman

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: 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

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

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

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: 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: 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

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: getting n items at a time from a generator

2007-12-27 Thread Terry Jones
> "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 python language and I am afraid to be missing >> > some clever construc

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

getting n items at a time from a generator

2007-12-27 Thread Kugutsumen
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. def chunk(size, items): """generate N items from a generator.""" chunk = [] count = 0 while True: try: item = it

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: 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: standalone python web server

2007-12-27 Thread Diez B. Roggisch
eric schrieb: > On Dec 27, 4:52 pm, Panos Laganakos <[EMAIL PROTECTED]> wrote: >> On Dec 27, 7:41 am, 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'v

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:

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: 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

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: 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

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

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

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

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)

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

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

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 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

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: 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

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-

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: 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

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: 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

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: 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: 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: 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

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

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: 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

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 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

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: 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: 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 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

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: 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: 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: 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: 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

"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 --

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

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: 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: 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: 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: 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: 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

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: 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: 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: 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: "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: 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: 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

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

  1   2   >