Python script that prints all word files in directory prints the documents out of order

Advertisements I have a short Python script that looks in the directory I point it to and prints all of the files in it (Microsoft Word .docx format). The entire script is below: import os from pathlib import Path #set path where the files to print are my_path = Path(__file__).parent / ‘OUTPUT’ string_path = str(my_path)… Read More Python script that prints all word files in directory prints the documents out of order

How to use subprocess.run with correct path on windows?

Advertisements On windows 10 using python 3.10.10 I am trying to run a windows executable, but there is some issue with the path to the folder of the executable. I am trying to run the following code path = r"C:/Program Files (x86)/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin" result = subprocess.run(command, cwd=path) but I get the error FileNotFoundError: [WinError 2] The… Read More How to use subprocess.run with correct path on windows?

Debug assertion failed error on using class function C++ Visual Studio

Advertisements I’m new to C++ Code: #include <iostream> #include <string> #include <fstream> #include <windows.h> class spawnTools { private: void specTools(std::string toolname) { } void normTools(std::string toolname) { } public: std::string toolList = { "regedit", "cmd" }; std::string toolListAdmin = { "regedit", "cmd" }; void initToolSet(int xadmin) { if (xadmin == TRUE) { } else if… Read More Debug assertion failed error on using class function C++ Visual Studio

Why it shows in console "[object File]" but not object itself?

Advertisements fs.addEventListener(‘change’, function () { for (name of this.files) console.log(name) } });` What’s wrong with my computer? Windows 7; >Solution : Please try below snipet to for file name fs.addEventListener(‘change’, getFileData); function getFileData() { const files = this.files; for ( let i = 0; i < files.length; i++) { console.log("file " + (i+1) +" name",… Read More Why it shows in console "[object File]" but not object itself?