def read_config_from_yaml(path_config):
'''
:param path_config: Path to the config file
:return:
'''
# Read the content of the yaml file
config_data = {}
with open(path_config, 'r') as file:
data = yaml.safe_load(file)
# Extract key-value pairs from the nested 'config' key
return data
set srcFldr to (choose folder with prompt "Select the source folder:")
set destFldr to (choose folder with prompt "Select the destination folder:")
tell application "Finder"
--set fileList to files of srcFldr -- sorted by name in HFS Plus' fashion (?)
set fileList to sort (get files of srcFldr) by name -- sorted by name in Finder's fashion
set fileCnt to count fileList
set ff to {}
repeat with i from 2 to fileCnt by 2
set end of ff to item i of fileList
end repeat
move ff to destFldr -- you can move list at once
end tell
public void writeFile(String text) {
try {
// Abre el archivo en modo de escritura
BufferedWriter writer = new BufferedWriter(new FileWriter("C:\\Users\\integratec\\Desktop\\universalError.txt"));
// Escribe en el archivo
writer.write(text);
writer.newLine(); // Añade una nueva línea
// Cierra el archivo
writer.close();
System.out.println("Se ha escrito en el archivo exitosamente.");
} catch (IOException e) {
System.out.println("Ocurrió un error al escribir en el archivo: " + e.getMessage());
}
Comments