标签: command

自动重新排列文档“recoverso”中的两个 pdf 文件

我扫描了正反面文件,但我的扫描仪只有正反面,所以我有两个 pdf 文件。第一个包含第 1-3-5-7-9 页,第二个包含第 10-8-6-4-2 页(按此顺序)

我想将它们重新排列在一个 pdf 文件中,页面顺序良好。当然,我的真实文件包含 10 多页,所以这样做是我的责任。

您是否知道如何正确且自动地将这两个文件重新排列为一个文件?

我想到了一个带有命令行软件的 bash 文件。但哪一个(必须在 Windows 7 上兼容)?

谢谢

pdf command batch-file line

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

如何在 Linux 中创建别名?

假设我想为 srm 创建一个别名(安全删除),这样每次使用 srm 时,都会运行交互式 rm 命令,例如 rm \xe2\x80\x93i。需要对必要的配置文件进行此更改,以便每次任何用户登录时都会设置别名。同时表明您的别名有效。

\n\n

我该怎么做呢?

\n

linux alias command

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

无法使用 System.cmd 从 Elixir 中运行curl 命令

我只是尝试使用 Elixir 运行特定格式的curl 命令。

$ curl -w "@config/curl-format.txt" -o /dev/null -s "http://wordpress.com/"
0.004, 0.017, 0.000, 0.017, 0.000, 0.029, 0.029
Run Code Online (Sandbox Code Playgroud)

直接从终端运行命令效果很好。


这就是我在 Elixir 中尝试做的事情:

args = ["-w config/curl-format.txt", "-o /dev/null", "-s", "http://wordpress.com"]
result = System.cmd("curl", args, [])
Run Code Online (Sandbox Code Playgroud)

但我得到:

{" config/curl-format.txt", 23}
Run Code Online (Sandbox Code Playgroud)

而且结果和上面不一样。

curl command system elixir

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

如何在字典中包含命令?

我正在创建一个智能聊天机器人。然而,这部分信息无关紧要。我想做的是调用字典中的指令 - 我将向您展示:

dictionary = ["command1": "print("I just called command1!")]

dictionary["command1"]
Run Code Online (Sandbox Code Playgroud)

有点像那样。显然你不能那样做。我希望能够拥有一个包含不同命令的字典,当您使用字典时将运行这些命令[whatever_command you Want_in_here]

你明白我的意思吗?

我可以使用函数,但显然这会占用大量空间和大量代码,当我的聊天机器人中有如此多的响应时,我无法承受这些空间和代码。

我真的需要知道如何以简单的方式做到这一点。

python command dictionary chatbot

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

<<长选项的强制参数对于短选项也是强制的>>

我是Linux命令手册中的菜鸟,我得到了短语“长选项的强制参数对于短选项也是强制的”,我搜索过强制参数是必须指定的参数,但是“我不明白什么是”长选项的强制参数对于短选项也是强制的”意味着..你能给我解释和例子吗?

抱歉...我需要研究如何解决我在 linux 中录制的 man mv 中的问题,以搜索描述中的信息 ans 将源重命名为目标,或将源移动到目录。长期权的强制性参数对于短期权也是强制性的。我无法理解长选项的强制参数对于短选项也是强制的这句话。

linux command manual

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

如何安装特定版本的 helm?

我正在通过使用这些命令安装最新版本的脚本安装 helm -

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3.2.0
chmod 700 get_helm.sh
./get_helm.sh
Run Code Online (Sandbox Code Playgroud)

但是,我不希望它总是安装最新版本。如何始终安装 v3.2.4 版本?

shell command version kubernetes kubernetes-helm

0
推荐指数
2
解决办法
1176
查看次数

在python中读取.txt文件

我的 python 代码有问题。我想读取 .txt 文件。我使用代码:

f = open('test.txt', 'r')  # We need to re-open the file
data = f.read()

print(data)
Run Code Online (Sandbox Code Playgroud)

我只想读取此 .txt 文件中的第一行。我用

f = open('test.txt', 'r')  # We need to re-open the file
data = f.readline(1)

print(data)
Run Code Online (Sandbox Code Playgroud)

但我看到屏幕上只显示该行的第一个字母。

你能帮我读出这一行的所有字母吗?(我的意思是读取 .txt 文件的整行)

python command line

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

在cmd和batch中使用数字序列重命名多个文件

这是我在这个美丽的网站上提出的第一个问题。正如您可能在标题中读到的那样,我想重命名可变数量的文件,在cmd和批处理文件中使用一系列数字,该序列是递增的,就像这样(1,2,3,4,5, 6、7、8、9、10...)。例如:

Test.txt它应该变成1.txt

Another.txt应变为2.txt

等等,一切都是自动的。

我的想法是设置一个类似的变量set /a number=1,并通过循环向其添加+1 set number="%number%+1",并每次重命名,但这是不可能的,因为当我使用ren 命令重命名文件时,它会立即重命名。

谁能帮我提供cmd和批处理文件版本?

提前致谢

command cmd batch-file command-prompt

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

Discord Bot Not Responding to Commands (Python)

I've just gotten into writing discord bots. While trying to follow online instructions and tutorials, my bot would not respond to commands. It responded perfectly fine to on_message(), but no matter what I try it won't respond to commands. I'm sure it's something simple, but I would appreciate the help.

import discord
from discord.ext.commands import Bot
from discord.ext import commands

bot = commands.Bot(command_prefix='$')
TOKEN = '<token-here>'

@bot.event
async def on_ready():
    print(f'Bot connected as {bot.user}')
    
@bot.event
async def on_message(message):
    if message.content …
Run Code Online (Sandbox Code Playgroud)

python command bots discord

0
推荐指数
2
解决办法
3317
查看次数

BASH 注释:#(散列)-vs- 之间的区别:(冒号)注释

在 bash GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)或任何稳定版本中,您可以使用#:进行评论

这两个和有用性有什么区别?

我注意到#注释使整行成为注释,而:作用域/效果仅在它到达第一个\n;字符(在给定行中)之前。

[gigauser@someserver ~]$ # this is a # comment; echo this will not print
[gigauser@someserver ~]$ : this is a : comment; echo this will print
this will print
Run Code Online (Sandbox Code Playgroud)

在下面的代码中,为什么最后 2 条评论没有按预期工作,然后将它们视为评论(尽管::如果它出现在: ?

[gigauser@someserver ~]$ #
[gigauser@someserver ~]$ ##
[gigauser@someserver ~]$ ####
[gigauser@someserver ~]$ ####
[gigauser@someserver ~]$ : : : : : : : : : …
Run Code Online (Sandbox Code Playgroud)

unix linux bash command comments

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