Re: FileIO problem

2005-08-24 Thread Sybren Stuvel
Layin'_Low enlightened us with: > count = 0 > while count != 1000: > count = count + 1 > print "Admin forceclass " , count , gclas I think you want: output = file('out', 'w') gclas = raw_input("What is the class:") for count in range(1000): output.write("Admin forceclass %4i %s\n"

Re: shelve non-transparency

2005-08-24 Thread Michele Simionato
The option writeback=True seems to work: # put something in the shelve import shelve class C(object): pass s = shelve.open("x.shelve") s["x"] = C() s.close() # read it s = shelve.open("x.shelve", writeback=True) c = s["x"] c.attr = 1 print s["x"].attr # => 1 s.close() Michele

Re: FileIO problem

2005-08-24 Thread Laszlo Zsolt Nagy
Try this: gclas = raw_input("What is the class:") def Princlas(): count = 0 while count != 1000: count = count + 1 return "Admin forceclass %s %s " % ( count , gclas ) #asks for file name a = raw_input("What is new file name:") out_file = open(a,"w") #this is the input of t

Re: list insertion

2005-08-24 Thread Sybren Stuvel
Randy Bush enlightened us with: > hold = self.next > self.next = DaClass(value) > self.next.next = hold shouldn't that last line be this? self.next.prev = hold > but i suspect (from print statement insertions) that the result is > not as i expect. What did you expect, and wha

Re: Inline::Python, pyperl, etc.

2005-08-24 Thread Sybren Stuvel
Eli Stevens (WG.c) enlightened us with: > I've bumped into some snags with pyperl (can't import perl2.so? But > it's right there in site-packages/ !), and I'm wondering if it's bitrot > or a config error on my end. If the .so file is as old as you described, it's probably linked to an old versi

What's the matter with this code section?

2005-08-24 Thread Johnny Lee
Here is the source: #! /bin/python [EMAIL PROTECTED] This is a xunit test framework for python, see TDD for more details class TestCase: def setUp(self): print "setUp in TestCase" pass def __init__(self, name): print "__init__ in Te

Re: how to deal with space between numbers

2005-08-24 Thread Sybren Stuvel
Mohammed Altaj enlightened us with: > I managed to do all these things , but i did it in the way that i am > reading my data as strings ( no space between numbers) Keep the spaces, and use thestring.split() Sybren -- The problem with the world is stupidity. Not saying there should be a capital p

Re: how to deal with space between numbers

2005-08-24 Thread Sybren Stuvel
Mohammed Altaj enlightened us with: > Thanks a lot for your valuable answer, i like the way you code , but > i would like to use my own, You don't learn to code properly if you always stick to your own stuff... > so if it is possible for you and if you have time, please could you > fix my code, s

Re: pipes like perl

2005-08-24 Thread Sybren Stuvel
max(01)* enlightened us with: > but i need to check the success/failure of the external command > *before* closing the file! You can't, unless you have a more intimite knowledge of the command involved. If you know, for instance, that any output on stderr means an error, you can check for just tha

Re: FileIO problem

2005-08-24 Thread Layin'_Low
thnx guys it was late and had just come from a bar and didnt reread the lines. thnx again for the help -- http://mail.python.org/mailman/listinfo/python-list

Re: python asp page keeps state across queries !?!?

2005-08-24 Thread Sybren Stuvel
nicolas_riesch enlightened us with: > I notice that variables outside functions keep their value across > queries. I don't know if it is normal. I think it's normal. > To be sure, I tried a similar asp script written in VB script, and I > can see that in VBscript, variables at this same level AR

Re: py-serial + CSV

2005-08-24 Thread Sybren Stuvel
McBooCzech enlightened us with: > This (according to your suggestions) is my code which works for me > > import serial > s = serial.Serial(port=0,baudrate=4800, timeout=20) > while 1: > line = s.readline() > words = line.split(',') > if words[0]=="$GPRMC": > print wo

Re: Doubt C and Python

2005-08-24 Thread praba kar
--- James <[EMAIL PROTECTED]> wrote: > > Some people with C background use Python instead > > of programming in C.why? > > Becuase it is much more efficient. > > -James What why it is more efficient. Kindly let me know with some details. regards Prabahar

