Off topic:python3 click syntax error, please help
1
0
Entering edit mode
3.4 years ago

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.

click • 535 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 1742 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6