小编geo*_*eek的帖子

使用python正确地将XLSX转换为CSV

我正在寻找一个python库或任何帮助将.XLSX文件转换为.CSV文件.

python csv excel python-2.7

37
推荐指数
1
解决办法
7万
查看次数

将console.writeline从Windows应用程序重定向到字符串

我有一个用C#编写的外部dll,我从程序集文档中研究了它将调试消息写入Console使用Console.WriteLine.

这个DLL在我与应用程序的UI交互期间写入控制台,所以我不直接进行DLL调用,但我会捕获所有控制台输出,所以我想我必须在表单加载中初始化,然后在以后获取捕获的文本.

我想将所有输出重定向到字符串变量.

我试过Console.SetOut,但它用于重定向到字符串并不容易.

.net c# console

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

无法安装PyPdf 2模块

试图安装PyPdf2模块,我下载的zip并解压它,我执行python setup.py buildpython setup.py install,但它似乎并没有被安装,当我试图从一个python脚本导入,则返回ImportError:

import pyPdf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pyPdf
Run Code Online (Sandbox Code Playgroud)

请帮忙.

我在Windows XP下使用python 2.7.

python module pypdf importerror

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

处理后台工作程序错误

在执行耗时的python脚本时,我会用后台工作者管理IU以显示进度条.

当我不需要事件时OutputDataReceived,我已成功使用后台工作程序,但我正在使用的脚本打印了一些进度值,如("10","80",..),所以我必须听取事件OutputDataReceived.

我得到这个错误:This operation has already had OperationCompleted called on it and further calls are illegal.在这一行progress.bw.ReportProgress(v);.

我试图使用2个后台工作器实例,一个执行而另一个监听,它没有给出任何错误,但它似乎没有调用事件'OutputDataReceived'所以我没有在进度条中看到任何进展.

在我使用的代码下面:

    private void execute_script()
    {
             progress.bw.DoWork += new DoWorkEventHandler( //progress.bw is reference to the background worker instance
        delegate(object o, DoWorkEventArgs args)
        {

        System.Diagnostics.Process proc = new System.Diagnostics.Process();
        proc.StartInfo.FileName = "python.exe";
        proc.StartInfo.UseShellExecute = false;
        proc.StartInfo.Arguments = @".\scripts\script1.py " + file_path + " " + txtscale.Text;
        //proc.StartInfo.CreateNoWindow = true;
        //proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
        proc.StartInfo.RedirectStandardOutput = true;
        //proc.EnableRaisingEvents = …
Run Code Online (Sandbox Code Playgroud)

.net c# process backgroundworker

5
推荐指数
1
解决办法
8413
查看次数

链的多个背景工作者

我有一系列3个耗时的函数,我想在后台工作者或其他任何工具中执行它们,我的问题是每个函数都应该等待先前函数完成,所以这是我的伪代码:

open_session() // during the execution of this function i like to display a loading-window 

open_session() //this function opens a process another windows app , while opening this app i would like to keep the current app responsive.

close_session()// during the execution of this function i like to display a loading-window 
Run Code Online (Sandbox Code Playgroud)

我想用背景工作者做这个,但功能是异步的.

请帮忙

.net c# multithreading backgroundworker

2
推荐指数
1
解决办法
2246
查看次数

使用java函数从Spring引导调用Spring执行器/重启端点

我正在寻找重启弹簧启动应用程序,所以使用Spring Actuator/restart端点正在使用curl,但我想在应用程序内部使用java代码调用相同的函数,我已经尝试过这段代码了,但它是不工作:

Thread thread = new Thread(new Runnable() {
    @Override
    public void run() {
        RestartEndpoint p = new RestartEndpoint();
        p.invoke();
    }
});
thread.setDaemon(false);
thread.start();
Run Code Online (Sandbox Code Playgroud)

java spring spring-boot spring-cloud spring-boot-actuator

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