1

I have written a setup.py for a Python project. In the python script the documentation (e.g. html) can be opened from the script. The documentation file is added in the setup.py as data_files (so it goes into the egg). So I code on Ubuntu, all is smooth when testing on Windows, it does not work. It seems that the egg is not accessible (unzipped) for opening files in Windows. My code in setup.py is:

   setup(name='name',
      version="000",
      packages=[],
      data_files=[('Documentation', docList),
                  ('doxygen' ,      doxygenList),
                  ('testCase',      testCaseList),
                  ('testScripts',   testScriptsList)],
      description='OOO',
      url='none',
      author='I',
      author_email='me@here.com',
      scripts=scriptList,)

The code in the python script that opens the documentation:

if (sys.argv[1] == "-man"):
    filename = os.path.join(documentationAbsPath, 'Documentation.html')
    webbrowser.open(filename)
    sys.exit()

Ok so this is apparently no how to do it! So what should I do to use the egg in Windows as it is used in Ubuntu? I read that one can use zipfile module to open the egg. However, I am not interested in accessing the files inner content themselves, just open the html with the default web browser.

Thanks in advance!

4

0 回答 0