小编gh4*_*h4x的帖子

有没有办法不等待system()命令完成?(在c中)

类似于:
程序在调用system()后没有执行任何操作

我对使用C很新,但基本上,我想执行以下行:

int a = system("python -m plotter");
Run Code Online (Sandbox Code Playgroud)

这将启动我开发的python模块.但是,我希望我的c程序的其余部分继续运行而不是等待命令完成执行(python应用程序处于无限循环,因此它不会自动关闭).有没有办法用C/C++做到这一点?

更新: 解决方案是:

int a = system("start python -m plotter &");
Run Code Online (Sandbox Code Playgroud)

c c++ system call hang

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

reStructuredText换行符会破坏代码块

嗨,谢谢你看我的问题!所以我使用reStructuredText和Sphinx来生成一组文档.每个页面必须符合PEP8,因此每行最多80个字符.这是一项新要求,打破了几个页面.

我们曾经有过:

.. code-block:: bash
    really really long line of code that I would want a new user to copy and paste into a terminal
Run Code Online (Sandbox Code Playgroud)

我们现在有:

.. code-block:: bash
    really really long line of code that
    I would want a new user to copy and
    paste into a terminal
Run Code Online (Sandbox Code Playgroud)

这是一个问题,因为每个行在粘贴到终端时都被视为单独的命令.阅读文档,我看到我可以做类似的事情:

| really really long line of code that I 
  would want a new user to copy and paste
  into a terminal
Run Code Online (Sandbox Code Playgroud)

使我的文本适合1行,但这不会保持我想要的块样式或语法高亮.有谁知道如何实现我想要的东西?在此先感谢您的反馈!

restructuredtext python-sphinx

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

标签 统计

c ×1

c++ ×1

call ×1

hang ×1

python-sphinx ×1

restructuredtext ×1

system ×1