Re: [Tutor] easy way to populate a dict with functions

2009-08-11 Thread Albert-Jan Roskam
Hi Bob, Sorry for the late reply, but thank you for your code. I still haven't completely wrappped my brain around decorator functions, but thanks to your reply at least now my frontal lobe is touching it. ;-) Re: the ordering of functions: I thought it mattered because the inspect module retu

Re: [Tutor] run python script on another computer's terminal (LAN)

2009-08-11 Thread Alan Gauld
"pedro" wrote Hi, does anyone know how to send a command that is within a python script to another computer's terminal. This is what it looks like in Applescript. tell application "Terminal" of machine "eppc://USERNAME:passw...@computer2.local" do script "ls" end tell You might be bette

[Tutor] To write data in two different fonts?

2009-08-11 Thread prasad rao
Hello I am wtriting some dat on to a file in which headings should be of different size than other data. Is it possible?If possible please tell me how to do it. def sc(adir): import os,myfiles dest=open('C:/scripts.txt','w') s=myfiles.myfiles(adir) for x in s:

Re: [Tutor] To write data in two different fonts?

2009-08-11 Thread Kent Johnson
On Tue, Aug 11, 2009 at 5:24 AM, prasad rao wrote: > Hello > I am wtriting some dat on to a file in which > headings should be of different size than other data. > Is it possible?If possible please tell me how to do it. > > > > def sc(adir): >   import os,myfiles >   dest=open('C:/scr

Re: [Tutor] To write data in two different fonts?

2009-08-11 Thread Dave Angel
prasad rao wrote: Hello I am wtriting some dat on to a file in which headings should be of different size than other data. Is it possible?If possible please tell me how to do it. def sc(adir): import os,myfiles dest=open('C:/scripts.txt','w') s=myfiles.myfiles(adir)

[Tutor] list question

2009-08-11 Thread proportional
hi i am currently doing the 'livewires' python tutorial lesson 5. i am making a little game that makes a few squares chase a circle around a little grid. i can get the 1 square acting on 1 variable to come up, but the tutorial now wants me to create a list of variables that act under the same cl

Re: [Tutor] list question

2009-08-11 Thread Ataulla S H
On Tue, Aug 11, 2009 at 5:47 PM, wrote: > hi i am currently doing the 'livewires' python tutorial lesson 5. i am > making a little game that makes a few squares chase a circle around a little > grid. i can get the 1 square acting on 1 variable to come up, but the > tutorial now wants me to creat

Re: [Tutor] list question

2009-08-11 Thread Wayne
On Tue, Aug 11, 2009 at 7:17 AM, wrote: > hi i am currently doing the 'livewires' python tutorial lesson 5. i am > making a little game that makes a few squares chase a circle around a little > grid. i can get the 1 square acting on 1 variable to come up, but the > tutorial now wants me to creat

Re: [Tutor] run python script on another computer's terminal (LAN)

2009-08-11 Thread pedro
On 2009-08-11 05:27:19 -0400, "Alan Gauld" said: "pedro" wrote Hi, does anyone know how to send a command that is within a python script to another computer's terminal. This is what it looks like in Applescript. tell application "Terminal" of machine "eppc://USERNAME:passw...@computer2.loca

Re: [Tutor] list question

2009-08-11 Thread Ataulla S H
if u want to add new attributes into ur list u need to import list object in ur class class customlist(list): x = 'your val' c = customlist() >>> dir(c) ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__delslice__', '__dict__', '__doc__', '__eq__', '__ge__', '__getattr

Re: [Tutor] list question

2009-08-11 Thread Dave Angel
Wayne wrote: On Tue, Aug 11, 2009 at 7:17 AM, wrote: hi i am currently doing the 'livewires' python tutorial lesson 5. i am making a little game that makes a few squares chase a circle around a little grid. i can get the 1 square acting on 1 variable to come up, but the tutorial now wants

Re: [Tutor] easy way to populate a dict with functions

2009-08-11 Thread bob gailer
Albert-Jan Roskam wrote: Hi Bob, Sorry for the late reply, but thank you for your code. I still haven't completely wrappped my brain around decorator functions, but thanks to your reply at least now my frontal lobe is touching it. ;-) Decorator functions: def collect(func): 'a "decorator

Re: [Tutor] To write data in two different fonts?

2009-08-11 Thread prasad rao
Hello I modified my code.But I am gettingmy my lines stripped of indentation. What should I do to avoid it?Sorry if it is not about Python. def sc(adir): import os,myfiles dest=open('C:/scripts.html','w') s=myfiles.myfiles(adir) dest.write('') for x in s:

Re: [Tutor] MySQLdb field type

2009-08-11 Thread Rick Pasotto
On Mon, Aug 10, 2009 at 07:22:03PM -0400, Kent Johnson wrote: > On Mon, Aug 10, 2009 at 3:52 PM, Rick Pasotto wrote: > > Not exactly what I'm looking for. > > > > The type_code in the tuple is a number. For one of my tables I see the > > following numbers: 1, 2, 10, 252, 253, 254. What I wanted was

Re: [Tutor] To write data in two different fonts?

2009-08-11 Thread Dave Angel
prasad rao wrote: Hello I modified my code.But I am gettingmy my lines stripped of indentation. What should I do to avoid it?Sorry if it is not about Python. def sc(adir): import os,myfiles dest=open('C:/scripts.html','w') s=myfiles.myfiles(adir) dest.write('')

Re: [Tutor] To write data in two different fonts?

2009-08-11 Thread Michael M Mason
Dave Angel wrote on 11 August 2009 at 16:42:- > The brute-force way might be to replace each space in "l" with >   which is a "nonbreaking space." But I think you want the > tag, which means the text is pre-formatted. And you could put that > around the whole sorce file, instead of doin

Re: [Tutor] droplet like behaviour in Python

2009-08-11 Thread Nick Raptis
pedro wrote: #!/usr/bin/env python # encoding: utf-8 import sys theFilePath = sys.argv[1] print theFilePath But when I try to drop something on it nothing happens. Sorry I guess there is something fundamental that I am missing. Pete Pedro, I'll reply to this message instead of the last o

Re: [Tutor] easy way to populate a dict with functions

2009-08-11 Thread Kent Johnson
On Tue, Aug 11, 2009 at 10:22 AM, bob gailer wrote: > Decorator functions: > > def collect(func): > 'a "decorator" that adds each function to the cmds list' > cmds.append((func.__name__, func)) Decorators must return a callable, add to the above: return func Kent _

Re: [Tutor] MySQLdb field type

2009-08-11 Thread Kent Johnson
On Tue, Aug 11, 2009 at 11:10 AM, Rick Pasotto wrote: > I didn't realize there were different MySQLdb modules. I didn't realize you had specified MySQLdb...sorry, I'm not being very helpful. I don't know where to find that information for MySQLdb. Kent ___

Re: [Tutor] droplet like behaviour in Python

2009-08-11 Thread Nick Raptis
For the Windows users out there: A google search returned me this: Make Python Scripts Droppable in Windows I checked my registry and the extension was there. That must be why my drop script works.

Re: [Tutor] droplet like behaviour in Python

2009-08-11 Thread Wayne
On Tue, Aug 11, 2009 at 4:49 PM, Nick Raptis wrote: > > PS2: I guess I'm starting to deduce that the answer is > platform/installation specific rather than python/script specific. > That turns the question it to a whole new direction for me. It's probably even more than that - my guess is

[Tutor] string.title(): correct?

2009-08-11 Thread Allen Fowler
Hello, "He's a great guy".title() Gives me: "He'S A Great Guy" I expected: "He's A Great Guy" Did i miss something here? Thank you, :) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] To write data in two different fonts?

