下载地址:http://pan.baidu.com/s/1dDAZJxv

SharpDevelop 3.1 now supports converting C# and VB.NET code to IronPython. It can convert a single file or an entire project. The code to convert between these languages is still under development and has some limitations.

Converting an Individual File

To convert a C# or VB.NET file, open it in SharpDevelop's text editor, then from Tools menu select Convert code to Python.

The code conversion is limited to converting classes so it will not convert an arbitary piece of code that is not inside a class.

Converting a Project

To convert a C# or VB.NET project, open it in SharpDevelop, then from the Project menu select Convert From C# to Python.

Once converted the project will most likely not compile straight away due to limitations in the implementation. At the time of writing converting a project has the following limitations:

  • Project's Main File is not set.
  • No code generated to call the project's Main entry method.
  • Namespace imports do include all the used classes.

Code Conversion Internals

Converting code to IronPython was originally supported in SharpDevelop 2.2 and was based on converting code to aMicrosoft CodeDOM and then getting IronPython 1.0 to generate the Python code. In IronPython 2.0 this CodeDOM support was removed so the code conversion feature was removed from SharpDevelop 3.0 since that was using IronPython 2.0. In SharpDevelop 3.1 the code conversion has been rewritten to no longer use the CodeDOM support. It now works by executing the following simple steps:

  1. The C# or VB.NET code is parsed using SharpDevelop's parsing library NRefactory and an abstract syntax tree (AST) is generated.
  2. visitor class then walks this AST and generates Python code which is added to a StringBuilder.
  3. Once the visit is complete the generated Python code is then displayed or saved to disk.

C# 代码转换到Python的更多相关文章

  1. urllib2模块中文翻译与学习 - Python 2.7.8官方文档

    总结 目的 打开指定网址 要求 了解需要处理的网站的操作流程 数据包的构造与提交 对可能的响应处理选择合适的处理器(模块内的各种 *Handler()) 核心 urllib.urlencode(que ...

  2. Github上的python开源项目

    Python开源项目,期待大家和我们一起共同维护 github排名榜单 https://github.com/trending github搜索榜单:https://github.com/search ...

  3. 学习 Python,这 22 个包怎能不掌握?

    如今全球各个行业内 Python 的使用状况怎么样呢? 很多人学习python,不知道从何学起.很多人学习python,掌握了基本语法过后,不知道在哪里寻找案例上手.很多已经做案例的人,却不知道如何去 ...

  4. Scratch3 二次开发系列

       Scratch3.0来啦!!! Scratch做为图像化编程的首选语言,拖过积木块搭建实现动画游戏的制作.Scratch3添加了音乐.画笔.视频侦测.文字朗读.翻译等选择性下载扩展积木,可实现积 ...

  5. 爬虫05 /js加密/js逆向、常用抓包工具、移动端数据爬取

    爬虫05 /js加密/js逆向.常用抓包工具.移动端数据爬取 目录 爬虫05 /js加密/js逆向.常用抓包工具.移动端数据爬取 1. js加密.js逆向:案例1 2. js加密.js逆向:案例2 3 ...

  6. 对 js加密数据进行爬取和解密

    对 js加密数据进行爬取和解密 分析: 爬取的数据是动态加载 并且我们进行了抓包工具的全局搜索,没有查找到结果 意味着:爬取的数据从服务端请求到的是加密的密文数据 页面每10s刷新一次,刷新后发现数据 ...

  7. 用 VS Code 搞Qt6:使用 PySide 6

    一般来说,用C++写 Qt 应用才是正宗的,不过,为了让小学生也能体验 Qt 的开发过程,或者官方为了增加开发者人数,推出了可用 Python 来编程的 Qt 版本.此版本命名比较奇葩,叫 PySid ...

  8. Python和JavaScript间代码转换4个工具-乾颐堂

    Python 还是 JavaScript?虽然不少朋友还在争论二者目前谁更强势.谁又拥有着更为光明的发展前景,但毫无疑问,二者的竞争在 Web 前端领域已经拥有明确的答案.立足于浏览器平台,如果放弃 ...

  9. Python和JavaScript间代码转换4个工具

    Python 还是 JavaScript?虽然不少朋友还在争论二者目前谁更强势.谁又拥有着更为光明的发展前景,但毫无疑问,二者的竞争在 Web 前端领域已经拥有明确的答案.立足于浏览器平台,如果放弃 ...

随机推荐

  1. linux应用程序地址布局

    Linux应用程序在内存中的布局,由高地址到低地址依次为:栈.堆.BSS段.数据段.代码段.代码段的起始地址固定为0x8048000,无论哪一个应用程序它的代码段起始地址一定是0x8048000,这里 ...

  2. FZU 11月月赛D题:双向搜索+二分

    /* 双向搜索感觉是个不错的技巧啊 */ 题目大意: 有n的物品(n<=30),平均(两个人得到的物品差不能大于1)分给两个人,每个物品在每个人心目中的价值分别为(vi,wi) 问两人心目中的价 ...

  3. Bootstrap--导航元素

    1.标签形导航 2.胶囊型导航: 3.垂直堆叠形导航: 4.导航加下拉菜单: 5.导航列表: 6.可切换的标签导航:

  4. iOS语音识别,语音播报,文字变语音播报,语音变文字

    首先使用的是科大讯飞的sdk 1.语音识别部分 AppDelegate.m #import "AppDelegate.h" #import <iflyMSC/iflyMSC. ...

  5. 利用JasperReport+iReport进行Web报表开发

    用JasperReport+iReport进行Web报表开发 序言 在非常多实际的项目里,报表都是当中十分重要的组成部分,比如把查询结果以报表的形式呈现出来.这里所提到的报表可不是简单的二维表,而是拥 ...

  6. 第12届北师大校赛热身赛第二场 A.不和谐的长难句1

    题目链接:http://www.bnuoj.com/bnuoj/problem_show.php? pid=17121 2014-04-25 22:59:49 不和谐的长难句1 Time Limit: ...

  7. resin4 简单学习

    1.Resin 4.0.26 Resin是CAUCHO公司的产品,是一个非常流行的application server,对servlet和JSP提供了良好的支持,性能也比较优良,resin自身采用JA ...

  8. [ES6] When should use Map instead of Object

    Use Maps when keys are unknown until runtime: Map: let recentPosts = new Map(); createPost( newPost, ...

  9. UltraEdit环境下,php简单环境配置

    1.语法高亮 菜单->视图->查看方式->选中“PHP” 2.自动补全 菜单->高级->配置->自动完成->选中“自动显示自动完成对话框”,字符数选择2-3为 ...

  10. CentOS6.7 常用操作命令

    centos 安装py环境 1.安装wget工具: yum install wget 2.安装Python-2.7.8: wget --no-check-certificate https://www ...