[Tutor] [OT]Death of VMS

2013-06-12 Thread Mark Lawrence
I figured some of the folks out there who appreciate real operating systems might be interested in this http://www.theregister.co.uk/2013/06/10/openvms_death_notice/ -- "Steve is going for the pink ball - and for those of you who are watching in black and white, the pink is next to the green."

Re: [Tutor] Creating a Choose Your Own Adventure Game :p:

2013-06-12 Thread DragonDon
Thanks for the info Thomas. I have heard of github but not bitbucket. I have tried PyPI once from another book(HeadFirst series) but never went further. I don't even know yet if this is something worthy of making available to a broader audience. Outside of my blog and a few select other people,

[Tutor] Using __init__ to return a value

2013-06-12 Thread Khalid Al-Ghamdi
Hi, Why doesn't this work? And is there way to have an object immediately return a value or object once it is instantiated with using a method call? 1. >>> class k: 2. def __init__(self,n): 3. return n*n 4. 5. 6. >>> khalid=k(3) 7. Traceback (most rec

Re: [Tutor] Using __init__ to return a value

2013-06-12 Thread vishwajeet singh
On Wed, Jun 12, 2013 at 3:02 PM, Khalid Al-Ghamdi wrote: > Hi, > > Why doesn't this work? And is there way to have an > object immediately return a value or object once it is instantiated with > using a method call? > __init__ returns the newly created object. You cannot (or at least shouldn't) r

Re: [Tutor] Using __init__ to return a value

2013-06-12 Thread Peter Otten
Khalid Al-Ghamdi wrote: >1. >>> class k: >2. def __init__(self,n): >3. return n*n >4. >5. >6. >>> khalid=k(3) >7. Traceback (most recent call last): >8. File "", line 1, in >9. khalid=k(3) >10. TypeError: __init__() should retu

Re: [Tutor] Using __init__ to return a value

2013-06-12 Thread Steven D'Aprano
On 12/06/13 19:32, Khalid Al-Ghamdi wrote: Hi, Why doesn't this work? And is there way to have an object immediately return a value or object once it is instantiated with using a method call? It does return a value. It returns the object that was just instantiated. Supposed you could do what

Re: [Tutor] First program after PyCamp

2013-06-12 Thread bjames
I've updated this code and to make it more easily readible put it in a github repo https://github.com/CyberCowboy/FindDuplicates Everything is working, however the code is hard to read and I'll be working on cleaning that up, as well as splitting the program into 3 different functions (one that ge

Re: [Tutor] First program after PyCamp

2013-06-12 Thread bjames
I've updated this code and to make it more easily readible put it in a github repo https://github.com/CyberCowboy/FindDuplicates Everything is working, however the code is hard to read and I'll be working on cleaning that up, as well as splitting the program into 3 different functions (one that ge

Re: [Tutor] On a looping input, subsequent inputs are hidden

2013-06-12 Thread Jim Mooney
I guess that would be hard on Ben Flinkelstein ;') But I guess I could still have give_cake = True to be more understandable. Or keep the program the way it is, use if '' in msg , and sell it to Guantanamo. Jim On 11 June 2013 19:19, Steven D'Aprano wrote: > On 12/06/13 03:53, Jim Mooney wro

Re: [Tutor] First program after PyCamp

2013-06-12 Thread Chris Calloway
On 6/12/2013 11:18 AM, bja...@jamesgang.dyndns.org wrote: I've updated this code and to make it more easily readible put it in a github repo https://github.com/CyberCowboy/FindDuplicates Everything is working, however the code is hard to read and I'll be working on cleaning that up, as well as s

[Tutor] Value Error

2013-06-12 Thread Jim Mooney
I'm going through the exceptions so I can recall and use the basic ones (not much use for unicode errors at this point ;') But I'm puzzled by an aspect of the Value Error: *exception *ValueError Raised when a built-in operation or function receives an argument that has the right type but an inapp

Re: [Tutor] Value Error

2013-06-12 Thread Sander Sweers
On 06/12/2013 10:49 PM, Jim Mooney wrote: > Raised when a built-in operation or function receives an argument that has > the right type but an inappropriate value, and the situation is not > described by a more precise exception such as > IndexError

Re: [Tutor] Value Error

2013-06-12 Thread Dave Angel
On 06/12/2013 04:49 PM, Jim Mooney wrote: I'm going through the exceptions so I can recall and use the basic ones (not much use for unicode errors at this point ;') But I'm puzzled by an aspect of the Value Error: *exception *ValueError Raised when a built-in operation or function receives an a

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Matt D
On 06/10/2013 12:23 PM, Prasad, Ramit wrote: > Matt D wrote: >> Ramit Prasad wrote: > Scrolled panel is just a graphical container that allows for scrolling > inside, > but it is the window that scrolls not widgets inside it. This of it like > a webpage that scrolls. If you use we

Re: [Tutor] Value Error

2013-06-12 Thread Jim Mooney
Dave Angel import math > print math.sqrt(-1) Ah, that's what I was looking for. I already saw it trip on type mismatches like int('blah'). I was looking for what would be an actual inappropriate value that was still the right type. Although I'm not sure why int('blah') wouldn't be a type e

Re: [Tutor] Value Error

2013-06-12 Thread Steve Willoughby
or if you try to take the square root of a negative number, etc. On 12-Jun-2013, at 14:06, Sander Sweers wrote: > On 06/12/2013 10:49 PM, Jim Mooney wrote: >> Raised when a built-in operation or function receives an argument that has >> the right type but an inappropriate value, and the situatio

Re: [Tutor] Value Error

2013-06-12 Thread Steve Willoughby
int('blah') is not a type error because the int() function is expecting to be given a string, and it was given a string. The 'blah' is of the correct type. The problem is that int() couldn't do anything useful with the value of that string. Steve On 12-Jun-2013, at 14:41, Jim Mooney wrote: >

Re: [Tutor] Value Error

2013-06-12 Thread Roel Schroeven
Jim Mooney schreef: Although I'm not sure why int('blah') wouldn't be a type error rather than a value error. Because passing a string to int() is perfectly okay, as long as the string has an appropriate value: int('42') works, int('forty two') raises ValueError. -- "People almost invariabl

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Dave Angel
On 06/12/2013 05:32 PM, Matt D wrote: On 06/10/2013 12:23 PM, Prasad, Ramit wrote: Matt D wrote: Ramit Prasad wrote: Scrolled panel is just a graphical container that allows for scrolling inside, but it is the window that scrolls not widgets inside it. This of it like a webpage that scrolls. I

Re: [Tutor] Value Error

2013-06-12 Thread Jim Mooney
On 12 June 2013 14:16, Steve Willoughby wrote: > or if you try to take the square root of a negative number, etc. > Or the log of -10. Although sqrt(-1) works fine for cmath.sqrt(-1) - I think I get it. Come to think of it you can do cmath.log(-10), but that's getting scary ;') Jim ___

Re: [Tutor] Value Error

2013-06-12 Thread Dave Angel
On 06/12/2013 06:07 PM, Jim Mooney wrote: On 12 June 2013 14:16, Steve Willoughby wrote: or if you try to take the square root of a negative number, etc. Or the log of -10. Although sqrt(-1) works fine for cmath.sqrt(-1) - I think I get it. Come to think of it you can do cmath.log(-10), bu

Re: [Tutor] Value Error

2013-06-12 Thread Marc Tompkins
On Wed, Jun 12, 2013 at 3:31 PM, Dave Angel wrote: > >>> cmath.sqrt(float((math.e **(i * math.pi)).real)) > 1j > Sh*t just got real. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/li

Re: [Tutor] Value Error

2013-06-12 Thread Alan Gauld
On 13/06/13 01:08, Marc Tompkins wrote: On Wed, Jun 12, 2013 at 3:31 PM, Dave Angel mailto:da...@davea.name>> wrote: >>> cmath.sqrt(float((math.e **(i * math.pi)).real)) 1j Sh*t just got real. no, it's imaginary. :-) -- Alan G Author of the Learn to Program web site http://www.alan

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Matt D
On 06/12/2013 05:59 PM, Dave Angel wrote: > On 06/12/2013 05:32 PM, Matt D wrote: >> On 06/10/2013 12:23 PM, Prasad, Ramit wrote: >>> Matt D wrote: Ramit Prasad wrote: >>> Scrolled panel is just a graphical container that allows for >>> scrolling inside, >>> but it is the window th

[Tutor] hello.

2013-06-12 Thread Lolo Lolo
http://pictmania.com/tez.php___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Dave Angel
On 06/12/2013 08:46 PM, Matt D wrote: On 06/12/2013 05:59 PM, Dave Angel wrote: On 06/12/2013 05:32 PM, Matt D wrote: Hey, if i put: self.logfile = open('logfile.csv', 'w') in the .py file, within the 'class TrafficPane', then shouldn't logfile.csv be written to the directory the .

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Matt D
> There are other ways a script might change the current directory. For > example, some naive scripts use os.chdir() > > But how is it you don't know what the current directory was when the > code ran? A simply pwd can tell you, if your prompt doesn't already > reveal it. > > hey i found the

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Dave Angel
On 06/12/2013 09:23 PM, Matt D wrote: There are other ways a script might change the current directory. For example, some naive scripts use os.chdir() But how is it you don't know what the current directory was when the code ran? A simply pwd can tell you, if your prompt doesn't already rev

Re: [Tutor] Value Error

2013-06-12 Thread Jim Mooney
On 12 June 2013 17:08, Marc Tompkins wrote: > On Wed, Jun 12, 2013 at 3:31 PM, Dave Angel wrote: > >> >>> cmath.sqrt(float((math.e **(i * math.pi)).real)) >> 1j >> > Sh*t just got real. > I give up. When I got to Complex Analysis I decided to enlist instead. And that was during Vie

[Tutor] Any speech to text conversation python library for Linux and mac box

2013-06-12 Thread Ranjith Kumar
Hello all, I'm looking for speech to text conversation python library for linux and mac box, I found few libraries but non of them supports any of these platform. I found following libraries speech, dragonfly and pyspeech supports only windows and sphinx for linux. Any suggestion? -- Cheers, Ran

[Tutor] Fwd: Re: Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Matt D
Original Message Subject: Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging) Date: Thu, 13 Jun 2013 00:17:44 -0400 From: Matt D To: Dave Angel On 06/12/2013 09:44 PM, Dave Angel wrote: > On 06/12/2013 09:23 PM, Matt D wrote: >> >>> There are o

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Matt D
On 06/12/2013 09:54 PM, Dave Angel wrote: > On 06/12/2013 09:14 PM, Matt D wrote: >> On 06/12/2013 09:02 PM, Dave Angel wrote: >>> On 06/12/2013 08:46 PM, Matt D wrote: On 06/12/2013 05:59 PM, Dave Angel wrote: > On 06/12/2013 05:32 PM, Matt D wrote: >>> >>> >>> >> Hey, >> if