请教这个程序怎么用python写
这个程序是java的 被要求用python写..
python只略懂皮毛 特别是跟java的库对应关系
帮我把这个main重写一次 我就可以循着规律来写剩下的了
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
public class Main {
static public Properties properties = new Properties();
static Logger logger = Logger.getRootLogger();
static String configFileName;
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
loadProperty();
Main main = new Main();
main.process();
}
static final String CONFIGRATION_FILE_NAME = "configFile";
static final String INPUT_DIR = "file.inputDir";
static final String BACKUP_DIR = "file.backupDir";
static final String INPUT_FILE_PATTERN = "file.infileName";
public static void loadProperty() {
try {
properties.load(new FileInputStream(System
.getProperty(CONFIGRATION_FILE_NAME)));
} catch (Exception e) {
logger.error("Properties file loading error", e);
}
// System.out.println(properties);
PropertyConfigurator.configure(properties);
}
public void process() {
logger.info("DWH batch loader start.");
String searchDirectoryName = properties.getProperty(INPUT_DIR);
String searchFilePattern = properties.getProperty(INPUT_FILE_PATTERN);
File[] processFileList = Util.searchFile(searchDirectoryName,
searchFilePattern);
FileProcessor processor = new FileProcessor();
processor.load(processFileList);
logger.info("DWH batch loader end.");
}
}
[解决办法]
任重而道远!