the real .pyc file

Wolfgang Strobl wks000 at t-online.de
Sat Nov 30 08:20:53 EST 2002


Duncan Booth <duncan at rcp.co.uk> schrieb am Fri, 29 Nov 2002 09:39:52
+0000 (UTC):

>Well, you could trivially cut it down to two line:
>
>#define print(s) void main(){ printf(s); }
>print ("signature under construction")

>although, of course, your 'void main' isn't actually legal, 

I believe it is legal. See

http://homepages.tesco.net/~J.deBoynePollard/FGA/legality-of-void-main.html

>nor do you
>define printf (and since it takes a variable number of arguments calling
>it without defining it gives undefined behaviour), 

That's true indeed.  Let me excuse me by pointing out that old habits
die hard. It _was_ legal C at the time I learned C. ;-)   

>so I think you really
>need three lines: 
>
>#include <stdio.h>
>#define print(s) int main(){ printf(s); return 0; }
>print("signature under construction")

#include <stdio.h>
#include <time.h>

#define print(p,s) int main(){time_t
t;char*b;time(&t);b=ctime(&t);b[24]=0;printf("('%s',
'%s')\n",b,s);return 0;}

print(getattr(eval("__import__('time')"),'asctime')(),"signature under
construction")

(four lines only, line wrapping has to be repaired)

C:\>signature.exe
('Sat Nov 30 14:15:10 2002', 'signature under construction')

C:\>python signature.c
('Sat Nov 30 14:17:42 2002', 'signature under construction')

C:\>
-- 
Thank you for observing all safety precautions



More information about the Python-list mailing list