Re: [Tutor] Question about Python being object oriented

2010-05-08 Thread Lie Ryan
On 05/09/10 02:19, Tino Dai wrote: > Hi Everybody, > > My friend and I were having a disagreement about Python. Has Python > always been an OO language or was it at one point a procedural language like > C? Thanks! AFAIK Python has always been a mixed paradigm language. You can write fully O

Re: [Tutor] Question about Python being object oriented

2010-05-08 Thread bob gailer
On 5/8/2010 12:19 PM, Tino Dai wrote: Hi Everybody, My friend and I were having a disagreement about Python. Has Python always been an OO language or was it at one point a procedural language like C? Thanks! OO and procedural are not mutually exclusive! From http://en.wikipedia.org/wik

Re: [Tutor] Question about Python being object oriented

2010-05-08 Thread Eike Welk
On Saturday May 8 2010 18:19:53 Tino Dai wrote: > Hi Everybody, > > My friend and I were having a disagreement about Python. Has Python > always been an OO language or was it at one point a procedural language > like C? Thanks! The Wikipedia article states: Yes, it was always an object orie

[Tutor] Question about Python being object oriented

2010-05-08 Thread Tino Dai
Hi Everybody, My friend and I were having a disagreement about Python. Has Python always been an OO language or was it at one point a procedural language like C? Thanks! -Tino ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscri

Re: [Tutor] QUESTION REGARDING STATUS OF MY SUBSCRIPTION FW: Auto-response for your message to the "Tutor" mailing list

2010-04-16 Thread Dave Angel
Peter Meagher wrote: GREETINGS, THIS EMAIL WOULD INDICATE THAT I AM ON THE SUBSCRIPTION LIST. HOWEVER, I GOT ANOTHER EMAIL, THAT CAME IN AT PRECISELY THE SAME TIME AS THE ORIGINAL MESSAGE THAT I AM FORWARDING YOU. THAT INDICATES THAT THERE WAS AN ISSUE ADDING ME TO THE LIST. I'VE PASTED IT IN T

[Tutor] QUESTION REGARDING STATUS OF MY SUBSCRIPTION FW: Auto-response for your message to the "Tutor" mailing list

2010-04-16 Thread Peter Meagher
GREETINGS, THIS EMAIL WOULD INDICATE THAT I AM ON THE SUBSCRIPTION LIST. HOWEVER, I GOT ANOTHER EMAIL, THAT CAME IN AT PRECISELY THE SAME TIME AS THE ORIGINAL MESSAGE THAT I AM FORWARDING YOU. THAT INDICATES THAT THERE WAS AN ISSUE ADDING ME TO THE LIST. I'VE PASTED IT IN THE BLOCK OF TEXT BELOW,

Re: [Tutor] Question about importing

2010-02-02 Thread Alan Gauld
"Grigor Kolev" wrote Can I use something like this #-- import sys sys.path.append("/home/user/other") import module #- Yes but if you have a lot of modules in there that you might want to use in

Re: [Tutor] Question about importing

2010-02-02 Thread Dave Angel
Eike Welk wrote: On Tuesday February 2 2010 20:28:03 Grigor Kolev wrote: Can I use something like this #-- import sys sys.path.append("/home/user/other") import module #- Yes I think so. I

Re: [Tutor] Question about importing

2010-02-02 Thread David Hutto
--- On Tue, 2/2/10, Grigor Kolev wrote: From: Grigor Kolev Subject: Re: [Tutor] Question about importing To: "David Hutto" Cc: "Python Tutor" Date: Tuesday, February 2, 2010, 2:54 PM В 11:47 -0800 на 02.02.2010 (вт), David Hutto написа: > > > ---

Re: [Tutor] Question about importing

2010-02-02 Thread Eike Welk
On Tuesday February 2 2010 20:28:03 Grigor Kolev wrote: > Can I use something like this > #-- > import sys > sys.path.append("/home/user/other") > import module > #- > Yes I think so. I just tried some

Re: [Tutor] Question about importing

2010-02-02 Thread Grigor Kolev
В 11:47 -0800 на 02.02.2010 (вт), David Hutto написа: > > > --- On Tue, 2/2/10, Grigor Kolev wrote: > > From: Grigor Kolev > Subject: Re: [Tutor] Question about importing > To: "David Hutto" > Cc: "Python Tuto

