Python中文
首页
教程
问答
标签
搜索
登录
注册
Iron Python-没有名为“os”的模块
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我一直在试着调试这个示例代码,但遇到了问题。</p> <p><strong>代码如下:</strong></p> <pre><code>import System import get_events_devices from System.Windows.Forms import * from System.ComponentModel import * from System.Drawing import * from clr import * clr.AddReference("IronPython") class Check: # namespace class Form1(System.Windows.Forms.Form): """type(_label1) == System.Windows.Forms.Label, type(_button1) == System.Windows.Forms.Button""" __slots__ = ['_label1', '_button1'] def __init__(self): self.InitializeComponent() @accepts(Self(), bool) @returns(None) def Dispose(self, disposing): super(type(self), self).Dispose(disposing) @returns(None) def InitializeComponent(self): self._button1 = System.Windows.Forms.Button() self._label1 = System.Windows.Forms.Label() self.SuspendLayout() # # button1 # self._button1.Location = System.Drawing.Point(58, 61) self._button1.Name = 'button1' self._button1.Size = System.Drawing.Size(75, 23) self._button1.TabIndex = 0 self._button1.Text = 'Click' self._button1.UseVisualStyleBackColor = True self._button1.Click += self._button1_Click # # label1 # self._label1.AutoSize = True self._label1.Location = System.Drawing.Point(190, 70) self._label1.Name = 'label1' self._label1.Size = System.Drawing.Size(0, 13) self._label1.TabIndex = 1 # # Form1 # self.ClientSize = System.Drawing.Size(292, 273) self.Controls.Add(self._label1) self.Controls.Add(self._button1) self.Name = 'Form1' self.Text = 'Form1' self.ResumeLayout(False) self.PerformLayout() @accepts(Self(), System.Object, System.EventArgs) @returns(None) def _button1_Click(self, sender, e): # Snippet Statement pass # End Snippet Statement self._label1.Text = 'mohsin' get_events_devices.units() </code></pre> <p>我刚刚添加了optparse.py、get_events_devices.py和iron python.dll。</p> <p>从那里我得到Iron Python_module.dll,因为我已经安装了ironpython,我没有得到这个.dll?</p> <p>有什么想法吗?</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>在python脚本中,需要显式导入os.py的lib路径</p> <pre><code>import sys sys.path.append("C:\\Program Files (x86)\\IronPython 2.7\\Lib\\") </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
Kerasterflow预训练模型中的纯训练偏差
3 回答
KerasTF Conv2D模型运行时无响应型号.fi
4 回答
Kerastuner Randomsearch:TypeError:(“关键字参数未理解:”,“激活”)
7 回答
Kerastuner ValueError:形状(320,)和(1,)不兼容
9 回答
Kerastuner:“ValueError:不是法律参数”问题,当我使用LSTM网络时,但密集层工作正常
6 回答
KerasTuner:是否可以在目标/度量函数中使用测试/验证集?
8 回答
KerasTuner自定义目标函数
8 回答
kerastuner调整层数会创建与报告的层数不同的层数
8 回答
KerasTuner运行时错误:构建模型的失败尝试太多
3 回答
kerasv1.2.2与kerasv2+的奇怪行为(精确度上的巨大差异)
3 回答
kerasvis中visualize_-cam/visualize_显著性的热图输出形状
7 回答
Kerasvis和tfkerasvis的激活最大化不适用于MobileNetV2模型
8 回答
Kerasvis对于显著性图表,我们应该使用softmax还是线性激活
9 回答
Kerasvis给出以下错误:AttributeError:多个入站节点
7 回答
kerasyolov3模型中预期输入和目标的格式和形状
1 回答
Keras一个GPU可以同时训练两个不相关的模型吗?
10 回答
Keras一类CNN两个输入,每一步一个
6 回答
keras三维张量上的Softmax层
2 回答
Keras三维目标预测
8 回答
keras上的flatten与python中的Image的区别
8 回答