简体   繁体   English

如何使用中间人应用程序控制Python提示符?

[英]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/vilnohttp://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 . 我建议您看一下thisthis ,如果您的DSL与Python真正不同,则thisthis

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.

相关问题 Python - 中间人 - Python - Man in the Middle Python Guizero - 你如何将按钮居中到窗口中间 - Python Guizero - How do you centre buttons to the middle of a window 如何从python中的名称中删除中间的首字母? - How do you remove a middle initial from a name in python? python:将中间人注入方法调用 - python: Injecting a middle man to method calls python扭曲的中间人实现 - python twisted man-in-the-middle implementation Python 或 Bash - 如何在两个句子中间添加文件中列出的单词并将 output 放入另一个文件? - Python or Bash - How do you add words listed in a file in the middle of two sentences and put the output into another file? Python(3.4)列表理解-如何控制执行流程 - Python (3.4) List comprehensions - How do you control the flow of execution 如何使用命令提示符安装 pip? - How do you install pip with Command Prompt? Python:如何获得一个程序来提示用户一定的固定时间来输入用户信息? - Python: How do you get a programme to prompt the user a certian fixed amount of times for a user input? 如何使用 Python 在 Windows 命令提示符中终止正在运行的文件? - How do you terminate a running file in a Windows command prompt using Python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM