python宽度语法错误

Bla*_*ner 1 python linux syntax

我用python 2.7.2运行Ubuntu.

脚本

python \
/home/blainer/Desktop/convert/converter.py \
/home/blainer/Desktop/convert/urban.shp \
/home/blainer/Desktop/convert/result.js \
--width 900 \
--country_name_index 4 \
--where "ISO = 'USA'" \
--codes_file /home/blainer/Desktop/convert/codes-en.tsv \
--insets '[{"codes": ["US-AK"], "width": 200, "left": 10, "top": 370}, {"codes": ["US-HI"], "width": 100, "left": 220, "top": 400}]' \
--minimal_area 4000000 \
--buffer_distance -3000 \
--simplify_tolerance 1000 \
--longtitude0 10w \
--name us
Run Code Online (Sandbox Code Playgroud)

错误

blainer@ubuntu:~/Desktop/convert$ python script.py
File "script.py", line 5
--width 900 \
          ^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)

agf*_*agf 6

这不是Python脚本,它是运行Python的shell脚本.

  1. 说出来script.sh,不是.py.
  2. 在顶部添加"shebang"行: #!/bin/bash
  3. 使其可执行: chmod +x ./script.sh
  4. 运行: blainer@ubuntu:~/Desktop/convert$ ./script.sh