【发布时间】:2020-07-16 06:23:57
【问题描述】:
#!/usr/bin/env python3
#!/config.py
_UNIGENE_DIR = "/data/PROGRAMMING/assignment5"
_UNIGENE_FILE_ENDING = "unigene"
def get_unigene_directory (self,_UNIGENE_DIR) :
"""Returns the absolute path"""
self._UNIGENE_DIR = _UNIGENE_DIR
print(self._UNIGENE_DIR)
def get_uigene_extension(self,_UNIGENE_FILE_ENDING) :
"""Returns the extension of the file"""
self._UNIGENE_FILE_ENDING = _UNIGENE_FILE_ENDING
print(self_UNIGENE_FILE_ENDING)
所以,当我在我的 bash 的 python 环境中运行以下命令时:
file = "/".join( (config.get_unigene_directory(), host, gene + "." +
config.get_unigene_extension() ) )
我收到以下错误:
TypeError: get_unigene_directory() missing 2 required positional arguments: 'self' and
'_UNIGENE_DIR'.May I know whats the reason for this error?
【问题讨论】:
标签: python bash function parameters shebang