Re: [Tutor] Top Programming Languages of 2013

2007-10-08 Thread Michael
I'd guess that by 2013 we'll be using a slightly more graceful, but still horribly wrong (and unsupported by IE 7.666), redo of HTML, CSS, Javascript, Flash, and Java with a poorly conceived back-end marriage of PHP + MySQL or some horrible Microsoft technology for most apps. I'll also venture that

Re: [Tutor] newbie: Django suited for database driven web application?

2007-10-08 Thread Howard Hansen
Kent Johnson wrote: > cuongvt wrote: > >> Hello >> I'm new to both Django and Python. I'm mainly developing on PHP. >> I tend to move to Django. But I want to confirm as below: >> I heard that Django is mainly used for something like content management, >> CMS or something >> like that and R

Re: [Tutor] Logging with proper format

2007-10-08 Thread Eric Brunson
Kent Johnson wrote: > Eric Brunson wrote: > >> claxo wrote: >> >>> dont indent the line after '\', that means 0 indent >>> >>> s = 'hello\ >>> boy' >>> >>> >> Or, arguably better: >> >> s = '''hello >> boy''' >> > > That is a different string, it contains a newline, the origi

[Tutor] Fwd: Permission Report

2007-10-08 Thread Stephen Nelson-Smith
Sorry... -- Forwarded message -- From: Stephen Nelson-Smith <[EMAIL PROTECTED]> Date: Oct 8, 2007 6:54 PM Subject: Re: [Tutor] Permission Report To: Alan Gauld <[EMAIL PROTECTED]> On 10/8/07, Alan Gauld <[EMAIL PROTECTED]> wrote: > Yes, os.walk and os.stat should do what you wan

Re: [Tutor] Updating MySQL Database

2007-10-08 Thread wormwood_3
Thanks to everyone who responded for the information and tips. * That line I had: > for line in inputlist: > updatequery = "update resultstable set fqdn = line.split(",")[1] > where ip = line.split(",")[0];" was totally bogus. I was typing and thinking, and not at the same rate:-) Th

Re: [Tutor] Updating MySQL Database

2007-10-08 Thread Eric Brunson
wormwood_3 wrote: > Thanks to everyone who responded for the information and tips. > > * That line I had: > >> for line in inputlist: >> updatequery = "update resultstable set fqdn = line.split(",")[1] >> where ip = line.split(",")[0];" >> > > was totally bogus. I was typing an

[Tutor] os.rename anomaly in Python 2.3 on Windows XP

2007-10-08 Thread Tony Cappellini
Using Windows XP, SP2 and Python 2.3 I've written a script which walks through a bunch of directories and replaces characters which are typically illegals as filenames, with an '_' character. The directories are part of a package of software which is released by a group of people from Japan, and

[Tutor] print question

2007-10-08 Thread Dick Moores
def secsToHMS(seconds): """ Convert seconds to hours:minutes:seconds, with seconds rounded to nearest hundredths of a second, and print """ hours, minutes = 0, 0 if seconds >= 60 and seconds < 3600: minutes, seconds = divmod(seconds, 60) elif seconds >= 3600:

Re: [Tutor] print question

2007-10-08 Thread John Fouhy
On 09/10/2007, Dick Moores <[EMAIL PROTECTED]> wrote: > What's the best way to get hours in 2 or more digits, and minutes in > 2 digits, so that the above would be 05:07:36.88? (I'm writing a stopwatch.) String formatting! >>> template = '%02d:%02d:%02d.%02d' >>> template % (1, 22, 3, 44) '01:22:

Re: [Tutor] print question

2007-10-08 Thread Ian Witham
On 10/9/07, Dick Moores <[EMAIL PROTECTED]> wrote: > > def secsToHMS(seconds): > """ > Convert seconds to hours:minutes:seconds, with seconds rounded > to nearest hundredths of a second, and print > """ > hours, minutes = 0, 0 > if seconds >= 60 and seconds < 3600: >

[Tutor] Nested list access?

2007-10-08 Thread Chuk Goodin
I've got a bit of code here that's giving me some trouble. I am trying to make a 2 dimensional array with nested lists, but when I try to change one element, it changes all the elements in that "column". --begin code-- width = 7 depth = 6 board = [['.']*width]*depth def printBoard(board): 'Pr

Re: [Tutor] Nested list access?

2007-10-08 Thread John Fouhy
On 09/10/2007, Chuk Goodin <[EMAIL PROTECTED]> wrote: > I've got a bit of code here that's giving me some trouble. I am trying > to make a 2 dimensional array with nested lists, but when I try to > change one element, it changes all the elements in that "column". > > I'm trying to get it to make on

Re: [Tutor] os.rename anomaly in Python 2.3 on Windows XP

2007-10-08 Thread Luke Paireepinart
Tony Cappellini wrote: > Using Windows XP, SP2 and Python 2.3 > > I've written a script which walks through a bunch of directories and > replaces characters which are typically illegals as filenames, with an > '_' character. > > The directories are part of a package of software which is released by

Re: [Tutor] print question

2007-10-08 Thread Dick Moores
At 06:24 PM 10/8/2007, John Fouhy wrote: >On 09/10/2007, Dick Moores <[EMAIL PROTECTED]> wrote: > > What's the best way to get hours in 2 or more digits, and minutes in > > 2 digits, so that the above would be 05:07:36.88? (I'm writing a > stopwatch.) > >String formatting! > > >>> template = '%02d

Re: [Tutor] print question

2007-10-08 Thread Kent Johnson
Dick Moores wrote: > At 06:24 PM 10/8/2007, John Fouhy wrote: >> On 09/10/2007, Dick Moores <[EMAIL PROTECTED]> wrote: >>> What's the best way to get hours in 2 or more digits, and minutes in >>> 2 digits, so that the above would be 05:07:36.88? (I'm writing a >> stopwatch.) >> >> String formattin

Re: [Tutor] print question

2007-10-08 Thread Ian Witham
> > > Thanks! > > So now I have > > def secsToHMS(seconds): > """ > Convert seconds to hours:minutes:seconds, with seconds rounded > to hundredths of a second, and print > """ > hours, minutes = 0, 0 > if seconds >= 60 and seconds < 3600: > minutes, seconds = divmo

Re: [Tutor] print question

2007-10-08 Thread Dick Moores
Thanks, Kent and Ian. See below. At 07:30 PM 10/8/2007, Kent Johnson wrote: >> if seconds >= 60 and seconds < 3600: >> minutes, seconds = divmod(seconds, 60) >> elif seconds >= 3600: > >You don't need this conditional, just use the next two lines >unconditionally. If seconds<3