Created
May 26, 2024 02:22
-
-
Save sefgit/470a14ff9d7ca31549305229e12e1032 to your computer and use it in GitHub Desktop.
Freezing python lightweight_charts using pyinstaller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import chdir | |
from os.path import dirname | |
import multiprocessing | |
import numpy as np | |
import pandas as pd | |
import asyncio | |
from lightweight_charts import Chart | |
async def main(): | |
#print(sys._MEIPASS) | |
#chdir(sys._MEIPASS) | |
FOLDER = dirname(__file__) | |
chdir(FOLDER) | |
chart = Chart(title='candles', debug=False) | |
df = pd.read_csv('ohlcv.csv') | |
chart.set(df) | |
await chart.show_async(block=True) | |
if __name__ == '__main__': | |
multiprocessing.freeze_support() | |
asyncio.run(main()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
pyi-makespec --collect-all lightweight_charts --collect-all webview --collect-submodules pandas._libs --add-data ohlcv.csv:. chart.py | |
pyinstaller chart.spec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment