无模块命名的fcntl [英] No module named fcntl

查看:309
本文介绍了无模块命名的fcntl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图执行该法的IronPython在.NET 4.0使用IronPython的2.7。我使用Windows 7

I am trying to execute this method with IronPython on .NET 4.0 using IronPython 2.7. i am using Windows 7

import os
import re
import nltk
import urllib
import xapian
import sys

def getData(url):
        try:
         html = urllib.urlopen(url)
         text = html.read()
         html.close()
        except:
            return "error"
        try:
            return nltk.clean_html(text) #takes the tokens
        except:
            return text

C#代码:

public static object Execute()
        {
            string scriptPath = "Calculator.py";
            ScriptEngine engine = Python.CreateEngine();
            engine.SetSearchPaths(new string[] { "c:\\Python26\\lib","c:\\Python26\\lib\\site-packages",
                "C:\\IronPython-2.7\\Lib\\site-packages","C:\\IronPython-2.7\\Lib"});
            ScriptSource source = engine.CreateScriptSourceFromFile(scriptPath);
             ScriptScope scope = engine.CreateScope();
        ObjectOperations op = engine.Operations;
        source.Execute(scope);

        dynamic Calculator = scope.GetVariable("Calculator");
        dynamic calc = Calculator();

        return calc.getData("http://www.wowebook.com/dot-net/ironpython-in-action.html");



        }



谁能告诉我我在做什么错了?我一直刚开,我不具备的fcntl模块

Can someone tell me what I am doing wrong? I keep gettin that i do not have fcntl module

推荐答案

我觉得目前为止最简单的解决办法是切换到CPython的。我不认为这将是比任何现有的解决方案,集成度较低和你避免所有缺失模块头疼的问题。

I think by far your easiest solution would be to switch to CPython. I don't think it would be any less integrated than your existing solution and you'd avoid all the headaches with missing modules.

这篇关于无模块命名的fcntl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