在我的.vimrc
,有这一行:
map <F4> :w<cr>:!python %<cr>
vim /home/debian/rd.py
当我使用并在文件写入后按编辑 python 文件F4时,我收到此错误:
/bin/bash: /home/debian/rd.py: Permission denied
shell returned 126
Press ENTER or type command to continue
1 gphoto2 --get-all-files
1 0x670x700x680x6f0x740x6f0x320xc20xa00x200x2d0x2d0x670x650x740x2d0x610x6c0x6c0x2d0x660x690x6c0x650x730xa
2 gphoto2 --get-all-files
2 0x670x700x680x6f0x740x6f0x320x200x200x2d0x2d0x670x650x740x2d0x610x6c0x6c0x2d0x660x690x6c0x650x730xa
Press ENTER or type command to continue
结果是对的,为什么Permission denied
我得到了结果?
编辑:
我经常使用gphoto2 --get-all-files
将数码相机照片放到我的电脑上,有时命令
gphoto2 --get-all-files
无法运行。我对这种现象感到困惑,当我将其擦除并再次输入时,它可以工作。我将两个看起来相同的命令粘贴到一个文件中,请从这里下载
并保存为\tmp\compare.txt
,
文件内容
gphoto2 --get-all-files
gphoto2 --get-all-files
当我打开vim在python上写一段小代码看原因时,
rd.py 的内容
myfile=open("/tmp/compare.txt","rb")
for x,line in enumerate(myfile.readlines()):
print x+1,line,
str1=""
for char in line:
str1=str1+hex(ord(char))
print x+1,str1
完成后按 F4 ,我得到输出,原因 
在命令中。
1 0x670x700x680x6f0x740x6f0x320xc20xa00x200x2d0x2d0x670x650x740x2d0x610x6c0x6c0x2d0x660x690x6c0x650x730xa
2 0x670x700x680x6f0x740x6f0x320x200x200x2d0x2d0x670x650x740x2d0x610x6c0x6c0x2d0x660x690x6c0x650x730xa
str1 是0xa0
哪个 
大于 str2