Re: [Tutor] garbage collection/class question

2013-01-12 Thread Jan Riechers
On 12.01.2013 02:19, Mitya Sirenef wrote: Functions are the same, (called methods), but the self object is different for each instance, and represents the instance. Consider that since the logic performed by the method is the same (if it wasn't, you'd define it as a separate method, right?), the

Re: [Tutor] run perl script files and capture results

2013-01-12 Thread eryksun
On Fri, Jan 11, 2013 at 7:33 PM, Prasad, Ramit wrote: > > Why not just use r'C:\Python27\\'? Might be too confusing for > a beginner to remember, I suppose. Off the top of my heard I can think of 3 raw-escape uses of backslash in a raw string literal: placing an even number of backslashes at the

Re: [Tutor] garbage collection/class question

2013-01-12 Thread Alan Gauld
On 12/01/13 08:09, Jan Riechers wrote: So to rephrase what you and also other wrote: By setting "oakTree = Tree()" I create a new "Tree()" class instance. Now calls to "oakTree.grow()" access functions of the Tree class, by traversing to it's "Superclass" Tree. No, they traverse to its Tree cl

Re: [Tutor] pexports python27.dll > python27.def (pygraphviz 1.1 package )

2013-01-12 Thread eryksun
On Fri, Jan 11, 2013 at 7:12 PM, somnath chakrabarti wrote: > > Actually the problem was the access permission for the destination folder. I > changed to my account-specific path and it worked. You should be OK using gcc as long as you're not using C++. But why not use Microsoft's free (as in bee

Re: [Tutor] garbage collection/class question

2013-01-12 Thread Jan Riechers
On 12.01.2013 11:24, Alan Gauld wrote: On 12/01/13 08:09, Jan Riechers wrote: So to rephrase what you and also other wrote: By setting "oakTree = Tree()" I create a new "Tree()" class instance. Now calls to "oakTree.grow()" access functions of the Tree class, by traversing to it's "Superclass"

Re: [Tutor] Is a link broken?

2013-01-12 Thread Steven D'Aprano
On 12/01/13 13:47, Ed Owens wrote: I've written an example that I hope illustrates my problem: #!/usr/bin/env python import urllib2 sites = ('http://www.catb.org', 'http://ons-sa.org', 'www.notasite.org') for site in sites: try: page = urllib2.urlopen(site) print page.getu

Re: [Tutor] Working with output of a subprocess

2013-01-12 Thread Jan Riechers
On 12.01.2013 00:29, 3n2 Solutions wrote: Need some help with working with a text file. Is it possible to get the values associated with each of the parameter in the below text file format? For example: 1. How can I check what the Min and Max values are? 2. How to check the second column value a

[Tutor] (no subject)

2013-01-12 Thread Ali Raza Ghasemi
I have to make a program that adds binary numbers together. The program has to accept two binary values (up to 8 binary digits) and output their total in binary. The output should not contain any leading zeros. I have a problem in that I don't know how to limit the number digits to 8 as it accep

Re: [Tutor] (no subject)

2013-01-12 Thread Joel Goldstick
First, you need to type in a useful subject line for your question. Second, it is nicer if you use plain text instead of rtf because rtf messes up indentations sometimes. This looks like homework. That's ok. But you should say so. You haven't really asked a question. You state the assignment,

Re: [Tutor] (no subject)

2013-01-12 Thread Dave Angel
On 01/12/2013 12:32 PM, Ali Raza Ghasemi wrote: > I have to make a program that adds binary numbers together. The program has > to accept two binary values (up to 8 binary digits) and output their total in > binary. The output should not contain any leading zeros. > I have a problem in that I don

Re: [Tutor] Problem with calling class methods stored in a list

2013-01-12 Thread Tobias M.
Peter Otten wrote: You are right; the misunderstanding is that I wasn't advertising the above "fancy" solution (which is buggy, btw). Yes, I wasn't sure about the irony in you last post ;) Peter Otten wrote: I have now implemented what I had in mind with the protocol to function name mapping,

[Tutor] Binary Addition

2013-01-12 Thread Ali Raza Ghasemi
Hi, the program that I sent you is not homework. It is merely something I did in my free time. I don't know what you mean so can you make it a little bit clearer by sending me the code. ___ Tutor maillist - Tutor@python.org To unsubscribe or change su

Re: [Tutor] a Pygtk question sort of

2013-01-12 Thread ALAN GAULD
Forwarding to the List Pleae use ReplyAll for list responses.   Alan Gauld Author of the Learn To Program website http://www.alan-g.me.uk/ > > From: richard kappler >To: Alan Gauld >Sent: Saturday, 12 January 2013, 2:15 >Subject: Re: [Tutor] a Pygtk question

[Tutor] Adding Binary

2013-01-12 Thread Ali Raza Ghasemi
I am making a program that adds binary numbers together. The program has to accept two binary values (up to 8 binary digits) and output their total in binary. The output should not contain any leading zeros. I have a problem in that I don't know how to limit the number digits to 8 as it accepts

Re: [Tutor] Adding Binary

2013-01-12 Thread Dave Angel
On 01/12/2013 03:43 PM, Ali Raza Ghasemi wrote: > I am making a program that adds binary numbers together. The program has to > accept two binary values (up to 8 binary digits) and output their total in > binary. The output should not contain any leading zeros. > I have a problem in that I don't

Re: [Tutor] Adding Binary

2013-01-12 Thread Alan Gauld
On 12/01/13 20:43, Ali Raza Ghasemi wrote: I am making a program that adds binary numbers together. The program has to accept two binary values (up to 8 binary digits) and output their total in binary. The output should not contain any leading zeros. The first thing to realize is that all numbe

Re: [Tutor] running multiple versions of python

2013-01-12 Thread Wayne Werner
On Thu, 10 Jan 2013, Fowler, Trent wrote: I am running Windows 7 and I've installed two versions of python, 3.3 and 2.7. Python 3.3 was the first version I installed and I was able to run scripts from the desktop (not the command line). I installed python 2.7 so that I could get numpy, scipy,