jeudi 9 avril 2015

How to use cx_freeze with pyautoit?

I want to create a cx_freeze executable from my windows application that use "pyautoit" module.



pip install -U pyautoit


This is my example code:


main.py



import autoit

autoit.run("notepad.exe")
autoit.win_wait_active("[CLASS:Notepad]", 3)
autoit.control_send("[CLASS:Notepad]", "Edit1", "hello world{!}")
autoit.win_close("[CLASS:Notepad]")
autoit.control_click("[Class:#32770]", "Button2")


setup.py



import sys
from cx_Freeze import setup, Executable

build_exe_options = {
"packages": ["autoit"],
"excludes": []
}

base = None
if sys.platform == "win32":
base = "Win32GUI"

setup(
name = "AutoItSample",
version = "0.1",
description = "Automate Notepad Editor",
options = {"build_exe": build_exe_options},
executables = [Executable("main.py", base=base)],
)


And I created the build with this command inside my project folder.



python setup.py build


This module use a .dll file included inside the module folder.



autoit
lib
AutoItX3.dll
autoit.py
...


But cx_freeze doesn't include this .dll in the library.zip archive.

I tried to include the lib folder manually inside the library.zip archive.

But I've got the same error.


http://ift.tt/1IJufji


What should I do to make it work?


Aucun commentaire:

Enregistrer un commentaire