Re: Network performance

2005-08-24 Thread Richie Hindle
[Roland] > The client sends a number of lines (each ending with \n) and ends one > set of lines with a empty line. > [...] > I was surprised to find that the performance was [poor]. Are you sending all the lines in a single packet: >>> sock.send('\n'.join(lines)) or sending them one at a time

reg packages examples

2005-08-24 Thread praba kar
Dear All, I want to know about Modules and packages. I can understand about Modules but I cannot understand about Packages. Kindly let me know about Packages with small example. I can understand conceptually but I don't know how to write programmatically. regards Prabahar

Re: Anyone recognize this numeric storage format - similar to "float", but not quite

2005-08-24 Thread Terry Reedy
This appears to be a repost, perhaps not by the op but due to a glitch somewhere, of a question posted about a month ago and answered. <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > We are working on a project to decipher a record structure of an old > accounting system that origi

Reg Python Modules/Packages

2005-08-24 Thread praba kar
Dear All, I know how to use modules. But I want to know how to create package. Can any one let me know how to write package through small specimen code. regards PRabahar Send a rakhi to your brother

execfile in global scope

2005-08-24 Thread v . vayer
I need to execfile() from a function in order to set value for a global variable from inside the executed file. I know there are "globals" and "locals" optional arguments for execfile, but I just can't figure out how to use them correctly. Here is an example: Change.py = x = 555 Main.py =

Re: while c = f.read(1)

2005-08-24 Thread Antoon Pardon
Op 2005-08-24, Magnus Lycka schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Such a PEP would have no chance of being accepted, since >> it would break to much existing code. > > What's the point of this thread then? I only hope to impress people that the way python treats 'nothing' in a con

Re: list insertion

2005-08-24 Thread Ross Wilson
On Tue, 23 Aug 2005 20:58:11 -0700, Randy Bush wrote: > i am trying to insert into a singly linked list > > hold = self.next > self.next = DaClass(value) > self.next.next = hold > > but i suspect (from print statement insertions) that the result > is not as i expect. as the concept

slip beta code released

2005-08-24 Thread vpr
Hi All Just released the code from my little excusion in socket coding with Python. I still need many pointers esp wrt. the way I hacked wx into the code. Comments welcomed. Quick start --- start up the service: slip.py -s all hosts running slip will be discovered, to see who else is ar

Re: Line Removal strategy

2005-08-24 Thread Bengt Richter
On 23 Aug 2005 14:07:15 -0700, "PyPK" <[EMAIL PROTECTED]> wrote: >Hi I am looking for a simple algorithm for removing straight lines in a >given Image using something like an PIL or simpler. > The simplest is if you are in control of drawing in the first place and don't draw the lines ;-) Otherwis

Re: What's the matter with this code section?

2005-08-24 Thread Simon Brunning
On 24 Aug 2005 00:18:00 -0700, Johnny Lee <[EMAIL PROTECTED]> wrote: > AttributeError: WasRun instance has no attribute 'wasSetUp' It means exactly what it says. The last line of your TestCaseTest classes testSetUp method refers to test.wasSetUp. So far as I can see, test is an instance of your Wa

Re: loop in python

2005-08-24 Thread bruno modulix
Terry Hancock wrote: > On Tuesday 23 August 2005 05:35 am, bruno modulix wrote: > (snip) >> >>If you hope to be taken seriously, please abandon the sms-talk style here. >> > > > I think it's reasonably clear that neither poster hoped "to be taken > seriously". :-D > Err... I guess that "to be

Re: Anyone recognize this numeric storage format - similar to "float", but not quite

2005-08-24 Thread Bengt Richter
On 23 Aug 2005 19:04:45 -0700, [EMAIL PROTECTED] wrote: >We are working on a project to decipher a record structure of an old >accounting system that originates from the late80's mid-90's. >We have come across a number format that appears to be a "float" but >doesn't match any of the more standard

Re: Externally-defined properties?

