On 24Jan2015 00:47, Alan Gauld wrote:
On 24/01/15 00:37, Cameron Simpson wrote:
By contrast, I use it a far bit (though still far less than non-property
methods). Generally for derived properties which are:
- cheap to compute i.e. O(1)
- which I want to abstract
- usually represent some pro
>
> But why a property rather than a simple method?
> Why is
>
> k = url.key
>
> better than
>
> k = url.key()
>
> for meeting those criteria?
My understanding is this is very much a Python-specific problem.
Python style encourages raw access to the attributes of an object via
direct lookup and a
On 24/01/15 00:37, Cameron Simpson wrote:
By contrast, I use it a far bit (though still far less than non-property
methods). Generally for derived properties which are:
- cheap to compute i.e. O(1)
- which I want to abstract
- usually represent some property which is stable, such as a
On 23Jan2015 20:37, Alan Gauld wrote:
On 23/01/15 11:47, jarod...@libero.it wrote:
Thanks so much for clear explanation!!! So in this way work .
In [38]: Test().x.__name__
Out[38]: 'x'
The decoratory proprerty dosen't help to create the class in fast way.. When
it is advisable use @property?
On 23/01/15 11:47, jarod...@libero.it wrote:
Thanks so much for clear explanation!!! So in this way work .
In [38]: Test().x.__name__
Out[38]: 'x'
The decoratory proprerty dosen't help to create the class in fast way.. When
it is advisable use @property?
Very rarely, and mainly when you need to
On 23/01/15 03:09, dw wrote:
I have a python script that I've created.
The issue is, I made it for someone else to use in his PC.
And its not working for him.
The first thing to do when creating a program for use on another
computer is to make everything that could be machine specific
conf
On 23/01/15 01:44, jarod...@libero.it wrote:
How can gave the attributes __name__ to a function?
You don't Python does it for you.
class Foo(object):
def __init__(self):
steps = {}
tmp = open("rnaseq.base.ini","rb")
config.readfp(tmp)
readsets =
pa
On 22/01/2015 22:53, Alan Gauld wrote:
On 22/01/15 12:56, Sydney Shall wrote:
I use MAC OSX 10.9.5
Canopy Enthought python 2.7.6
I also use the Enthought Package Manager to keep my installation
up-todate.
Canopy and Enthoughts paqckage management are well beyond the bounds of
standard Python
Thanks so much for clear explanation!!! So in this way work .
In [38]: Test().x.__name__
Out[38]: 'x'
The decoratory proprerty dosen't help to create the class in fast way.. When
it is advisable use @property?
___
Tutor maillist - Tutor@python.org
T
You are trying to use advanced features of Python, and they are not
the right tool for what you're trying to do.
Specifically, you're trying two things at the same time:
1. Properties, which allows method calls to look like simple variable access.
2. The __name__ special attribute on methods (
On 22/01/2015 15:40, dw wrote:
Thanks for your good comments.
I do think I found a work around
body = ""
for x in range(0,len(line_array)):
test_line = len(re.findall(r'[0-9]{2}/[0-9]{2}/[0-9]{4}',
line_array[x]))
if test_line > 0:
body = body + line_array[x]+"\n"
Using
On 22/01/2015 16:15, dw wrote:
Thanks so much Steve and Mark!
You've given me a lot to chew on. :-D
I'll pursue!
More Python FUN!!
Thanks for the thanks, but please don't change the subject as it breaks
threading, making it more
This is the all code: http://pastebin.com/nYGEiXY4
I don't know well which i meas . I suppose it is the name of the class (self.
__name__). So the name it is present.
it is correct?
thanks for the patience!
M.
>Messaggio originale
>Da: danny@gmail.com
>Data: 23/01/2015 11.08
>A:
On Fri, Jan 23, 2015 at 12:37 AM, jarod...@libero.it wrote:
> Thanks for the help and patience!
> It is a function on the class so I suppose for read that function list I
> need self.steps Where I'm wrong?
> @property
> def steps(self):
> return [
>
>
On 23/01/15 06:10, boB Stepp wrote:
As far as version control, I consider it *absolutely essential* for
anyone who is serious about programming professionalism.
stated direction, but finding time to become proficient in such a tool
in the midst of all the other things I am trying to absorb is
Thanks for the help and patience!
It is a function on the class so I suppose for read that function list I need
self.steps Where I'm wrong?
@propertydef steps(self):return [
self.trimmomatic,
self.merg
On 23/01/15 07:02, Ben Finney wrote:
An example::
# -*- coding: utf-8 -*-
# foo/frob.py
# Part of FooBar, a garden gnome decoration library.
#
# Copyright © 2011–2015 Ben Finney
#
# This is free software: you may copy, modify, and/or distribute this work
I have a python script that I've created.
It logs into an online email service and sends out an email.
It works in my Linux box, and it works in my Windows 7 box.
I've also converted it with Py2EXE and it works as an executable in my
Win-7 box.
The issue is, I made it for someone else to use in hi
> #@property
> def show(self):
> ftp="\n".join([str(idx + 1) + "- " + step.__name__ for idx, step
in enumerate(self.steps)])
>
Questions you should be asking yourself:
What is self.steps? What type is it?
In the case where this breaks with an error, what is self.steps t
If the code I'm seeing is correct, the problem is the class is Jobs,
and you instantiated a Job, which doesn't exit.
Replace one with the other in either case should fix it.
On Thu, Jan 22, 2015 at 11:11 AM, jarod...@libero.it wrote:
> Dear All,
>
> I created a class that invoke from another fi
Thanks for your good comments.
I do think I found a work around
body = ""
for x in range(0,len(line_array)):
test_line = len(re.findall(r'[0-9]{2}/[0-9]{2}/[0-9]{4}',
line_array[x]))
if test_line > 0:
body = body + line_array[x]+"\n"
For each iteration re.findall returns a lis
Thanks so much Steve and Mark!
You've given me a lot to chew on. :-D
I'll pursue!
More Python FUN!!
Based on your description, I think the best way to do this is:
# remove blank lines
line_array = [line for line in line_array if l
22 matches
Mail list logo