can python make web applications?

lkcl luke.leighton at googlemail.com
Fri Sep 18 23:59:37 CEST 2009


On Sep 16, 7:02 pm, Paul Boddie <p... at boddie.org.uk> wrote:
> On 16 Sep, 18:31, lkcl <luke.leigh... at googlemail.com> wrote:
>
>
>
> >http://pyjs.org/examples/timesheet/output/TimeSheet.html
>
> I get this error dialogue message when visiting the above page:
>
> "TimeSheet undefined list assignment index out of range"
>
> Along with the following in-page error, once the data has been
> imported:
>
> "JavaScript Error: uncaught exception: list assignment index out of
> range at line number 0. Please inform webmaster."
>
> It looks quite nice, though.
>
> Paul

DOH!  someone assuming javascript-isms in lists, and the compiler's
been improved to ban them :)

       ...
       self.date = None
       ...
       ...

       print 'setEntries:', entries
       try:
         #tt = time.localtime(time.time())
-        tt = []
-        tt[0] = int(self.date[:4])
-        tt[1] = int(self.date[4:6])
-        tt[2] = int(self.date[6:8])
+        tt = [0] * 9
+        if self.date:
+            tt[0] = int(self.date[:4])
+            tt[1] = int(self.date[4:6])
+            tt[2] = int(self.date[6:8])
         tt[3] = 0
         tt[4] = 0
         tt[5] = 0



More information about the Python-list mailing list