Re: file locked for writing

2008-05-14 Thread Dmitry Teslenko
On Wed, May 14, 2008 at 8:18 AM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Tue, 13 May 2008 11:57:03 -0300, Dmitry Teslenko <[EMAIL PROTECTED]> > Is the code above contained in a function? So all references are released > upon function exit? Yes, it's a function > If not, you could try

Re: list.__len__() or len(list)

2008-05-14 Thread Hrvoje Niksic
"Ian Kelly" <[EMAIL PROTECTED]> writes: > On Tue, May 13, 2008 at 5:57 PM, Nikhil <[EMAIL PROTECTED]> wrote: >> __len__() is a built-in function of the list object and is updated along >> with the list object elements and will be useful incase the list is very >> huge. >> >> len() is an external

Re: Is using range() in for loops really Pythonic?

2008-05-14 Thread cokofreedom
On May 14, 8:37 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Tue, 13 May 2008 10:20:41 -0700, John Nagle wrote: > > Matt Nordhoff wrote: > > >> Well, you should use "xrange(10)" instead of "range(10)". > > >CPython really is naive. That sort of thing should be a > > compile-tim

Re: file locked for writing

2008-05-14 Thread Dmitry Teslenko
On Wed, May 14, 2008 at 11:04 AM, Dmitry Teslenko <[EMAIL PROTECTED]> wrote: > When I've rewrite code something like that: >with open(backup_file_name, 'w') as backup_file: >. > >filter.parse('') >del input, output, filter > os.re

Re: portable way to tell what Popen will call

2008-05-14 Thread Gabriel Genellina
En Tue, 13 May 2008 23:14:56 -0300, Brendan Miller <[EMAIL PROTECTED]> escribió: I need a portable way to tell what subprocess.Popen will call. For instance on unix systems, Popen will work for files flagged with the executable bit, whereas on windows Popen will work on files ending the in .e

Re: What is self.file = file for?

2008-05-14 Thread Bruno Desthuilliers
afrobeard a écrit : (top-post corrected. Please, do not top-post). On May 14, 3:08 am, [EMAIL PROTECTED] wrote: Hello! I have trouble understanding something in this code snippet: class TextReader: """Print and number lines in a text file.""" def __init__(self, file): self.fi

Re: Fill memeory with endless loop?

2008-05-14 Thread Bruno Desthuilliers
Tim Roberts a écrit : globalrev <[EMAIL PROTECTED]> wrote: and when the program get skiled because out of memory all this will be deleted from the memory? Yes. When a process is killed, all of the memory it was using is released. so there is no way that you can, by accident, fill your whole

Help with setting local variables of class