Re: [Tutor] Question about importing

2010-02-02 Thread David Hutto
--- On Tue, 2/2/10, Grigor Kolev wrote: From: Grigor Kolev Subject: Re: [Tutor] Question about importing To: "David Hutto" Cc: "Python Tutor" Date: Tuesday, February 2, 2010, 2:28 PM В 10:33 -0800 на 02.02.2010 (вт), David Hutto написа: > > > ---

Re: [Tutor] Question about importing

2010-02-02 Thread Grigor Kolev
В 10:33 -0800 на 02.02.2010 (вт), David Hutto написа: > > > --- On Tue, 2/2/10, Григор wrote: > > From: Григор > Subject: [Tutor] Question about importing > To: "Python Tutor" > Date: Tuesday, February 2, 2010, 12

Re: [Tutor] Question about importing

2010-02-02 Thread David Hutto
--- On Tue, 2/2/10, Григор wrote: From: Григор Subject: [Tutor] Question about importing To: "Python Tutor" Date: Tuesday, February 2, 2010, 12:07 PM Hi all. How can I import a module which is located in the upper directory. I think the following might be what you're loo

[Tutor] Question about importing

2010-02-02 Thread Григор
Hi all. How can I import a module which is located in the upper directory. -- Криле имат само тия, дето дето сърцето им иска да лети ! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-10 Thread Kent Johnson
On Sat, Jan 9, 2010 at 3:50 AM, spir wrote: > Lie Ryan dixit: > >> only use "from module import *" if the >> module was designed for such use > > In most cases, this translates to: the imported module defines __names__, > which holds the list of names (of the objects) to be exported. Check it. >

Re: [Tutor] question about function inside of function

2010-01-10 Thread Kent Johnson
On Sat, Jan 9, 2010 at 8:03 AM, spir wrote: > Do you realize the inner func will be redefined before each call? Meaning in > your case n calls x n outer loops x n inner loops. >   def f() ... > is actually a kind of masked assignment >   f = function()... That's true, but it is pretty inexpensi

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-10 Thread Eric Pavey
On Sat, Jan 9, 2010 at 9:08 PM, Lie Ryan wrote: > On 1/10/2010 11:23 AM, Eric Pavey wrote: > >> I should add (that as I understand it), when you do a 'from foo import >> blah', or 'from foo import *', this is doing a /copy/ (effectively) of >> that module's attributes into the current namespace.

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-09 Thread Lie Ryan
On 1/10/2010 11:23 AM, Eric Pavey wrote: I should add (that as I understand it), when you do a 'from foo import blah', or 'from foo import *', this is doing a /copy/ (effectively) of that module's attributes into the current namespace. Doing "import foo" or "import foo as goo" is keeping a /refe

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-09 Thread bob gailer
Eric Pavey wrote: I should add (that as I understand it), when you do a 'from foo import blah', or 'from foo import *', this is doing a /copy/ (effectively) of that module's attributes into the current namespace. Not a copy (which means duplicating the attribute) but a new reference to the orig

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-09 Thread Eric Pavey
method with its' parent module name, which [I think] makes > the code more understandable. > > From the virtual desk of Lowell Tackett > > > --- On *Sat, 1/9/10, Alan Gauld * wrote: > > > From: Alan Gauld > Subject: Re: [Tutor] Question on "import foobar&

Re: [Tutor] question about function inside of function

2010-01-09 Thread Richard D. Moores
On Sat, Jan 9, 2010 at 07:28, Alan Gauld wrote: > > "Richard D. Moores" wrote >> >> to be put in a function. For convenience sake, I've put this new >> function inside the one that calls it. >> >> Question 1: Is this bad practice? It works fine that way, but.. > > No, but there are some issues to

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-09 Thread Lowell Tackett
hey are not alway easily recognizable.  i.e, by importing foobar, you will always prefix a method with its' parent module name, which [I think] makes the code more understandable. >From the virtual desk of Lowell Tackett  --- On Sat, 1/9/10, Alan Gauld wrote: From: Alan Gauld Subject: Re: [

Re: [Tutor] question about function inside of function

