----- Original Message ----- From: "Remco Gerlich" <scarblac at pino.selwerd.nl> Newsgroups: comp.lang.python To: <python-list at python.org> Sent: Tuesday, April 17, 2001 5:20 AM Subject: Re: Stop python > Ken Seehof <kens at sightreader.com> wrote in comp.lang.python: > > Hey, this reminds me of a useless python idea I had a few years ago. > > > > First write a streaming preprocessor for python. Make a fancy > > importer that makes *.py dependent on *.ppy the same way *.pyc > > is dependent on *.py. Then add a preprocessor command "exit()". > > > > # example.ppy > > print 'hello', > > #!x=5 > > #!if x==5: > > #! print "print 'lumberjacks.'" > > #! exit() > > print 'world.' > > > > This would be a fun project that I don't have time for. Any idea why > > it would be useful? I might be willing to coauthor it if someone else > > wants to do the import logic (custom importers make my head hurt). > > > > Of course it's most likely useless since python's a bit too dynamic to > > really -need- a proprocessor, but I could be missing something. > > > > In case you are confused: > > The preprocessor copies lines that don't start with "#!". > > The preprocessor executes lines that start with "#!". > > The print statement (stdout) is redirected to preprocessor output. > > Would it be possible to nest these things? :-) Sure, why not? :-) It's difficult to come up with any practical reason for doing this though. I think on extra level of indirection it enough. But hey, who cares about practical? It's what's sexy that really matters :-) > And of course, the final output needn't be a Python program. Hmmmmm.... Indeed, the output could be HTML, in which case it is called PMZ. http://www.suxers.de/python/pmz.htm I'd love to see more stuff like this. It's fun! > -- > Remco Gerlich > -- > http://mail.python.org/mailman/listinfo/python-list - Ken Seehof mailto:kseehof at neuralintegrator.com
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4