小编Jas*_*oof的帖子

在win7上安装rpy2时遇到问题(R 2.12,Python 2.5)

我是Python的新手(以及一般的编程)我来自金融背景,所以请耐心等待.我刚开始使用Python(Enthought的Pylab/Scipy/Numpy)和R进行统计分析.我正在尝试将rpy2安装到Python中以集成R,但我得到错误:

试图猜测R的HOME但在PATH中没有R命令.

我不确定这意味着什么.我的R.exe的路径是"C:\ Program Files\R\R-2.12.1\bin",如果它有用的话.任何帮助将非常感激!

这是setup.py的代码

import os, os.path, sys, shutil, re, itertools
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.build import build as _build

from distutils.core import setup
from distutils.core import Extension


pack_name = 'rpy2'
pack_version = __import__('rpy').__version__


class build(_build):
    user_options = _build.user_options + \
        [
        #('r-autoconfig', None,
        # "guess all configuration paths from " +\
        #     "the R executable found in the PATH " +\
        #     "(this overrides r-home)"),
        ('r-home=', None, 
         "full path for the R home to …
Run Code Online (Sandbox Code Playgroud)

python r matplotlib windows-7 rpy2

15
推荐指数
2
解决办法
2万
查看次数

在node.js中使用net.createConnection(port,[host])创建一个tcp套接字

这里的任何人都可以给我一些使用node.js中套接字的指针吗?

可以在端口8000上打开172.0.0.1上的tcp连接,例如使用net.createConnection(port,host)

var net = require('net'),
    querystring = require('querystring'),
    http = require('http'),
    port = 8383,
    host = 172.123.321.213,
    path = /path/toService,
    _post = '';

var server = http.createServer(function(req, res) {

    if(req.method == 'POST') {
      req.on('data', function(data) {
        body+=data;
      });
      req.on('end', function() {
        _post = querystring.parse(body);//parser post data
        console.log(_post);
      })
    }

var socket = net.createConnection(port, host);

var socket = net.createConnection(port, host);

    socket.on('error', function(error) {
      send404(res, host, port);
    })

    socket.on('connect', function(connect) {
      console.log('connection established');
      res.writeHead(200, {'content-type' : 'text/html'});
      res.write('<h3>200 OK: 
           Connection to …
Run Code Online (Sandbox Code Playgroud)

sockets node.js

4
推荐指数
1
解决办法
3万
查看次数

标签 统计

matplotlib ×1

node.js ×1

python ×1

r ×1

rpy2 ×1

sockets ×1

windows-7 ×1