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 Alan Gauld
Grigor Kolev grigor.ko...@gmail.com 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

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 lie.1...@gmail.com 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

Re: [Tutor] question about function inside of function

2010-01-10 Thread Kent Johnson
On Sat, Jan 9, 2010 at 8:03 AM, spir denis.s...@free.fr 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

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 denis.s...@free.fr 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.

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

[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

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 answer

Re: [Tutor] question about function inside of function

2010-01-09 Thread Richard D. Moores
On Sat, Jan 9, 2010 at 05:03, spir denis.s...@free.fr 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

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

2010-01-09 Thread Alan Gauld
Rob Cherry pythontu...@lxrb.com 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

Re: [Tutor] question about function inside of function

2010-01-09 Thread Alan Gauld
Richard D. Moores rdmoo...@gmail.com 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

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

2010-01-09 Thread Lowell Tackett
Subject: Re: [Tutor] Question on import foobar vs from foobar import * To: tutor@python.org Date: Saturday, January 9, 2010, 10:21 AM Rob Cherry pythontu...@lxrb.com wrote Extending on this advice somewhat - is it *ever* correct to import foobar. Yes, it is *usually* correct to 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 alan.ga...@btinternet.com wrote: Richard D. Moores rdmoo...@gmail.com 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,

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

2010-01-09 Thread Eric Pavey
of Lowell Tackett --- On *Sat, 1/9/10, Alan Gauld alan.ga...@btinternet.com* wrote: From: Alan Gauld alan.ga...@btinternet.com Subject: Re: [Tutor] Question on import foobar vs from foobar import * To: tutor@python.org Date: Saturday, January 9, 2010, 10:21 AM Rob Cherry pythontu

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

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

[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 =

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

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
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()

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 pythontu...@lxrb.com 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

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 pythontu...@lxrb.com 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,

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; only

[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, usually

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_suite

Re: [Tutor] question about for loops

2010-01-07 Thread taserian
On Thu, Jan 7, 2010 at 7:43 AM, Richard D. Moores rdmoo...@gmail.comwrote: 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

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.

[Tutor] question about for loops

2010-01-07 Thread Richard D. Moores
On Thu, Jan 7, 2010 at 05:03, Alan Plum alan.p...@uni-koeln.de 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:

[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 : Creating cribbage game

2009-12-07 Thread Tim Goddard
Message: 2 Date: Mon, 7 Dec 2009 02:30:30 -0400 From: Christopher schueler chris_schue...@hotmail.com To: tutor@python.org Subject: [Tutor] Question : Creating cribbage game Message-ID: col115-w23640cb7712629d3a205fee0...@phx.gbl Content-Type: text/plain; charset=iso-8859-1 My name

Re: [Tutor] Question : Creating cribbage game

2009-12-07 Thread spir
Christopher schueler chris_schue...@hotmail.com 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

[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

Re: [Tutor] Question re: hangman.py

2009-11-13 Thread Hugo Arts
On Fri, Nov 13, 2009 at 2:17 PM, biboy mendz bibsmen...@gmail.com 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

Re: [Tutor] Question re: hangman.py

2009-11-13 Thread Alan Gauld
biboy mendz bibsmen...@gmail.com 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:

Re: [Tutor] Question re: hangman.py

2009-11-13 Thread Alan Gauld
Hugo Arts hugo.yo...@gmail.com 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/

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 bibsmen...@gmail.com wrote chapter 8: hangman.py

Re: [Tutor] Question about time.gmtime

2009-11-02 Thread Eduardo Vieira
On Tue, Sep 29, 2009 at 8:11 AM, Eduardo Vieira eduardo.su...@gmail.com 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

[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 Alan Gauld
Darth Kaboda darthkab...@msn.com 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

Re: [Tutor] Question if my reasoning is right

2009-08-19 Thread Kent Johnson
On Wed, Aug 19, 2009 at 1:52 AM, Darth Kabodadarthkab...@msn.com 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

[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

[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

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! faint_grain.jpgSENDER_EMAILfiberfolly@gmail@@com.pngsg-a85400.gif___ Tutor maillist - Tutor@python.org

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 http://code.google.com/appengine/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-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

[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 from a newbie

2009-07-21 Thread Kent Johnson
On Tue, Jul 21, 2009 at 2:12 PM, Debswifts...@comcast.net 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

Re: [Tutor] Question from a newbie

2009-07-21 Thread Alan Gauld
Deb swifts...@comcast.net 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

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 class

Re: [Tutor] question about class

2009-06-09 Thread spir
Le Mon, 8 Jun 2009 17:31:23 -0600, Vincent Davis vinc...@vincentdavis.net 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

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

Re: [Tutor] question about class

2009-06-09 Thread Alan Gauld
Vincent Davis vinc...@vincentdavis.net 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

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

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):

Re: [Tutor] question about class

2009-06-09 Thread Alan Gauld
Vincent Davis vinc...@vincentdavis.net 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

[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 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

[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 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

Re: [Tutor] Question about Python.

2009-03-25 Thread Alan Gauld
T suger_c...@hotmail.com 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

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

2009-02-08 Thread Alan Gauld
Hi haztan...@gmail.com 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

[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

[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 ___

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 of

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,

[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

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-19 Thread W W
On Mon, Jan 19, 2009 at 12:05 PM, Steve Willoughby st...@alchemy.comwrote: 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

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.

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-19 Thread Kent Johnson
On Mon, Jan 19, 2009 at 1:05 PM, Steve Willoughby st...@alchemy.com 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

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 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 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 jervi...@gmail.com wrote: On Mon, Jan 5, 2009 at 8:04 PM, vishwajeet singh dextrou...@gmail.comwrote: Hi List, I am running following code to get ldap com object but the result I am getting is unknown

Re: [Tutor] Question

2008-11-10 Thread W W
On Mon, Nov 10, 2008 at 9:40 AM, Alan Gauld [EMAIL PROTECTED]wrote: snip 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 Michael Connors
2008/11/10 W W [EMAIL PROTECTED] On Mon, Nov 10, 2008 at 9:40 AM, Alan Gauld [EMAIL PROTECTED]wrote: snip 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

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

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 and

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

[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

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 maillist -

[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 =

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) http://www.linuxdevcenter.com/pub/a/linux/2000/11/16/LinuxAdmin.html I would just add that to see what

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 port#'. I would like to know if the socket state is

[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 port#'. 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

Re: [Tutor] Question on how to do something.

2008-07-18 Thread Alan Gauld
Mitchell Nguyen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello. I'm new to Python and I was wondering how to read all the files in a folder. Take a look at the fileinput module, I think it will do what you want. Alan G ___

Re: [Tutor] Question on how to do something.

2008-07-18 Thread Jerry Hill
On Thu, Jul 17, 2008 at 6:39 PM, Mitchell Nguyen [EMAIL PROTECTED] wrote: Hello. I'm new to Python and I was wondering how to read all the files in a folder. I used this program or command for single files. And if possible, is there a way to make it so that it waits at the end of each file

[Tutor] Question on how to do something.

2008-07-17 Thread Mitchell Nguyen
Hello. I'm new to Python and I was wondering how to read all the files in a folder. I used this program or command for single files. import pprint pprint.pprint(open(r'c:\text\somefile.txt').readlines()) And if possible, is there a way to make it so that it waits at the end of each file for

[Tutor] Question about string

2008-07-03 Thread Dong Li
Hi, everyone I am new to python, so what I ask may be so basic. I don't know the difference between s = 'a' 'b' and s = 'a'+'b' They have the same results. Thanks for relying! ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Question about string

2008-07-03 Thread Alan Gauld
Dong Li [EMAIL PROTECTED] wrote I am new to python, so what I ask may be so basic. I don't know the difference between s = 'a' 'b' and s = 'a'+'b' They have the same results. Thanks for relying! I think the differencec is that the first is purely a syntax thing so the interpreter does the

Re: [Tutor] Question about string

2008-07-03 Thread Monika Jisswel
Python is one of the smartest languages, it does many things for the programmer (I don't know but this might be what they mean with Batteries-Included) , you have just scratched the surface of it, here python concatenated your strings together for you, later you will meet list comprehention

Re: [Tutor] Question about string

2008-07-03 Thread Dong Li
Date: Thu, 3 Jul 2008 10:18:23 +0100 From: Alan Gauld [EMAIL PROTECTED] Subject: Re: [Tutor] Question about string To: tutor@python.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; format=flowed; charset=iso-8859-1; reply-type=original Dong Li [EMAIL PROTECTED] wrote

Re: [Tutor] Question about string

2008-07-03 Thread Michael yaV
= ’10’ converted_age = int(age) if converted_age == 10: ... print ’you are 10’ ... you are 10 On Jul 3, 2008, at 12:29 PM, Dong Li wrote: Date: Thu, 3 Jul 2008 10:18:23 +0100 From: Alan Gauld [EMAIL PROTECTED] Subject: Re: [Tutor] Question about string To: tutor@python.org Message-ID

Re: [Tutor] Question about global variables on modules

2008-04-07 Thread Dave Kuhlman
On Fri, Apr 04, 2008 at 10:25:30PM -0300, Tiago Katcipis wrote: I know its not such a pretty thing to have global variables but its only for an exercise my teacher told to do. Its a function to calculate the results of a matrix using jacob. I want to inside the module (inside a function on the

[Tutor] Question about global variables on modules

2008-04-06 Thread Tiago Katcipis
I know its not such a pretty thing to have global variables but its only for an exercise my teacher told to do. Its a function to calculate the results of a matrix using jacob. I want to inside the module (inside a function on the module )assign a value to a global variable, but the only way i

Re: [Tutor] Question about global variables on modules

2008-04-05 Thread Alan Gauld
Tiago Katcipis [EMAIL PROTECTED] wrote results of a matrix using jacob. I want to inside the module (inside a function on the module )assign a value to a global variable, but the only way i found to do this inside the own module function is importing the module inside himself. Is there

[Tutor] Question about global variables on modules

2008-04-04 Thread Tiago Katcipis
I know its not such a pretty thing to have global variables but its only for an exercise my teacher told to do. Its a function to calculate the results of a matrix using jacob. I want to inside the module (inside a function on the module )assign a value to a global variable, but the only way i

Re: [Tutor] Question about global variables on modules

2008-04-04 Thread Anthony Baldwin
Tiago Katcipis wrote: I know its not such a pretty thing to have global variables but its only for an exercise my teacher told to do. Its a function to calculate the results of a matrix using jacob. I want to inside the module (inside a function on the module )assign a value to a global

[Tutor] Question about Python ORM

2008-04-02 Thread hiren kumar
Hi, I am very much new to Python and it's available framework. When I search the over net about Python ORM, I found there are so many ORMs available and I was confused between them? I don't understand where to go? :( Can you please tell me something about Python ORM? Regards, Kumar

Re: [Tutor] Question about Python ORM

2008-04-02 Thread Andreas Kostyrka
There are many as you said yourself. Recommendation: sqlalchemy.org Andreas Am Mittwoch, den 02.04.2008, 16:51 +0530 schrieb hiren kumar: Hi, I am very much new to Python and it's available framework. When I search the over net about Python ORM, I found there are so many ORMs available

Re: [Tutor] Question about Python ORM

2008-04-02 Thread Michael Langford
If you do sqlalchemy, I recommend you at least also look at sqlsoup to help making your mappings easier: http://www.sqlalchemy.org/trac/wiki/SqlSoup If you don't want to write mappers and you don't need the relational database, ZODB also works: http://www.zope.org/Products/StandaloneZODB

[Tutor] question concerning Boolean operators

2008-03-20 Thread Guba
Dear list, from Guido's tutorial: It is possible to assign the result of a comparison or other Boolean expression to a variable. For example, string1, string2, string3 = '', 'Trondheim', 'Hammer Dance' non_null = string1 or string2 or string3 non_null

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