Re: Classes

2014-10-31 Thread Chris Angelico
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

Re: Classes

2014-10-31 Thread Ian Kelly
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

Re: Challenge: optimizing isqrt

2014-10-31 Thread Chris Angelico
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,

Challenge: optimizing isqrt

2014-10-31 Thread Steven D'Aprano
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

Re: Classes

2014-10-31 Thread Steven D'Aprano
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

Re: Classes

2014-10-31 Thread Steven D'Aprano
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

Re: Classes

2014-10-31 Thread Seymore4Head
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

Re: Classes

2014-10-31 Thread Seymore4Head
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

Re: Classes

2014-10-31 Thread Gregory Ewing
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

Re: Classes

2014-10-31 Thread Chris Angelico
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

Re: Classes

2014-10-31 Thread Rob Gaddi
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

Re: Classes

2014-10-31 Thread Chris Angelico
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

Re: problem with pefile

2014-10-31 Thread Cameron Simpson
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?

Re: Classes

2014-10-31 Thread sohcahtoa82
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

Re: Classes

2014-10-31 Thread Chris Angelico
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

Re: .write() behavior

2014-10-31 Thread Alan Bawden
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

Re: Classes

2014-10-31 Thread Seymore4Head
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

Re: Teaching Python

2014-10-31 Thread sohcahtoa82
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

Re: Classes

2014-10-31 Thread Seymore4Head
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

Re: Classes

2014-10-31 Thread Joel Goldstick
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

Re: Classes

2014-10-31 Thread Seymore4Head
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

Re: Classes

2014-10-31 Thread ast
"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

Re: set environmental variable from python

2014-10-31 Thread Zachary Ware
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

Re: Classes

2014-10-31 Thread Seymore4Head
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:

Re: accents in windows

2014-10-31 Thread Nobody
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

Re: Classes

2014-10-31 Thread Seymore4Head
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

Re: Implementing pdfkit and wkhtmltopdf on windows fails

2014-10-31 Thread Peter Otten
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

Re: Classes

2014-10-31 Thread Rob Gaddi
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

Re: Classes

2014-10-31 Thread Grant Edwards
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

Re: Classes

2014-10-31 Thread Grant Edwards
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

Re: Classes

2014-10-31 Thread Rob Gaddi
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.

Re: Classes

2014-10-31 Thread Zachary Ware
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

Re: Classes

2014-10-31 Thread Marko Rauhamaa
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

Re: Classes

2014-10-31 Thread Seymore4Head
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 >

Re: Implementing pdfkit and wkhtmltopdf on windows fails

2014-10-31 Thread robert brook
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

EuroPython 2015 Call for Participation: On-site Teams

2014-10-31 Thread M.-A. Lemburg
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

Re: Classes

2014-10-31 Thread Seymore4Head
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

Re: Classes

2014-10-31 Thread Dave Angel
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

Re: Teaching Python

2014-10-31 Thread Seymore4Head
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

Re: Popen class?

2014-10-31 Thread Steven D'Aprano
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

Re: Classes

2014-10-31 Thread Steven D'Aprano
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,

Re: Classes

2014-10-31 Thread Chris Angelico
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/

Re: Implementing pdfkit and wkhtmltopdf on windows fails

2014-10-31 Thread Dave Angel
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

Re: Classes

2014-10-31 Thread Seymore4Head
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) >>

Re: Classes

2014-10-31 Thread Seymore4Head
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 >>

Implementing pdfkit and wkhtmltopdf on windows fails

2014-10-31 Thread robert brook
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

Re: Classes

2014-10-31 Thread Chris Angelico
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

Re: Classes

2014-10-31 Thread Seymore4Head
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

Re: Classes

2014-10-31 Thread Grant Edwards
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

Re: Classes

2014-10-31 Thread Ian Kelly
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

Re: Saving a file "in the background" -- How?

2014-10-31 Thread Chris Angelico
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

Re: set environmental variable from python

2014-10-31 Thread Mark Lawrence
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

Re: Classes

2014-10-31 Thread Seymore4Head
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

Re: Classes

2014-10-31 Thread Mark Lawrence
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

Re: Classes

2014-10-31 Thread Seymore4Head
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) >>

Re: Saving a file "in the background" -- How?

2014-10-31 Thread Steven D'Aprano
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

Re: problem with pefile

2014-10-31 Thread Kiuhnm
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

Re: Popen class?

2014-10-31 Thread Cameron Simpson
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

Re: set environmental variable from python

2014-10-31 Thread Dave Angel
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

Popen class?

2014-10-31 Thread satishmlmlml
What is Popen class? -- https://mail.python.org/mailman/listinfo/python-list

Re: Saving a file "in the background" -- How?

2014-10-31 Thread Chris Angelico
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

Re: Emulating py2exe for python version 3 and above

2014-10-31 Thread Akira Li
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

Re: Saving a file "in the background" -- How?

2014-10-31 Thread Akira Li
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

Re: set environmental variable from python

2014-10-31 Thread Gisle Vanem
"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

Re: Build Question: How to Add -Wl, --option Before Objects In Setup.py?

2014-10-31 Thread Cyd Haselton
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

Re: Classes

2014-10-31 Thread alister
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 >>

Re: Classes

2014-10-31 Thread Chris Angelico
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

Re: Classes

2014-10-31 Thread ast
"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

Re: Classes

2014-10-31 Thread ast
"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

Re: pySerial works in miniterm but not in my app

2014-10-31 Thread Dario
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

Re: Has color "Green" changed from Python 33 to 34 ?

2014-10-31 Thread Christian Gollwitzer
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