Re: eof

2007-11-21 Thread Wayne Brehaut
On Wed, 21 Nov 2007 17:06:15 -0800 (PST), braver <[EMAIL PROTECTED]> wrote: >On Nov 22, 3:41 am, Wayne Brehaut <[EMAIL PROTECTED]> wrote: >> If you have PythonWin 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 >> 32 bit (Intel)] on win32.for example, using Help, Index, eof gives: >> 8< ===

Re: having problem using xlrd

2007-11-21 Thread Kelie
FYI, this question has been answered in python-excel group. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the function to evaluate code object returned byPyParser _SimpleParseString function?

2007-11-21 Thread grbgooglefan
On Nov 16, 7:11 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Borse, Ganesh" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | Py_CompileString takes the sourcecodefrom file, isn't it? > > No. > > | As can be seen from the syntax of thisfunction: "PyObject* > Py_CompileString(ch

Please help in creating Python function in C ++ program

2007-11-21 Thread gagsl-py2
Forwarded to python-list@python.org --- "Borse, Ganesh" <[EMAIL PROTECTED]> escribió: > Hi, > > I am new to Python. I would like to use Python for > the specialized purpose of dynamic expressions > parsing & evaluation in my C++ application. > I would like to encapsulate the expressions to be >

Re: why it is invalid syntax?

2007-11-21 Thread Zara
On Thu, 22 Nov 2007 00:00:16 -0600, alf <[EMAIL PROTECTED]> wrote: >Hi, > >I wonder why it is an invalid syntax: > > > >>> if 1: if 1: if 1: print 1 > File "", line 1 > if 1: if 1: if 1: print 1 > > >or > > >>> if 1: for i in range(10): print i > File "", line 1 > if 1: for i in range(

Re: Next float?

2007-11-21 Thread Steven D'Aprano
On Thu, 22 Nov 2007 00:44:34 -0600, Robert Kern wrote: > Steven D'Aprano wrote: >> Is there a simple, elegant way in Python to get the next float from a >> given one? By "next float", I mean given a float x, I want the smallest >> float larger than x. > > Heh: > > http://mail.python.org/piperm

Re: why it is invalid syntax?

2007-11-21 Thread Marc 'BlackJack' Rintsch
On Thu, 22 Nov 2007 00:00:16 -0600, alf wrote: > I wonder why it is an invalid syntax: > > > >>> if 1: if 1: if 1: print 1 >File "", line 1 > if 1: if 1: if 1: print 1 > > or > > >>> if 1: for i in range(10): print i >File "", line 1 > if 1: for i in range(10): print i > >

Re: Next float?

2007-11-21 Thread Robert Kern
Steven D'Aprano wrote: > Is there a simple, elegant way in Python to get the next float from a > given one? By "next float", I mean given a float x, I want the smallest > float larger than x. Heh: http://mail.python.org/pipermail/python-list/2005-December/357771.html -- Robert Kern "I have

Issue with reading and writing into .ini files using python

2007-11-21 Thread tarun
Hello, I am using config approach as mentioned in the below link to read and write into setup (.ini) files: http://www.voidspace.org.uk/python/configobj.html I've a key named 'SELECTED' in my .ini file. Sometimes I get the following error on trying to read the .ini file:val = dict.__getitem_

Re: Next float?

2007-11-21 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Is there a simple, elegant way in Python to get the next float from a > given one? By "next float", I mean given a float x, I want the smallest > float larger than x. I think you have to do it by bit twiddling. But something like bisection search co

Re: Next float?

2007-11-21 Thread Robert Kern
Steven D'Aprano wrote: > Is there a simple, elegant way in Python to get the next float from a > given one? By "next float", I mean given a float x, I want the smallest > float larger than x. Courtesy of Tim Peters: http://mail.python.org/pipermail/python-list/2001-August/099152.html > Bonus

**SMALL BUSINESS**PLAN FOR A LOAN**

2007-11-21 Thread Pressly
**SMALL BUSINESS**PLAN FOR A LOAN** **BPM SOFTWARE** **INTERNET SOFTWARE** **SOFTWARE DEVELOPMENT** **PROCESS MODELLING SOFTWARE** http://regantame.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

why it is invalid syntax?

2007-11-21 Thread alf
Hi, I wonder why it is an invalid syntax: >>> if 1: if 1: if 1: print 1 File "", line 1 if 1: if 1: if 1: print 1 or >>> if 1: for i in range(10): print i File "", line 1 if 1: for i in range(10): print i I would expect one could nest : -- alf -- http://mail.python.org/

Re: logging and propagation

2007-11-21 Thread Vinay Sajip
On Nov 21, 11:38 am, oj <[EMAIL PROTECTED]> wrote: > Hi, > > I want to setuploggingwith two loggers: > > The child logger is used when something different needs to be done > with the log record, and the log record will propagate and be logged > by the root logger as usual. > > However, there are ce

Re: Next float?

2007-11-21 Thread Mark T
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there a simple, elegant way in Python to get the next float from a > given one? By "next float", I mean given a float x, I want the smallest > float larger than x. > > Bonus points if I can go in either direction (

Re: Next float?

2007-11-21 Thread Alex Holkner
On Nov 22, 2007 2:04 PM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Is there a simple, elegant way in Python to get the next float from a > given one? By "next float", I mean given a float x, I want the smallest > float larger than x. > > Bonus points if I can go in either direction (i.e. the "pr

Re: the annoying, verbose self

2007-11-21 Thread Steven D'Aprano
On Wed, 21 Nov 2007 15:51:56 -0800, braver wrote: > Is there any trick to get rid of having to type the annoying, > character-eating "self." prefix everywhere in a class? Oh I know! It' uch a pain. Sinc writing a hug cla lat wk, I'v had a trribl hortag o lowrca S E L and F charactr. It mak writ

Re: Introspect the class name of object?

2007-11-21 Thread Steven D'Aprano
On Wed, 21 Nov 2007 18:55:21 -0800, Davy wrote: > Hi all, > > How to get the class name of an object from an introspect way? For > example, > Class cls:pass > > obj = cls() > > I want to get function(obj) = 'cls' obj.__class__ returns the class itself. obj.__class__.__name__ returns the name

how terminate console(not Ctrl-C)

2007-11-21 Thread NoName
Is it possible to interrupt loop (program) by pressing Q key like Ctrl- C? how can i hook user's keypress while program running? thnx -- http://mail.python.org/mailman/listinfo/python-list

Buffer type

2007-11-21 Thread Benjamin
What's the point of the built in buffer type? The documentation (http://docs.python.org/lib/typesseq.html) is not very enlightening. -- http://mail.python.org/mailman/listinfo/python-list

Re: eof

2007-11-21 Thread Steven D'Aprano
On Wed, 21 Nov 2007 15:17:14 -0800, braver wrote: > I'd like to check, for a filehandle f, that EOF has been reached on it. > What's the way to do it? I don't want to try/except on EOF, I want to > check, after I read a line, that now we're in the EOF state. Why? For some file-like objects, the

Next float?

2007-11-21 Thread Steven D'Aprano
Is there a simple, elegant way in Python to get the next float from a given one? By "next float", I mean given a float x, I want the smallest float larger than x. Bonus points if I can go in either direction (i.e. the "previous float" as well as the next). Note to maths pedants: I am aware tha

Introspect the class name of object?

2007-11-21 Thread Davy
Hi all, How to get the class name of an object from an introspect way? For example, Class cls:pass obj = cls() I want to get function(obj) = 'cls' Best regards, Davy -- http://mail.python.org/mailman/listinfo/python-list

Re: eof

2007-11-21 Thread I V
On Wed, 21 Nov 2007 17:06:15 -0800, braver wrote: > Why do I have to count sizes of lines read and compare it to some > filesize or do other weird tricks just to see, in a way not changing my > input stream, whether it's at the, well, EOF? Because you can't, generally, tell whether or not a stream

Re: eof

2007-11-21 Thread Neil Cerutti
On 2007-11-21, braver <[EMAIL PROTECTED]> wrote: > I'd like to check, for a filehandle f, that EOF has been reached on > it. What's the way to do it? I don't want to try/except on EOF, I > want to check, after I read a line, that now we're in the EOF state. > In Ruby it's f.eof: > > In Ruby: >>>

RE: the annoying, verbose self

2007-11-21 Thread Looney, James B
There are always tricks. If 5 characters is really too much to type, how about 2 characters "s.". Though I would recommend against that since it violates standard Python convention. def foo( self ): becomes def foo( s ): Otherwise, if you happen to be using self.something a lot, just assign i

Re: eof

2007-11-21 Thread braver
On Nov 22, 3:41 am, Wayne Brehaut <[EMAIL PROTECTED]> wrote: > If you have PythonWin 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 > 32 bit (Intel)] on win32.for example, using Help, Index, eof gives: > > eof > Token used to determine end of file. This will be set to the empty > string ('')

Re: eof

2007-11-21 Thread Wayne Brehaut
Hi braver, On Wed, 21 Nov 2007 15:17:14 -0800 (PST), braver <[EMAIL PROTECTED]> wrote: >I'd like to check, for a filehandle f, that EOF has been reached on >it. What's the way to do it? I don't want to try/except on EOF, I >want to check, after I read a line, that now we're in the EOF state. I

Re: the annoying, verbose self

2007-11-21 Thread Farshid Lashkari
braver wrote: > Is there any trick to get rid of having to type the annoying, > character-eating "self." prefix everywhere in a class? Sometimes I > avoid OO just not to deal with its verbosity. In fact, I try to use > Ruby anywhere speed is not crucial especially for @ prefix is better- > lookin

the annoying, verbose self

2007-11-21 Thread braver
Is there any trick to get rid of having to type the annoying, character-eating "self." prefix everywhere in a class? Sometimes I avoid OO just not to deal with its verbosity. In fact, I try to use Ruby anywhere speed is not crucial especially for @ prefix is better- looking than self. But things

twisted client.getPage threading safety

2007-11-21 Thread sndive
I found nothing better to do than to start a new thread from c and run twisted event loop there. my question is: how can i safely call client.getPage() from another thread? could i? i have compiled python without threading support and am wondering what the repercussions will be (i don't want to en

eof

2007-11-21 Thread braver
I'd like to check, for a filehandle f, that EOF has been reached on it. What's the way to do it? I don't want to try/except on EOF, I want to check, after I read a line, that now we're in the EOF state. In Ruby it's f.eof: In Ruby: >> f = File.open("jopa") => # >> f.read() => "jopa\n" >> f.eof =

Re: Clean way to get one's network IP address?

2007-11-21 Thread Steven D'Aprano
On Wed, 21 Nov 2007 12:00:52 -0500, Joe Riopel wrote: > On Nov 21, 2007 10:15 AM, Gilles Ganault <[EMAIL PROTECTED]> wrote: >> I know about socket.gethostbyname, but this relies on what's in >> /etc/hosts, and I'd rather have a more independent solution. > > I might be missing something in your q

Re: s[i:j:t] = t stipulation

2007-11-21 Thread Terry Reedy
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On 2007-11-20, Terry Reedy <[EMAIL PROTECTED]> wrote: | > No, it should be defined as resulting in | > | > ['a', 1, 'a', 2, 'a', 3, None, 5, None, 7, None, 9] # ;-) Note smiley. | I thought deletion of elements would b

Re: sendmail a long message

2007-11-21 Thread Helmut Jarausch
Laszlo Nagy wrote: > Helmut Jarausch wrote: >> Hi, >> >> to send a possibly long email I have seen a solution >> which does os.popen to an external sendmail program and >> then writes the message into that pipe. >> >> I wonder if it possible to use smtplib.SMTP.sendmail >> but this requires buildin

Re: python safe scripting

2007-11-21 Thread i3dmaster
On Nov 21, 12:44 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > 2007/11/21, Vladimir Rusinov <[EMAIL PROTECTED]>: > > > Hello! > > > In one my project (it's logfile manager) I want to implement 'smart' > > configuration files, e.g. > > > logfile("/var/log/messages") > > if (size() > 10*1024*1024

Re: sendmail a long message

2007-11-21 Thread Laszlo Nagy
Helmut Jarausch wrote: > Hi, > > to send a possibly long email I have seen a solution > which does os.popen to an external sendmail program and > then writes the message into that pipe. > > I wonder if it possible to use smtplib.SMTP.sendmail > but this requires building the complete body as one lo

Re: python safe scripting

2007-11-21 Thread Guilherme Polo
2007/11/21, Vladimir Rusinov <[EMAIL PROTECTED]>: > Hello! > > In one my project (it's logfile manager) I want to implement 'smart' > configuration files, e.g. > > logfile("/var/log/messages") > if (size() > 10*1024*1024) and (lavg() < 5): > execute("my_log_alerter") >rotate(save=10, compre

sendmail a long message

2007-11-21 Thread Helmut Jarausch
Hi, to send a possibly long email I have seen a solution which does os.popen to an external sendmail program and then writes the message into that pipe. I wonder if it possible to use smtplib.SMTP.sendmail but this requires building the complete body as one long string in memory before calling th

python safe scripting

2007-11-21 Thread Vladimir Rusinov
Hello! In one my project (it's logfile manager) I want to implement 'smart' configuration files, e.g. logfile("/var/log/messages") if (size() > 10*1024*1024) and (lavg() < 5): execute("my_log_alerter") rotate(save=10, compress='bzip2') how can I safely do this? -- Vladimir Rusinov GreenM

Dictionary vs binary search lookups [was: Populating a dictionary, fast [SOLVED]]

2007-11-21 Thread Francesc Altet
A Tuesday 20 November 2007, Istvan Albert escrigué: > On Nov 19, 2:33 pm, Francesc Altet <[EMAIL PROTECTED]> wrote: > > Just for the record. I was unable to stop thinking about this, and > > after some investigation, I guess that my rememberings were > > gathered from some benchmarks with code in

Re: import pysqlite2 or import sqlite3?

2007-11-21 Thread Hertha Steck
Hertha Steck wrote: > Hello, > > I'm using Python 2.5.1, Pysqlite 2.3.5 and SQLite 3.4.1 on Gentoo Linux. > I've always imported pysqlite using > > from pysqlite2 import dbapi2 > > and that works. If I try > > import sqlite3 > > I get > > Traceback (most recent call last): > File "", line

import pysqlite2 or import sqlite3?

2007-11-21 Thread Hertha Steck
Hello, I'm using Python 2.5.1, Pysqlite 2.3.5 and SQLite 3.4.1 on Gentoo Linux. I've always imported pysqlite using from pysqlite2 import dbapi2 and that works. If I try import sqlite3 I get Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/sqlite3/__init__.

Re: regex problem with re and fnmatch

2007-11-21 Thread Fabian Braennstroem
Hi John, John Machin schrieb am 11/20/2007 09:40 PM: > On Nov 21, 8:05 am, Fabian Braennstroem <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I would like to use re to search for lines in a files with >> the word "README_x.org", where x is any number. >> E.g. the structure would look like this: >> [[file

Re: Clean way to get one's network IP address?

2007-11-21 Thread poltrone
> What would be a good way to do this? using 'netifaces'? see http://pypi.python.org/pypi/netifaces/0.3 -- http://mail.python.org/mailman/listinfo/python-list

computer programming

2007-11-21 Thread lawry_jim
http://computer-programmings.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Contextmenu in a QTreeWidget with PyQT

2007-11-21 Thread [EMAIL PROTECTED]
I apologize in advance if this is not the correct forum to ask this and if someone knows a better place, please let me know. But, I am trying to create a Contextmenu (a right-click popup menu) from within a QTreeWidget. I tried setting the contextMenuPolicy to CustomContextMenu and then handling

having problem using xlrd

2007-11-21 Thread Kelie
Hello, I tried using xlrd to read an Excel file and kept getting this error: AttributeError: 'Book' object has no attribute 'mem' >>> import xlrd >>> p = r'C:\2.xls' >>> wb = xlrd.open_workbook(p) >>> wb.get_sheets() AttributeError: 'Book' object has no attribute 'mem' >>> wb.get_record_parts()

Re: Create thumbnail image (jpg/png) of PDF file using Python

2007-11-21 Thread sophie_newbie
On Nov 20, 5:36 pm, sophie_newbie <[EMAIL PROTECTED]> wrote: > Is there any way to do this directly within python? > > If not is there any other good way to achieve it? > > Thanks in advance for any help! I think I've solved this problem using a piece of software called imageMagick. Good stuff so

Re: Formatting question.

2007-11-21 Thread mike5160
On Nov 21, 11:36 am, mike5160 <[EMAIL PROTECTED]> wrote: > On Nov 21, 1:22 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > > > > On Tue, 20 Nov 2007 15:11:38 -0800 (PST), mike5160 <[EMAIL PROTECTED]> > > declaimed the following in comp.lang.python: > > > > Hi all, > > > > My input file looks l

Re: new is missing in module hmac SHA-based encryption function in Python

2007-11-21 Thread Chris Mellon
On Nov 21, 2007 10:50 AM, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > Hailong Wang wrote: > > Matt, > > > > Thanks for response, I changed my script to hw_hmac.py, but still does > > not work. > > > > Traceback (most recent call last): > > File "C:/Python25/hw_script/my_hmac.py", line 1, in > >

Re: Python web frameworks

2007-11-21 Thread Steven Bethard
Jeff wrote: > On Nov 21, 6:25 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: >> joe jacob a écrit : >> (snip) >> >>> Thanks everyone for the response. From the posts I understand that >>> Django and pylons are the best. By searching the net earlier I got the >>> same information that Django is

Re: Clean way to get one's network IP address?

2007-11-21 Thread Joe Riopel
On Nov 21, 2007 10:15 AM, Gilles Ganault <[EMAIL PROTECTED]> wrote: > I know about socket.gethostbyname, but this relies on what's in > /etc/hosts, and I'd rather have a more independent solution. I might be missing something in your question, but on a Windows XP machine, I can get the IP address

Re: Python web frameworks

2007-11-21 Thread BartlebyScrivener
On Nov 21, 4:42 am, joe jacob <[EMAIL PROTECTED]> wrote: > Django is best among the frameworks so I > downloaded it and I found it very difficult to configure. I referred > the djangobook. It's not a turnkey type thing like WordPress or Joomla. It's a webframework. Also watch versions. The book ex

Re: Python too complex ?!?!?!

2007-11-21 Thread Chris Mellon
On Nov 20, 2007 2:43 PM, John J. Lee <[EMAIL PROTECTED]> wrote: > "Chris Mellon" <[EMAIL PROTECTED]> writes: > [...] > > These modules exist, but aren't that common. Certainly anything you're > > likely to be using in an introductory compsci course is well packaged. > > And even if it's not, it's r

Re: new is missing in module hmac SHA-based encryption function in Python

2007-11-21 Thread Matt Nordhoff
Hailong Wang wrote: > Matt, > > Thanks for response, I changed my script to hw_hmac.py, but still does > not work. > > Traceback (most recent call last): > File "C:/Python25/hw_script/my_hmac.py", line 1, in > import hmac > File "C:\Python25\hw_script\hmac.py", line 4, in > myhmac =

Re: Clean way to get one's network IP address?

2007-11-21 Thread Jean-Paul Calderone
On Wed, 21 Nov 2007 16:15:43 +0100, Gilles Ganault <[EMAIL PROTECTED]> wrote: >Hello > >I need to get the local computer's IP address, ie. what's displayed >when running "ifconfig" in Linux: > ># ifconfig >eth0 Link encap:Ethernet HWaddr 00:15:58:A1:D5:6F > inet addr:192.168.0.79 Bc

Re: new is missing in module hmac SHA-based encryption function in Python

2007-11-21 Thread Hailong Wang
Matt, Thanks for response, I changed my script to hw_hmac.py, but still does not work. Traceback (most recent call last): File "C:/Python25/hw_script/my_hmac.py", line 1, in import hmac File "C:\Python25\hw_script\hmac.py", line 4, in myhmac = hmac.new("test") AttributeError: 'modul

Re: Clean way to get one's network IP address?

2007-11-21 Thread Roy Smith
Gilles Ganault <[EMAIL PROTECTED]> wrote: > I know about socket.gethostbyname, but this relies on what's in > /etc/hosts, and I'd rather have a more independent solution. The system I'm currently working on uses exactly this strategy -- we get the hostname then do a name lookup on it. We've gon

Re: Formatting question.

2007-11-21 Thread mike5160
On Nov 21, 1:22 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 20 Nov 2007 15:11:38 -0800 (PST), mike5160 <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > > Hi all, > > > My input file looks like this : ( the data is separated by tabs ) > > > 11/26/2007 56.366

Re: new is missing in module hmac SHA-based encryption function in Python

2007-11-21 Thread Matt Nordhoff
Hailong Wang wrote: > I have small hmac encryption programm by python, but always complain > that hmac module does not have attribute new, do I need to install > anything additinal in my laptop? I am using python 2.5.1 > > import hmac > import md5 > import sha > myhmac = hmac.new("test") > > > T

Re: [regex] Basic rewriting

2007-11-21 Thread Mohammad Tayseer
It's also preferred if you use \d{2} instead of repeating \d Mohammad Tayseer http://spellcoder.com/blogs/tayseer Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. http://

Re: Fwd: Formatting question.

2007-11-21 Thread mike5160
On Nov 20, 9:13 pm, "Sergio Correia" <[EMAIL PROTECTED]> wrote: > Hey Mike, > Welcome to Python! > > About your first issue, just change the line > outfile.write( "'%s'," % (LoL[x][y])) > With > outfile.write( "'%s'," % (LoL[x][y][:-1])) > > Why? Because when you do the line.split, you are includin

Re: write iso 9660 with python

2007-11-21 Thread Avell Diroll
bryan rasmussen wrote: > Hi, > > I need to read in a system of files and write them to an iso 9660, any > libraries suited to this task that are up to date? Python 2.4 or 2.5 > should be assumed. You could subprocess a call to cdrecord ... There are also python bindings for libburn ... http://icc

Re: google earth / pythoncom

2007-11-21 Thread John Walsh
Tom, Meff, Thanks for your replies - very useful. Meff - we already have the GSM/GPS module, but we will take a look at Round and track4free. Tom - yes, got the win32 extension working, and the com interface to google earth is working fine... John. >>> I'd like to write a python script to c

Re: logging.SocketHandler connections

2007-11-21 Thread oj
On Nov 20, 8:32 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > On Nov 20, 1:47 pm, oj <[EMAIL PROTECTED]> wrote: > > > On Nov 20, 12:26 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > > > > Can you confirm that if you add the while loop back in, all messages > > > are seen by the server? It worked for m

Re: Python web frameworks + adobe flex

2007-11-21 Thread SamFeltus
I never used the Django AMF, I use JSON to go between Python and Flex. It works well, but lacks easy 2 way communication of course. Interfacing with Flex is a gaping hole in the Python libraries. Python needs a web framework that embraces Flex from the ground up, HTML being such a limited web disp

Re: Clean way to get one's network IP address?

2007-11-21 Thread Gilles Ganault
On Wed, 21 Nov 2007 07:20:45 -0800 (PST), Paul McGuire <[EMAIL PROTECTED]> wrote: >Be aware that it is very possible to have multiple IP addresses from >which to choose Yup, but this is the local host, and it only has a single interface. Should I look into os.environ() or something like that? --

Re: compiling python 2.5, missing zlib

2007-11-21 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
On Nov 19, 8:22 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Those headers are already installed, according to "up2date". Is there > > a way to specify the header files used? > > It will automatically use them if they are good. What's the value of > ZLIB_VERSION in /usr/include/zlib.h? > >

Re: Clean way to get one's network IP address?

2007-11-21 Thread Paul McGuire
On Nov 21, 9:15 am, Gilles Ganault <[EMAIL PROTECTED]> wrote: > Hello > > I need to get the local computer's IP address, ie. what's displayed > when running "ifconfig" in Linux: > > # ifconfig > eth0 Link encap:Ethernet HWaddr 00:15:58:A1:D5:6F > inet addr:192.168.0.79 Bcast:192.

new is missing in module hmac SHA-based encryption function in Python

2007-11-21 Thread Hailong Wang
Hi, I have small hmac encryption programm by python, but always complain that hmac module does not have attribute new, do I need to install anything additinal in my laptop? I am using python 2.5.1 import hmac import md5 import sha myhmac = hmac.new("test") Traceback (most recent call last): F

Clean way to get one's network IP address?

2007-11-21 Thread Gilles Ganault
Hello I need to get the local computer's IP address, ie. what's displayed when running "ifconfig" in Linux: # ifconfig eth0 Link encap:Ethernet HWaddr 00:15:58:A1:D5:6F inet addr:192.168.0.79 Bcast:192.168.0.255 Mask:255.255.255.0 I know about socket.gethostbyname, but this re

Re: Python too complex ?!?!?!

2007-11-21 Thread BlueBird
On Nov 20, 9:36 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > FWIW it's trivial to run pyflakes on your code (automatically behind > the scenes) to get syntax checking; in vim, my syntax errors get > underlined immediately for python code. Can you describe your setup a bit more precisel

Re: how to change current working directory while using pdb within emacs

2007-11-21 Thread Diez B. Roggisch
duyanning wrote: > I have written a pyhton script that will process data file in current > working directory. > My script is in an different directory to data file. > When I debug this script using pdb within emacs, emacs will change the > current working directory to the directory which include t

RE: Python web frameworks + adobe flex

2007-11-21 Thread Sells, Fred
slight shift of topic here. I'm a newbie at standard web stuff. Mostly java webstart and a little mod_python. I experimented with Adobe Flex and really loved it for doing the front end. The backend needs to provide xml, json or AMF (an adobe proprietary binary format). For prototyping, I was

Re: s[i:j:t] = t stipulation

2007-11-21 Thread Neil Cerutti
On 2007-11-20, Terry Reedy <[EMAIL PROTECTED]> wrote: > "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >| s[i:j:t] = t (1) t must have the same length as the slice it is > replacing. > > This is essentially the same rule as requiring a proper length > of t for > > a,

Re: Python web frameworks

2007-11-21 Thread Joe Riopel
On Nov 21, 2007 5:42 AM, joe jacob <[EMAIL PROTECTED]> wrote: > Thanks everyone for the response. From the posts I understand that > Django and pylons are the best. By searching the net earlier I got the > same information that Django is best among the frameworks so I > downloaded it and I found it

Re: Python web frameworks

2007-11-21 Thread Jeff
On Nov 21, 6:25 am, Bruno Desthuilliers wrote: > joe jacob a écrit : > (snip) > > > Thanks everyone for the response. From the posts I understand that > > Django and pylons are the best. By searching the net earlier I got the > > same information that Django is best among the frameworks so I > > d

RE: Python web frameworks

2007-11-21 Thread Sells, Fred
-snip-- > > Thanks everyone for the response. From the posts I understand that > Django and pylons are the best. By searching the net earlier I got the > same information that Django is best among the frameworks so I > downloaded it and I found it very difficult to configure. I referred > the dja

how to change current working directory while using pdb within emacs

2007-11-21 Thread duyanning
I have written a pyhton script that will process data file in current working directory. My script is in an different directory to data file. When I debug this script using pdb within emacs, emacs will change the current working directory to the directory which include the script, so my script cann

Re: logging and propagation

2007-11-21 Thread Diez B. Roggisch
Paul Rudin wrote: > oj <[EMAIL PROTECTED]> writes: > >> On Nov 21, 11:48 am, Paul Rudin <[EMAIL PROTECTED]> wrote: > >>> Loggers have a "propagate" attribute. If you set this to False in the >>> child then you should get what you want I think. >> >> No, because I want message to propagate usuall

Re: logging and propagation

2007-11-21 Thread Paul Rudin
oj <[EMAIL PROTECTED]> writes: > On Nov 21, 11:48 am, Paul Rudin <[EMAIL PROTECTED]> wrote: >> Loggers have a "propagate" attribute. If you set this to False in the >> child then you should get what you want I think. > > No, because I want message to propagate usually. There are only > specific i

Re: logging and propagation

2007-11-21 Thread oj
On Nov 21, 11:48 am, Paul Rudin <[EMAIL PROTECTED]> wrote: > oj <[EMAIL PROTECTED]> writes: > > Hi, > > > I want to setup logging with two loggers: > > > The child logger is used when something different needs to be done > > with the log record, and the log record will propagate and be logged > > b

Re: logging and propagation

2007-11-21 Thread Paul Rudin
oj <[EMAIL PROTECTED]> writes: > Hi, > > I want to setup logging with two loggers: > > The child logger is used when something different needs to be done > with the log record, and the log record will propagate and be logged > by the root logger as usual. > > However, there are certain times when

Re: sorting a list of list

2007-11-21 Thread Matt Nordhoff
Tim Chase wrote: >> are there available library or pythonic algorithm for sorting a list >> of list depending on the index of the list inside the list of my >> choice? > > The built-in sorted() function and the sort() method on various > collections take an optional "key=function" keyword paramate

logging and propagation

2007-11-21 Thread oj
Hi, I want to setup logging with two loggers: The child logger is used when something different needs to be done with the log record, and the log record will propagate and be logged by the root logger as usual. However, there are certain times when I don't want a log record to propagate from the

Re: Python web frameworks

2007-11-21 Thread Bruno Desthuilliers
joe jacob a écrit : (snip) > Thanks everyone for the response. From the posts I understand that > Django and pylons are the best. By searching the net earlier I got the > same information that Django is best among the frameworks so I > downloaded it and I found it very difficult to configure. ???

Re: logging module: removing handlers

2007-11-21 Thread Michele Simionato
On Nov 21, 11:08 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Having thought more about this, it _has_ to be that way - think of one > handler attached to several loggers. Removing AND closing it from one would > render it useless for others. You can't want that to happen. You have a point.

Re: Python web frameworks

2007-11-21 Thread joe jacob
On Nov 21, 10:15 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Nov 21, 1:37 pm, BartlebyScrivener <[EMAIL PROTECTED]> wrote: > > > > > On Nov 20, 3:39 pm, Graham Dumpleton <[EMAIL PROTECTED]> > > wrote: > > > > This only holds if actually hosted on Apache. As Django these days > > > supports

Re: Code Management

2007-11-21 Thread Jens
On 21 Nov., 05:34, Ben Finney <[EMAIL PROTECTED]> wrote: > > I hope the above makes it clearer what I prefer for this situation. > It does. You've been most helpful - thanks a lot! I'll bookmark this thread and keep it under my pillow :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: logging module: removing handlers

2007-11-21 Thread Diez B. Roggisch
Michele Simionato wrote: > On Nov 21, 10:23 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> I can only guess - but I'd say if you can do >> >> foo.removeHandler(h) >> >> you can do >> >> foo.removeHandler(h) >> h.close() >> >> easily. But not >> >> foo.removeHandler(h) # implicit closing >

Re: logging module: removing handlers

2007-11-21 Thread Michele Simionato
On Nov 21, 10:23 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > I can only guess - but I'd say if you can do > > foo.removeHandler(h) > > you can do > > foo.removeHandler(h) > h.close() > > easily. But not > > foo.removeHandler(h) # implicit closing > bar.addHandler(h) > > It does kind of mak

Re: logging module: removing handlers

2007-11-21 Thread Diez B. Roggisch
Michele Simionato schrieb: > I have just discovered a bug in my code using the logging module, due > to > handlers not being closed properly. The issue was that I called the > function > removeHandler and I assumed that it took care of closing the handler, > but it did not. > Looking at the source

Re: Recursive insertion of a line

2007-11-21 Thread Francesco Pietra
--- Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 20 Nov 2007 01:16:53 -0800 (PST), Francesco Pietra > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > > Now, "file .out" had "TER" inserted where I wanted. It might well be that > it > > was my incorrect use o

logging module: removing handlers

2007-11-21 Thread Michele Simionato
I have just discovered a bug in my code using the logging module, due to handlers not being closed properly. The issue was that I called the function removeHandler and I assumed that it took care of closing the handler, but it did not. Looking at the source code of logging/__init__.py I discovered

Re: Web update library in python?

2007-11-21 Thread Jorgen Bodde
Thanks everybody, You gave me plenty of information to go on and look for something that might give me a sound and solid solution to my problem! I will look into bzr I've heard good things about it, and maybe I can use it in my app! Regards, - Jorgen On Nov 21, 2007 9:05 AM, A.T.Hofkamp <[EMAIL

Re: Web update library in python?

2007-11-21 Thread A.T.Hofkamp
On 2007-11-20, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Jorgen Bodde wrote: > >> Hi, A.T.Hofkamp (sorry for not knowing your first name ;-), Well Jorgen, it is at the bottom of each post (usually)... ;-) >> SCM sounds like a term I can google for, if the tool needed is very >> easy to instal