path

PyInstaller Tree Cannot find the path specified

PyInstaller Tree Cannot find the path specified Question: I want to include a folder and its contents within pyinstaller. I have a folder named ‘etc’ and it has a file named sbom.json. I am following the post mentioned tree, but I keep getting an error saying The system cannot find the path specified: ‘..\etc when …

Total answers: 1

Escaping a Linux path in Python without quotes, the correct way

Escaping a Linux path in Python without quotes, the correct way Question: I’m seeing a large amount of answers on here to this question that are blatantly incorrect or are partially correct but don’t account for any variances outside of a small scope. here is my path: "/home/user/text/Chapter 1-100" In bash/zsh I can hit tab …

Total answers: 1

cannot write images using cv2.write

cannot write images using cv2.write Question: I am trying to convert images from .jpg to .png format using opencv. I have written the following code. if __name__ == ‘__main__’: logging.info(r’%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%’) logging.info(‘Starting to make a .lst file’) # png_to_png = glob.globoos.path.join(args.jpg2png, ‘*.png’) images_list = glob.glob(os.path.join(args.image, "*.jpg")) logging.info(f’images_list example: {images_list[3]}’) # mask_list = glob.glob(os.path.join(args.masks, "*.png")) # Changing …

Total answers: 1

Run python commands within the project directory without running into file does not exist error

Run python commands within the project directory without running into file does not exist error Question: Project structure: ├── main.py └── utils ├── assets │   ├── export.csv ├── client.py utils/client.py code snippet: df = pd.read_csv("/assets/export.csv") command within project root: python utils/client.py FileNotFoundError: [Errno 2] No such file or directory: ‘/assets/export.csv’ I want to make this …

Total answers: 1

Finding all directed paths in networkx and saving them as a dataframe

Finding all directed paths in networkx and saving them as a dataframe Question: I need to find all directed paths in a network as shown in the sample, and save the directed paths in a new dataframe. Sample: import pandas as pd import networkx as nx import matplotlib.pyplot as plt sample_dict = { ‘target’: [‘A’, …

Total answers: 2

How do I replace slaces in python

How do I replace slash character "'' by backslash character "/" in python Question: I need to replace forward slash "" with backward slash "/". I have tried: c = "/r/tes/integrtest_Ame.txt" x = c.replace("", "/") print(x) But I have got the error: File "C:Usersbwar1korDesktopTesttest.py", line 33 x = c.replace("", "/") ^ SyntaxError: EOL while scanning …

Total answers: 1

Folder as python String wit _

Folder as python String wit _ Question: i want to print a foldername as a python 3.9 string. It looks like C:ABCDEF_GHI When i use print(r’C:ABCDEF_GHI’) it works generally. BUT: I need to print it in Jira as a issue comment. There it unfortunately looks like this: C:ABCDEF_GHI I use the default JIRA API for …

Total answers: 1

python – any function to access pickle causes FileNotFoundError

python – any function to access pickle causes FileNotFoundError Question: The error: > Traceback (most recent call last): > File ".scriptspickle_threed_future_dataset.py", line 127, in <module> > main(sys.argv[1:]) > File ".scriptspickle_threed_future_dataset.py", line 101, in main > scenes_dataset = ThreedFront.from_dataset_directory( > File "c:usersmibigdesktopatissscene_synthesisdatasetsthreed_front.py", line 169, in from_dataset_directory > scenes = parse_threed_front_scenes( > File "c:usersmibigdesktopatissscene_synthesisdatasetsutils.py", line 129, in …

Total answers: 1

How do you identify a list of filepaths containing non-ascii characters?

How do you identify a list of filepaths containing non-ascii characters? Question: I would like to print a list of file paths from a Windows directory which contain non-ascii characters. The files are located on deeply-nested subdirectories. I have two pieces of the problem figured out: A conditional that can evaluate a character and determine …

Total answers: 1