> I know I've seen problems executing .pyc files from the shell in the > past... perhaps I was conflating details of something else. Ah, I know! > > [steve@sylar ~]$ chmod u+x toto.pyc > [steve@sylar ~]$ ./toto.pyc > : command not found �� > ./toto.pyc: line 2: syntax error near unexpected token `(' > ./toto.pyc: line 2: `P7Mc@s dGHdS(tfooN((((s ./ > toto.py<module>s'
Works fine here: martin@mira:/tmp$ cat >a.py print "Hello, world" martin@mira:/tmp$ python Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. py> import a Hello, world py> martin@mira:/tmp$ chmod +x a.pyc martin@mira:/tmp$ ./a.pyc Hello, world Notice that it is a Linux feature that it can support Python bytecode as a "native" executable when properly configured. Windows has a very similar feature, though. I think OSX can support it as well, but I haven't tried. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list