Hi Sun, You can't store anything in the local file system. You can store data in the datastore, memcache, blobstore, etc.
With the App Engine Python 2.5 runtime it is *not* possible to execute arbitrary bytecode. Cheers, Brian On Sun, Oct 16, 2011 at 9:30 PM, Sun Jing <[email protected]> wrote: > Hi Brian, > So it means I can manipulate bytecode, but cannot store it to the file > system? > I can also generate bytecode in Python 2.5, what has been changed? > Thanks for your explain. > > ---------- > keakon > My blog(Chinese): www.keakon.net > Blog source code: https://bitbucket.org/keakon/doodle/ > > > On Sun, Oct 16, 2011 at 5:35 PM, Brian Quinlan <[email protected]> wrote: >> >> Hi Sun, >> >> You are seeing those exceptions because you are trying to write to a >> file and App Engine does not support writing to the local filesystem. >> >> By default, jinja2 uses a memory-backed LRU cache to cache the last 50 >> accessed templates but you can customize this if you want. See: >> http://jinja.pocoo.org/docs/api/#bytecode-cache >> >> Cheers, >> Brian >> >> On Sun, Oct 16, 2011 at 6:02 PM, Sun Jing <[email protected]> wrote: >> > Hi all, >> > As the document says, in Python 2.7, no longer restricts access to >> > Python >> > bytecode. >> > But I tried to compile a source code file, it raised an IOError: [Errno >> > 13] >> > Permission denied: >> >> >> >> import os >> >> import os.path >> >> import py_compile >> >> path = os.path.join(os.getcwd(), 'model.py') >> >> py_compile.compile(path) >> > >> > marshal is not working either: >> >> >> >> import os >> >> import os.path >> >> import marshal >> >> code = compile('1+1', '<string>', 'eval') >> >> file = open(os.path.join(os.getcwd(), 'test.pyc'), 'wb') >> >> marshal.dump(code, file) >> >> file.close() >> > >> > I'm not sure whether jinja2's template caching works fine, it seems it >> > just >> > opens a file and writes into it. >> > ---------- >> > keakon >> > My blog(Chinese): www.keakon.net >> > Blog source code: https://bitbucket.org/keakon/doodle/ >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "Google App Engine" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]. >> > For more options, visit this group at >> > http://groups.google.com/group/google-appengine?hl=en. >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google App Engine" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/google-appengine?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
