do python's nifty indentation rules spell the death of one-liners?
Duncan Booth
duncan at NOSPAMrcp.co.uk
Thu Apr 17 05:02:54 EDT 2003
grante at visi.com (Grant Edwards) wrote in
news:3e9d9bb9$0$151$a1866201 at newsreader.visi.com:
>> python << DONE
>> print 2
>> for i in (1,4):
>> print i
>> DONE
>
> But how do you do it in a Makefile?
Switch to Windows? Microsoft's nmake happily handles this :^)
Microsoft's syntax isn't, of course, quite identical, they use the << to
end the document, and create a (optionally named) temporary file which is
deleted afterwards.
Here's an example I used recently:
.SUFFIXES: .exe .dll .obj .c .cpp .pyx
.pyx.c:
<<pyrexc.py $<
import Pyrex.Compiler.Main
Pyrex.Compiler.Main.main(command_line = 1, c_only = 1)
<<
--
Duncan Booth duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
More information about the Python-list
mailing list