Ticket #488 (new support)
Include javascript file within python executable file
| Reported by: | rsraman@… | Owned by: | matysek |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | PyInstaller | Version: | 1.5.1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I use python to generate html pages to display a set of plots. The page includes javascript functions to dynamically update the contents of the page.
In a python source implementation, I open the javascript file and write it's contents to the webpage I am generating using python. The javascript file is in the same folder as the other python scripts. The execution is done via: python <Name of top level script> <optional parameters>
To access the javascript file within the python scripts, I do the following: file_path = sys.path[0]; (path to the python top level script) fopen( file_path + 'Name of .js file' )
This obviously does not work when I generate an executable using pyinstaller. sys.path[0] will be some OS determined location. Would it be possible for pyinstaller to include the javascript file as well within the exe file? I suppose I can then say, fopen( 'Name of .js file' )
Much appreciate your help!
Ram

I suggest reading the manual: http://www.pyinstaller.org/export/1899/trunk/doc/Manual.html#accessing-data-files