2005-08-24 Thread Bengt Richter
On Wed, 24 Aug 2005 01:15:03 -0500, Terry Hancock <[EMAIL PROTECTED]> wrote: >Frankly, I was surprised this worked at all, but I tried >creating a property outside of a class (i.e. at the module >level), and it seems to behave as a property: > def get_x(ob): >... global x >... return

Inheritance problem ?

2005-08-24 Thread tooper
Hello all, I'm trying to implement a common behavior for some object that can be read from a DB or (when out of network) from an XML extract of this DB. I've then wrote 2 classes, one reading from XML & the other from the DB, both inheritating from a common one where I want to implement several co

Re: Anyone recognize this numeric storage format - similar to "float", but not quite

2005-08-24 Thread Bengt Richter
On Wed, 24 Aug 2005 04:10:07 -0400, "Terry Reedy" <[EMAIL PROTECTED]> wrote: ><[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> We are working on a project to decipher a record structure of an old >> accounting system that originates from the late80's mid-90's. >> We have come across

Re: Binary Trees in Python

2005-08-24 Thread Chris Smith
> "[diegueus9]" == [diegueus9] Diego Andrés Sanabria writes: [diegueus9]> Hello!!! I want know if python have binary trees and [diegueus9]> more? The latest boost, 1.33, says it has a python wrapper for the boost graph library. Boost explicitely states that it's experimental, but my

Eric3 for Windows not firing up.

2005-08-24 Thread sonicSpammersGoToHellSmooth
Hi, I downloaded Python 2.4.1 for Windows and PyQtGPL10.exe and Eric3snapshot2005-04-10.exe from http://pythonqt.vanrietpaap.nl/ They seemed to install fine. Python 2.4.1 works. I tried Linguist and Designer, but there was some entrypoint error in qt-mt3.dll. I copied this file into the c:\wind

jython debugger

2005-08-24 Thread volpadri
Hi, I am looking for an ide debugger for jython: is there someone with some suggestions ? Thanks, Adriano -- http://mail.python.org/mailman/listinfo/python-list

Re: execfile in global scope

2005-08-24 Thread tooper
What about : globdict= globals() def changevar(): global globdict execfile("changevar.py",globdict) x = 111 # global var changevar() print x # returns 111 instead of 555 -- http://mail.python.org/mailman/listinfo/python-list

Re: execfile in global scope

2005-08-24 Thread tooper
What about : globdict= globals() def changevar(): global globdict execfile("changevar.py",globdict) x = 111 # global var changevar() print x # returns 111 instead of 555 -- http://mail.python.org/mailman/listinfo/python-list

Variables in REs

2005-08-24 Thread Yoav
Anyway to set variables in REs. Meaning: I have the RE re.compile(r'/[^/]*') for example and I want to use it on both Win32 machines and Unix machnes. Meaning tha tI need to be able to control the '/' before compiling. I want to create and if and decide what the system is and then put the right

Re: list insertion

2005-08-24 Thread Randy Bush
>> hold = self.next >> self.next = DaClass(value) >> self.next.next = hold > shouldn't that last line be this? > self.next.prev = hold single threaded list > What did you expect, and what did you ovserve? i will try to distill a case randy -- http://mail.python.org/mailman/l

Re: slip beta code released

2005-08-24 Thread vpr
I forgot to say that this is my little P2P pet project. Need to send files quickly between systems without having to set up shares or start ftp servers. The idea is to make it easy to "slip" files between parties esp if they are on different OS's. -- http://mail.python.org/mailman/listinfo/pytho

Re: Variables in REs

2005-08-24 Thread tooper
Use os.sep to get / or \ or whatever character used to build pathes on the os you're working on -- http://mail.python.org/mailman/listinfo/python-list

Re: The ONLY thing that prevents me from using Python

2005-08-24 Thread Richie Hindle
[Chris] > Not to be a shill, but I'd be interested in testimonials on > http://linode.org/ > I wonder if virtualization is the next killer app. > Certainly blows the WTF my ISP? question away... I can't speak for linode.org, but I have a Xen VPS from rimuhosting.com and it's early days but so fa

Warning when doubly linked list is defined gloablly

2005-08-24 Thread chand
Hi., In my api.py file 'g_opt_list' is defined globally g_opt_list =[[],[],[],[],[],[],[]] I am using this global list in the fucntion def function (): gloabl g_opt_list when I run the py file, I am getting the Following Error SyntaxWarning: name 'g_opt_list' is used prior to global declar

Re: where does __class__ come from?

2005-08-24 Thread Diez B. Roggisch
Adriaan Renting wrote: > You might find the chapter 3.3 (in my python 2.3.4, it's "Special Method > names") in the reference manual useful, it is the only place I have found > sofar that describes most of these special methods. It does however not > contain __class__. I don't know where in the

Re: Warning when doubly linked list is defined gloablly

2005-08-24 Thread Diez B. Roggisch
chand wrote: > In my api.py file 'g_opt_list' is defined globally > g_opt_list =[[],[],[],[],[],[],[]] > > I am using this global list in the fucntion > > def function (): > gloabl g_opt_list This is obviously wrong and not the code you wrote, global being written horribly wrong - which shou

Re: Warning when doubly linked list is defined gloablly

2005-08-24 Thread Benjamin Niemann
chand wrote: > Hi., > > In my api.py file 'g_opt_list' is defined globally > g_opt_list =[[],[],[],[],[],[],[]] > > I am using this global list in the fucntion > > def function (): > gloabl g_opt_list global? > when I run the py file, I am getting the Following Error > > SyntaxWarning: n

Re: Inheritance problem ?

2005-08-24 Thread db
On Wed, 24 Aug 2005 03:34:36 -0700, tooper wrote: > Hello all, > > I'm trying to implement a common behavior for some object that can be > read from a DB or (when out of network) from an XML extract of this DB. > I've then wrote 2 classes, one reading from XML & the other from the > DB, both inhe

Re: Inheritance problem ?

2005-08-24 Thread jitya
tooper wrote: > Hello all, > > I'm trying to implement a common behavior for some object that can be > read from a DB or (when out of network) from an XML extract of this DB. > I've then wrote 2 classes, one reading from XML & the other from the > DB, both inheritating from a common one where I wan

Re: Anyone recognize this numeric storage format - similar to "float", but not quite

2005-08-24 Thread geskerrett
Thanks Bengt for directing me to your previous post. I think I agree with you on the "reversing bit" and the constant MSB. In reworking my examples I was always changing the 0 to 1. -- http://mail.python.org/mailman/listinfo/python-list

Re: reg packages examples

2005-08-24 Thread Steve Holden
praba kar wrote: > Dear All, > > I want to know about Modules and packages. > I can understand about Modules but I cannot understand > about Packages. Kindly let me > know about Packages with small example. > I can understand conceptually but I don't know > how to write programmatically. >

Re: Logging all activity on a tty/pty?

2005-08-24 Thread Benji York
Dan Stromberg wrote: > Is there a way, using python, to (voluntarily) log all activity in a > given shell, in a way that should work on pretty much all *ix's with a > port of python? If it's just a simple transcript you're wanting see "man script". -- Benji York -- http://mail.python.org/mailma

Re: Inheritance problem ?

2005-08-24 Thread tooper
Thanks, at least makes it running ! I'll have to teach myself to move to this new style classes by default anyway... -- http://mail.python.org/mailman/listinfo/python-list

wanna stop by my homemade glory hole?

2005-08-24 Thread Casee
my husband is installing an extra bathroom poolside. there is a perfect size hole (unless you have a huge cock) to stick your dick through into the adjoing room. come around the side of my house(perfect if you look like a repair man) enter into the unfisnished bathroom and I'll service you fro

Re: jython debugger

2005-08-24 Thread Fabio Zadrozny
wait one more week... until there, pydev (http://pydev.sf.net) should already have debugger support for jython. Cheers, Fabio [EMAIL PROTECTED] wrote: >Hi, >I am looking for an ide debugger for jython: is there someone with >some suggestions ? > >Thanks, > Adriano > > > -- Fabio Zad

Re: where does __class__ come from?

2005-08-24 Thread Adriaan Renting
I did mean the Language reference. chapter "Special method names". It contains a lot of the funky stuff like __dict__ and __getattr__. There is a little info in chapter 3.2 about __class__ : "__class__ is the instance's class." Adriaan Renting| Email: [EMAIL PROTECTED] ASTRON

Should I move to Amsterdam?

2005-08-24 Thread Wade
http://www.slate.com/id/2124561/entry/2124562/ Nice little series by Seth Stevenson for Americans daydreaming about emigration. Somewhere, anywhere ... maybe Amsterdam? I've never been to the Netherlands myself, but it sounds very civilized. Extra Python connection, besides the obvious one: Is "

Re: jython debugger

2005-08-24 Thread Frank LaFond
The PyDev environment (http://pydev.sourceforge.net/) for Eclipse appears to have Jython debug support, though I just tried it now and it did not work for me. The release notes http://pydev.sourceforge.net/features.html seem to suggest it should, so perhaps I just haven't configured something p

Re: What's the matter with this code section?

2005-08-24 Thread bruno modulix
Johnny Lee wrote: > Here is the source: > (snip) > class TestCaseTest(TestCase): > def testRunning(self): > print "testRunning in TestCaseTest" > test = WasRun("testMethod") > assert(not test.wasRun) > test.run() > assert(

Re: how to deal with space between numbers

2005-08-24 Thread bruno modulix
Mohammed Altaj wrote: > > Thanks a lot for your valuable answer, i like the way you code , Thanks. > but i > would like to use my own, so if it is possible for you and if you have > time, please could you fix my code, so that i can do what i want. > Because i am using the this out put to anoth

Re: Should I move to Amsterdam?

2005-08-24 Thread Adriaan Renting
Well, I'm not sure if Amsterdam is nice, but the Netherlands is o.k., except for the weather. I'd like to descripbe it as 49 weeks of autumn, 1 week of spring, 1 week of summer, 1 week of winter. Currently my employer only has an opening for a Microwave Antenna designer though, sorry no Python c

Re: Inheritance problem ?

2005-08-24 Thread jitya
The stuff on Descriptor.htm was really good . Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables in REs

2005-08-24 Thread Yoav
Such a sweet and simple way. Thanks. tooper wrote: > Use os.sep to get / or \ or whatever character used to build pathes on > the os you're working on > -- http://mail.python.org/mailman/listinfo/python-list

Getting rid of "close failed: [Errno 0] No Error" on Win32

2005-08-24 Thread Yoav
I am using os.popen3 to call a console process and get its output and stderr. However on Win32 (and not OS X) I also get the Errno message. It's printed to the screen, which I wish to keep clean. How can disable this notification? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: global interpreter lock

2005-08-24 Thread Bryan Olson
Mike Meyer wrote: > Bryan Olson writes: > >>Mike Meyer wrote: >> > The rule I follow in choosing my tools is "Use the least complex tool >> > that will get the job done." >> >>Even if a more complex tool could do the job better? > > In that case, the simpler model isn't necessarily getting

Re: Inheritance problem ?

2005-08-24 Thread tooper
Not always easy to follow but great ! Using __str__ instead of __repr__ makes it work also with old style (thanks to Simon Brunning for suggesting it, and with your link I even now understand why !) -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-24 Thread Bryan Olson
Paul Rubin wrote: > Bryan Olson writes: > >> seq[3 : -4] >> >>we write: >> >> seq[3 ; $ - 4] > > > +1 I think you're wrong about the "+1". I defined '$' to stand for the length of the sequence (not the address of the last element). >>When square-brackets appear within other sq

Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-24 Thread Bryan Olson
Kay Schluehr wrote: > Bryan Olson wrote: > >>Steven Bethard wrote: >> > Well, I couldn't find where the general semantics of a negative stride >> > index are defined, but for sequences at least[1]: >> > >> > "The slice of s from i to j with step k is defined as the sequence of >> > items wi

Unix diff command under Window.

2005-08-24 Thread TonyHa
Hello, Does any one have using Python to write a Unix "diff" command for Window? Tony Ha. -- http://mail.python.org/mailman/listinfo/python-list

[no subject]

2005-08-24 Thread bhjqsbgdhj
-- http://mail.python.org/mailman/listinfo/python-list

tkraise oddity

2005-08-24 Thread twd
I'm seeing some new and unexpected behaviour with tkinter + python2.4, in a gnome+linux environment. The code below used to work (and continues to work under windows). The intended behaviour is that a window is created the the first time the button is pushed, and then de-iconified and brought to th

Re: Jargons of Info Tech industry

2005-08-24 Thread Dragan Cvetkovic
[EMAIL PROTECTED] (Richard Bos) writes: > l v <[EMAIL PROTECTED]> wrote: > >> Mike Schilling wrote: >> > A formatting-only subset of HTML would be useful for both e-mail and >> > Usenet >> > posts. >> >> I would *agree* (your news reader may bold that last word) > > It had bloody better not.

Re: Unix diff command under Window.

2005-08-24 Thread Adriaan Renting
There probably is some free version somewhere, maybe even as part of CygWin. I've used Araxis Merge on Windows. It used to be shareware. It's nice enough that I bought it. >>>"TonyHa" <[EMAIL PROTECTED]> 08/24/05 3:50 pm >>> Hello, Does any one have using Python to write a Unix "diff" com

Re: The ONLY thing that prevents me from using Python

2005-08-24 Thread Andreas Kostyrka
On Wed, Aug 24, 2005 at 09:49:01AM +0100, Richie Hindle wrote: > > [Chris] > > Not to be a shill, but I'd be interested in testimonials on > > http://linode.org/ > > I wonder if virtualization is the next killer app. > > Certainly blows the WTF my ISP? question away... > > I can't speak for lino

Re: Should I move to Amsterdam?

2005-08-24 Thread Wouter van Ooijen (www.voti.nl)
>Nice little series by Seth Stevenson for Americans daydreaming about >emigration. Somewhere, anywhere ... maybe Amsterdam? > >I've never been to the Netherlands myself, but it sounds very >civilized. It used to be, until some lunatic (alledged to be a left-winger) killed an (alledged right-wing)

Re: Should I move to Amsterdam?

2005-08-24 Thread Armin Steinhoff
Adriaan Renting wrote: > Well, I'm not sure if Amsterdam is nice, but the Netherlands is o.k., except > for the weather. > I'd like to descripbe it as 49 weeks of autumn, 1 week of spring, 1 week of > summer, 1 week of winter. > Currently my employer only has an opening for a Microwave Antenna de

Re: Doubt C and Python

2005-08-24 Thread Grant Edwards
On 2005-08-23, praba kar <[EMAIL PROTECTED]> wrote: >>> Some people with C background use Python instead of >>> programming in C.why? >> >> Becuase it is much more efficient. >> >> -James > > What why it is more efficient. Kindly let me > know with some details. Have you read _any_ of the thre

Re: yapsnmp port issues

2005-08-24 Thread [EMAIL PROTECTED]
Solved the problem all by myself. Patch (and rationale) available on sourceforge. -- http://mail.python.org/mailman/listinfo/python-list

Re: py-serial + CSV

2005-08-24 Thread Grant Edwards
On 2005-08-24, Sybren Stuvel <[EMAIL PROTECTED]> wrote: >> import serial >> s = serial.Serial(port=0,baudrate=4800, timeout=20) >> while 1: >> line = s.readline() >> words = line.split(',') >> if words[0]=="$GPRMC": >> print words[1], words[3], words[5] >> >> I just won

Re: Unix diff command under Window.

2005-08-24 Thread Benji York
TonyHa wrote: > Does any one have using Python to write a Unix "diff" command for > Window? No, but you can get the *actual* diff command for Windows: http://unxutils.sourceforge.net/ -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Email client in Pyhton

2005-08-24 Thread knaren
Hi grp, I new to this grp and python too. i have started writing few python scripts myself. now i am planning to write a bear minimum email client in pyhton. i found the smtp module of python could serve my pupose. I can send message using mails using the smtp lib. Now i'm looking for some modules

Re: Unix diff command under Window.

2005-08-24 Thread Thomas Heller
"TonyHa" <[EMAIL PROTECTED]> writes: > Hello, > > Does any one have using Python to write a Unix "diff" command for > Window? > > Tony Ha. Yes. There's a script in your Python distribution: Tools/scripts/diff.py See also the docs for the 'difflib' standard library module. I do not know whether

Re: Bug in slice type

2005-08-24 Thread Bryan Olson
Kay Schluehr wrote: > Steven Bethard wrote: >>"The slice of s from i to j with step k is defined as the sequence of >>items with index x = i + n*k such that 0 <= n < (j-i)/k." >> >>This seems to contradict list behavior though. >> range(10)[9:-1:-2] == [] > > > No, both is correct. But

use SciPy with Python 2.4.1?

2005-08-24 Thread beliavsky
Is SciPy usable with Python 2.4.1? At http://www.scipy.org/download/ it says that 2.3.3 is recommended, and I don't see a binary for 2.4.1. -- http://mail.python.org/mailman/listinfo/python-list

Re: Email client in Pyhton

2005-08-24 Thread Michael Ekstrand
On Wed, 24 Aug 2005 20:15:01 +0530 (IST) [EMAIL PROTECTED] wrote: > now i am planning to write a bear minimum email client in > pyhton. i found the smtp module of python could serve my > pupose. I can send message using mails using the smtp lib. > Now i'm looking for some modules which can help me

a question about tkinter StringVars()

2005-08-24 Thread William Gill
Working with tkinter, I have a createWidgets() method in a class. Within createWidgets() I create several StringVars() and assign them to the textvariable option of several widgets. Effectively my code structure is: def createWidgets(self): ... var = StringVar() Entry(master,textvar

Re: Email client in Pyhton

2005-08-24 Thread Jonas Geiregat
[EMAIL PROTECTED] wrote: > Hi grp, > I new to this grp and python too. > i have started writing few python scripts myself. > > now i am planning to write a bear minimum email client in > pyhton. i found the smtp module of python could serve my > pupose. I can send message using mails using the smt

Re: gtkmozembed in fedora core 3

2005-08-24 Thread Martin DeMello
Jonas Geiregat <[EMAIL PROTECTED]> wrote: > > If you can't find any rpm's there aren't any available. > You need to compile mozilla with (I think) support for gtkmozembed but I > guess that's done by default when you compile mozilla with > ac_add_options --enable-default-toolkit=gtk2 in your moz

Re: py-serial + CSV

2005-08-24 Thread Michael Hoffman
McBooCzech wrote: > This (according to your suggestions) is my code which works for me > > import serial > s = serial.Serial(port=0,baudrate=4800, timeout=20) > while 1: > line = s.readline() > words = line.split(',') > if words[0]=="$GPRMC": > print words[1], words

Re: Email client in Pyhton

2005-08-24 Thread rafi
Mark Lutz in Programming Python, 2nd ed from O'Reilly covers the subject in chapter 11 using only the standards modules for mails and Tkinter. hth [EMAIL PROTECTED] wrote: > Hi grp, > I new to this grp and python too. > i have started writing few python scripts myself. > > now i am plannin

Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-24 Thread Bryan Olson
Steven Bethard wrote: > Bryan Olson wrote: > >> Steven Bethard wrote: >> > Well, I couldn't find where the general semantics of a negative stride >> > index are defined, but for sequences at least[1]: >> > >> > "The slice of s from i to j with step k is defined as the sequence of >> >

Re: Unix diff command under Window.

2005-08-24 Thread Dejan Rodiger
TonyHa said the following on 24.08.2005 15:50: > Hello, > > Does any one have using Python to write a Unix "diff" command for > Window? http://gnuwin32.sourceforge.net/ http://gnuwin32.sourceforge.net/packages.html Under Diffutils -- Dejan Rodiger - PGP ID 0xAC8722DC Delete wirus from e-mail a

Re: Email client in Python

2005-08-24 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hi grp, > I new to this grp and python too. > i have started writing few python scripts myself. > > now i am planning to write a bear minimum email client in > pyhton. i found the smtp module of python could serve my > pupose. I can send message using mails using the smt

Re: Unix diff command under Window.

2005-08-24 Thread jepler
Either it didn't exist at the time, or I didn't know about the diff.py that Thomas Heller mentioned in another response, so I wrote 'pyunidiff' http://unpy.net/~jepler/pyunidiff.py ah, I guess unix 'diff'-style output was added to difflib.py in 2003, while my pyunidiff dates to 2002. Jef

Re: a question about tkinter StringVars()

2005-08-24 Thread Eric Brunel
On Wed, 24 Aug 2005 15:07:27 GMT, William Gill <[EMAIL PROTECTED]> wrote: > Working with tkinter, I have a createWidgets() method in a class. > Within createWidgets() I create several StringVars() and > assign them to the textvariable option of several widgets. > Effectively my code structure is:

Default function arguments behaving badly

2005-08-24 Thread [EMAIL PROTECTED]
Hi I'm having some trouble with a function I've written in Python: def myFunction(l1,l2,result=[]): index=0 for i in l1: result.append([]) if type(i)==list: myFunction(i,l2,result[index]) else: for j in l2: result[index].appe

Re: Default function arguments behaving badly

2005-08-24 Thread rafi
[EMAIL PROTECTED] wrote: > Hi hi > I'm having some trouble with a function I've written in Python: > > def myFunction(l1,l2,result=[]): > index=0 > for i in l1: > result.append([]) > if type(i)==list: > myFunction(i,l2,result[index]) > else: >

Re: tkraise oddity

2005-08-24 Thread Eric Brunel
On 24 Aug 2005 06:57:07 -0700, twd <[EMAIL PROTECTED]> wrote: > I'm seeing some new and unexpected behaviour with tkinter + python2.4, > in a gnome+linux environment. The code below used to work (and > continues to work under windows). The intended behaviour is that a > window is created the the f

Re: Default function arguments behaving badly

2005-08-24 Thread Paul McNett
[EMAIL PROTECTED] wrote: > I'm having some trouble with a function I've written in Python: > def myFunction(l1,l2,result=[]): [snipped rest of function and explanation of what it does] > Does anyone know what is going on here? Is there an easy solution? It shined out like a supernova. It has to

Re: Default function arguments behaving badly

2005-08-24 Thread [EMAIL PROTECTED]
That works perfectly - Thanks! I'm always getting tripped up by the mutability of lists, I should really learn to look out for it more... -- http://mail.python.org/mailman/listinfo/python-list

Re: a question about tkinter StringVars()

2005-08-24 Thread William Gill
Eric Brunel wrote: > On Wed, 24 Aug 2005 15:07:27 GMT, William Gill <[EMAIL PROTECTED]> wrote: > >> Working with tkinter, I have a createWidgets() method in a class. >> Within createWidgets() I create several StringVars() and >> assign them to the textvariable option of several widgets. >> Effec

Re: Should I move to Amsterdam?

2005-08-24 Thread Tom Anderson
On Wed, 24 Aug 2005, Armin Steinhoff wrote: > Adriaan Renting wrote: > > "Wade" <[EMAIL PROTECTED]> 08/24/05 2:31 pm >>> >> >> http://www.slate.com/id/2124561/entry/2124562/ Nice little series by >> Seth Stevenson for Americans daydreaming about emigration. Somewhere, >> anywhere ... maybe

Re: The ONLY thing that prevents me from using Python

2005-08-24 Thread Magnus Lycka
Andreas Kostyrka wrote: > I cannot comment on linode as I'm not a customer. The info on the website > seems ok. But the prices are somehow laughable: I'm currently paying > EUR39 for a dedicated host (with at least 200GB traffic, I'd had to look it > up > 60GB "storage", 256MB RAM and a 2.4GHz P4

Re: while c = f.read(1)

2005-08-24 Thread Magnus Lycka
Antoon Pardon wrote: > I think he did, because both expression are not equivallent > unless some implicite constraints make them so. Values where > both expressions differ are: > > start1=67, stop1=9, start2=10, stop2=29 Ouch! That didn't occur to me. How sloppy to just assume that time periods

problems with hasattr() and custom __getattr__ inside urllib2

2005-08-24 Thread Gil Tal
Hi, I use urllib2 to download a redirected url and I get an exception from the bowels of urllib2. It seems that urllib2 implements some super sophisticated self check and tries to control the access to attributes using lots of calls to hasattr(the builtin function) and a custom __getattr__() on the

  1   2   >