On Mon, Oct 5, 2009 at 9:28 PM, Sander Sweers wrote:
>
> Hi Tutors,
>
> I am going through someone's python script and I am seeing a lot of the
> following boolean checks.
>
> if not s == ""
>
> if not n == 0
>
> if b == True
>
> if not b == True
>
> etc..
>
> All of these can be written without t
Dave Angel wrote:
Now in this case where it is only used as boolean checks which would be
the most pythonic way if writing these checks?
The shorter version may be preferable, but it doesn't generally give the
same results. Without knowing the possible data, these substitutions
are not saf
Vern Ceder wrote:
Hi Sander,
PEP 8, the "Style Guide for Python Code"
http://www.python.org/dev/peps/pep-0008/ is pretty clear that the
shorter version is preferable:
if s:
if n:
if b:
if not b:
and so on...
Cheers,
Vern
Sander Sweers wrote:
Hi Tutors,
I am going through someone's pytho
Thanks all! I think i will install the newly released 2.6.3 and go
from there. Its a little intimidating but i guess i gotta jump right
in and get my feet wet.
Thanks again!
-Nick
On Mon, Oct 5, 2009 at 5:59 PM, wesley chun wrote:
> On Mon, Oct 5, 2009 at 2:24 PM, Nick Hird wrote:
>> What is th
On Mon, Oct 5, 2009 at 4:41 PM, David Perlman wrote:
> I fixed this by changing it to "mods=None" and then setting it in the body
> of the __init__ method. Works fine now.
That is the correct fix.
> My question is, is this just a quirky misbehavior, or is there a principled
> reason why the co
On Mon, Oct 5, 2009 at 2:24 PM, Nick Hird wrote:
> What is the best version of python to start out with? I see some
> discussions on the net about not going to 3.1 but staying with the 2.x
> releases. But then i see that 3.1 is better if your just starting.
greetings nick!
ironically, i just ga
> I am going through someone's python script and I am seeing a lot of the
> following boolean checks.
>
> if not s == ""
> if not n == 0
> if b == True
> if not b == True
> etc..
>
> All of these can be written without the == notation like "if n", "if s"
> etc.Now in this case where it is only used
> def __init__(self, time, mods=[], dur=None, format='%1.2f'):
> :
> The mods that were added to the first instance of oneStim also appear in the
> second, newly created instance!
>
> It appears that what is happening here is that the __init__() method is
> being parsed by the interpreter
On Mon, Oct 5, 2009 at 4:24 PM, Nick Hird wrote:
> What is the best version of python to start out with? I see some
> discussions on the net about not going to 3.1 but staying with the 2.x
> releases. But then i see that 3.1 is better if your just starting.
> Thanks for any insight on which versi
2009/10/5 Nick Hird :
> What is the best version of python to start out with? I see some
> discussions on the net about not going to 3.1 but staying with the 2.x
> releases. But then i see that 3.1 is better if your just starting.
> Thanks for any insight on which version to go with.
> -Nick
>
On Mon, Oct 5, 2009 at 3:41 PM, David Perlman wrote:
> OK, I thought I had this one fixed but it was weirder than I thought. I
> think I understand what's going on, but I wanted to check with the experts
> here.
>
> I have the following class definition, which does not subclass anything:
>
> cla
What is the best version of python to start out with? I see some
discussions on the net about not going to 3.1 but staying with the 2.x
releases. But then i see that 3.1 is better if your just starting.
Thanks for any insight on which version to go with.
-Nick
__
David Perlman wrote:
OK, I thought I had this one fixed but it was weirder than
I thought. I think I understand what's going on, but I wanted to check
with the experts here.
I have the following class definition, which does not subclass
anything:
class oneStim:
def __init__(
This language is not appropriate for this list and I'm sorry to see it
used even in a private reply. Let's keep the discussions here polite
and respectful.
Thanks,
Kent
On Sun, Oct 4, 2009 at 8:40 AM, Luke Paireepinart
wrote:
>
>
> On Sun, Oct 4, 2009 at 1:59 PM, Andrius wrote:
>>
>> Very good.
I think you forgot to hit Reply-all, so forwarding on to the list with my
response
On Mon, Oct 5, 2009 at 11:38 AM, Nicola De Quattro <
lead.express...@gmail.com> wrote:
> Wayne ha scritto:
>
>> The most difficult task would be analyzing the image and possibly some of
>> the graph generation.
>>
Thanks Wesly/Vern for the replies.
On Mon, 2009-10-05 at 21:56 +0200, Luke Paireepinart wrote:
> if not n == 0
>
> if b == True can be written as if b.
>
>
> However,
> if not n == 0 can be written as if n != 0 but NOT as if n.
> The reason why is that 0 is not equivalent to False even
OK, I thought I had this one fixed but it was weirder than I thought.
I think I understand what's going on, but I wanted to check with the
experts here.
I have the following class definition, which does not subclass anything:
class oneStim:
def __init__(self, time, mods=[], dur=None, fo
Hi Sander,
PEP 8, the "Style Guide for Python Code"
http://www.python.org/dev/peps/pep-0008/ is pretty clear that the
shorter version is preferable:
if s:
if n:
if b:
if not b:
and so on...
Cheers,
Vern
Sander Sweers wrote:
Hi Tutors,
I am going through someone's python script and I am s
On Mon, 05 Oct 2009 12:59 -0400, "Kent Johnson" wrote:
> On Mon, Oct 5, 2009 at 10:22 AM, Oleg Oltar
> wrote:
>
> > os.popen4("application -parameter1 -file temp.txt")
> >
> > I wonder if that possible to execute this script (called application)
> > without writing the file with initial data to
Hi Tutors,
I am going through someone's python script and I am seeing a lot of the
following boolean checks.
if not s == ""
if not n == 0
if b == True
if not b == True
etc..
All of these can be written without the == notation like "if n", "if s"
etc.
Now in this case where it is only used
Bye bye.
Regards,
Andrius
On 04/10/2009, Luke Paireepinart wrote:
> On Sun, Oct 4, 2009 at 1:59 PM, Andrius wrote:
>
>> Very good. Nice to hear that from another 'untouchable'. Must to
>> confirm for your that I'm usually left wing fella, so, if you have
>> nothing what to say for my in my cas
On Mon, Oct 5, 2009 at 10:22 AM, Oleg Oltar wrote:
> os.popen4("application -parameter1 -file temp.txt")
>
> I wonder if that possible to execute this script (called application)
> without writing the file with initial data to the hard disk?
If "application" can take its input from stdin then yo
Oleg Oltar wrote:
Hi!
I want to try to use a command line script with my python application.
The task is the following, my database stores some initial data for
the script and
I need to execute a command line application in a following way:
$ application -parameter1 -file1
where file 1 is a
Hi!
I want to try to use a command line script with my python application. The
task is the following, my database stores some initial data for the script
and
I need to execute a command line application in a following way:
$ application -parameter1 -file1
where file 1 is a file which contains my
Snip from PIP http://pypi.python.org/pypi/pip/0.4
Differences From easy_install
pip cannot install some packages. Specifically:
* It cannot install from eggs. It only installs from source. (Maybe
this will be changed sometime, but it's low priority.)
If you want to download eggs then you
Hi,
thanks for the hint.
> pip (http://pypi.python.org/pypi/pip/) is a drop-in replacement for the
> easy_install tool and can do that.
>
> Just run easy_install pip and set an environment variable
> PIP_DOWNLOAD_CACHE to the path you want pip to store the files. Note
> that the cache won't work
http://stackoverflow.com/questions/529425/easyinstall-cache-downloaded-files
pip (http://pypi.python.org/pypi/pip/) is a drop-in replacement for the
easy_install tool and can do that.
Just run easy_install pip and set an environment variable
PIP_DOWNLOAD_CACHE to the path you want pip to store th
27 matches
Mail list logo