我尝试___name__
在 python 脚本的开头使用:
#!/usr/bin/python
# Comments...
# blabla
#
__name__="cigarline_by_pos.py"
__synopsis__ = "cigarline_by_pos.py | INPUT_BAM_FILE --output OUTPUT_FILE [--output OUTPUT_FILE_R2 --readsplit]"
__example__ = "cigarline_by_pos.py hg18.bam --output hg18_read1.csv --output hg18_read2.csv --readsplit"
__date__ = "05/2013"
__authors__ = "Frederic Escudie & Antoine Leleu"
__keywords__ = "SAM Alignment"
__description__ = "Sum by position the status of reads. This provides for example the number of reads that have a mismatch at first base."
__version__ = '2.3.1'
import argparse,re,sys
the rest of the code...
但随后 Python 会打印一个警告:
cigarline_by_pos.py:29: RuntimeWarning: Parent module 'cigarline_by_pos' not found while handling absolute import
import argparse,re,sys
我不知道它可能来自什么。
我只知道如果我删除___name__
脚本的行,但我想要这个变量。
有人可以帮助我吗?