Quantcast
Viewing all articles
Browse latest Browse all 5970

I could not open a file in ubuntu 22.04 using python

I created a script in pyqt to store a document in a mysql blob field. I could retrieve it and view the document before freezing the code with pyinstaller on a ubuntu 22.04 machine. After freezing I could retrieve it but could not view. The code snippet is given below;

cursor.execute("SELECT DOC_COPY FROM DOC_STORE WHERE DOC_ID=%s", (docID, ))docCopy = cursor.fetchone()[0]docPath = Path.cwd().joinpath("%s"%docID) # /home/Documents/Docstore/20240002writeTofile(docCopy, docPath) # writes the file to the specified pathsubprocess.run(['open',docPath], check=True) # not opening the file

witeToFile function writes the file '20240002' to the disk and i can see it. But the subprocess does not open/show the file. (It works fine in Windows 10). Somebody please help.


Viewing all articles
Browse latest Browse all 5970

Trending Articles