Re: Reading Java byte[] data stream over standard input

2008-05-19 Thread sapsi
Yes, that could be the case. Browsing through hadoop's source, i see stdin in the above code is reading from piped Java DataOutputStream. I read of a libray on the net Javadata.py that reads this but it has disappeared. What is involved in reading from a Dataoutputstream? Thank you Sapsi -- http:/

python script to windows exe

2008-05-19 Thread sandeep
hi all i am very much a newbie to python but has some experience of development.i am trying to write a script which will loop through the outlook 2003 inbox and save the email data in an simple data.html page and save all the attachments in a folder name emails.after some initial struggling i am a

unpack() exploration!

2008-05-19 Thread Marlin Rowley
All: I've got a script that runs really slow because I'm reading from a stream a byte at a time: // TERRIBLE for y in range( height ): for color in range(4): for x in range( width ): pixelComponent = fileIO.read(4) buffer = unpack("!f"

Rearranging elements (cont..)

2008-05-19 Thread Marlin Rowley
All: Say I have an array: a = ([''],['']) How do I make it so that I now have: starting with first element (a[0]) new_arr[0] = 'r' new_arr[1] = 'g' new_arr[2] = 'b' new_arr[3] = 'a' new_arr[4] = 'r' . continuing "through" a[1] with the same new_arr new_

More on numpy trickiness.

2008-05-19 Thread Marlin Rowley
All: Say I have an array: a = ([''],['']) How do I make it so that I now have: starting with first element (a[0])new_arr[0] = 'r'new_arr[1] = 'g'new_arr[2] = 'b'new_arr[3] = 'a'new_arr[4] = 'r'. continuing "through" a[1] with the same new_arrnew_arr[N] = 'r'ne

arrays

2008-05-19 Thread Marlin Rowley
All: Say I have an array: a = ([''],['']) How do I make it so that I now have: starting with first element (a[0])new_arr[0] = 'r'new_arr[1] = 'g'new_arr[2] = 'b'new_arr[3] = 'a'new_arr[4] = 'r'. continuing "through" a[1] with the same new_arrnew_arr[N] = 'r'ne

Re: Classmethods are evil

