小编tle*_*ras的帖子

Python - 格式的零长度字段名称

我在我的Centos机器上使用Python,当我尝试运行我的程序时,我显示了以下错误:

Running setup.py egg_info for package pyepr
Traceback (most recent call last):
  File "<string>", line 16, in <module>
  File "/tmp/pip-build-root/pyepr/setup.py", line 68, in <module>
    print('using EPR C API sources at "{}"'.format(eprsrcdir))
ValueError: zero length field name in format
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 16, in <module>

  File "/tmp/pip-build-root/pyepr/setup.py", line 68, in <module>

print('using EPR C API sources at "{}"'.format(eprsrcdir))

ValueError: zero length field name in format
Run Code Online (Sandbox Code Playgroud)

我已经检查了关于这个主题的其他问题,我已经安装了Python 2.7.6并将其设置为我的默认配置,如下所示....

 $ python …
Run Code Online (Sandbox Code Playgroud)

python centos

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

RxJava超时

我是RxJava的新手,我需要以异步方式使用Observable功能.

我还需要使用超时:在我的例子中,我希望每个进程在1秒或更短的时间内结束.

这就是我现在所做的:

public static void hello(String name) throws IOException {
Observable<String> obs2 = Observable.just(name).timeout(1000, TimeUnit.MILLISECONDS).subscribeOn(Schedulers.io());
    obs2.subscribe(new Action1<String>() {
        @Override
        public void call(String s) {
            if("CCCCC".equals(s)){
                try {
                    Thread.sleep(3200);
                } catch (InterruptedException e) {
                e.printStackTrace();
            }
        } 
        System.out.println(s + " " + new Date() +" "+Thread.currentThread().getName());
        }
    });
}

public static void main(final String[] args) throws InterruptedException, IOException {     
    hello("AAAAA");
    hello("CCCCC");
    hello("BBBBBB");
    System.in.read();
}
Run Code Online (Sandbox Code Playgroud)

结果:

AAAAA Thu Oct 05 09:43:46 CEST 2017 RxIoScheduler-2
BBBBBB Thu Oct 05 09:43:46 CEST 2017 …
Run Code Online (Sandbox Code Playgroud)

java timeout reactive-programming rx-java

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

标签 统计

centos ×1

java ×1

python ×1

reactive-programming ×1

rx-java ×1

timeout ×1