问题描述
我需要发送PBS作业名称的名称作为工作目录中的最后一个文件夹。我应用以下行:
print(Foo._Foo__attr) # prints 5
exec 'print(Foo._Foo__attr)' # CORRECTED REFERENCE,PRINTS OUTPUT 5
# exec does not consider Foo to be
#the "current class",# so the private attribute cannot be referenced
#(unless you reference it as Foo._Foo__attr).
但是看来这是一个不正确的选择。
解决方法
这不起作用:
PBS -N "${PWD##*/}"