K1DV5 / docal-tkinter

GUI for docal made with tkinter
MIT License
8 stars 0 forks source link

Running docal-tkinter on Ubuntu #2

Open AndreyNvk opened 3 years ago

AndreyNvk commented 3 years ago

Hello,

Tried to run docal-tkinter on Ubuntu and faced an issue:

ImportError: cannot import name 'startfile' from 'os' (/usr/lib/python3.7/os.py)

Checked in source code and found, the startfile can be used in windows only:

if sys.platform == 'win32':
    def startfile(path: AnyPath, operation: Optional[str] = ...) -> None: ...

My traceback is below:

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/user/PycharmProjects/docal-try/venv/lib/python3.7/site-packages/docal_tkinter/__main__.py", line 2, in <module>
    from docal_tkinter.app import App
  File "/home/user/PycharmProjects/docal-try/venv/lib/python3.7/site-packages/docal_tkinter/app.py", line 3, in <module>
    from .sidebar import Sidebar
  File "/home/user/PycharmProjects/docal-try/venv/lib/python3.7/site-packages/docal_tkinter/sidebar.py", line 4, in <module>
    from os import startfile, path
ImportError: cannot import name 'startfile' from 'os' (/usr/lib/python3.7/os.py)
K1DV5 commented 3 years ago

Yes, startfile is a windows only function. I was working only on windows and didn't have a linux machine. I would appreciate a cross platform way of opening a file, as if you double clicked it from your file explorer.