2009-08-11 Thread Dave Angel
Michael M Mason wrote: Dave Angel wrote on 11 August 2009 at 16:42:- The brute-force way might be to replace each space in "l" with   which is a "nonbreaking space." But I think you want the tag, which means the text is pre-formatted. And you could put that around the whole

Re: [Tutor] easy way to populate a dict with functions

2009-08-11 Thread bob gailer
Kent Johnson wrote: On Tue, Aug 11, 2009 at 10:22 AM, bob gailer wrote: Decorator functions: def collect(func): 'a "decorator" that adds each function to the cmds list' cmds.append((func.__name__, func)) Decorators must return a callable The docs indeed say that, but the interprete

Re: [Tutor] string.title(): correct?

2009-08-11 Thread bob gailer
Allen Fowler wrote: Hello, "He's a great guy".title() Gives me: "He'S A Great Guy" I expected: "He's A Great Guy" Did i miss something here? The docs state: "title( ) - Return a titlecased version of the string: words start with uppercase characters, all remaining cased characters

Re: [Tutor] To write data in two different fonts?

2009-08-11 Thread prasad rao
> > But I think you want the tag, which means the text is > pre-formatted. And you could >put that around the whole sorce file, instead > of doing for each line. > > >See http://www.w3schools.com/tags/tag_pre.asp Thank you Dave. I put in tag and it worked. But at one particular line in a mo

[Tutor] creating an exe

2009-08-11 Thread proportional
hi, thanks to all that helped with my list question yesterday. i have now finished my program the way i want it. is there a way to compile my program so that people without python can see what i have made?___ Tutor maillist - Tutor@python.org http://m