[英]How do you control the Python prompt with a middle-man application?
How do you get a new application to stand between , like an I/O filter, the python prompt and the Python software? 如何获得一个介于I / O过滤器,python提示符和Python软件之间的新应用程序? So that it would pass most stuff through to Python , unchanged , but some domain-specific paragraphs that the end-user types in , would be handled by a pre-parser, translated to python-legal syntax, and then given to Python?
这样它就可以将大部分内容传递给Python,并且保持不变,但是最终用户键入的某些特定领域的段落将由预解析器处理,转换为python-legal语法,然后提供给Python? And output and error messages would be passed from Python to the user's prompt, like usual?
像往常一样,输出和错误消息会从Python传递到用户的提示吗?
I'm a statistical programming language designer and my third project will be a data-cleaner, slanted to users who do not wish to be professional programmers. 我是一名统计编程语言设计师,我的第三个项目将是一个数据清理程序,向不希望成为专业程序员的用户倾斜。 Python is great for some types of data preparation, but with a caveat: some types of data transformation benefit greatly from data-paragraphs, where each paragraph of code , pulls in some input datasets, does some querying/modifications, and puts the results in output datasets.
Python非常适合某些类型的数据准备,但有一个警告:某些类型的数据转换从数据段中受益匪浅,其中每个代码段,提取一些输入数据集,进行一些查询/修改并将结果放入输出数据集。 ( examples of this are my first project , vilno data transformation ( http://code.google.com/p/vilno or http://fivetimesfaster.blogspot.com ) , the SAS datastep, and the SQL SELECT statement ).
(示例包括我的第一个项目,vilno数据转换( http://code.google.com/p/vilno或http://fivetimesfaster.blogspot.com ),SAS数据步骤和SQL SELECT语句)。
So ... something that combines Python with a data paragraph, and has a really easy learning curve, would be incredibly useful. 因此,将Python与数据段落结合起来并具有非常容易学习的曲线的东西将非常有用。
Robert Wilkins 罗伯特·威尔金斯
I would recommend you look at this , this and if your DSL is going to really differ from Python, this and this . 我建议您看一下this和this ,如果您的DSL与Python真正不同,则this和this 。
Also, I would also recommend you look into Ruby as it is very easy to write domain specific languages in it. 另外,我也建议您研究Ruby,因为用它编写领域特定的语言非常容易。 And, despite what a lot of people say, its not just for web development and ruby 1.9 speeds are comparable to python.
而且,尽管很多人都说过,但它不仅适用于Web开发,而且ruby 1.9的速度与python相当。
Then, of course, there's Lisp, but, I think I'm getting carried away :) 然后,当然,有了Lisp,但是,我想我已经被带走了:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.