ironpython

Why does IronPython tell me that pip is a package and not an executable?

两盒软妹~` 提交于 2021-02-19 00:58:26
问题 I am a complete newbie at Python. I wanted to try to see if Pyomo (a Python package for mathematical modeling) could work under IronPython because all my code for generating the data needed for Pyomo is in C#. I installed IronPython 2.7.5, then tried as an administrator the advice found in http://blog.ironpython.net/2014/12/pip-in-ironpython-275.html#disqus_thread on how to run "pip" for IronPython. I used the exact example they gave (installing html5lib ): ipy -X:Frames -m ensure pip ipy -X

Python简介

 ̄綄美尐妖づ 提交于 2021-02-11 19:32:47
引言 python是什么? python是编程语言,即python是语言 语言有英语、法语、葡萄牙语等,但凡是语言,都是用来沟通的介质。 程序员编程的本质就是让计算机去工作,而编程语言就是程序员与计算机沟通的介质 什么是编程? 编程,是个动词,“编程”就等于“写代码”。写代码的目的就是为了让计算机做我们想要让它做的事情。所以如果我们现在想要让一台电脑听你的话去干活,就得使用它能够理解的语言去让它干活。 计算机只能理解“二进制”,也就是只能使用“0”和“1”来与计算机进行交流。例如,010110100100010011。 Python编程语言的排名(TIOBE链接: https://www.tiobe.com/tiobe-index/ ) python介绍 python的创始人为吉多·范罗苏姆(Guido van Rossum)。1989年的圣诞节期间,吉多·范罗苏姆(中文名字:龟叔)为了在阿姆斯特丹打发时间,决心开发一个新的脚本解释程序,作为ABC语言的一种继承。 (龟叔:2005年加入谷歌至2012年,2013年加入Dropbox直到现在,依然掌握着Python发展的核心方向,被称为仁慈的独裁者)。 2017年7月的TIOBE排行榜,Python已经占据第四的位置, Python崇尚优美、清晰、简单,是一个优秀并广泛使用的语言。 由上图可见,Python整体呈上升趋势

Accessing the name of a list by defining a new class, error: NamedList instance has no attribute '__len__'

守給你的承諾、 提交于 2021-02-11 14:44:12
问题 I am pretty new to python, So I have created a list of elements like: main_list = [1,2,3] I want this list to have a name and I don't want to use a dictionary, so I have created a class with the name as an attribute: class NamedList: def __init__(self, name, obj) self.name = name self.object = obj when I try to access the length of the first list: len(main_list) #works fine but for the second one it gives me this error: NamedList instance has no attribute ' len ' : new_main_list = NamedList(

IronPython support for Visual Studio debugging like Set Next Statement and Edit-and-Continue

自作多情 提交于 2021-02-11 14:39:33
问题 I'm evaluating IronPython for a project. I'm trying to get it working with typical Windows Visual Studio .NET debugging features: Set Next Statement (move the instruction pointer to another line of code) Edit and Continue (this lets you edit lines of code live. It's useful for eliminating bugs.) The most basic debug functions seem to work out of the box. (Setting breakpoints, watches, etc.) However, I've struggled to get these 2 features working. Are they supported by IronPython? I tried

Is it possible to check the syntax of a python script before running it when making use of IronPython and C#?

我们两清 提交于 2021-02-08 10:10:47
问题 Since I solved the issue of checking the syntax, I shall elaborate on how I did this. I will use my own implementation as an example. First of all what have I used and how I have used it? I made use of the ast module available in IronPython since version 2.6 (I made use of 2.7.4(1)). The ast module builds an abstract syntax tree(2) (ast for short) of code supplemented to the module. This function made it possible for me to know if a script had a good syntax or not. As such I knew if the

Is it possible to check the syntax of a python script before running it when making use of IronPython and C#?

左心房为你撑大大i 提交于 2021-02-08 10:07:19
问题 Since I solved the issue of checking the syntax, I shall elaborate on how I did this. I will use my own implementation as an example. First of all what have I used and how I have used it? I made use of the ast module available in IronPython since version 2.6 (I made use of 2.7.4(1)). The ast module builds an abstract syntax tree(2) (ast for short) of code supplemented to the module. This function made it possible for me to know if a script had a good syntax or not. As such I knew if the

IronPython : Microsoft.Scripting.SyntaxErrorException: 'unexpected token '=''

假如想象 提交于 2021-02-08 06:20:09
问题 I have a Python scrirpt and that I am trying to execute from C# code using IronPython and I am getting the below error message: Microsoft.Scripting.SyntaxErrorException: 'unexpected token '='' Here is my Python code: import logging logging.basicConfig(filename='c:\\rahul\\example.log',level=logging.DEBUG) logging.debug('This message should go to the log file') logging.info('So should this') BUCKET_NAME='Rahul' print("Bucket name :-" + BUCKET_NAME) And here is my .NET C# code: var engine =

Python学习之pycharm的快捷键大全

情到浓时终转凉″ 提交于 2021-02-07 17:53:36
  PyCharm是一款功能强大的Python编辑器,具有跨平台性,还支持Django、IronPython和APP Engine开发。那么你知道PyCharm的快捷键有哪些吗?我们一起来看看吧。   编辑   Ctrl + Space 基本的代码完成   Ctrl + Alt + Space 快速导入任意类   Ctrl + Shift + Enter 语句完成   Ctrl + P 参数信息   Ctrl + Q 快速查看文档   Shift + F1 外部文档   Ctrl + 鼠标   Ctrl + F1 显示错误描述或警告信息   Alt + Insert 自动生成代码   Ctrl + O 重新方法   Ctrl + Alt + T 选中   Ctrl + / 行注释   Ctrl + Shift + / 块注释   Ctrl + W 选中增加的代码块   Ctrl + Shift + W 回到之前状态   Ctrl + Shift + ]/[ 选定代码块结束、开始   Alt + Enter 快速修正   Ctrl + Alt + L 代码格式化   Ctrl + Alt + O 优化导入   Ctrl + Alt + I 自动缩进   Tab / Shift + Tab 缩进、不缩进当前行   Ctrl+X/Shift+Delete 剪切当前行或选定的代码块到剪贴板

Python学习之pycharm的快捷键大全

对着背影说爱祢 提交于 2021-02-07 12:22:10
  PyCharm是一款功能强大的Python编辑器,具有跨平台性,还支持Django、IronPython和APP Engine开发。那么你知道PyCharm的快捷键有哪些吗?我们一起来看看吧。   编辑   Ctrl + Space 基本的代码完成   Ctrl + Alt + Space 快速导入任意类   Ctrl + Shift + Enter 语句完成   Ctrl + P 参数信息   Ctrl + Q 快速查看文档   Shift + F1 外部文档   Ctrl + 鼠标   Ctrl + F1 显示错误描述或警告信息   Alt + Insert 自动生成代码   Ctrl + O 重新方法   Ctrl + Alt + T 选中   Ctrl + / 行注释   Ctrl + Shift + / 块注释   Ctrl + W 选中增加的代码块   Ctrl + Shift + W 回到之前状态   Ctrl + Shift + ]/[ 选定代码块结束、开始   Alt + Enter 快速修正   Ctrl + Alt + L 代码格式化   Ctrl + Alt + O 优化导入   Ctrl + Alt + I 自动缩进   Tab / Shift + Tab 缩进、不缩进当前行   Ctrl+X/Shift+Delete 剪切当前行或选定的代码块到剪贴板

IronPython unable to run script that imports numpy

家住魔仙堡 提交于 2021-02-07 09:36:28
问题 Disclaimer - I'm not familiar with Python. I'm a C# developer who has written an application to execute Python scripts (authored by others) using IronPython. These scripts have so far have only needed to use import math , but one of our users has asked for the application to support for Numpy. I have installed Numpy on my PC (using the 'numpy-1.9.2-win32-superpack-python2.7.exe' file), which has created a numpy folder under \Lib\site-packages. I've written a two-line Python script to test