【发布时间】:2018-12-20 13:43:41
【问题描述】:
当我在终端中输入它时,我会立即得到输出。我想把它变成一个变量并在我的代码中使用它
python -c 'import crypt; print crypt.crypt("MyPassword", "$6$LsCK1WmouFiO9AT/$")'
我尝试过类似的方法
Password = python -c 'import crypt; print crypt.crypt("MyPassword", "$6$LsCK1WmouFiO9AT/$")'
【问题讨论】:
-
变量有什么用?什么样的代码是“你的代码”?
-
您想将此值分配给 bash 脚本中的变量吗?还是蟒蛇?
-
@Murali 是的,我正在使用 .shell 文件中的代码。
python -c 'import crypt; print crypt.crypt("MyPassword", "$6$LsCK1WmouFiO9AT/$")'的返回值应该在一个变量中。