14 Jul 2012, 11:52
Generic-user-small

Charlie (3 posts)

I am trying to generate a random number in a Google App Engine application using random.py, but I keep getting this error message:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”> ^ SyntaxError: invalid syntax

How could I generate a random number, and assign it to a variable in one view for use in another view?

04 Aug 2012, 17:58
Generic-user-small

Mark Chu-Carroll (14 posts)

Sorry for the delay in answering - I’ve been crazy busy lately.

In any case - I’m not sure what’s going on; without seeing your source code, it’s hard for me to guess why you’re getting a syntax error. The error that you’re showing looks like you’re trying to run an HTML file as python. Your python code shouldn’t have an XHTML header.

  You must be logged in to comment