我的目录结构如下:
//I want to call the variables of the Variables() method to this one..but how??
public void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
float flin = Third.variables(fin);
JOptionPane.showMessageDialog(null,"Your Percentage for this Cycle Test is: "+flin+"%");
this.dispose();
Fourth IV = new Fourth();
IV.setVisible(true);
}
我想在单个语句中列出root/person1/yes/
root/person1/no/type1/
root/person1/no/type2/
root/person1/no/type3/
root/person1/no/type4/
root/person2/yes/
root/person2/no/type1/
root/person2/no/type2/
root/person2/no/type3/
root/person2/no/type4/
root/person3/yes/
root/person3/no/type1/
root/person3/no/type2/
root/person3/no/type3/
root/person3/no/type4/
和root/*/no/type1
中所有带有python root/*/no/type2
函数的.txt文件,如:
glob.glob
或
lst = glob.glob('root/*/no/(type1||type3)/*.txt')
答案 0 :(得分:-2)
Glob patterns没有“或”,但在这种情况下您可以使用字符匹配:
lst = glob.glob('root/*/no/type[12]/*.txt')