2010-01-09 Thread Alan Gauld
"Richard D. Moores" wrote to be put in a function. For convenience sake, I've put this new function inside the one that calls it. Question 1: Is this bad practice? It works fine that way, but.. No, but there are some issues to consider. Denis has addressed some but one other is... Reuse:

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-09 Thread Alan Gauld
"Rob Cherry" wrote Extending on this advice somewhat - is it *ever* correct to "import foobar". Yes, it is *usually* correct to "import foobar" and rarely correct to "from foobar". The exception being if you only need one or two names from foobar, but usually you need a lot more, in which

Re: [Tutor] question about function inside of function

2010-01-09 Thread Richard D. Moores
On Sat, Jan 9, 2010 at 05:03, spir wrote: > Do you realize the inner func will be redefined before each call? Oh, I forgot about that. Thanks! Dick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.pyth

Re: [Tutor] question about function inside of function

2010-01-09 Thread spir
Richard D. Moores dixit: > I'm working on a function that seems to cry out for some of its code > to be put in a function. For convenience sake, I've put this new > function inside the one that calls it. > > Question 1: Is this bad practice? It works fine that way, but.. > > Question 2: If the a

[Tutor] question about function inside of function

2010-01-09 Thread Richard D. Moores
I'm working on a function that seems to cry out for some of its code to be put in a function. For convenience sake, I've put this new function inside the one that calls it. Question 1: Is this bad practice? It works fine that way, but.. Question 2: If the answer to Q1 is no, is there a standard p

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-09 Thread spir
Lie Ryan dixit: > only use "from module import *" if the > module was designed for such use In most cases, this translates to: the imported module defines __names__, which holds the list of names (of the objects) to be exported. Check it. Below, a,b,c,f,g,X,Y are defined, but only c,g,Y are ex

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-08 Thread Lie Ryan
On 1/9/2010 6:39 AM, Rob Cherry wrote: Extending on this advice somewhat - is it *ever* correct to "import foobar". There are countless examples of import os,sys The rule of thumb is: Use the "from module import something" if you're only going to use one or two functions from the module; onl

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-08 Thread Kent Johnson
On Fri, Jan 8, 2010 at 2:39 PM, Rob Cherry wrote: > Extending on this advice somewhat - is it *ever* correct to "import foobar". > > There are countless examples of > > import os,sys > > etc,etc.  Strictly speaking should we always be using "from" to only > get what we know we need? No, the plain

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-08 Thread Wayne Werner
On Fri, Jan 8, 2010 at 1:21 PM, Rob Cherry wrote: > Still trying to get the hang of some python intricacies, but this one > has come up a few times. Beyond the obvious syntactic niceties what > is the difference between importing with and without the "from" > syntax? > > Its nice for example to

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-08 Thread Luke Paireepinart
Yes, it depends how the library was designed. Some are designed so that you can import some of the library into your global namespace. For example, in Pygame library, it's accepted to do import pygame from pygame.locals import * This keeps the methods like pygame.init() pygame.display.set_mode(

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-08 Thread Rob Cherry
Extending on this advice somewhat - is it *ever* correct to "import foobar". There are countless examples of import os,sys etc,etc. Strictly speaking should we always be using "from" to only get what we know we need? Thanks, Rob ___ Tutor maillist

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-08 Thread Luke Paireepinart
The difference is a term called "namespace pollution". the "from socket import *" will place a whole lot of methods into your global namespace, possibly colliding with other methods / variables you've defined yourself. For example, if your file contained x = 5 from foobar import * and foobar co

[Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-08 Thread Rob Cherry
Still trying to get the hang of some python intricacies, but this one has come up a few times. Beyond the obvious syntactic niceties what is the difference between importing with and without the "from" syntax? Its nice for example to do this - from socket import * googleip = gethostbyname("www.g

[Tutor] question about for loops

2010-01-07 Thread Richard D. Moores
On Thu, Jan 7, 2010 at 05:03, Alan Plum wrote: > Variable unpacking works like this: > > points = [(0,0), (0,1), (0,2), (1,0), (1,1), (1,2), (2,0), (2,1), (2,2)] > > for (x,y) in points: >    print 'x: %d, y: %d' % (x, y) > > Without unpacking: > > for point in points: >    print 'x: %d, y: %d' %

Re: [Tutor] question about for loops

2010-01-07 Thread Richard D. Moores
Now I have a nice collection of examples, which to me are worth more than the sometimes inscrutable docs. My thanks to you three for taking the time to create the examples, and accompany them with understandable explanations. BTW I like Summerfield's book a lot, but he let me down on p.162. Dick

Re: [Tutor] question about for loops

2010-01-07 Thread taserian
On Thu, Jan 7, 2010 at 7:43 AM, Richard D. Moores wrote: > On p. 162 of "Programming In Python", 2nd ed., by Summerfield, the > section entitled "for Loops" begins: > > = > for expression in iterable: > for_suite > else: > else_suite > > The expressi

Re: [Tutor] question about for loops

2010-01-07 Thread Eike Welk
Hello Richard! On Thursday January 7 2010 13:43:26 Richard D. Moores wrote: > On p. 162 of "Programming In Python", 2nd ed., by Summerfield, the > section entitled "for Loops" begins: > > = > for expression in iterable: > for_suite > else: > else_

[Tutor] question about for loops

2010-01-07 Thread Richard D. Moores
On p. 162 of "Programming In Python", 2nd ed., by Summerfield, the section entitled "for Loops" begins: = for expression in iterable: for_suite else: else_suite The expression is normally either a single variable or a sequence of variables, usuall

Re: [Tutor] Question : Creating cribbage game

2009-12-07 Thread spir
Christopher schueler dixit: > > My name is Chris Schueler and i am having some troubles with my Python > programming > > > > Our current project is to create the game of cribbage from scratch. > > The only problem is we are not allowed to use classes, only user-defind > functions and arra

Re: [Tutor] Question : Creating cribbage game

2009-12-07 Thread Tim Goddard
> Message: 2 > Date: Mon, 7 Dec 2009 02:30:30 -0400 > From: Christopher schueler > To: > Subject: [Tutor] Question : Creating cribbage game > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > > My name is Chris Schueler and i am having som

[Tutor] Question : Creating cribbage game

2009-12-07 Thread Christopher schueler
My name is Chris Schueler and i am having some troubles with my Python programming Our current project is to create the game of cribbage from scratch. The only problem is we are not allowed to use classes, only user-defind functions and arrays. I was wondering if anybody could give me tips

Re: [Tutor] Question re: hangman.py

2009-11-13 Thread biboy mendz
thanks a lot for the clarification Alan and all. -- Regards, bibs M. Host/Kernel/OS "cc02695" running Linux 2.6.31-5.slh.4-sidux-686 [sidux 2009-02 Αιθήρ - kde-full - (200907141427) ] www.sidux.com Alan Gauld wrote: "biboy mendz" wrote chapter 8: hangman.py expression is: print(l

Re: [Tutor] Question re: hangman.py

2009-11-13 Thread Alan Gauld
"Hugo Arts" wrote print letter, ' ', You don't need the space, Python automatically inserts a space instead of the newline when you use the comma. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/l2p/ ___ Tutor maill

Re: [Tutor] Question re: hangman.py

2009-11-13 Thread Alan Gauld
"biboy mendz" wrote chapter 8: hangman.py expression is: print(letter, end=' ') it explained: end keyword argument in print() call makes the print() function put a space character at the end of the string instead of a newline. however when run it gives error: SyntaxError: invalid syntax.

Re: [Tutor] Question re: hangman.py

2009-11-13 Thread Hugo Arts
On Fri, Nov 13, 2009 at 2:17 PM, biboy mendz wrote: > http://inventwithpython.com > > chapter 8: hangman.py > > expression is: print(letter, end=' ') > > it explained: > end keyword argument in print() call makes the print() function put a space > character at the end of the string instead of a ne

[Tutor] Question re: hangman.py

2009-11-13 Thread biboy mendz
http://inventwithpython.com chapter 8: hangman.py expression is: print(letter, end=' ') it explained: end keyword argument in print() call makes the print() function put a space character at the end of the string instead of a newline. however when run it gives error: SyntaxError: invalid synta

Re: [Tutor] Question about time.gmtime

2009-11-02 Thread Eduardo Vieira
On Tue, Sep 29, 2009 at 8:11 AM, Eduardo Vieira wrote: > Hello, I had a problem with a script yesterday that made me puzzled. > My time zone is US Mountain Time. This script was running nice last > week, but yesterday it reported the date of today instead > So, yesterday at 5:20pm this line: > hoj

[Tutor] Question about time.gmtime

2009-09-29 Thread Eduardo Vieira
Hello, I had a problem with a script yesterday that made me puzzled. My time zone is US Mountain Time. This script was running nice last week, but yesterday it reported the date of today instead So, yesterday at 5:20pm this line: hoje = time.strftime("%a, %b %d, %Y", time.gmtime()) Gave me this: "

Re: [Tutor] Question if my reasoning is right

2009-08-19 Thread Kent Johnson
On Wed, Aug 19, 2009 at 1:52 AM, Darth Kaboda wrote: > I'm questioning my reason for why the follwoing code doesn't behave as I > thought it would upon first coding a project. > > m = 8 > n = 10 > cb = [[[0, None]] * (n + 1)] * (m + 1) > cb[3][2][0] = 10 > > This last statement causes the every fir

Re: [Tutor] Question if my reasoning is right

2009-08-19 Thread Alan Gauld
"Darth Kaboda" wrote cb = [[[0, None]] * (n + 1)] * (m + 1) cb[3][2][0] = 10 This last statement causes the every first element in the list to update. Is this becuase this method of initializing a list is just a copy Yes exactly. To get around this I'm now doing the folowing: cb = [[[0,N

[Tutor] Question if my reasoning is right

2009-08-18 Thread Darth Kaboda
I'm questioning my reason for why the follwoing code doesn't behave as I thought it would upon first coding a project. m = 8 n = 10 cb = [[[0, None]] * (n + 1)] * (m + 1) cb[3][2][0] = 10 This last statement causes the every first element in the list to update. Is this becuase this metho

Re: [Tutor] Question about the FONT in Tkinter

2009-08-03 Thread Kent Johnson
On Sat, Aug 1, 2009 at 12:12 PM, Mohannad Mohammad wrote: > Kindly refer to the attached photo. > There are two sentences appearing when the user checked two checkbutton, I > make it as a practice. > ok > I want to change the font of these two sentences. how? >     self.box = Text(self, width

[Tutor] Question about the FONT in Tkinter

2009-08-01 Thread Mohannad Mohammad
Hello all, Kindly refer to the attached photo. There are two sentences appearing when the user checked two checkbutton, I make it as a practice. ok I want to change the font of these two sentences. how? This is the code I use to make this simple application: from Tkinter import * class Appl

Re: [Tutor] Question from a newbie (thank you)

2009-07-23 Thread fiberfolly
WoW! You all have given me lots to look at, think about, and play with. Thank you one and all for your answers! <><><>___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Question from a newbie

2009-07-22 Thread John
On Tuesday 21 July 2009 11:12:23 am Deb wrote: > My son suggested I play around with Python. I was wondering if anybody has > any real life applications? It appears to be able to do quite a lot, but > is anybody really doing it with Python? I am very curious about this > language. I used to be a

Re: [Tutor] Question from a newbie

2009-07-22 Thread Glen Zangirolami
Deb, For starters most of the Google enterprise runs on python. Google App Engin e is for developers to develop web applications on Google There are many applications ranging from web frameworks to math modules. Web frameworks: Django

Re: [Tutor] Question from a newbie

2009-07-21 Thread Alan Gauld
"Deb" wrote My son suggested I play around with Python. Hi, welcome to the tutor list. I was wondering if anybody has any real life applications? There are several folks on the list who make a liiving writing Python. Others, like myself, use it in their day job but its not the main or en

Re: [Tutor] Question from a newbie

2009-07-21 Thread Kent Johnson
On Tue, Jul 21, 2009 at 2:12 PM, Deb wrote: > My son suggested I play around with Python.  I was wondering if anybody has > any real life applications?  It appears to be able to do quite a lot, but is > anybody really doing it with Python? Yes, Python is used in a wide variety of real-life applica

[Tutor] Question from a newbie

2009-07-21 Thread Deb
My son suggested I play around with Python. I was wondering if anybody has any real life applications? It appears to be able to do quite a lot, but is anybody really doing it with Python? I am very curious about this language. I used to be a Clipper programmer in another life (dBASE compiler),

Re: [Tutor] question about class

2009-06-10 Thread Lie Ryan
Vincent Davis wrote: > Thanks again for the help, A little followup. > For my applicant class I have a few initial values that need to be set > but I what to choose the value (actually the calculation to set the > value) for each applicant (instance?) > Here is the start of my Applicant Class > >

Re: [Tutor] question about class

2009-06-09 Thread Alan Gauld
"Vincent Davis" wrote Here is the start of my Applicant Class class Applicant(object): "quality is refers to the quality of the Applicant observe refers to the accuracy of which they assess the quality of the school" I guess you intended those to be triple quotes? def _

Re: [Tutor] question about class

2009-06-09 Thread Vincent Davis
Thanks again for the help, A little followup. For my applicant class I have a few initial values that need to be set but I what to choose the value (actually the calculation to set the value) for each applicant (instance?) Here is the start of my Applicant Class class Applicant(object): "qua

Re: [Tutor] question about class

2009-06-09 Thread Vincent Davis
Thanks for the help and comments, I think my questions have been answered, I will know if I understand when I try to implement them. The Match algorithm. algorithm is described in the link below. The Applicant and School rankings will be (Attributes ?) of the Applicant and School class, and I simul

Re: [Tutor] question about class

2009-06-09 Thread Alan Gauld
"Vincent Davis" wrote I am reading several tutorials about classes and trying to figure out how to apply it to my project. I have a working program that basically matches up applicants and schools. Schools and applicants have and "true" quality and an "observed" quality. Then there is an algori

Re: [Tutor] question about class

2009-06-09 Thread A.T.Hofkamp
Vincent Davis wrote: Accidentally sent I have added the rest (by the way I refrain from using the terms attribute, method, as I will likely miss use them) I am reading several tutorials about classes and trying to figure out how to apply it to my project. I have a working program that basic

Re: [Tutor] question about class

2009-06-09 Thread spir
Le Mon, 8 Jun 2009 17:31:23 -0600, Vincent Davis s'exprima ainsi: > Accidentally sent I have added the rest > (by the way I refrain from using the terms attribute, method, as I > will likely miss use them) > > > I am reading several tutorials about classes and trying to figure out > > how to

Re: [Tutor] question about class

2009-06-08 Thread Vincent Davis
Accidentally sent I have added the rest (by the way I refrain from using the terms attribute, method, as I will likely miss use them) > I am reading several tutorials about classes and trying to figure out > how to apply it to my project. I have a working program that basically > matches up ap

[Tutor] question about class

2009-06-08 Thread Vincent Davis
I am reading several tutorials about classes and trying to figure out how to apply it to my project. I have a working program that basically matches up applicants and schools. Schools and applicants have and "true" quality and an "observed" quality. Then there is an algorithm that matches them up.

Re: [Tutor] Question about Python.

2009-03-25 Thread Alan Gauld
"T" wrote I'm working on Paper, Rock, Scissors in Python. I need to make it a loop, and test the values (1, 2, 3, /Rock/Paper/Scissors) yet, but i'm kind of stuck. Could you help me? What exactly puzzles you? You know you need a loop so you presumably realize that you need to repeat some

Re: [Tutor] Question about Python.

2009-03-25 Thread A.T.Hofkamp
T wrote: Hi. I'm working on Paper, Rock, Scissors in Python. I need to make it a loop, and test the values (1, 2, 3, /Rock/Paper/Scissors) yet, but i'm kind of stuck. Could you help me? import random #Imports the random modual from the library. def main(): #First function. print 'Lets p

[Tutor] Question about Python.

2009-03-25 Thread T
Hi. I'm working on Paper, Rock, Scissors in Python. I need to make it a loop, and test the values (1, 2, 3, /Rock/Paper/Scissors) yet, but i'm kind of stuck. Could you help me? import random #Imports the random modual from the library. def main(): #First function. print 'Lets play Paper

Re: [Tutor] Question on how to open other programs and files

2009-02-08 Thread Alan Gauld
"Hi" wrote I have a question regarding how to open other programs and files in Python code. I am creating a simple interface and I want it to be able to open other files, such as a text file or a pdf file. OK, lets clarify something first. When you say open do you mean you want to open the

[Tutor] Question on how to open other programs and files

2009-02-07 Thread Hi
I have a question regarding how to open other programs and files in Python code. I am creating a simple interface and I want it to be able to open other files, such as a text file or a pdf file. However, those files are usually associated with other programs - for instance, gedit for text and docum

[Tutor] question about mpmath product expression

2009-02-02 Thread Bernd Prager
Does anybody know if there is a precision difference when I use mpmath and take an expression: from mpmath import * mp.dps = 100 mu0 = [mpf('4') * pi * power(10, -7) rather then: mu0 = fprod([mpf('4'), pi, power(10, -7)]) ? Thanks, -- Bernd ___ Tutor

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-20 Thread Lie Ryan
On Tue, 2009-01-20 at 08:04 -0800, Steve Willoughby wrote: > > In this case, that might be enough. I just need to show a video clip > in > an otherwise fairly simple GUI. A decorationless, borderless window > popped up on the screen over the Tk stuff would probably work. Thanks > for the advice

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-20 Thread Lie Ryan
On Mon, 19 Jan 2009 15:46:27 -0800, Steve Willoughby wrote: > On Mon, Jan 19, 2009 at 05:30:01PM -0500, Kent Johnson wrote: >> My guess is that pygame and Tkinter are both going to want to control >> the event loop. Googling 'pygame tkinter' gives both hints that it >> might be possible and hints

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-19 Thread Chris Fuller
On Monday 19 January 2009 12:05, Steve Willoughby wrote: > I have a game I'm porting to Python which is currently written > using TCL/Tk. Now it would be fairly easy to make it work in > Python with Tkinter, of course, since the way the GUI would be > organized and implemented would be essentially

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-19 Thread Steve Willoughby
On Mon, Jan 19, 2009 at 05:30:01PM -0500, Kent Johnson wrote: > My guess is that pygame and Tkinter are both going to want to control > the event loop. Googling 'pygame tkinter' gives both hints that it > might be possible and hints of trouble... Yeah, I was thinking that, but since what I saw up

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-19 Thread Kent Johnson
On Mon, Jan 19, 2009 at 1:05 PM, Steve Willoughby wrote: > Is it reasonable to expect that I could use Tkinter for > everything else, but use pygame/pymedia to handle things like > creating a video playback window on the screen, or is pygame > going to want to run the whole GUI event loop and scr

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-19 Thread Eike Welk
You could use Qt and PyQt (bindings) for your application. QT is a library for buttons and similar things; it can show images, play video and play sound. They should both be part of every big Linux distribution. They are also available for Windows and Mac OS. http://doc.trolltech.com/4.4/inde

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-19 Thread W W
On Mon, Jan 19, 2009 at 12:05 PM, Steve Willoughby wrote: > Is it reasonable to expect that I could use Tkinter for > everything else, but use pygame/pymedia to handle things like > creating a video playback window on the screen, or is pygame > going to want to run the whole GUI event loop and scr

[Tutor] Question about pygame/tkinter interaction

2009-01-19 Thread Steve Willoughby
I have a game I'm porting to Python which is currently written using TCL/Tk. Now it would be fairly easy to make it work in Python with Tkinter, of course, since the way the GUI would be organized and implemented would be essentially the same. However, I'd also like to implement some fancier (but

Re: [Tutor] Question regarding win32com getting ldap object

2009-01-05 Thread vishwajeet singh
Thanks for the help. It worked for me. On Tue, Jan 6, 2009 at 1:28 AM, Jervis Whitley wrote: > > > On Mon, Jan 5, 2009 at 8:04 PM, vishwajeet singh wrote: > >> Hi List, >> >> I am running following code to get ldap com object but the result I am >> getting is unknown >> I am using Python 25 and

Re: [Tutor] Question regarding win32com getting ldap object

2009-01-05 Thread Jervis Whitley
On Mon, Jan 5, 2009 at 8:04 PM, vishwajeet singh wrote: > Hi List, > > I am running following code to get ldap com object but the result I am > getting is unknown > I am using Python 25 and win32 bindings available at > http://downloads.sourceforge.net/pywin32/pywin32-212.win32-py2.2.exe?modtime=1

[Tutor] Question regarding win32com getting ldap object

2009-01-05 Thread vishwajeet singh
Hi List, I am running following code to get ldap com object but the result I am getting is unknown I am using Python 25 and win32 bindings available at http://downloads.sourceforge.net/pywin32/pywin32-212.win32-py2.2.exe?modtime=1217535908&big_mirror=0 *adsi = win32com.client.Dispatch('ADsNameSpa

Re: [Tutor] Question

2008-11-10 Thread Kent Johnson
On Mon, Nov 10, 2008 at 11:07 AM, Michael Connors <[EMAIL PROTECTED]> wrote: > My guess is that, if you want to provide instructions to someone with no > linux/unix experience. e.g. to edit a config file, you can safely tell them > to: nano myfile.conf and expect them to be able to save the file a

Re: [Tutor] Question

2008-11-10 Thread Alan Gauld
"Python Nutter" <[EMAIL PROTECTED]> wrote On the Mac I just linked ipython in the config file to nano On the iPhone 3G I just linked ipython in the config file to nano On the Linux/Ubuntu box I also linked to nano... hmmm looks like I use nano a lot more than I though ;-) Nothing to do with P

Re: [Tutor] Question

2008-11-10 Thread Michael Connors
2008/11/10 W W <[EMAIL PROTECTED]> > On Mon, Nov 10, 2008 at 9:40 AM, Alan Gauld <[EMAIL PROTECTED]>wrote: > >> > > What does nano do that vi (or emacs) doesn't? Given that vi is the >> "standard" editor on *nix ity would seem the obvious choice. But everyone >> seems to be using nano? Why? > > >

Re: [Tutor] Question

2008-11-10 Thread W W
On Mon, Nov 10, 2008 at 9:40 AM, Alan Gauld <[EMAIL PROTECTED]>wrote: > What does nano do that vi (or emacs) doesn't? Given that vi is the > "standard" editor on *nix ity would seem the obvious choice. But everyone > seems to be using nano? Why? AFAIK, it's a little smaller/faster than emacs..

Re: [Tutor] Question

2008-11-10 Thread Python Nutter
I use Notepad++ on my Windows box for Python, but my feeling about it is a bit "Blah..." but thats my feeling with Windows in general ;-) I think I'm one of the rare ones who do not like its choice of Syntax Highlighting colours. But too lazy to change them since I don't do much development on my

Re: [Tutor] Question

2008-11-09 Thread Rich Lovely
All you really need for python is a basic text editor, and the interpretter. Everything else is icing. Notepad++ has syntax highlighting support for python, and sounds as if it has brace and bracket completion. Most people here will tell you that auto- completion in python is a complex issue

Re: [Tutor] Question

2008-11-08 Thread Nick Scholtes
Last I checked, Notepad ++ works with Python. I've never used it for Python, so I don't know how it works. Nick On Sat, Nov 8, 2008 at 9:22 PM, Bap <[EMAIL PROTECTED]> wrote: > Can I use notepad++ for Python? > > Thank you! ;-) > > ___ > Tutor maillis

[Tutor] Question

2008-11-08 Thread Bap
Can I use notepad++ for Python? Thank you! ;-) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Question on DOMImplementation Objects

2008-09-30 Thread Chris Babcock
Does the DOMImplementation interface support schemas? I'm tweaking an example from a book to process a flat file registration database: from xml.dom import implementation class RegistrationParser: def parseFile(self, fileAsString): # Create DocType Declaration doctype = implement

Re: [Tutor] question about socket status

2008-07-24 Thread Monika Jisswel
if networking code is inside of the kernel then its from the kernel that you can get network information & nowhere else. (http://www.linuxdevcenter.com/pub/a/linux/2000/11/16/LinuxAdmin.html) I would just add that to see what ne

Re: [Tutor] question about socket status

2008-07-22 Thread arsyed
On Mon, Jul 21, 2008 at 1:25 PM, Rupp, Romaine <[EMAIL PROTECTED]> wrote: > Hello, > > I am new to programming with python and sockets. > > I would like to determine the status of a socket as it is returned when you > do 'netstat –a | grep '. I would like to know if the socket state > is ESTABLI

[Tutor] question about socket status

2008-07-21 Thread Rupp, Romaine
Hello, I am new to programming with python and sockets. I would like to determine the status of a socket as it is returned when you do 'netstat -a | grep '. I would like to know if the socket state is ESTABLISHED, LISTEN , CLOSE_WAIT, etc. Is there a way to get this information through a socke

<    1   2   3   4   5   6   7   8   9   10   >