Over has made a standalone Sound-player where Python is not required.
Now gone take a look making the same Sound player for Python with wheel.
Wheel can also be distribute bye PyPi(soon Warehouse),example could have been
For making wheel will be using
So bye doing
Build the wheel:
Now gone take a look making the same Sound player for Python with wheel.
Wheel can also be distribute bye PyPi(soon Warehouse),example could have been
pip install play
if i had uploaded my wheel.For making wheel will be using
setup.py
.So bye doing
pip install wheel
,should all be included for 3-party user.data_files:
this add dll
and so
file to OS.install_requires:
This will install packages.entry_points:
This is cool function that will actually make .exe
for Windows as executable for Linux.# setup.py from setuptools import setup __author__ = 'snippsat' setup( name="play", version='0.1', py_modules=['play'], description="Play sound files", url='https://python-forum.io', author_email='[email protected]', python_requires='>=3.4', # Add required files to Windows and Linux data_files=[ ('Scripts', ['avbin.dll']), ('usr/lib', ['libavbin.so.10']) ], classifiers=[ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ], # These will be installed when "pip install wheel" run install_requires=[ 'pyglet', 'click', ], # Make executable eg for Windows will make .exe in Scripts folder entry_points='''\ [console_scripts] play=play:play''', )Now i activate folder again
pipenv shell
.Build the wheel:
E:\sound_env λ python setup.py bdist_wheelNow navigate to
dist
folder and install wheel.E:\sound_env λ cd dist E:\sound_env\dist λ ls play-0.1-py3-none-any.whl E:\sound_env\dist λ pip install play-0.1-py3-none-any.whlSo now in Python Script folder in virtual environment i have.
play.exe avbin.dllThen this should work from anywhere in
cmd
,as long as Scripts folder is in environment variable Path
for Windows.