I use numpy's genfromtxt
function for work all the time. Tomorrow I have to make a presentation on how to use Python (something I've only just started learning 6 weeks ago). The problem is that a lot of my audience will be using Mac's or Linux systems. I however, use Windows. I have found the Path
function, but it doesn't quite work:
from pathlib import Path
Path('File_180620_123733_Aunp_10nm_stock.txt').resolve()
which returns:
C:\Users\brand\Downloads\Python\My Files\aupnipam_scan41_3DFLR(1).txt
for windows, which again is my operating system, I need the format of my file path to be
C:\\Users\\brand\\Downloads\\Python\\My Files\\aupnipam_scan41_3DFLR(1).txt
for genfromtxt
to work.
Any suggestions to how to make this work, not only for Windows, but for all operating systems?