path

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

How do I normalize a path format to Unix-style while on Windows?

How do I normalize a path format to Unix-style while on Windows? Question: I am storing paths in a json file using a python script. I want the paths to be stored in the same format (Unix-style) no matter which OS the script is run on. So basically I want to run the os.path.normpath function, …

Total answers: 2

File not found error when copying images from one folder to another

File not found error when copying images from one folder to another Question: I have a text file containing the names of images to be copied from a source folder to a destination folder. The source folder contains several sub-folders as shown below. The images may come from any of these sub-folders. animals (source folder) …

Total answers: 1

Imported function not finding filepath when used in jupyter notebooks

Imported function not finding filepath when used in jupyter notebooks Question: I have the following folder setup: project ├── pipeline │ ├── functions.py | ├── __init__.py | └── library │ └── data.csv | └── notebook.ipynb I import my functions.py into the notebook as follows: from pipeline.functions import * In my notebook I use one of …

Total answers: 1

Rename all csv files in folder by removing the end of the filename

Rename all csv files in folder by removing the end of the filename Question: I have an entire data folder ending with .csv. All csv files are named like this : "data_AA_10_344362.csv" "data_AA_25_124567.csv" "data_AA_37_896432.csv" etc. I want to rename all of them by removing everything after the last underscore but keep ‘.csv’. So i would …

Total answers: 2