[Zope] Python syntax error
Andreas Jung
andreas at andreas-jung.com
Mon Oct 20 05:03:43 EDT 2003
No idea but
(DateTime() + 7).stftime('%d %m %Y')
is maybe what you want.
-aj
--On Montag, 20. Oktober 2003 16:49 Uhr +0800 Julian Clark
<Julian.Clarke at b-online.com.au> wrote:
> Hi list...
> I'm getting a bizarre set of syntax errors.
>
> I've a python script which I call from a dtml method.
>
> This script works
>
> today=DateTime()
> day=today.dd()
> month=today.Month()
> year= " 20"+today.yy()
> string= day + ' ' + month + year
> return string
>
> when I modify it to something like this..
> today=DateTime()+7
> day=today.dd()
> month=today.Month()
> year= " 20"+today.yy()
> string= day + ' ' + month + year
> return string
>
> I get a syntax error.
>
> Any suggestions?
>
> here's the traceback
>
> Traceback (innermost last):
> File D:\Zope\2-3-3\lib\python\ZPublisher\Publish.py, line 223, in
> publish_module File D:\Zope\2-3-3\lib\python\ZPublisher\Publish.py,
> line 187, in publish File D:\Zope\2-3-3\lib\python\Zope\__init__.py,
> line 221, in zpublisher_exception_hook (Object: 7days)
> File D:\Zope\2-3-3\lib\python\ZPublisher\Publish.py, line 171, in
> publish File D:\Zope\2-3-3\lib\python\ZPublisher\mapply.py, line 160,
> in mapply (Object: manage_edit)
> File D:\Zope\2-3-3\lib\python\ZPublisher\Publish.py, line 112, in
> call_object (Object: manage_edit)
> File D:\Zope\Products\PythonMethod\PythonMethod.py, line 92, in
> manage_edit (Object: 7days)
> File D:\Zope\Products\PythonMethod\PythonMethod.py, line 140, in
> makeFunction (Object: 7days)
> File D:\Zope\Products\PythonMethod\PythonMethod.py, line 115, in
> _checkCBlock (Object: 7days)
> File D:\Zope\Products\PythonMethod\zbytecodehacks\VSExec.py, line 138,
> in __init__ SyntaxError: (see above)
>
>
>
> _______________________________________________
> Zope maillist - Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
More information about the Zope
mailing list