C# 代码转换到Python
下载地址: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:
- The C# or VB.NET code is parsed using SharpDevelop's parsing library NRefactory and an abstract syntax tree (AST) is generated.
- A visitor class then walks this AST and generates Python code which is added to a StringBuilder.
- Once the visit is complete the generated Python code is then displayed or saved to disk.
C# 代码转换到Python的更多相关文章
- urllib2模块中文翻译与学习 - Python 2.7.8官方文档
总结 目的 打开指定网址 要求 了解需要处理的网站的操作流程 数据包的构造与提交 对可能的响应处理选择合适的处理器(模块内的各种 *Handler()) 核心 urllib.urlencode(que ...
- Github上的python开源项目
Python开源项目,期待大家和我们一起共同维护 github排名榜单 https://github.com/trending github搜索榜单:https://github.com/search ...
- 学习 Python,这 22 个包怎能不掌握?
如今全球各个行业内 Python 的使用状况怎么样呢? 很多人学习python,不知道从何学起.很多人学习python,掌握了基本语法过后,不知道在哪里寻找案例上手.很多已经做案例的人,却不知道如何去 ...
- Scratch3 二次开发系列
Scratch3.0来啦!!! Scratch做为图像化编程的首选语言,拖过积木块搭建实现动画游戏的制作.Scratch3添加了音乐.画笔.视频侦测.文字朗读.翻译等选择性下载扩展积木,可实现积 ...
- 爬虫05 /js加密/js逆向、常用抓包工具、移动端数据爬取
爬虫05 /js加密/js逆向.常用抓包工具.移动端数据爬取 目录 爬虫05 /js加密/js逆向.常用抓包工具.移动端数据爬取 1. js加密.js逆向:案例1 2. js加密.js逆向:案例2 3 ...
- 对 js加密数据进行爬取和解密
对 js加密数据进行爬取和解密 分析: 爬取的数据是动态加载 并且我们进行了抓包工具的全局搜索,没有查找到结果 意味着:爬取的数据从服务端请求到的是加密的密文数据 页面每10s刷新一次,刷新后发现数据 ...
- 用 VS Code 搞Qt6:使用 PySide 6
一般来说,用C++写 Qt 应用才是正宗的,不过,为了让小学生也能体验 Qt 的开发过程,或者官方为了增加开发者人数,推出了可用 Python 来编程的 Qt 版本.此版本命名比较奇葩,叫 PySid ...
- Python和JavaScript间代码转换4个工具-乾颐堂
Python 还是 JavaScript?虽然不少朋友还在争论二者目前谁更强势.谁又拥有着更为光明的发展前景,但毫无疑问,二者的竞争在 Web 前端领域已经拥有明确的答案.立足于浏览器平台,如果放弃 ...
- Python和JavaScript间代码转换4个工具
Python 还是 JavaScript?虽然不少朋友还在争论二者目前谁更强势.谁又拥有着更为光明的发展前景,但毫无疑问,二者的竞争在 Web 前端领域已经拥有明确的答案.立足于浏览器平台,如果放弃 ...
随机推荐
- HDU-1078
Problem Description FatMouse has stored some cheese in a city. The city can be considered as a squar ...
- 《深度解析SDN》学习小结
SDN(软件定义网络),顾名思义,通过软件来控制或驱动整个网络.SDN的核心概念有两个,第一是转发面与控制面的分离:第二是开放的可编程接口.另外,SDN强调集中式控制,通过软件来控制整个网络,但这并不 ...
- MyBatis的事务处理
先来假设这样一个问题:如果数据库里面有一个用户表和一个作家表,那么当要添加一条数据到作家表中时,作家表的id必须是用户表中的其中一个id,因为作家一定也要是一个用户.这时就涉及到事务处理. 在上一篇博 ...
- js函数收藏:获取cookie值
//先设置一段子cookie var d = new Date(); d.setMonth(d.getMonth() + 1); d = d.toGMTString(); var a = " ...
- BZOJ 3110 ZJOI 2013 K大数查询 树套树(权值线段树套区间线段树)
题目大意:有一些位置.这些位置上能够放若干个数字. 如今有两种操作. 1.在区间l到r上加入一个数字x 2.求出l到r上的第k大的数字是什么 思路:这样的题一看就是树套树,关键是怎么套,怎么写.(话说 ...
- Socket tips: UDP Echo service - Server code
#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/soc ...
- Zend Framework学习日记(2)--HelloWorld篇(转)
Zend Framework学习日记(2)--HelloWorld篇 这一篇主要演示如何用zf命令行工具建立一个基于Zend Framework框架的工程,也是我初学Zend Framework的小练 ...
- springmvc入门详解
首先,我们先写一个入门小案例,先熟悉一下springmvc是什么,了解一下springmvc的运行流程,对加强springmvc的深层理解有很大帮助 .第一步,创建一个maven项目: <?xm ...
- 【转】NSHashtable and NSMaptable
本文转自Nidom的博客,原文:<NSHashtable & NSMaptable> NSSet, NSDictionary, NSArray是Foundation框架关于集合 ...
- Asp.Net--主题/皮肤文件
主题 是皮肤的集合.皮肤描述了控件应该如何显示,它可以定义样式的属性,图片,颜色等. 如果拥有多个主题,用户可以根据需要选择主题来显示站点,这只需要通过点击按钮,从一个皮肤切换到另一个皮肤. 皮肤文件 ...