I know it's something simple that I am missing but for love nor money can i see what it is. The backslash is represented as a keyboard character that is the mirror image of the forward slash ( / ), often just called a slash, which is more widely. We hope this clarifies how slashes are used in writing. The backslash ( \ ) is mostly used in computing, not as a punctuation mark. his/her ), as well as for writing out dates, fractions, abbreviations, and URLs in various situations. Pdf_dir_list = #holds path names to indvidual pdf filesįor root, dirs,files in os.walk('G:/Books/'):ĭictionary=dict(zip(pdf_filenames, pdf_dir_list)) #maps the pdf names to their directory address The forward slash ( / ) can be used to mean ‘or’ when presenting alternatives (e.g. Pdf_filenames= #holds list of all pdf filenames in indexlist Indexlist= #holds all files in the given directory including subfolders It will also add \\ to any subfolders within subfolders.īelow is the procedure: def dicitonary_list(): Sometimes, in order to distinguish it from the backslash, we call it forward slash. I would suggest in the scripts try to use relative paths as much as possible instead of using absolute path locations. The type of slash used doesn't matter usually in MATLAB. About Forward Slash Forward slash /, usually known as slash, is an oblique slanting line punctuation mark. Make sure the path name is inside single quotes, because it may be the case that some folder name could have spaces. It is encoded at U+005C \ REVERSE SOLIDUS (92 decimal) in Unicode and ASCII. (which is obviously an invalid path name). Back slash is the mirror image of the common slash / (forward slash). G:/Books/Title.Pdf but the second it scans a subfolder e.g G:/Books/Sub Folder/Title.pdf it will print the following G:/Books/Sub Folder\\Title.Pdf The issue I am having is that it will scan the topmost directory and print the appropriate filename e.g. I have a procedure that os.walks a directory and its subdirectories to filter pdf files, separating out their names and corresponding pathnames.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |