NaxToPy.Modules.N2PtoEXE package#
Submodules#
NaxToPy.Modules.N2PtoEXE.N2PtoEXE module#
- NaxToPy.Modules.N2PtoEXE.N2PtoEXE.n2ptoexe(path: str, console: bool = True, solver: Literal['ALL', 'NASTRAN', 'ABAQUS', 'ANSYS', 'OPTISTRUCT'] = 'ALL', abaqusversion: list[Literal['2016', '2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024', '6.11', '6.12', '6.13', '6.14']] = None, splash: str = '', extra_packages: list[str] = None, extra_files: list[str] = None, hidden_imports: list[str] = None) None [source]#
Function that creates .exe files of programs that use NaxToPy
- Parameters:
path – str -> path of the module that will be used to create the .exe file
console – bool -> If True (Default), the .exe will opne a console of python. If False, the .exe will not open any python console.
solver – srt | list[str] -> Default=”ALL” Solver or list of solvers that the module will work with. Posible solvers are: “NASTRAN”, “ABAQUS”, “ANSYS”, “OPTISTRUCT”
abaqusversion – str | list[srt] -> Default=’2022’. Only when “ABAQUS” is selected a str or a list of ABAQUS version are aviable. Posible abaqus versions: [‘2016’, ‘2017’, ‘2018’, ‘2019’, ‘2020’, ‘2021’, ‘2022’, ‘6.11’, ‘6.12’, ‘6.13’, ‘6.14’]
splash – str -> Optional. Path to the splash image. If used, the user must introduce pyi_splash.close() at the beginning of the execution of the module. Import pyi_splash first. The splash image will appear during the .exe unpacking. Image should be png and smaller than 500x500 pixels.
extra_packages – list[str] -> If some packages are not imported correctly by the function, they can be added manually. An example of a package that usually fails is ‘sv_ttk’.
extra_files – list[str] -> Lis of path of extra dll, images or other files the user want to add the exe. The files will be saved in the ./bin directory inside the exe. To acces to the files use: path_file = os.path.join(sys._MEIPASS, r”binmylib.dll”)
Examples
>>> n2ptoexe(r"C:\Scripts\myscript1.py") >>> n2ptoexe(r"C:\Scripts\myscript2.py", console=False, solver="NASTRAN") >>> n2ptoexe(r"C:\Scripts\myscript3.py", console=True, solver="OPTISTRUCT", splash=r"C:\Scripts\mysplash.jpg") >>> n2ptoexe(r"C:\Scripts\myscript4.py", extra_packages=["sv_ttk"], extra_files=[r"C:\Scripts\icon.png"]) >>> n2ptoexe(r"C:\Scripts\myscript5.py", hidden_imports=["plyer.platforms.win.notification"])