Re: [Tutor] Only appending one object to list, when I am expecting more than 1

2019-02-27 Thread Alex Kleider
On 2019-02-27 05:25, AdamC wrote: That's great - bug found. Thanks. However the next question is, how do I create an instance of a class with variable parameters (i.e. with dateAdded already computed and stored, or with dateAdded created for the first time)? Might this work? class myClass(ob

Re: [Tutor] ANSI / VT100 Escape Codes in Windows 7 Environment

2019-02-27 Thread boB Stepp
On Wed, Feb 27, 2019 at 6:50 PM Chip Wachob wrote: > > Hello again, > > As always, this list has been very helpful, and thank you. > > So, I thought I was good to go until I attempted to run my code on a > Windows 7 vintage machine this morning. The application is intended to be > run in the comm

Re: [Tutor] Why does using "window.addchr()" to place a character at the lower right corner raise an exception?

2019-02-27 Thread boB Stepp
On Wed, Feb 27, 2019 at 8:09 PM Alex Kleider wrote: > > On 2019-02-27 17:48, boB Stepp wrote: > > Under https://docs.python.org/3/library/curses.html#window-objects in > > the curses docs, it states: > > > > > > window.addch(ch[, attr]) > > window.addch(y, x, ch[, attr]) > > [...] > > > > Note >

Re: [Tutor] Why does using "window.addchr()" to place a character at the lower right corner raise an exception?

2019-02-27 Thread Alex Kleider
On 2019-02-27 17:48, boB Stepp wrote: Under https://docs.python.org/3/library/curses.html#window-objects in the curses docs, it states: window.addch(ch[, attr]) window.addch(y, x, ch[, attr]) [...] Note Writing outside the window, subwindow, or pad raises a curses.error. Attempting to write t

Re: [Tutor] ANSI / VT100 Escape Codes in Windows 7 Environment

2019-02-27 Thread eryk sun
On 2/27/19, Alan Gauld via Tutor wrote: > On 27/02/2019 18:28, Chip Wachob wrote: >> Windows 7 vintage machine this morning. > > Caveat: I have no direct experience on Windows 7 - I jumped > from XP to Windows 8... Also I haven't used ANSIO codes in > Windows since the heady days of Windows 98! Bu

[Tutor] Why does using "window.addchr()" to place a character at the lower right corner raise an exception?

2019-02-27 Thread boB Stepp
Under https://docs.python.org/3/library/curses.html#window-objects in the curses docs, it states: window.addch(ch[, attr]) window.addch(y, x, ch[, attr]) [...] Note Writing outside the window, subwindow, or pad raises a curses.error. Attempting to write to the lower right corner of a window, su

Re: [Tutor] ANSI / VT100 Escape Codes in Windows 7 Environment

2019-02-27 Thread eryk sun
On 2/27/19, Chip Wachob wrote: > > I've been spending the morning looking at different solutions. Many of > them seem to involve either including yet aother module, or, worse (IMHO) a > C library that will 'emulate' the ANSI escape sequences, API calls, etc. To support virtual-terminal sequences

Re: [Tutor] ANSI / VT100 Escape Codes in Windows 7 Environment

2019-02-27 Thread Alan Gauld via Tutor
On 27/02/2019 18:28, Chip Wachob wrote: > Windows 7 vintage machine this morning. Caveat: I have no direct experience on Windows 7 - I jumped from XP to Windows 8... Also I haven't used ANSIO codes in Windows since the heady days of Windows 98! But... > run in the command window in Windows, from

[Tutor] ANSI / VT100 Escape Codes in Windows 7 Environment

2019-02-27 Thread Chip Wachob
Hello again, As always, this list has been very helpful, and thank you. So, I thought I was good to go until I attempted to run my code on a Windows 7 vintage machine this morning. The application is intended to be run in the command window in Windows, from the terminal in Linux... In the code

Re: [Tutor] Only appending one object to list, when I am expecting more than 1

2019-02-27 Thread Alan Gauld via Tutor
On 27/02/2019 13:25, AdamC wrote: > That's great - bug found. Thanks. However the next question is, how do I > create an instance of a class with variable parameters (i.e. with dateAdded > already computed and stored, or with dateAdded created for the first time)? > > I hope that makes sense. Not

Re: [Tutor] Only appending one object to list, when I am expecting more than 1

2019-02-27 Thread Mats Wichmann
Without spending a lot of time on an answer, you can use default arguments in the cases where only the number of arts differs in your instance creation. If there's larger differences, look into @classmethod. On February 27, 2019 5:25:02 AM PST, AdamC wrote: >That's great - bug found. Thanks. Ho

Re: [Tutor] Only appending one object to list, when I am expecting more than 1

2019-02-27 Thread Tobiah
Without fully understanding what you're getting at, I'll offer this: class Car(object): def __init__(self, **kwargs): self.features = { 'make': 'Hyundai', 'color': 'purple'

Re: [Tutor] I flip a coin 1 million times what is the consecutive times it will come up head and come up tails

2019-02-27 Thread Abdur-Rahmaan Janhangeer
XD that will help in the future, yes it was not unreadable this one. Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription option

Re: [Tutor] I flip a coin 1 million times what is the consecutive times it will come up head and come up tails

2019-02-27 Thread Steven D'Aprano
On Tue, Feb 26, 2019 at 01:34:33PM -0700, shaef...@q.com wrote: > I am learning python. I wanted to test my ability by making a program to > keep track of the flip of a coin to find how many consecutive times it came > up heads and tails. Here's how to count the number of times it comes up heads

Re: [Tutor] Only appending one object to list, when I am expecting more than 1

2019-02-27 Thread AdamC
That's great - bug found. Thanks. However the next question is, how do I create an instance of a class with variable parameters (i.e. with dateAdded already computed and stored, or with dateAdded created for the first time)? I hope that makes sense. Adam On Tue, 26 Feb 2019 at 18:24, Tobiah wro

Re: [Tutor] I flip a coin 1 million times what is the consecutive times it will come up head and come up tails

2019-02-27 Thread Alan Gauld via Tutor
On 27/02/2019 09:35, Abdur-Rahmaan Janhangeer wrote: > maybe try dpaste.de or something like that for code pasting ^^_ That can be useful if it's very long code but this is actually quite a short program and it's much easier to reply to if the code is in the message so I think the OP did the right

Re: [Tutor] I flip a coin 1 million times what is the consecutive times it will come up head and come up tails

2019-02-27 Thread Abdur-Rahmaan Janhangeer
maybe try dpaste.de or something like that for code pasting ^^_ Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: ht