2008-05-14 Thread Mark
im trying to create a class user so that i can do r=User(1) r._user.keys() ['rating', 'last_name', 'pageviews', 'ip', 'number_polls', 'site', 'myrand', 'hotmail', 'number_activities', 'skype', 'id', 'city', 'rawpassword', 'number_useraudios', 'zip', 'number_votes', 'last_login', 'number_u

ANN: Pyrex 0.9.7.2

2008-05-14 Thread greg
Pyrex 0.9.7.2 is now available: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/ Seems I didn't quite eradicate all of the integer indexing bugs. Here's a fix for the other half. What is Pyrex? -- Pyrex is a language for writing Python extension modules. It lets you free

Re: [ANN] PPyGui emulator

2008-05-14 Thread clabepa
Stef Mientki wrote: I've ran the first real world application through PPyGui-emulator, so I think it's time to release the first version. There's lot of room for improvements and a more beautiful layout. PPyGui-emulator is build upon wxPython and released under BSD license. For remarks, screen

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 13, 9:55 pm, alex23 <[EMAIL PROTECTED]> wrote: > On May 14, 5:41 am, "inhahe" <[EMAIL PROTECTED]> wrote: > > > "George Sakkis" <[EMAIL PROTECTED]> wrote in message > > > You must be new here. It is an AS (Artificial Stupidity) trolling bot, > > > you can safely ignore its posts. > > > How do

Re: asynchat sends data on async_chat.push and .push_with_producer

2008-05-14 Thread Jean-Paul Calderone
On Tue, 13 May 2008 18:20:29 -0700 (PDT), Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: On 14 Mag, 02:56, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: Why? Isn't this why subtraction exists? If there is a call scheduled to happen at T1 and the current time is T2, then I know that after (T1

Re: portable way to tell what Popen will call

2008-05-14 Thread Ville M. Vainio
Brendan Miller <[EMAIL PROTECTED]> writes: > For instance on unix systems, Popen will work for files flagged with > the executable bit, whereas on windows Popen will work on files > ending the in .exe extension (and I don't think anything else). Is > there a portable way Actually, if you pass the

Re: Python and Flaming Thunder

2008-05-14 Thread Bruno Desthuilliers
Dave Parker a écrit : (snip spam) Please stop spamming here trying to sell your dumbass proprietary basic. -- http://mail.python.org/mailman/listinfo/python-list

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 4:32 am, [EMAIL PROTECTED] wrote: > On May 13, 9:55 pm, alex23 <[EMAIL PROTECTED]> wrote: > > > On May 14, 5:41 am, "inhahe" <[EMAIL PROTECTED]> wrote: > > > > "George Sakkis" <[EMAIL PROTECTED]> wrote in message > > > > You must be new here. It is an AS (Artificial Stupidity) trolling b

Re: Python and Flaming Thunder

2008-05-14 Thread J. Clifford Dyer
On Tue, 2008-05-13 at 10:33 -0700, Dave Parker wrote: > > You sound like a commercial. > > Get Flaming Thunder for only $19.95! It slices, it dices! > > > And while programs and libraries written in assembly may be twice as fast > > as programs and libraries written in C, ... > > It's a myth th

Re: Best way to delimit a list?

2008-05-14 Thread castironpi
On May 13, 11:25 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 13 May 2008 04:14:16 -0700 (PDT), [EMAIL PROTECTED] > declaimed the following in comp.lang.python: > > > So f is a list, rather than a file object, of which os.open would have > > returned (my initial typo redirected the mi

Re: [ANN] PPyGui emulator

2008-05-14 Thread python
Stef, Looks great!! Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Flaming Thunder

2008-05-14 Thread castironpi
On May 14, 5:53 am, "J. Clifford Dyer" <[EMAIL PROTECTED]> wrote: > On Tue, 2008-05-13 at 10:33 -0700, Dave Parker wrote: > > > You sound like a commercial. > > > Get Flaming Thunder for only $19.95!  It slices, it dices! > > > > And while programs and libraries written in assembly may be twice as

Re: Python and Flaming Thunder

2008-05-14 Thread Jean-Paul Calderone
On Wed, 14 May 2008 06:53:02 -0400, "J. Clifford Dyer" <[EMAIL PROTECTED]> wrote: On Tue, 2008-05-13 at 10:33 -0700, Dave Parker wrote: > You sound like a commercial. Get Flaming Thunder for only $19.95! It slices, it dices! > And while programs and libraries written in assembly may be twice

Re: list.__len__() or len(list)

2008-05-14 Thread Ian Kelly
On Wed, May 14, 2008 at 1:01 AM, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Have you tried it? __len__ is in fact marginally slower because it > involves a dict lookup, whereas the built-in len() knows how to cheat > and invoke __len__ through a slot in the C type struct very > efficiently. >

Re: Python and Flaming Thunder

2008-05-14 Thread Diez B. Roggisch
>>> That's also a myth. For example, if C is easy to maintain, why is >>> Flaming Thunder the only single-asset 8-by-8 shotgun cross compiler in >>> the world? There should be lots of single-asset 8-by-8 shotgun cross >>> compilers written in C, if C is easier to maintain. >>Not only is it the wo

Re: python: lexical or dynamic scope?

2008-05-14 Thread Mark Wooding
Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > AFAIK, Python has lexical scoping, with the restriction that > non-global non-local names cannot be rebound. I believe so. It's possible to implement (shallow) dynamic binding as a Python context manager, though it involves a little unpleasantness wi

Re: Python and Flaming Thunder

2008-05-14 Thread Bruno Desthuilliers
Dave Parker a écrit : 5-10 times faster for what kind of code? Mostly numerical analysis Benches, please ? I mean : benches using Python's numpy or similar packages - that is, what anyone doing numerical intensive computation in Python would use. and CGI scripting. Is there anyone stil

Re: Fill memeory with endless loop?

2008-05-14 Thread Grant Edwards
On 2008-05-14, Tim Roberts <[EMAIL PROTECTED]> wrote: > globalrev <[EMAIL PROTECTED]> wrote: > >>and when the program gets killed because out of memory all this >>will be deleted from the memory? > > Yes. When a process is killed, all of the memory it was using > is released. > >>so there is no wa

Class Methods Vs Any Other Callable

2008-05-14 Thread vbgunz
I remember learning closures in Python and thought it was the dumbest idea ever. Why use a closure when Python is fully object oriented? I didn't grasp the power/reason for them until I started learning JavaScript and then BAM, I understood them. Just a little while ago, I had a fear of decorators

Python libraries for iCalendar, which one to use?

2008-05-14 Thread tinnews
I am about to try writing a little Python utility to extract some data from an iCalendar file. A quick Google search turns up two possible libraries to use - vobject and "iCalendar package for Python". First question - have I missed any other (better?) ones? Second question - how do I choose whi

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread Diez B. Roggisch
> An instance method works on the instance > A Static method is basically a function nested within a class object > A class method is overkill? If anything, a static method is overkill. See it this way: *if* you for some reason put a method into an enclosing context - isn't it worth having a refer

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread George Sakkis
On May 14, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > An instance method works on the instance > > A Static method is basically a function nested within a class object > > A class method is overkill? > > If anything, a static method is overkill. See it this way: *if* you for some

Re: [off-topic] Usenet

2008-05-14 Thread Duncan Booth
hdante <[EMAIL PROTECTED]> wrote: > How can I access Usenet without using Google Groups ? (my ISP doesn't > have a NNTP server). Do you recommend doing so ? Yes, even those ISP's who do have a news server often seem to make a mess of maintaining it. I use news.individual.net which seems to do a

Re: list.__len__() or len(list)

2008-05-14 Thread Nikhil
Christian Heimes wrote: Ian Kelly schrieb: The purpose of obj.__len__() is to implement len(obj), which simply calls it. So obj.__len__() may be faster, but only marginally. The reason to prefer len(obj) is that if you inadvertently pass an object that does not implement __len__, you get the m

Rename field in Access DB

2008-05-14 Thread Iain King
I'm manipulating an MS Access db via ADODB with win32com.client. I want to rename a field within a table, but I don't know how to. I assume there is a line of SQL which will do it, but nothing I've tried (from searching) has worked. Basic code: import win32com.client connection = win32com.client

Re: Rename field in Access DB

2008-05-14 Thread Diez B. Roggisch
Iain King wrote: > I'm manipulating an MS Access db via ADODB with win32com.client. I > want to rename a field within a table, but I don't know how to. I > assume there is a line of SQL which will do it, but nothing I've tried > (from searching) has worked. > Basic code: > > import win32com.cli

HASH TABLES IN PYTHON

2008-05-14 Thread Blubaugh, David A.
To Whom It May Concern, I was wondering if anyone has ever worked with hash tables within the Python Programming language? I will need to utilize this ability for quick numerical calculations. Thank You, David Blubaugh This e-mail transmission contains information that is confidential

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread vbgunz
> > An instance method works on the instance > > A Static method is basically a function nested within a class object > > A class method is overkill? > > If anything, a static method is overkill... > class Foo: > >   [EMAIL PROTECTED] >    def register(cls, listener): >        cls.LISTENERS.append(

Re: list.__len__() or len(list)

2008-05-14 Thread Hrvoje Niksic
"Ian Kelly" <[EMAIL PROTECTED]> writes: > On Wed, May 14, 2008 at 1:01 AM, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: >> Have you tried it? __len__ is in fact marginally slower because it >> involves a dict lookup, whereas the built-in len() knows how to cheat >> and invoke __len__ through a slo

What's a call-tip to do?

2008-05-14 Thread Tal Einat
Hi all, I just ran into this. In IDLE (Python 2.5), the call-tip for itertools.count is: "x.__init__(...) initializes x; see x.__class__.__doc__ for signature" That's itertools.count.__init__.__doc__, while itertools.count.__doc__ is the informative doc-string ("DS" henceforth): """count([firstva

Re: Rename field in Access DB

2008-05-14 Thread Tim Golden
Iain King wrote: I'm manipulating an MS Access db via ADODB with win32com.client. I want to rename a field within a table, but I don't know how to. I assume there is a line of SQL which will do it, but nothing I've tried (from searching) has worked. Basic code: import win32com.client connectio

pretty generic question

2008-05-14 Thread castironpi
I have to talk about coding. I'm thinking about traffic, freight, scheduling, microcontrols, and acoustics. I have pretty basics understandings of the controls of computers. My knowledge is a little contrary or rare; I specialize in information interfaces, but they're not very expensive to copy,

Re: list.__len__() or len(list)

2008-05-14 Thread Duncan Booth
Nikhil <[EMAIL PROTECTED]> wrote: > Then why to have __len__() internal method at all when the built-in > len() is faster? Because the internal method is used internally. The idea is that you define __len__() on your objects when appropriate. You are not expected to ever call it. -- http://ma

Re: cgitb performance issue

2008-05-14 Thread Ethan Furman
Gabriel Genellina wrote: En Mon, 05 May 2008 15:56:26 -0300, Ethan Furman <[EMAIL PROTECTED]> escribió: I tried adding a form to our website for uploading large files. Personally, I dislike the forms that tell you you did something wrong and make you re-enter *all* your data again, so this

Re: PPyGui emulator

2008-05-14 Thread castironpi
On May 14, 7:54 am, [EMAIL PROTECTED] wrote: > Stef, > > Looks great!! > > Malcolm Nice touch on the Spin / Slider / Progress. Wink. -- http://mail.python.org/mailman/listinfo/python-list

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread Diez B. Roggisch
> When I learned about static methods, I learned they're a way to > tightly couple some functionality with a class without tying the > functionality to any of the instances. I see them as nothing more than > a design decision. To me they make some sense. Which you can say exactly about classmethod

Re: built in list generator?

2008-05-14 Thread Ethan Furman
Ben Finney wrote: Subject: Re: built in list generator? From: Ben Finney <[EMAIL PROTECTED]> Date: Wed, 14 May 2008 09:43:43 +1000 To: [email protected] To: [email protected] Newsgroups: comp.lang.python "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: globalrev schrieb: if

Re: usage of python

2008-05-14 Thread Rajarshi
On May 13, 6:57 pm, afrobeard <[EMAIL PROTECTED]> wrote: > If I were you, I'd show them actual code and how easy it is to get > things done. Showing them how to implement a GTalk Bot[http:// > code.google.com/p/pygtalkrobot/] or how to build simple arcade games > with PyGame[http://www.pygame.org/n

Re: usage of python

2008-05-14 Thread Rajarshi
Thanks to the all posters. This will be very useful! -- http://mail.python.org/mailman/listinfo/python-list

Re: HASH TABLES IN PYTHON

2008-05-14 Thread Eduardo O. Padoan
On Wed, May 14, 2008 at 12:20 PM, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > To Whom It May Concern, > > I was wondering if anyone has ever worked with hash tables within the Python > Programming language? I will need to utilize this ability for quick > numerical calculations. http://docs.py

named tuple mutability

2008-05-14 Thread castironpi
I'm concerned over the future of Python. Should tuples be named? -- http://mail.python.org/mailman/listinfo/python-list

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread vbgunz
> > Instance methods make the most sense. A static method makes sense too > > *but* I can see how a class method not only does what a static method > > does but how a class method *also* gets the cls reference for free. > > I don't understand the last part - but I certainly agree on the "instance >

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread vbgunz
> > > Instance methods make the most sense. A static method makes sense too > > > *but* I can see how a class method not only does what a static method > > > does but how a class method *also* gets the cls reference for free. > > > I don't understand the last part - but I certainly agree on the "in

Re: What is self.file = file for?

2008-05-14 Thread castironpi
On May 14, 2:26 am, Bruno Desthuilliers wrote: > afrobeard a écrit : > > (top-post corrected. Please, do not top-post). > > > > > > > On May 14, 3:08 am, [EMAIL PROTECTED] wrote: > >> Hello! > > >> I have trouble understanding something in this code snippet: > > >> class TextReader: > >>     """Pr

Re: SOAP/ZSI post/get for Java Web App

2008-05-14 Thread Waldemar Osuch
On May 13, 1:02 pm, Jennifer Duerr <[EMAIL PROTECTED]> wrote: > All, > > I need help concerning SOAP, Python and XML. I am very new to this, so > dumbing it down for me will not offend me! > > I'm using Python and want to send a user-inputted string to an > existing Java web app that > will output

Re: Usenet

2008-05-14 Thread castironpi
On May 14, 11:58 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Duncan Booth" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | I also recommend Gmane which provides a free news server for most mailing > | lists: mailing lists are a lot more manageable when gatewayed into a news

Re: Purpose of operator package

2008-05-14 Thread Matthew Woodcraft
I V <[EMAIL PROTECTED]> wrote: > I hadn't heard of operator.truth before. Does it do anything different > from bool(x) ? Not really. It was occasionally useful before the bool type existed; now it's just a leftover. -M- -- http://mail.python.org/mailman/listinfo/python-list

Re: built in list generator?

2008-05-14 Thread Andrii V. Mishkovskyi
2008/5/14 Ethan Furman <[EMAIL PROTECTED]>: > > Ben Finney wrote: > > > Subject: Re: built in list generator? > > From: Ben Finney <[EMAIL PROTECTED]> > > Date: Wed, 14 May 2008 09:43:43 +1000 > > To: [email protected] > > To: [email protected] > > Newsgroups: comp.lang.python > > "Diez

Re: Purpose of operator package

2008-05-14 Thread castironpi
On May 14, 11:58 am, Matthew Woodcraft <[EMAIL PROTECTED]> wrote: > I V  <[EMAIL PROTECTED]> wrote: > > > I hadn't heard of operator.truth before. Does it do anything different > > from bool(x) ? > > Not really. It was occasionally useful before the bool type existed; > now it's just a leftover. >

Re: [off-topic] Usenet

2008-05-14 Thread Terry Reedy
"Duncan Booth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I also recommend Gmane which provides a free news server for most mailing | lists: mailing lists are a lot more manageable when gatewayed into a news | server. If you just want to access comp.lang.python I think you'll f

Re: [ANN] PPyGui emulator

2008-05-14 Thread Stef Mientki
clabepa wrote: Stef Mientki wrote: I've ran the first real world application through PPyGui-emulator, so I think it's time to release the first version. There's lot of room for improvements and a more beautiful layout. PPyGui-emulator is build upon wxPython and released under BSD license. For

Re: named tuple mutability

2008-05-14 Thread Raymond Hettinger
> Should tuples be named? Yes. -- http://mail.python.org/mailman/listinfo/python-list

Re: list.__len__() or len(list)

2008-05-14 Thread Terry Reedy
"Nikhil" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Then why to have __len__() internal method at all when the built-in | len() is faster? Nearly all syntax constructions and builtin functions are implemented by calling one or another of the __special__ methods. This is what

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread Arnaud Delobelle
George Sakkis <[EMAIL PROTECTED]> writes: > On May 14, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> > An instance method works on the instance >> > A Static method is basically a function nested within a class object >> > A class method is overkill? >> >> If anything, a static meth

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 5:25 am, [EMAIL PROTECTED] wrote: > On May 14, 4:32 am, [EMAIL PROTECTED] wrote: > > > On May 13, 9:55 pm, alex23 <[EMAIL PROTECTED]> wrote: > > > > On May 14, 5:41 am, "inhahe" <[EMAIL PROTECTED]> wrote: > > > > > "George Sakkis" <[EMAIL PROTECTED]> wrote in message > > > > > You must b

Re: Python and Flaming Thunder

2008-05-14 Thread castironpi
On May 14, 8:43 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >>> That's also a myth.  For example, if C is easy to maintain, why is > >>> Flaming Thunder the only single-asset 8-by-8 shotgun cross compiler in > >>> the world?  There should be lots of single-asset 8-by-8 shotgun cross > >>> c

Re: Python and Flaming Thunder

2008-05-14 Thread Dotan Cohen
2008/5/14 <[EMAIL PROTECTED]>: > 8x8 is pretty easy to aim for. Turn on 16x16, and you're the laptop > to stand on. FxF? I'll see your 16x16 and raise you 32x32. Any number is pretty easy to aim for when one can arbitrarily invent 2nx2n. Dotan Cohen http://what-is-what.com http://gibberish.co

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 12:51 pm, [EMAIL PROTECTED] wrote: > On May 14, 5:25 am, [EMAIL PROTECTED] wrote: > > > > > > > On May 14, 4:32 am, [EMAIL PROTECTED] wrote: > > > > On May 13, 9:55 pm, alex23 <[EMAIL PROTECTED]> wrote: > > > > > On May 14, 5:41 am, "inhahe" <[EMAIL PROTECTED]> wrote: > > > > > > "George

Re: named tuple mutability

2008-05-14 Thread castironpi
On May 14, 12:41 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > Should tuples be named? > > Yes. Not clearly should. Sequences ought be. If you're on the right time for both, can't the library hold the B? -- http://mail.python.org/mailman/listinfo/python-list

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 1:02 pm, [EMAIL PROTECTED] wrote: > On May 14, 12:51 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 14, 5:25 am, [EMAIL PROTECTED] wrote: > > > > On May 14, 4:32 am, [EMAIL PROTECTED] wrote: > > > > > On May 13, 9:55 pm, alex23 <[EMAIL PROTECTED]> wrote: > > > > > > On May 14, 5:41 am

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 1:06 pm, [EMAIL PROTECTED] wrote: > On May 14, 1:02 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 14, 12:51 pm, [EMAIL PROTECTED] wrote: > > > > On May 14, 5:25 am, [EMAIL PROTECTED] wrote: > > > > > On May 14, 4:32 am, [EMAIL PROTECTED] wrote: > > > > > > On May 13, 9:55 pm, alex23

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 1:07 pm, [EMAIL PROTECTED] wrote: > On May 14, 1:06 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 14, 1:02 pm, [EMAIL PROTECTED] wrote: > > > > On May 14, 12:51 pm, [EMAIL PROTECTED] wrote: > > > > > On May 14, 5:25 am, [EMAIL PROTECTED] wrote: > > > > > > On May 14, 4:32 am, [EMAIL

Re: SOAP/ZSI post/get for Java Web App

2008-05-14 Thread Jennifer Duerr
On May 14, 12:59 pm, Waldemar Osuch <[EMAIL PROTECTED]> wrote: > On May 13, 1:02 pm, Jennifer Duerr <[EMAIL PROTECTED]> wrote: > > > > > > > All, > > > I need help concerning SOAP, Python and XML. I am very new to this, so > > dumbing it down for me will not offend me! > > > I'm using Python and wa

Submitting data to HTTPS javascript

2008-05-14 Thread John Chandler
I am trying to write a script to test certain functionality of a website that requires users to login. The login page is simple, a few pictures and two text bars (one for username and one for password). I tried logging in with webbrowser, but that did not work because the page uses javascript. I al

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 1:09 pm, [EMAIL PROTECTED] wrote: > On May 14, 1:07 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 14, 1:06 pm, [EMAIL PROTECTED] wrote: > > > > On May 14, 1:02 pm, [EMAIL PROTECTED] wrote: > > > > > On May 14, 12:51 pm, [EMAIL PROTECTED] wrote: > > > > > > On May 14, 5:25 am, [EMAIL

Re: I'm stuck in Python!

2008-05-14 Thread Dan Upton
On Tue, May 13, 2008 at 10:55 PM, alex23 <[EMAIL PROTECTED]> wrote: > On May 14, 5:41 am, "inhahe" <[EMAIL PROTECTED]> wrote: >> "George Sakkis" <[EMAIL PROTECTED]> wrote in message >> > You must be new here. It is an AS (Artificial Stupidity) trolling bot, >> > you can safely ignore its posts. >>

Re: I'm stuck in Python!

2008-05-14 Thread castironpi
On May 14, 1:16 pm, [EMAIL PROTECTED] wrote: > On May 14, 1:09 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 14, 1:07 pm, [EMAIL PROTECTED] wrote: > > > > On May 14, 1:06 pm, [EMAIL PROTECTED] wrote: > > > > > On May 14, 1:02 pm, [EMAIL PROTECTED] wrote: > > > > > > On May 14, 12:51 pm, [EMAIL

readlines with line number support?

2008-05-14 Thread Nikhil
Hi, I am reading a file with readlines method of the filepointer object returned by the open function. Along with reading the lines, I also need to know which line number of the file is read in the loop everytime. I am sure, the line should have the property/attribute which will say the line n

Re: readlines with line number support?

2008-05-14 Thread Paul McNett
Nikhil wrote: I am reading a file with readlines method of the filepointer object returned by the open function. Along with reading the lines, I also need to know which line number of the file is read in the loop everytime. I am sure, the line should have the property/attribute which will say t

Re: readlines with line number support?

2008-05-14 Thread Arnaud Delobelle
Nikhil <[EMAIL PROTECTED]> writes: > Hi, > > I am reading a file with readlines method of the filepointer object > returned by the open function. Along with reading the lines, I also > need to know which line number of the file is read in the loop > everytime. > I am sure, the line should have the

Re: readlines with line number support?

2008-05-14 Thread Nikhil
Arnaud Delobelle wrote: Nikhil <[EMAIL PROTECTED]> writes: Hi, I am reading a file with readlines method of the filepointer object returned by the open function. Along with reading the lines, I also need to know which line number of the file is read in the loop everytime. I am sure, the line s

Re: readlines with line number support?

2008-05-14 Thread Nikhil
Arnaud Delobelle wrote: Nikhil <[EMAIL PROTECTED]> writes: Hi, I am reading a file with readlines method of the filepointer object returned by the open function. Along with reading the lines, I also need to know which line number of the file is read in the loop everytime. I am sure, the line s

Re: readlines with line number support?

2008-05-14 Thread Nikhil
Arnaud Delobelle wrote: The standard Python way is using enumerate() for i, line in enumerate(fp): print "line number: " + lineno + ": " + line.rstrip() I guess you meant to say : for lineno, line in enumerate(fp): print "line number: " + lineno + ": " + line.rstrip() Thanks. --

Re: readlines with line number support?

2008-05-14 Thread Arnaud Delobelle
Nikhil <[EMAIL PROTECTED]> writes: > Arnaud Delobelle wrote: > >> The standard Python way is using enumerate() >> >> for i, line in enumerate(fp): >> print "line number: " + lineno + ": " + line.rstrip() >> > > I guess you meant to say : > > for lineno, line in enumerate(fp): > print "li

Re: Using the indent method

2008-05-14 Thread dj
Hello All, I am using elementtree to write an XML document and I am having a hard time adding the correct indentation. I have tried using the indent method, but I can not figure out how to use it. Any suggestions. -- http://mail.python.org/mailman/listinfo/python-list

Re: list.__len__() or len(list)

2008-05-14 Thread Carl Banks
On May 14, 11:07 am, Nikhil <[EMAIL PROTECTED]> wrote: > Christian Heimes wrote: > > Ian Kelly schrieb: > >> The purpose of obj.__len__() is to implement len(obj), which simply > >> calls it. So obj.__len__() may be faster, but only marginally. The > >> reason to prefer len(obj) is that if you in

Re: named tuple mutability

2008-05-14 Thread castironpi
On May 14, 1:04 pm, [EMAIL PROTECTED] wrote: > On May 14, 12:41 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > > > Should tuples be named? > > > Yes. > > Not clearly should.  Sequences ought be.  If you're on the right time > for both, can't the library hold the B? On the web, you can. Both

Re: Python and Flaming Thunder

2008-05-14 Thread Luis Zarrabeitia
On Tuesday 13 May 2008 01:05:38 pm Dave Parker wrote: > The websites owners might not be unhappy, but lots of customers > complain about slow websites, so if the market is competitive then > eventually the PHP fad will die out. On my [modest] experience, bandwidth trumps code speed by a large frac

Using file objects with elementtree

2008-05-14 Thread dj
Hello, Rather then holding my XML document in memory before writing it to disk, I want to create a file object that elementtree will write each element to has it is created. Does any one know how to do that ? Here is my code so, far: fd = open("page.xml", "w") tree.write( fd, encoding="iso-8859-

enumerate() values starting at 1 vs. 0

2008-05-14 Thread python
Arnaud, >> Is there any way to have enumerate() start at 1 vs. 0? >> >> The problem with starting at 0 is that many things in the real world >> begin at 1 - like line numbers or labels in a list. > I suppose you could redefine enumerate to support an optional argument: > > from itertools import

Re: Python and Flaming Thunder

2008-05-14 Thread [EMAIL PROTECTED]
On 14 mai, 00:41, John Machin <[EMAIL PROTECTED]> wrote: (snip) > IIRC the idea was so that managers could write programs in English. It > failed because nobody could write a parser that would handle something > like "The bottom line is that the stakeholder group requires the > situation going forw

Re: named tuple mutability

2008-05-14 Thread [EMAIL PROTECTED]
On 14 mai, 18:20, [EMAIL PROTECTED] wrote: > I'm concerned over the future of Python. Should tuples be named? Obviously not, unless they should. -- http://mail.python.org/mailman/listinfo/python-list

Re: Submitting data to HTTPS javascript

2008-05-14 Thread Laszlo Nagy
John Chandler wrote: I am trying to write a script to test certain functionality of a website that requires users to login. The login page is simple, a few pictures and two text bars (one for username and one for password). I tried logging in with webbrowser, but that did not work because the

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread [EMAIL PROTECTED]
On 14 mai, 19:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > George Sakkis <[EMAIL PROTECTED]> writes: > > On May 14, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > >> > An instance method works on the instance > >> > A Static method is basically a function nested within a class obj

Re: wxpython dialog - do something after ShowModal()?

2008-05-14 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Iain King <[EMAIL PROTECTED]> wrote: > Hi. I have a modal dialog whcih has a "Browse..." button which pops > up a file selector. This all works fine, but the first thing the user > has to do when they open the dialog is select a file, so I would like > the dialo

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread [EMAIL PROTECTED]
On 14 mai, 16:30, George Sakkis <[EMAIL PROTECTED]> wrote: > On May 14, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > An instance method works on the instance > > > A Static method is basically a function nested within a class object > > > A class method is overkill? > > > If anyt

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread Arnaud Delobelle
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > On 14 mai, 19:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> __new__ is a static method! > > __new__ is a special-cased staticmethod that 1/ must not be declared > as such and 2/ takes the class object as first args. As far as I'm > concerned,

Re: Python and Flaming Thunder

2008-05-14 Thread J. Cliff Dyer
On Wed, 2008-05-14 at 13:27 -0700, [EMAIL PROTECTED] wrote: > On 14 mai, 00:41, John Machin <[EMAIL PROTECTED]> wrote: > (snip) > > IIRC the idea was so that managers could write programs in English. It > > failed because nobody could write a parser that would handle something > > like "The bottom

sys.excepthack...

2008-05-14 Thread David C. Ullrich
Becoming a fan of wxPython, but I can't stand what it does with error messsages (I can't find a way to dismiss that window with the error message from the keyboard. Seems to be anti-modal - the key strokes that normally kill the active window kill the main window (sitting behind the window with the

Re: HASH TABLES IN PYTHON

2008-05-14 Thread [EMAIL PROTECTED]
On 14 mai, 18:23, "Eduardo O. Padoan" <[EMAIL PROTECTED]> wrote: > On Wed, May 14, 2008 at 12:20 PM, Blubaugh, David A. > > <[EMAIL PROTECTED]> wrote: > > To Whom It May Concern, > > > I was wondering if anyone has ever worked with hash tables within the Python > > Programming language? I wonder i

Re: Python and Flaming Thunder

2008-05-14 Thread [EMAIL PROTECTED]
On 14 mai, 08:08, Lie <[EMAIL PROTECTED]> wrote: > On May 14, 12:51 pm, Lie <[EMAIL PROTECTED]> wrote: > > > And your 8 by 8 cross compiler doesn't impress me at all, they're all > > based on x86/IA-32 architecture which is quite similar, no PowerPC, > > SPARC, ARM, no other CISC or RISC architectu

Re: sys.excepthack...

2008-05-14 Thread Jean-Paul Calderone
On Wed, 14 May 2008 15:47:18 -0500, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: [snip] Came up with a ridiculous hack involving both sys.stderr and sys.excepthook. Works exactly the way I want. Seems ridiculous - what's the right way to do this? [snip] Hi David, Take a look at the traceba

"indexed properties"...

2008-05-14 Thread David C. Ullrich
Having a hard time phrasing this in the form of a question... The other day I saw a thread where someone asked about overrideable properties and nobody offered the advice that properties are Bad. So maybe we've got over that. I suppose properties could have Bad consequences if a user doesn't know

  1   2   >