On Sat, Nov 1, 2014 at 5:12 PM, Ian Kelly wrote:
> On Fri, Oct 31, 2014 at 7:06 PM, Steven D'Aprano
> wrote:
>> And there are times when using getters and setters is the right choice.
>> Properties should only be used for quite lightweight calculations, because
>> attribute access is supposed to
On Fri, Oct 31, 2014 at 7:06 PM, Steven D'Aprano
wrote:
> And there are times when using getters and setters is the right choice.
> Properties should only be used for quite lightweight calculations, because
> attribute access is supposed to be fast. If your calculation is complex,
> time-consuming
On Sat, Nov 1, 2014 at 12:29 PM, Steven D'Aprano
wrote:
> Q1: What is the largest value of M, such that
>
> all(isqrt(i) == int(math.sqrt(n)) for n in range(M))
>
> returns True?
>
> I have done a brute force test, and in nine hours confirmed that M is at
> least 7627926244. That took nine hours,
There is an algorithm for calculating the integer square root of any
positive integer using only integer operations:
def isqrt(n):
if n < 0: raise ValueError
if n == 0:
return 0
bits = n.bit_length()
a, b = divmod(bits, 2)
x = 2**(a+b)
while True:
y = (x + n
Gregory Ewing wrote:
> Seymore4Head wrote:
>> The course is free. You can't beat the price. It is only for a few
>> more weeks.
>
> But if it's teaching you things that are blatantly wrong
> in relation to Python, it may be doing more harm than
> good.
Like all good Pythonistas[1], we hate Jav
Dennis Lee Bieber wrote:
> What you are being taught is NOT PYTHON.
Of course it is. It uses Python syntax, Python terminology, and the Python
compiler. It might not be the preferred Python idiom or best practice, but
it's still Python code.
Exaggeration does not help anyone, it just makes us lo
On Fri, 31 Oct 2014 19:22:13 -0400, Seymore4Head
wrote:
>On Fri, 31 Oct 2014 18:57:31 -0400, Dennis Lee Bieber
> wrote:
>
>>On Fri, 31 Oct 2014 14:18:44 -0400, Seymore4Head
>> declaimed the following:
>>
>>>On Fri, 31 Oct 2014 10:43:19 -0700, Rob Gaddi
>>> wrote:
>>>
>>>
Define a Square class
On Fri, 31 Oct 2014 18:57:31 -0400, Dennis Lee Bieber
wrote:
>On Fri, 31 Oct 2014 14:18:44 -0400, Seymore4Head
> declaimed the following:
>
>>On Fri, 31 Oct 2014 10:43:19 -0700, Rob Gaddi
>> wrote:
>>
>>
>>>Define a Square class, subclassed from Rectangle. Use getters/setters
>>>to enforce that
Seymore4Head wrote:
The course is free. You can't beat the price. It is only for a few
more weeks.
But if it's teaching you things that are blatantly wrong
in relation to Python, it may be doing more harm than
good.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, Nov 1, 2014 at 8:40 AM, Rob Gaddi
wrote:
> For this specific exercise, a Square is a subclass of Rectangle because
> the point of Rectangle is to demonstrate that extraneous get/set
> functions are completely unnecessary in Python. The point of
> Square is to demonstrate that get/set func
On Fri, 31 Oct 2014 14:24:11 -0700 (PDT)
sohcahto...@gmail.com wrote:
> On Friday, October 31, 2014 1:51:23 PM UTC-7, Chris Angelico wrote:
> > On Sat, Nov 1, 2014 at 4:43 AM, Rob Gaddi
> > wrote:
> > > Define a Square class, subclassed from Rectangle. Use getters/setters
> > > to enforce that t
On Sat, Nov 1, 2014 at 8:24 AM, wrote:
> I've never heard of the Circle-Ellipse problem, and my first instinct to
> Rob's post was to ask, why would you want to sub-class Rectangle into a
> Square class? A square is just a special case of a Rectangle. Attempting
> that kind of sub-classing w
On 31Oct2014 06:12, Kiuhnm wrote:
On Friday, October 31, 2014 2:23:26 AM UTC+1, Cameron Simpson wrote:
On 30Oct2014 17:58, Kiuhnm wrote:
>On Friday, October 31, 2014 1:33:07 AM UTC+1, Cameron Simpson wrote:
>> On 29Oct2014 08:34, gandalf23 wrote:
>> >OT: how can I hide my email in these posts?
On Friday, October 31, 2014 1:51:23 PM UTC-7, Chris Angelico wrote:
> On Sat, Nov 1, 2014 at 4:43 AM, Rob Gaddi
> wrote:
> > Define a Square class, subclassed from Rectangle. Use getters/setters
> > to enforce that the length and width must be equal. Confirm that
> > length and width remain lock
On Sat, Nov 1, 2014 at 4:43 AM, Rob Gaddi
wrote:
> Define a Square class, subclassed from Rectangle. Use getters/setters
> to enforce that the length and width must be equal. Confirm that
> length and width remain locked, and that perimeter() and area() work
> correctly.
Here we go again...
ht
Marko Rauhamaa writes:
> Let me mention a related problem I ran into a couple of weeks ago.
> Linux's standard C library (glibc) implements fread(3) differently in
> RHEL 5 and RHEL 6/7. In RHEL 5, it blocks in a loop until it has read in
> the desired number of records. In RHEL 6 and 7, it appea
On Fri, 31 Oct 2014 14:41:08 -0400, Joel Goldstick
wrote:
>On Fri, Oct 31, 2014 at 2:31 PM, ast wrote:
>>
>> "Seymore4Head" a écrit dans le message de
>> news:rbf75ah9l1jp9e72gqr0ncu7bau8cnt...@4ax.com...
>>
>>> What material have you used to take you up to classes?
>>
>>
>> It's a french class
On Friday, October 31, 2014 10:10:33 AM UTC-7, Seymore4Head wrote:
> On Mon, 29 Sep 2014 11:44:01 -0400, Seymore4Head
> wrote:
>
> >On Mon, 29 Sep 2014 15:18:31 +0200, Gabor Urban
> >wrote:
> >
> >>Hi,
> >>
> >>my 11 years old son and his classmate told me, that they would like to
> >>learn Pyth
On Fri, 31 Oct 2014 14:18:44 -0400, Seymore4Head
wrote:
>On Fri, 31 Oct 2014 10:43:19 -0700, Rob Gaddi
> wrote:
>
>
>>Define a Square class, subclassed from Rectangle. Use getters/setters
>>to enforce that the length and width must be equal. Confirm that
>>length and width remain locked, and th
On Fri, Oct 31, 2014 at 2:31 PM, ast wrote:
>
> "Seymore4Head" a écrit dans le message de
> news:rbf75ah9l1jp9e72gqr0ncu7bau8cnt...@4ax.com...
>
>> What material have you used to take you up to classes?
>
>
> It's a french classroom on the web
> http://openclassrooms.com/courses/apprenez-a-progra
On Fri, 31 Oct 2014 19:31:01 +0100, "ast" wrote:
>
>"Seymore4Head" a écrit dans le message de
>news:rbf75ah9l1jp9e72gqr0ncu7bau8cnt...@4ax.com...
>
>> What material have you used to take you up to classes?
>
>It's a french classroom on the web
>http://openclassrooms.com/courses/apprenez-a-progr
"Seymore4Head" a écrit dans le message de
news:rbf75ah9l1jp9e72gqr0ncu7bau8cnt...@4ax.com...
What material have you used to take you up to classes?
It's a french classroom on the web
http://openclassrooms.com/courses/apprenez-a-programmer-en-python
--
https://mail.python.org/mailman/lis
On Fri, Oct 31, 2014 at 1:11 PM, Dennis Lee Bieber
wrote:
> On Thu, 30 Oct 2014 22:00:33 -0500, Zachary Ware
> declaimed the following:
> >From a Command Prompt, do 'help setx' for details on how to use setx.
>
> Really?
>
> C:\Users\Wulfraed\Documents>help setx
> This command is not sup
On Fri, 31 Oct 2014 10:43:19 -0700, Rob Gaddi
wrote:
>Define a Square class, subclassed from Rectangle. Use getters/setters
>to enforce that the length and width must be equal. Confirm that
>length and width remain locked, and that perimeter() and area() work
>correctly.
class Rectangle:
On Thu, 30 Oct 2014 08:30:49 -0400, C@rlos wrote:
> thanks U, but the real problem is:
>
> i have a path C:\Users\yanet\Desktop\áaaéeeíiiióooúuuñnn this path
> is correct, áaaéeeíiiióooúuuñnn is the name of a directory but when
> i try to use os.walk() usin this path, dont work, for os this path
On Fri, 31 Oct 2014 12:39:34 -0500, Zachary Ware
wrote:
>On Fri, Oct 31, 2014 at 12:31 PM, Seymore4Head
> wrote:
>> I run across this page frequently. To me, this is examples. While
>> examples can be quite useful, I don't call this a tutorial. I have
>> found the answer to my question by sear
robert brook wrote:
> I am able to install both of these packages on my mac at home and it works
> well.
>
> I am trying to install on windows 7 at work and it fails. PDFKit is
> trying to find the wkh package and it cannot. I have entered the full path
> to the exe for the environment variables
On Fri, 31 Oct 2014 13:18:00 -0400
Seymore4Head wrote:
> On Sat, 01 Nov 2014 04:06:44 +1100, Steven D'Aprano
> wrote:
>
> >Seymore4Head wrote:
> >
> >> Because the topic of that lesson was getter setter.
> >> I can construct an __init___ but I was practicing get/set.
> >
> >What lesson is that
On 2014-10-31, Seymore4Head wrote:
> On Sat, 01 Nov 2014 04:06:44 +1100, Steven D'Aprano
>>Let's make the class a bit easier to use, at the expense of doing a bit more
>>work up front:
>>
>>class MyClass:
>>def __init__(self, value, message):
>>self.value = value
>>self.messag
On 2014-10-31, Seymore4Head wrote:
> On Fri, 31 Oct 2014 15:49:43 + (UTC), Grant Edwards
> wrote:
>
>>On 2014-10-31, Ian Kelly wrote:
>>> On Fri, Oct 31, 2014 at 8:05 AM, Seymore4Head
>>> wrote:
Because the topic of that lesson was getter setter.
I can construct an __init___ but I
On Fri, 31 Oct 2014 13:31:44 -0400
Seymore4Head wrote:
> On Sat, 1 Nov 2014 04:02:33 +1100, Chris Angelico
> wrote:
>
> >On Sat, Nov 1, 2014 at 3:47 AM, Seymore4Head
> > wrote:
> >> inbuilt tutorial?
> >>
> >> The course is free. You can't beat the price. It is only for a few
> >> more weeks.
On Fri, Oct 31, 2014 at 12:31 PM, Seymore4Head
wrote:
> I run across this page frequently. To me, this is examples. While
> examples can be quite useful, I don't call this a tutorial. I have
> found the answer to my question by searching this page several times,
> but the biggest problem with t
Seymore4Head :
> In this class, we will follow the practice of accessing the contents
> of objects using methods known as getters and setters.
The biggest problem in this OO disease is that it makes you think of
objects as data containers instead of dynamic agents.
An object is defined through i
On Sat, 1 Nov 2014 04:02:33 +1100, Chris Angelico
wrote:
>On Sat, Nov 1, 2014 at 3:47 AM, Seymore4Head
> wrote:
>> inbuilt tutorial?
>>
>> The course is free. You can't beat the price. It is only for a few
>> more weeks.
>>
>> Trying to learn from reading the Internet has no set direction. I
>
On Friday, October 31, 2014 1:02:44 PM UTC-4, Dave Angel wrote:
> On 10/31/2014 12:46 PM, robert brook wrote:
> > I am able to install both of these packages on my mac at home and it works
> > well.
> >
> > I am trying to install on windows 7 at work and it fails. PDFKit is trying
> > to find th
The EuroPython Society (EPS) is happy to announce the Call for
Participation (CFP) for EuroPython 2015. The purpose of this call is
to select teams willing to help organize the EuroPython conference
on-site at a suitable location.
Call for Participation (CFP)
Please
On Sat, 01 Nov 2014 04:06:44 +1100, Steven D'Aprano
wrote:
>Seymore4Head wrote:
>
>> Because the topic of that lesson was getter setter.
>> I can construct an __init___ but I was practicing get/set.
>
>What lesson is that? Using getters/setters is discouraged in Python.
>
>> This stuff is coming
On 10/31/2014 12:31 PM, Seymore4Head wrote:
In this class, we will follow the practice of accessing the contents
of objects using methods known as getters and setters. While not
required by Python, this practice encourages the user of the class to
manipulates class objects solely via class metho
On Mon, 29 Sep 2014 11:44:01 -0400, Seymore4Head
wrote:
>On Mon, 29 Sep 2014 15:18:31 +0200, Gabor Urban
>wrote:
>
>>Hi,
>>
>>my 11 years old son and his classmate told me, that they would like to
>>learn Python. They did some programming in Logo and turtle graphics, bat
>>not too much.
>>
>>Doe
satishmlm...@gmail.com wrote:
> What is Popen class?
Googling could answer that:
https://duckduckgo.com/html/?q=python+popen+class
If you have a specific question, please be more detailed when you ask your
question, then we can give more specific answers.
--
Steven
--
https://mail.python.o
Seymore4Head wrote:
> Because the topic of that lesson was getter setter.
> I can construct an __init___ but I was practicing get/set.
What lesson is that? Using getters/setters is discouraged in Python.
> This stuff is coming to me slowly. I need to rinse and repeat quite a
> few more times,
On Sat, Nov 1, 2014 at 3:47 AM, Seymore4Head
wrote:
> inbuilt tutorial?
>
> The course is free. You can't beat the price. It is only for a few
> more weeks.
>
> Trying to learn from reading the Internet has no set direction. I
> need a little nudge. More like a shove.
https://docs.python.org/
On 10/31/2014 12:46 PM, robert brook wrote:
I am able to install both of these packages on my mac at home and it works well.
I am trying to install on windows 7 at work and it fails. PDFKit is trying to
find the wkh package and it cannot. I have entered the full path to the exe for
the enviro
On Fri, 31 Oct 2014 10:05:03 +0100, "ast" wrote:
>
>"Seymore4Head" a écrit dans le message de
>news:51755at03r0bidjqh3qf0hhpvjr8756...@4ax.com...
>> class pet:
>>def set_age(self,age):
>>self.age=age
>>def get_age(self):
>>return self.age
>> pax=pet
>> pax.set_age(4)
>>
On Sat, 1 Nov 2014 03:37:29 +1100, Chris Angelico
wrote:
>On Sat, Nov 1, 2014 at 3:31 AM, Seymore4Head
> wrote:
>[presumably quoting his course material]
>> In this class, we will follow the practice of accessing the contents
>> of objects using methods known as getters and setters. While not
>>
I am able to install both of these packages on my mac at home and it works well.
I am trying to install on windows 7 at work and it fails. PDFKit is trying to
find the wkh package and it cannot. I have entered the full path to the exe for
the environment variables and the error below is spit ou
On Sat, Nov 1, 2014 at 3:31 AM, Seymore4Head
wrote:
[presumably quoting his course material]
> In this class, we will follow the practice of accessing the contents
> of objects using methods known as getters and setters. While not
> required by Python, this practice encourages the user of the clas
On Fri, 31 Oct 2014 15:49:43 + (UTC), Grant Edwards
wrote:
>On 2014-10-31, Ian Kelly wrote:
>> On Fri, Oct 31, 2014 at 8:05 AM, Seymore4Head
>> wrote:
>>> Because the topic of that lesson was getter setter.
>>> I can construct an __init___ but I was practicing get/set.
>>
>> Doesn't sound l
On 2014-10-31, Ian Kelly wrote:
> On Fri, Oct 31, 2014 at 8:05 AM, Seymore4Head
> wrote:
>> Because the topic of that lesson was getter setter.
>> I can construct an __init___ but I was practicing get/set.
>
> Doesn't sound like a very good lesson to me.
It's not. It's teaching java or C++ or s
On Fri, Oct 31, 2014 at 8:05 AM, Seymore4Head
wrote:
> Because the topic of that lesson was getter setter.
> I can construct an __init___ but I was practicing get/set.
Doesn't sound like a very good lesson to me. Getters and setters are
the Java way of doing things. The Pythonic way is to just u
On Sat, Nov 1, 2014 at 1:06 AM, Steven D'Aprano
wrote:
> Chris Angelico wrote:
>
>> Sounds like a lot of hassle, and a lot of things that could be done
>> wrongly. Personally, if I need that level of reliability and
>> atomicity, I'd rather push the whole question down to a lower level:
>> maybe c
On 31/10/2014 02:36, Rustom Mody wrote:
On Friday, October 31, 2014 8:01:08 AM UTC+5:30, Zachary Ware wrote:
On Thursday, October 30, 2014, Artur Bercik wrote:
Dear Dave Angel
Thanks for your answer.
I am using Python 2.7
I want to set it permanently.
I have to set several variables so i
On Fri, 31 Oct 2014 09:59:30 GMT, alister
wrote:
>On Thu, 30 Oct 2014 17:34:57 -0400, Seymore4Head wrote:
>
>> On Thu, 30 Oct 2014 14:28:19 -0700, Larry Hudson
>> wrote:
>>
>>>On 10/30/2014 01:16 PM, Seymore4Head wrote:
class pet:
def set_age(self,age):
self.age=age
On 31/10/2014 09:05, ast wrote:
"Seymore4Head" a écrit dans le message de
news:51755at03r0bidjqh3qf0hhpvjr8756...@4ax.com...
class pet:
def set_age(self,age):
self.age=age
def get_age(self):
return self.age
pax=pet
pax.set_age(4)
Traceback (most recent call last):
File "C
On Fri, 31 Oct 2014 10:05:03 +0100, "ast" wrote:
>
>"Seymore4Head" a écrit dans le message de
>news:51755at03r0bidjqh3qf0hhpvjr8756...@4ax.com...
>> class pet:
>>def set_age(self,age):
>>self.age=age
>>def get_age(self):
>>return self.age
>> pax=pet
>> pax.set_age(4)
>>
Chris Angelico wrote:
> Sounds like a lot of hassle, and a lot of things that could be done
> wrongly. Personally, if I need that level of reliability and
> atomicity, I'd rather push the whole question down to a lower level:
> maybe commit something to a git repository and push it to a remote
> s
On Friday, October 31, 2014 2:23:26 AM UTC+1, Cameron Simpson wrote:
> On 30Oct2014 17:58, Kiuhnm wrote:
> >On Friday, October 31, 2014 1:33:07 AM UTC+1, Cameron Simpson wrote:
> >> On 29Oct2014 08:34, gandalf23 wrote:
> >> >OT: how can I hide my email in these posts?
> >> >Every time I try to sen
On 31Oct2014 05:28, satishmlm...@gmail.com wrote:
What is Popen class?
It's a class from the subprocess module:
https://docs.python.org/3/library/subprocess.html#module-subprocess
used for starting external programs, waiting for them to execute, and using
their input and outputs.
Cheers
On 10/30/2014 10:40 PM, Artur Bercik wrote:
On Fri, Oct 31, 2014 at 11:30 AM, Zachary Ware <
zachary.ware+pyl...@gmail.com> wrote:
On Thursday, October 30, 2014, Artur Bercik wrote:
Dear Dave Angel
Thanks for your answer.
I am using Python 2.7
I want to set it permanently.
I have to set
What is Popen class?
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Oct 31, 2014 at 11:07 PM, Akira Li <4kir4...@gmail.com> wrote:
> where atomic_open() [1] tries to overcome multiple issues with saving
> data reliably:
>
> - write to a temporary file so that the old data is always available
> - rename the file when all new data is written, handle cases suc
Ian Dickinson writes:
> Can i emulate py2exe for python version 3 and above i also use pygame any
> suggestions for a basic staring script would be greatly appreciated
>
>
py2exe supports Python 3.3+ Actually, default installers from pypi
support only Python 3.
I see unofficial pygame's Windows
Virgil Stokes writes:
> While running a python program I need to save some of the data that is
> being created. I would like to save the data to a file on a disk
> according to a periodical schedule (e.g. every 10
> minutes). Initially, the amount of data is small (< 1 MB) but after
> sometime t
"Artur Bercik" wrote:
I have to set several variables so it would be easier if I could set them
from Python.
You can write a Python-script that generates a .bat file (in your %TEMP-dir?).
And run this .bat file when Python ends. Put it all in an alias or another .bat
file. E.g. untested:
alia
On Tue, Oct 28, 2014 at 4:01 PM, Ned Deily wrote:
> In article
> ,
> Cyd Haselton wrote:
>
>> On Tue, Oct 28, 2014 at 3:11 AM, Ned Deily wrote:
>> > In article
>> > ,
>> > Cyd Haselton wrote:
>> > [...]
>> >> I'm building python on an Android device in the KBOX
>> >> environment...which simul
On Thu, 30 Oct 2014 17:34:57 -0400, Seymore4Head wrote:
> On Thu, 30 Oct 2014 14:28:19 -0700, Larry Hudson
> wrote:
>
>>On 10/30/2014 01:16 PM, Seymore4Head wrote:
>>> class pet:
>>> def set_age(self,age):
>>> self.age=age
>>> def get_age(self):
>>> return self.age
>>
On Fri, Oct 31, 2014 at 8:18 PM, ast wrote:
>
> But this means that a method can create a new
> attribute not previously created with __init__.
> Is that correct ?
That's always the case. There's nothing special about __init__ for
creating attributes.
ChrisA
--
https://mail.python.org/mailman/l
"ast" a écrit dans le message de
news:545350c3$0$23449$426a7...@news.free.fr...
I am a beginner too, but I find it strange that your
pet class has no __init__ method to construct
instances
It works anyway because __init__ is taken in the
parent Class, probably Object.
But this means that a
"Seymore4Head" a écrit dans le message de
news:51755at03r0bidjqh3qf0hhpvjr8756...@4ax.com...
class pet:
def set_age(self,age):
self.age=age
def get_age(self):
return self.age
pax=pet
pax.set_age(4)
Traceback (most recent call last):
File "C:\Functions\test.py", line 18, i
Il giorno giovedì 30 ottobre 2014 23:57:40 UTC+1, Dennis Lee Bieber ha scritto:
> >sw o01 + <--- I send this
> How do you "send this"...
I just type or paste it in miniterm and hit return. Miniterm sends the return
as CR, but it also works with CRLF.
> >sw o01 + Command OK <--- device does wh
Am 30.10.14 12:23, schrieb ast:
I just updated this morning my Python from a 3.3rc to 3.4 (Windows) and
I noticed that the 'Green' color in tkinter GUI is not the same at all.
'Green' in 3.4 is very dark. I had to replace it with 'Lime' to
get back a nice 'Green'.
If you are dependent on the e
71 matches
Mail list logo