下载地址: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. Windows服务器Pyton辅助运维--02.远程重启IIS服务器

    Windows服务器Pyton辅助运维 02.远程重启IIS服务器 开发环境: u  Web服务器: Windows Server 2008 R2 SP1 IIS 7.5 u  运维服务器: Pyth ...

  2. Havel定理

    先贴一个百度百科的注释 Havel定理编辑 本词条缺少概述.名片图,补充相关内容使词条更完整,还能快速升级,赶紧来编辑吧! 中文名 Havel定理 外文名 Canisters theorem 特    ...

  3. jquery $.each()用法

    今天看到一个新的each玩法即each作为jquery的函数(平时用的大概都是用的each方法)使用: $.each([ 52, 97 ], function( index, value ) { al ...

  4. js基础例子动态创建table实例

    <style> table{ width:500px; font-weight: bold; border: 1px solid #000; border-collapse:collaps ...

  5. Struts 2零配置

    从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该 ...

  6. TypedArray和obtainStyledAttributes使用

    在编写Android自定义按钮示例基础上,如果要指定字体大小产生这样的效果: 其实是不需要自定义变量的,可以直接使用TextView的配置属性: <com.easymorse.textbutto ...

  7. php中定界符<<<的用法

    定界符给字符串定界的方法使用定界符语法(“<<<”).应该在 <<< 之后提供一个标识符,然后是字符串,然后是同样的标识符结束字符串. 结束标识符必须从行的第一列开 ...

  8. (一)一个工作任务引起的乱战——c#中结构体与byte[]间相互转换

    一个工作任务涉及到c#与c++系统间的udp通信,处理了蛮长时间没有完成任务,但是期间接触到不少小知识点.本人是初接触c#,c++语言没有接触过.可能写的东西都很小儿科,暂且记录下来当工作日记把. 先 ...

  9. 安装XP和Ubuntu双系统问题——Ubuntu安装时无法识别原有系统

    我主机本来安装了windows xp 和unbuntu15.04,由于在ubuntu下不小心卸载某依赖后,无法登入桌面,网上查了好多资料,原因各种,解决途径也各种,最终是还没有解决问题.各种更新,各种 ...

  10. SQL Server 中创建数据库、更改主文件组示例

    以下示例在 SQL Server 实例上创建了一个数据库.该数据库包括一个主数据文件.一个用户定义文件组和一个日志文件.主数据文件在主文件组中,而用户定义文件组包含两个次要数据文件.ALTER DAT ...