Entering edit mode
3.4 years ago
phoenixice154
•
0
I am trying to develop a python3 script using the click module to pass the arguments from commandline to variables in the script. my python3 version is 3.8.3 on a ubuntu 20.04 desktop.
The file is listed as following:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import click
@click.command()
@click.option('--bam', '-b', multiple=True, type=string, hide_input=False, required=True, help="BAM input")
@click.option('--threads', '-t', default=1, nargs=1, type=int, hide_input=False, required=False, help="Number of threads")
@click.option('--out', '-o', default="MyOut.stats", nargs=1, type=string, hide_input=False, required=False, help="Statistics Output")
debug_mode = 0
When I run it, I got a syntax error:
File "****/alignment_stats.py", line 12
debug_mode = 0
^
SyntaxError: invalid syntax
It seems the error locates at the line '@click.command()', but I can not figure it out why?
I am familiar with perl, but quite new to python3. If anyone knows the answer, please help.