On Wed, 19 Jan 2011 14:31:15 -0800, Alice Bevan–McGregor wrote: > On 2011-01-19 13:01:04 -0800, Steven D'Aprano said: >> 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' > > ... don't do that. I do not know why that would be expected to work, > ever. (Unless you're crafty and wrap a real shell script around the > .pyc, in which case it's no longer a .pyc.)
I didn't expect it to work, but I have seen others do it and be surprised that it doesn't. This is why I was pleasantly surprised to learn that `python toto.pyc` does work -- I was conflating the above failure with the issue under discussion. -- Steven -- http://mail.python.org/mailman/listinfo/python-list