To further document some points.
This comes from PEP 8 (http://www.python.org/dev/peps/pep-0008/)
For those who need "authority" :
Author: Guido van Rossum , Barry Warsaw
"""
With this in mind, here are the Pythonic guidelines:
- Public attributes should have no leading underscores.
Tiger12506 wrote:
>>> This is all fine and dandy, but the video game is pretty worthless unless
>>> it
>>> can show us what the score is. There are two ways to go about this. A)
>>> Give
>>> the video game a display which it updates, or B) Tear open the case of
>>> the
>>> video game and look at
> I'm having issues when I test my software on XP, but not Linux. When I
> run the progam it fails after running for a while but not at exactly
> the same point each time. It fails in one of two ways, the user
> interface either completely disappears, or gives a OS error message
> unhanded exceptio
>> This is all fine and dandy, but the video game is pretty worthless unless
>> it
>> can show us what the score is. There are two ways to go about this. A)
>> Give
>> the video game a display which it updates, or B) Tear open the case of
>> the
>> video game and look at the actual gears that in
> From: James Hartley <>
> Subject: [Tutor] opening a pipe?
> Sent: 2008-02-12 09:24
>
> A Perl script can easily serve as a filter within a pipe as seen in
> the following:
>
> use strict;
> use warnings;
>
> open(IN, 'cat hello.txt |') or die 'unable to open file';
> while () {
>
Ok, so I've started the path to put a GUI to the "MandarMails.py"
program. For starters I've included a progress bar. Any enhancements you
may suggest will be appreciated.
Note: not tested yet
##
### MandarMails.py ###
##
#!/usr/bin/env python
import time
> How do I ensure that when an object is deleted by the garbage
> collector that the file objects contained within the object are
> closed, or collected by the garbage collector?
__del__ is called after the reference count gets to zero for an
object. You can explicitly call close on the file there
Show us both path statements, then we might be able to fix it.
--Michael
On Feb 12, 2008 2:01 AM, Narain <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> Iam facing problems in Environment variables for python path as
> follows
> >Iam using Windows XP operating system in system v
Hi,
Iam facing problems in Environment variables for python path as
follows
>Iam using Windows XP operating system in system variable iam
appending two path,in this case only first path is working but second path is
not working,if
i remove first path means second path is w
The subprocess module is what you're looking for.
Your example would look like
%<
import subprocess
p = subprocess.Popen('cat hi.txt', shell=True, stdout=subprocess.PIPE)
for line in p.stdout:
print line
%<
I ass
Wesley Brooks wrote:
> Dear Python Users,
>
> How do I ensure that when an object is deleted by the garbage
> collector that the file objects contained within the object are
> closed, or collected by the garbage collector?
>
When there are no more references to a file object the file is closed.
On Feb 12, 2008 7:19 AM, Ricardo Aráoz <[EMAIL PROTECTED]> wrote:
>
> Did we think about REUSABILITY? What if in some other application I want
> to USE the score, not just display it? What if I want to display it in a
> different form (multiplying it by 100)? Then you are back to our
> original opt
Tiger12506 wrote:
> This is all fine and dandy, but the video game is pretty worthless unless it
> can show us what the score is. There are two ways to go about this. A) Give
> the video game a display which it updates, or B) Tear open the case of the
> video game and look at the actual gears t
Tiger12506 wrote:
> This is all fine and dandy, but the video game is pretty worthless unless it
> can show us what the score is. There are two ways to go about this. A) Give
> the video game a display which it updates, or B) Tear open the case of the
> video game and look at the actual gears t
Thank you all, very nice.
Steve Willoughby wrote:
> Kent Johnson wrote:
>> Try
>>list.append({'id': 'name', 'link': ('YY','XX')[total > 0]})
>
> I'd caution against that, though. It's clever and cute, sure, but the
> meaning of it is obfuscated enough to be unpythonic because [total > 0]
>
A Perl script can easily serve as a filter within a pipe as seen in
the following:
use strict;
use warnings;
open(IN, 'cat hello.txt |') or die 'unable to open file';
while () {
print;
}
close(IN);
Can I do the same within Python? Thanks.
Jim
___
"Tiger12506" <[EMAIL PROTECTED]> wrote
> Well, I don't know if this whole email was of use, but it makes the
> crux of
> the argument make sense to me.
I thought it was pretty clear.
And it highlights that the choices are like anything else in
the world of engineering - a compromise. And the be
Dear Python Users,
How do I ensure that when an object is deleted by the garbage
collector that the file objects contained within the object are
closed, or collected by the garbage collector?
I'd like to avoid having to read the whole file object into a string
and close the file immediately becau
18 matches
Mail list logo