2008-05-19 Thread Duncan Booth
Hans Nowak <[EMAIL PROTECTED]> wrote: > The way I see it, a class method is really just sugar for a function > operating on the class, living in the class namespace. As such, they > are basically redundant, and as you point out, they can always be > replaced by a function outside the class (and i

Re: default object comparison considered harmful?

2008-05-19 Thread A.T.Hofkamp
On 2008-05-16, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 16 Mai, 10:03, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: >> Hello all, >> >> Yesterday we found the cause of a bug that has caused problems for a long >> time. >> It appeared to be the following: >> >> class A(object): >> pass >> >> pr

Professional Grant Proposal Writing Workshop (August 2008: Manchester, New Hampshire)

2008-05-19 Thread Anthony Jones
The Grant Institute's Grants 101: Professional Grant Proposal Writing Workshop will be held in Manchester, New Hampshire on August 6 - 8, 2008.  Interested development professionals, researchers, faculty, and graduate students should register as soon as possible, as demand means that seats will

Re: how would you...?

2008-05-19 Thread Martin Sand Christensen
> "inhahe" == inhahe <[EMAIL PROTECTED]> writes: inhahe> Btw, use float() to convert a textual GPA to a number. It would be much better to use Decimal() instead of float(). A GPA of 3.6001 probably doesn't make much sense; this problem doesn't arise when using the Decimal type. M

Re: Organizing a Python project

2008-05-19 Thread A.T.Hofkamp
On 2008-05-19, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm starting work on what is going to become a fairly substantial > Python project, and I'm trying to find the best way to organize > everything. The project will consist of: > > - A few applications > - Several small scri

Re: arrays

2008-05-19 Thread Gary Herron
Marlin Rowley wrote: All: Say I have an array: a = ([''],['']) How do I make it so that I now have: starting with first element (a[0]) new_arr[0] = 'r' new_arr[1] = 'g' new_arr[2] = 'b' new_arr[3] = 'a' new_arr[4] = 'r' . continuing "through" a[1] wi

Re: explain this function to me, lambda confusion

2008-05-19 Thread Arnaud Delobelle
On May 19, 5:22 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Arnaud Delobelle" <[EMAIL PROTECTED]> wrote in message [...] > | Note that the same thing can be said about generator expressions, > | which are nothing more than anonymous, non-reusable, generator > | functions. > > Right. So if some

Re: python script to windows exe

2008-05-19 Thread [EMAIL PROTECTED]
> but when i run the exe my program in not behaving as > it supposed to be.its generating some errors.i dont know why this > thing is happening as when i run my script it works fine.can some one > put some light here. There is nothing special in executables produced by py2exe. I mean that the debu

Re: TPCServer and xdrlib

2008-05-19 Thread Laszlo Nagy
It is possible to change the serialization used by Pyro http://pyro.sourceforge.net/manual/9-security.html#pickle to the the 'gnosis' XML Pickler. As I said earlier, I would not use XML. Just an example - I need to be able to transfer image files, word and excel documents. How silly it

Re: Reading Java byte[] data stream over standard input

2008-05-19 Thread Marc 'BlackJack' Rintsch
On Mon, 19 May 2008 00:14:25 -0700, sapsi wrote: > Yes, that could be the case. Browsing through hadoop's source, i see > stdin in the above code is reading from piped Java DataOutputStream. > I read of a libray on the net Javadata.py that reads this but it has > disappeared. > What is involved in

Re: Classmethods are evil

2008-05-19 Thread Bruno Desthuilliers
Ivan Illarionov a écrit : After re-reading "Python is not Java" I finally came to conclusion that classmethods in Python are a very Bad Thing. > I can't see any use-case of them that couldn't be re-written more clearly with methods of metaclass or plain functions. Plain functions don't give

Re: python script to windows exe

2008-05-19 Thread Benjamin Kaplan
On Mon, May 19, 2008 at 3:32 AM, sandeep <[EMAIL PROTECTED]> wrote: > hi all > > i am very much a newbie to python but has some experience of > development.i am trying to write a script which will loop through the > outlook 2003 inbox and save the email data in an simple data.html page > and save

Re: python script to windows exe

2008-05-19 Thread sandeep
On May 19, 1:39 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > but when i run the exe my program in not behaving as > > it supposed to be.its generating some errors.i dont know why this > > thing is happening as when i run my script it works fine.can some one > > put some light here. > > Th

ANN: eric 4.1.4 released

2008-05-19 Thread Detlev Offenbach
Hi, this is to inform all of you about the immediate availability of eric 4.1.4. It includes a fix for an API change of Qt 4.4, that caused eric4 to crash. Please update immediately. As usual, it is available via http://www.die-offenbachs.de/eric/index.html. What is eric? - Eric is a

Re: Using Python for programming algorithms

2008-05-19 Thread Bruno Desthuilliers
Henrique Dante de Almeida a écrit : On May 17, 7:32 pm, Vicent Giner <[EMAIL PROTECTED]> wrote: Hello. (snip) However, it is usually said that Python is not a compiled but interpreted programming language —I mean, it is not like C, in that sense. (snip) I guess that python is not a good la

"Disabling" raw string to print newlines

2008-05-19 Thread kuratkull
Hello, *** import urllib2 import re import string import sys url = "http://www.macgyver.com/"; request = urllib2.Request(url) opener = urllib2.build_opener() html = opener.open(request).read() match = re.compile("(.+)", re.DOTALL) out = match.findall(html) print out **

Re: Showing the method's class in expection's traceback

2008-05-19 Thread Gabriel Genellina
En Sun, 18 May 2008 17:31:44 -0300, Diez B. Roggisch <[EMAIL PROTECTED]> escribió: > Agustin Villena schrieb: >> is there anyway to show the class of a method in an exception's >> traceback? >> >> I want to improve the line >> File "G:\dev\exceptions\sample.py", line 3, in foo >> >> to >> File "G

Re: python script to windows exe

2008-05-19 Thread sandeep
hi the py code that i have written is here.when i run this code i wont get any errors it just works fine for me.but when i created the exe i start getting an error in my 'getMailContent' function. The error description is TypeError:unsupported operand type(s) for :- 'instance' and 'int' i dont k

Re: "Disabling" raw string to print newlines

2008-05-19 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hello, > > *** > import urllib2 > import re > import string > import sys > > url = "http://www.macgyver.com/"; > request = urllib2.Request(url) > opener = urllib2.build_opener() > html = opener.open(request).read() > > match = re.compile("(.+)", re.DOTALL)

Re: Using Python for programming algorithms

2008-05-19 Thread Bruno Desthuilliers
Vicent Giner a écrit : Hello. I am new to Python. It seems a very interesting language to me. Its simplicity is very attractive. However, it is usually said that Python is not a compiled but interpreted programming language cf my answer to you and Henrique on this. I am working on my PhD T

Re: Using Python for programming algorithms

2008-05-19 Thread Tim Golden
Bruno Desthuilliers wrote: 2/ actually, all known Python implementations compile to byte-code. In curiosity, did your "actually" mean, in the French sense, "at the moment" or, in the English sense, "in contrast to something stated earlier"? Or maybe both? TJG -- http://mail.python.org/mailma

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Bruno Desthuilliers
John Salerno a écrit : Hey all. Just thought I'd ask a general question for my own interest. Every time I think of something I might do in Python, it usually involves creating a GUI interface, so I was wondering what kind of work you all do with Python that does *not* involve any GUI work. This c

Re: explain this function to me, lambda confusion

2008-05-19 Thread Bruno Desthuilliers
inhahe a écrit : Both the responses offer lambda free alternatives. That's fine, and given the terse documentation and problems that I had understanding them, I would agree. So what applications are lambdas suited to? I think the parameterised function model is one. What else? i've hardly ever

Re: Showing the method's class in expection's traceback

2008-05-19 Thread Diez B. Roggisch
> > That by itself is not enough, the method could be inherited; one should > walk the base classes in the MRO to find the right one. And deal with > classmethods and staticmethods. And decorators that don't preserve meta > information... Hmmm, I think it isn't so trivial as it seems. You might e

pickle internals

2008-05-19 Thread Rustom Mody
I am trying to understand pickle internals. This involves: -- the algorithm(s) used for traversal arbitrary structures -- the pickle format -- the use if any of introspection I'll be thankful for any pointers PS Should this question be put on some other list?/ -- http://mail.python.org/mailman/li

Re: Get all the instances of one class

2008-05-19 Thread Nick Craig-Wood
Matt Nordhoff <[EMAIL PROTECTED]> wrote: > Tommy Nordgren wrote: > > class MyClass : a_base_class > > memberlist=[] > > > > # Insert object in memberlist when created; > > # note: objects won't be garbage collected until removed from memberlist. > > Just to say, if you wanted to go abou

Re: Using Python for programming algorithms

2008-05-19 Thread Bruno Desthuilliers
Tim Golden a écrit : Bruno Desthuilliers wrote: 2/ actually, all known Python implementations compile to byte-code. In curiosity, did your "actually" mean, in the French sense, "at the moment" or, in the English sense, "in contrast to something stated earlier"? Or maybe both? I mainly inte

Re: Reading Java byte[] data stream over standard input

2008-05-19 Thread Giles Brown
On 19 May, 06:11, sapsi <[EMAIL PROTECTED]> wrote: > Hello, > I am using HadoopStreaming using a BinaryInputStream. What this > basically does is send a stream of bytes ( the java type is : private > byte[] bytes) to my python program. > > I have done a test like this, > while 1: > x=sys.s

Re: Organizing a Python project

2008-05-19 Thread Jorge Godoy
A.T.Hofkamp wrote: > Also, why do you make a distinction between shared and non-shared code? > You could simply eliminate 'shared' directory, and put its contents > directly under myproject. I would go further and make them individual projects, with their own version control, code repository and

ftplib returns EOFError

2008-05-19 Thread Jon Bowlas
Hi All, I've written a little method to connect to an ftpserver which works well, however when I send a file using this ftp connection oddly I _sometimes_ get returned an EOFError from ftplib.getline even though my file is actually transferred. Here's my script: def uploadViaFtp(self, file,

Re: "indexed properties"...

2008-05-19 Thread David C. Ullrich
On Sun, 18 May 2008 18:18:34 +0200, pataphor <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, >[EMAIL PROTECTED] says... > >> Is there some reason that would be better? It would make a lot >> of the code more complicated. Ok, it would require only one >> bit of added code, I suppose, b

Re: New to Python, Discussion Groups.

2008-05-19 Thread Fuzzyman
On May 19, 1:34 am, cmoller <[EMAIL PROTECTED]> wrote: > Hi, > > I am new to Python and the use of discussion groups. Is there a FAQ > for basic information so certain questions are not repeated? > > I am NOT an experienced programmer, but have decided to write a data > logger for sensors sending d

Re: "indexed properties"...

2008-05-19 Thread pataphor
On Mon, 19 May 2008 06:29:18 -0500 David C. Ullrich <[EMAIL PROTECTED]> wrote: > Maybe you could be more specific? Various "positions" I've > taken in all this may well be untenable, but I can't think > of any that have anything to do with whether the data should > be a single list instead of a li

Re: python script to windows exe

2008-05-19 Thread Fuzzyman
On May 19, 8:32 am, sandeep <[EMAIL PROTECTED]> wrote: > hi all > > i am very much a newbie to python but has some experience of > development.i am trying to write a script which will loop through the > outlook 2003 inbox and save the email data in an simple data.html page > and save all the attach

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread janislaw
On May 19, 12:20 am, John Salerno <[EMAIL PROTECTED]> wrote: > Hey all. Just thought I'd ask a general question for my own interest. Every > time I think of something I might do in Python, it usually involves creating > a GUI interface, so I was wondering what kind of work you all do with Python

Re: "Disabling" raw string to print newlines

2008-05-19 Thread Paul McGuire
On May 19, 4:54 am, [EMAIL PROTECTED] wrote: > Hello, > > *** > import urllib2 > import re > import string > import sys > > url = "http://www.macgyver.com/"; > request = urllib2.Request(url) > opener = urllib2.build_opener() > html = opener.open(request).read() > > match = re.compile("(

Re: explain this function to me, lambda confusion

2008-05-19 Thread Terry Reedy
"Arnaud Delobelle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On May 19, 5:22 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: | > "Arnaud Delobelle" <[EMAIL PROTECTED]> wrote in message | [...] | > | Note that the same thing can be said about generator expressions, | > | which are

Re: "Disabling" raw string to print newlines

2008-05-19 Thread Paul McGuire
On May 19, 4:54 am, [EMAIL PROTECTED] wrote: > Hello, > > > print out > ** Since you have no control over spacing and line breaks in the input, you can reformat using the textwrap module. First replace all "\n"s with " ", then use re.sub to replace multiple spaces with a single space

Re: "Disabling" raw string to print newlines

2008-05-19 Thread Paul McGuire
On May 19, 8:09 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > On May 19, 4:54 am, [EMAIL PROTECTED] wrote:> Hello, > > > > > > > print out > > ** > > Since you have no control over spacing and line breaks in the input, > you can reformat using the textwrap module.  First replace all "\

Re: python script to windows exe

2008-05-19 Thread Gabriel Genellina
En Mon, 19 May 2008 06:59:22 -0300, sandeep <[EMAIL PROTECTED]> escribió: > the py code that i have written is here.when i run this code i wont > get any errors it just works fine for me.but when i created the exe i > start getting an error in my 'getMailContent' function. The error > description

Re: Reading Java byte[] data stream over standard input

2008-05-19 Thread John Machin
sapsi wrote: I should also mention that for some reason there are several binay values popping in between for some reason. This behavior (for the inputr stream) is not expected Now, the incoming data is binary(though mine is actually merely ascii text) but the output is not what is expected. I

Re: TPCServer and xdrlib

2008-05-19 Thread Laszlo Nagy
I'm trying to write a multi threaded TPC server. I have used xmlrpc How exactly did you come to the conclusion that your server must be multi threaded ? I don't think that it is important. But if you are interested: - yes, the server will probably be I/O bound, not CPU bound - I'm h

Re: pickle internals

2008-05-19 Thread Gabriel Genellina
En Mon, 19 May 2008 07:52:25 -0300, Rustom Mody <[EMAIL PROTECTED]> escribió: > I am trying to understand pickle internals. > This involves: > -- the algorithm(s) used for traversal arbitrary structures > -- the pickle format > -- the use if any of introspection > > I'll be thankful for any pointe

Re: Using Python for programming algorithms

2008-05-19 Thread Roel Schroeven
Bruno Desthuilliers schreef: 1/ being interpreted or compiled (for whatever definition of these terms) is not a property of a language, but a property of an implementation of a language. 2/ actually, all known Python implementations compile to byte-code. You keep saying that, and in theory

Re: Organizing a Python project

2008-05-19 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hello all, | | I'm starting work on what is going to become a fairly substantial | Python project, and I'm trying to find the best way to organize | everything. The project will consist of: | | - A few applications | - Several small sc

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Ken Starks
John Salerno wrote: Hey all. Just thought I'd ask a general question for my own interest. Every time I think of something I might do in Python, it usually involves creating a GUI interface, so I was wondering what kind of work you all do with Python that does *not* involve any GUI work. This c

Re: explain this function to me, lambda confusion

2008-05-19 Thread Paul McGuire
On May 18, 10:41 am, "inhahe" <[EMAIL PROTECTED]> wrote: > > Both the responses offer lambda free alternatives. That's fine, and > > given the terse documentation and problems that I had understanding > > them, I would agree. So what applications are lambdas suited to? I > > think the parameterised

Re: Using Python for programming algorithms

2008-05-19 Thread Diez B. Roggisch
Roel Schroeven wrote: > Bruno Desthuilliers schreef: >> 1/ being interpreted or compiled (for whatever definition of these >> terms) is not a property of a language, but a property of an >> implementation of a language. >> >> 2/ actually, all known Python implementations compile to byte-code. >>

Re: Showing the method's class in expection's traceback

2008-05-19 Thread Agustin Villena
On May 18, 4:31 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Agustin Villena schrieb: > > > > > Hi! > > > is there anyway to show the class of amethodin an exception's > > traceback? > > > For example, the next code > > > class Some(object): > > def foo(self,x): > > raise Excepti

printing class __dict__

2008-05-19 Thread [EMAIL PROTECTED]
hi, i am a newbie. so bear wth me i wrote a program like this -- class H(object): def __init__( self): self.data =10 def e ( self ): pass def f ( self ): pass class H1(H): x2 = 11 def __init__(self): self.x = 10 class details(object): def data(self,className):

Re: printing class __dict__

2008-05-19 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > hi, > i am a newbie. so bear wth me > i wrote a program like this > -- > class H(object): > def __init__( self): > self.data =10 > def e ( self ): > pass > def f ( self ): > pass > > class H1(H): > x2 = 11 > def __init__(self): > self.x = 10 >

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Mike Driscoll
On May 18, 5:20 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Hey all. Just thought I'd ask a general question for my own interest. Every > time I think of something I might do in Python, it usually involves creating > a GUI interface, so I was wondering what kind of work you all do with Python

Re: distutils directory problem

2008-05-19 Thread Mike Driscoll
On May 18, 3:31 pm, Martin Manns <[EMAIL PROTECTED]> wrote: > Hi, > > I have the following problem with the distutils package: > (I have now spent hours reading and searching the manuals and tutorials, > and I am still stuck.) > > I have a working directory > ~/pyspread > in which my libraries are

Re: addendum Re: working with images (PIL ?)

2008-05-19 Thread Poppy
Thanks, since posting I figured out how to interpret the histogram results, which seems to be the consensus in responses. I wrote a check image program and have been periodically calling it against a folder where I make a copy of our images used for production. My method right now is to check w

Re: "Disabling" raw string to print newlines

2008-05-19 Thread kuratkull
On May 19, 4:01 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On May 19, 4:54 am, [EMAIL PROTECTED] wrote: > > > > > Hello, > > > *** > > import urllib2 > > import re > > import string > > import sys > > > url = "http://www.macgyver.com/"; > > request = urllib2.Request(url) > > opener =

ANN: Urwid 0.9.8.2 - Console UI Library

2008-05-19 Thread Ian Ward
Announcing Urwid 0.9.8.2 Urwid home page: http://excess.org/urwid/ Tarball: http://excess.org/urwid/urwid-0.9.8.2.tar.gz RSS: http://excess.org/feeds/tag/urwid/ About this release: === This is a maintenance release that fixes a number of bugs th

scope of optional arguments

2008-05-19 Thread cseja
If I call print walk([1,2,3], []) print walk([5,6,7]) I get [1, 2, 3] [4, 5, 6] but when I call print walk([1,2,3]) print walk([5,6,7]) I get [1, 2, 3] [1, 2, 3, 4, 5, 6] at stdout, where def walk(seq, result = []): for item in seq: result.append(item) return result Does that mean

Re: scope of optional arguments

2008-05-19 Thread Steven Clark
http://www.ferg.org/projects/python_gotchas.html#contents_item_6 On Mon, May 19, 2008 at 10:30 AM, cseja <[EMAIL PROTECTED]> wrote: > If I call > > print walk([1,2,3], []) > print walk([5,6,7]) > > I get > > [1, 2, 3] > [4, 5, 6] > > but when I call > > print walk([1,2,3]) > print walk([5,6,7]) >

Re: scope of optional arguments

2008-05-19 Thread cseja
Whoops, I meant to call print walk([1,2,3], []) print walk([4,5,6]) and print walk([1,2,3]) print walk([4,5,6]) with def walk(seq, result = []): for item in seq: result.append(item) return result The question is still the same: Why do both calls give different results? Thank you very

Re: scope of optional arguments

2008-05-19 Thread cseja
Thank you very much for your fast and usefull response, Steven. Have a nice day. -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a bug in urlunparse/urlunsplit

2008-05-19 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, Alex <[EMAIL PROTECTED]> wrote: > Hi all. > > Is there a bug in the urlunparse/urlunsplit functions? > Look at this fragment (I know is quite silly): > > urlunparse(urlparse('www.example.org','http')) > ---> 'http:///www.example.org' >^ > > Ther

Re: installing MySQLdb module

2008-05-19 Thread zaphotbretzel
Hi Rafael, > I googled around and people say you need the "-dev" package of mysql > in order to have the C headers...where can you download this for mac > os? > PS I am running XAMPP (http://www.keitr.com/tutorials/xampp) if that > changes anything Ok, here my solution to the problem (Mac OS X 10

Running commands on cisco routers using python

2008-05-19 Thread SPJ
Is it possible to run specific commands on cisco router using Python? I have to run command "show access-list" on few hundred cisco routers and get the dump into a file. Please let me know if it is feasible and the best way to achieve this. Thanks, SPJ -- http://mail.python.org/mailma

Re: TPCServer and xdrlib

2008-05-19 Thread Henrique Dante de Almeida
On May 19, 10:28 am, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > > I don't think that it is important. But if you are interested: > > - yes, the server will probably be I/O bound, not CPU bound > - I'm have experience with thread programming, but not with twisted That part was just to show you that

Newbie: Keep TCP socket open

2008-05-19 Thread Alan Wright
Hi Folks, I am newbie to Python, but have successfully created a simple client and server setup, I have one issue though. I am trying to test a box by sending many TCP conns (WHILE loop) but not closing them with a FIN/RST. However, no matter what i do, i cannot get the loop to stop sending FIN

Re: Running commands on cisco routers using python

2008-05-19 Thread Mike Driscoll
On May 19, 10:18 am, SPJ <[EMAIL PROTECTED]> wrote: > Is it possible to run specific commands on cisco router using Python? > I have to run command "show access-list" on few hundred cisco routers and get > the dump into a file. Please let me know if it is feasible and the best way > to achieve th

Re: Newbie: Keep TCP socket open

2008-05-19 Thread s0suk3
On May 19, 10:25 am, "Alan Wright" <[EMAIL PROTECTED]> wrote: > Hi Folks, > I am newbie to Python, but have successfully created a simple client and > server setup, I have one issue though. > > I am trying to test a box by sending many TCP conns (WHILE loop) but not > closing them with a FIN/RST. H

Re: Using Python for programming algorithms

2008-05-19 Thread Henrique Dante de Almeida
On May 19, 6:52 am, Bruno Desthuilliers wrote: > Henrique Dante de Almeida a écrit : > > > On May 17, 7:32 pm, Vicent Giner <[EMAIL PROTECTED]> wrote: > >> Hello. > > (snip) > >> However, it is usually said that Python is not a compiled but > >> interpreted programming language —I mean, it is not

[no subject]

2008-05-19 Thread ervin.ramonllari
Hi there, I'm trying to install PyGreSQL for python 2.4. the installation seems to be done correctly, but when I try to import the pgdb module I got the message: >>> import pgdb Traceback (most recent call last): File "", line 1, in -toplevel- import pgdb File "C:\Python24\Lib\site-packag

Re: explain this function to me, lambda confusion

2008-05-19 Thread Arnaud Delobelle
Paul McGuire <[EMAIL PROTECTED]> writes: [...] > lambda is handy in defining parse actions in pyparsing. Parse actions > are callbacks to be run when an expression within a larger grammar is > matched. A common use for parse actions is to do some sort of text or > type conversion. The simplest

Re: Using Python for programming algorithms

2008-05-19 Thread Henrique Dante de Almeida
On May 19, 7:03 am, Bruno Desthuilliers wrote: > Vicent Giner a écrit : > > > Hello. > > > I am new to Python. It seems a very interesting language to me. Its > > simplicity is very attractive. > > > However, it is usually said that Python is not a compiled but > > interpreted programming language

Re: Using Python for programming algorithms

2008-05-19 Thread Robin Becker
Vicent Giner wrote: Hello. I am new to Python. It seems a very interesting language to me. Its simplicity is very attractive. However, it is usually said that Python is not a compiled but interpreted programming language —I mean, it is not like C, in that sense. ... I programmed several

Re: Dbase / foxpro files

2008-05-19 Thread Ethan Furman
Johny wrote: Thanks for your reply.Is it possible to delete a record by using the module? Thanks L> -- http://mail.python.org/mailman/listinfo/python-list It is possible with mine. To clarify an earlier post, my module is for dBase III and VFP 6.0 files only (those were the only two I neede

Re: PyGreSQL installation

2008-05-19 Thread D'Arcy J.M. Cain
On Mon, 19 May 2008 18:00:30 +0200 <[EMAIL PROTECTED]> wrote: > Hi there, > > I'm trying to install PyGreSQL for python 2.4. I assume that you got the installer from http://www.PyGreSQL.org/. If so, please join the PyGreSQL list (see above URL) and explain the problem there. It's my module but I

Re: Thread killing - I know I know!

2008-05-19 Thread Roger Heathcote
[EMAIL PROTECTED] wrote: On May 16, 11:40 am, Roger Heathcote <[EMAIL PROTECTED]> wrote: Despite many peoples insistence that allowing for the arbitrary killing of threads is a cardinal sin and although I have no particular threading problem to crack right now I remain interest in the taboo that

Re: addendum Re: working with images (PIL ?)

2008-05-19 Thread Ken Starks
I would still be concerned that you are checking against the percentage of the 768 bins returned by the histogram method. Two pixels of widely different colour end up in the same bin, so long as just ONE of the Red, Green, or Blue components is equal. So, for example, colours (2, 27, 200) and (20

Re: Thread killing - I know I know!

2008-05-19 Thread Chris Mellon
On Mon, May 19, 2008 at 11:36 AM, Roger Heathcote <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> >> On May 16, 11:40 am, Roger Heathcote <[EMAIL PROTECTED]> >> wrote: >>> >>> Despite many peoples insistence that allowing for the arbitrary killing >>> of threads is a cardinal sin and altho

Using StringVars in List of Dictionaries as tkInter variables for Scale and Label widgets

2008-05-19 Thread seanacais
I'm trying to build an unknown number of repeating gui elements dynamically so I need to store the variables in a list of dictionaries. I understand that Scale "variable" name needs to be a StringVar but I cannot figure out how to initialize the dictionary. I've tried the following code ps =

Re: python script to windows exe

2008-05-19 Thread David C. Ullrich
On Mon, 19 May 2008 02:59:22 -0700 (PDT), sandeep <[EMAIL PROTECTED]> wrote: > >hi >the py code that i have written is here.when i run this code i wont >get any errors it just works fine for me.but when i created the exe i >start getting an error in my 'getMailContent' function. The error >descrip

Python and Plone Boot Camps in Chapel Hill, NC

2008-05-19 Thread Chris Calloway
Triangle (NC) Zope and Python Users Group (TriZPUG) is proud to open registration for our fourth annual ultra-low cost Plone and Python training camps, BootCampArama 2008: http://trizpug.org/boot-camp/2008/ Registration is now open for: PyCamp: Python Boot Camp, August 4 - 8 Plone Boot Camp:

Re: Using Python for programming algorithms

2008-05-19 Thread Vicent Giner
Thank you very much for all the answers I've got. As far as I have understood, Python can be a good alternative, or, at least, a reasonable choice. I intend to design new algorithms for a kind of Optimization problems, and then I have to implement them and show/prove that they are good enough, in

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Daniel Fetchinson
> > Hey all. Just thought I'd ask a general question for my own interest. >> Every time I think of something I might do in Python, it usually >> involves creating a GUI interface, so I was wondering what kind of >> work you all do with Python that does *not* involve any GUI work. >> This could be

Re: Using Python for programming algorithms

2008-05-19 Thread Vicent Giner
On May 19, 6:11 pm, Henrique Dante de Almeida <[EMAIL PROTECTED]> wrote: > On May 19, 7:03 am, Bruno Desthuilliers > I'm pretty sure about that: when the algorithms take 4 hours to test > a single execution, you value processor time. Yes, of course, but that should mean that I have to do it be

Re: Using StringVars in List of Dictionaries as tkInter variables for Scale and Label widgets

2008-05-19 Thread Peter Otten
seanacais wrote: > I'm trying to build an unknown number of repeating gui elements > dynamically so I need to store the variables in a list of > dictionaries. I understand that Scale "variable" name needs to be a > StringVar but I cannot figure out how to initialize the dictionary. > > I've t

sre_parse.py - over-view or explanation needed

2008-05-19 Thread korean_dave
What does sre_parse.py (Secret Labs' Regular Expression Engine) do? I see this referred to in some errors when i call the source() function (e.g. source(findFile("scripts","thisonehere.py")) ) The error then refers to name "ImportWarning" not defined?? (<--that might be a proprietary warning, as

Re: TPCServer and xdrlib

2008-05-19 Thread Irmen de Jong
Laszlo Nagy wrote: It is possible to change the serialization used by Pyro http://pyro.sourceforge.net/manual/9-security.html#pickle to the the 'gnosis' XML Pickler. As I said earlier, I would not use XML. Just an example - I need to be able to transfer image files, word and excel docu

Thread output with ncurses

2008-05-19 Thread blaine
Hey everyone, I currently have three independent applications that all 'do something' and output to the console when events are triggered. I'd like to combine these all into a single ncurses application. The idea would be that the application simply has three 'windows' or 'pads' and each thread

Re: Newbie: Keep TCP socket open

2008-05-19 Thread Irmen de Jong
Alan Wright wrote: while (num1<=10) : s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(10.0) s.connect(("10.1.1.69", 50008)) # SMTP print s.recv(1024) + '\n', num1=num1+1 #s.close() sys.exit(1) I think the following is happening: Reusing the 's' object for every ne

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Dan Upton
On Sun, May 18, 2008 at 6:20 PM, John Salerno <[EMAIL PROTECTED]> wrote: > Hey all. Just thought I'd ask a general question for my own interest. Every > time I think of something I might do in Python, it usually involves creating > a GUI interface, so I was wondering what kind of work you all do

Re: ftplib returns EOFError

2008-05-19 Thread Francesco Bochicchio
On Mon, 19 May 2008 13:27:23 +0100, Jon Bowlas wrote: > Hi All, > > I've written a little method to connect to an ftpserver which works well, > however when I send a file using this ftp connection oddly I _sometimes_ get > returned an EOFError from ftplib.getline even though my file is actually >

Re: Using StringVars in List of Dictionaries as tkInter variables for Scale and Label widgets

2008-05-19 Thread seanacais
On May 19, 2:11 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > > There's some magic going on behind the scene which means that you have to > create a Tkinter.Tk instance before you can start churning out StringVars: > > >>> import Tkinter as tk > >>> v = tk.StringVar() > > Traceback (most recent call

Re: Thread killing - I know I know!

2008-05-19 Thread blaine
How is it that you recommend killing a pure python thread? And also, when i use the 'threading' module am I creating a process, or a (gasp) thread? (Is this an obvious question - and if so, how does one create a 'process'?) Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Stef Mientki
John Salerno wrote: Hey all. Just thought I'd ask a general question for my own interest. Every time I think of something I might do in Python, it usually involves creating a GUI interface, so I was wondering what kind of work you all do with Python that does *not* involve any GUI work. This c

Re: Using Python for programming algorithms

2008-05-19 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Roel Schroeven <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers schreef: > > 1/ being interpreted or compiled (for whatever definition of these > > terms) is not a property of a language, but a property of an > > implementation of a language. > > > > 2/ actually

  1   2   >