Python 3.7

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
mkanet
Posts: 16
Joined: Mon Jun 11, 2018 12:53 am

Python 3.7

Post by mkanet » Thu Apr 23, 2020 1:48 am

Now that Python 2.7 support has ended, are there any immediate plans to update EventGhost to use Python 3.x? I tried the latest beta; however, it's still using Python 2.7.

User avatar
kgschlosser
Site Admin
Posts: 5446
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Python 3.7

Post by kgschlosser » Thu Apr 23, 2020 4:33 am

yes it is still using Python 2.7. There are plans to upgrade it to python 3.6 possibly 3.7, The single largest stumbling block is wxWidgets the gui framework that is being used. We would have to upgrade it to version 4.x and version 4.x is an almost complete rewrite of the code. and it is not a drop in replacement for 3.x. there are just under 400 plugins for EventGhost and each and every one of these plugins would have to be updated.The core has already been modified and we have a version that runs python 3.6 the plugins are what need to be done.

If I had some help making the changes it would be something that would get done sooner then later.
If you like the work I have been doing then feel free to Image

steve@rpad
Posts: 48
Joined: Sat May 25, 2013 12:10 pm
Location: Toronto, Canada

Re: Python 3.7

Post by steve@rpad » Wed Jul 22, 2020 8:30 pm

What would a person have to do to help out?

Just starting to learn python, js, html in relation to EG.....anything repetitive or word processey to do?

Literally am reading about dictionaries/list/tuples. seriously newbie.

Maybe Organizational tasks?

Am about to try my hand at a plugin soon. Let me know?
Thanx,

Steve

Win10 Pro - 2004 - 64bit i7-4771 3.50GHz 32GB RAM 60TB Storage
EG - 0.5.0rc6, FileBot - 4.9.1.0, VidCoder 5.21
USBIRT, O-MEGA, DirWatcher, Keyboard, VLC
MediaPortal ...et al.

User avatar
kgschlosser
Site Admin
Posts: 5446
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Python 3.7

Post by kgschlosser » Thu Jul 23, 2020 7:07 am

The bump to python 3.x is not so much of a problem. It is the changing of wxPython to version 4.x which needs to be done in order to change over to Python 3.x. the API for wxPython 4.x has a large number of changes to it and would require modifing almost every single one of the plugins that are available.
If you like the work I have been doing then feel free to Image

steve@rpad
Posts: 48
Joined: Sat May 25, 2013 12:10 pm
Location: Toronto, Canada

Re: Python 3.7

Post by steve@rpad » Thu Jul 23, 2020 8:59 pm

In other words, thanks but no thanks. :lol: :lol:

Let me know if I can help at all with anything repetitious or simple. I've donated but would be interested in helping out with other stuff as well. Just retired.

Stay safe...the numbers are frighteningly science-fiction like.
Thanx,

Steve

Win10 Pro - 2004 - 64bit i7-4771 3.50GHz 32GB RAM 60TB Storage
EG - 0.5.0rc6, FileBot - 4.9.1.0, VidCoder 5.21
USBIRT, O-MEGA, DirWatcher, Keyboard, VLC
MediaPortal ...et al.

User avatar
kgschlosser
Site Admin
Posts: 5446
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Python 3.7

Post by kgschlosser » Fri Jul 24, 2020 1:23 am

steve@rpad wrote:
Thu Jul 23, 2020 8:59 pm
In other words, thanks but no thanks. :lol: :lol:
Not true. It is a complex thing to do and it will definitely help you in learning Python. It is not going to be easy tho. I have the core of Python converted already and it runs just fine. It's the plugins. I wanted to get some form of a plugin repository going first This way everything was in a single place. makes it easier to make the updates. I would like to use PIP to install plugins into EG. I think the mechanism would work fine for doing it and PIP can be pointed to a GitHub repository to get the plugin from.

So lets start off here. Are you familiar with GitHub? and do you have an account? Do you use an IDE like PyCharm? If not I would recommend you download PyCharm. I can get you up to speed on how to use it.

What part of the world are you located in?
If you like the work I have been doing then feel free to Image

steve@rpad
Posts: 48
Joined: Sat May 25, 2013 12:10 pm
Location: Toronto, Canada

Re: Python 3.7

Post by steve@rpad » Sat Jul 25, 2020 12:24 pm

Hey, I have GitHub acct. Have been using pycharm outside of EG, but been using the built-in IDE for my scripts inside of EG. I'll start using pycharm inside of EG. I saw a post somewhere here that instructs how to use within EG. From Toronto, Canada. I'm also reading how to learn JavaScript and HTML so I can modify Sem's O-MEGA plug-in. I'm obsessed currently with SQL, GUI. I will begin to use pycharm in a consistent manner.
Thanx,

Steve

Win10 Pro - 2004 - 64bit i7-4771 3.50GHz 32GB RAM 60TB Storage
EG - 0.5.0rc6, FileBot - 4.9.1.0, VidCoder 5.21
USBIRT, O-MEGA, DirWatcher, Keyboard, VLC
MediaPortal ...et al.

User avatar
kgschlosser
Site Admin
Posts: 5446
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Python 3.7

Post by kgschlosser » Sat Jul 25, 2020 4:28 pm

I can provide you with a file you will need in order to set EG up for use in an IDE . just let me know if you need it. I will shoot it over to ya.
If you like the work I have been doing then feel free to Image

steve@rpad
Posts: 48
Joined: Sat May 25, 2013 12:10 pm
Location: Toronto, Canada

Re: Python 3.7

Post by steve@rpad » Mon Jul 27, 2020 11:43 pm

Yes please....and a few hints on how to get it going?

Appreciated!
Thanx,

Steve

Win10 Pro - 2004 - 64bit i7-4771 3.50GHz 32GB RAM 60TB Storage
EG - 0.5.0rc6, FileBot - 4.9.1.0, VidCoder 5.21
USBIRT, O-MEGA, DirWatcher, Keyboard, VLC
MediaPortal ...et al.

User avatar
kgschlosser
Site Admin
Posts: 5446
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Python 3.7

Post by kgschlosser » Tue Jul 28, 2020 4:42 am

I'll do one better I am going to tell you how to compile EG yourself This will make the file you need. Plus it is good knowledge to have.

Executable files

Stackless Python 2.7 x86
WARNING: This will remove any other Python 2.x installation you have, if you have python 2.x installed be sure to backup anything that you may need from that installation first


InnoSetup
creates Setup.exe file.

HTML Help Workshop
for building documentation

Visual C++ Compiler for Python 2.7
for compiling any needed C code

2008 Visual C++ Redist
For the GUI framework

wxPython GUI framework
GUI framework

Python commands. If you do not add Python to your path statements that you will have to key in the explicit path to the python executable.

Upgrade pip to 9.0.1 (do not go newer then this version it will not work!)

Code: Select all

python -m pip install --no-cache-dir -U "pip==9.0.1"
Needed modules. You should be able to copy and paste the whole code block right into the command prompt window and it should install each of the items.

Code: Select all

pip install -U "setuptools==34.3.0"
pip install "wheel==0.29.0"
pip install "sphinx==1.7.5"
pip install "commonmark==0.7.3"
pip install "pillow==6.2.2"
pip install "py2exe_py2==0.6.9"
pip install "pycrypto==2.6.1"
pip install "comtypes==1.1.7"
pip install "https://github.com/EventGhost/eventghost.github.io/blob/master/dist/dependencies/ctypeslib-0.5.6-cp27-none-any.whl"
pip install "paramiko==2.7.1"
pip install "pywin32==228"
run the pywin32 post installation script.
Be sure to set c:\python27 to your actual installation location.

Code: Select all

python c:\Python27\scripts\pywin32_postinstall.py
once done with the above you can download the EG source code from Github and unzip it and compile away!!

_build/Build.py in the EG sources directory is what you need to run. a GUI will appear
I believe you will be able to compile everything except for the installer (setup.exe), changelog and documentation.
Unfortunately because of the way the build system was written everything above needs to be installed even if it ends
up being unused.

you will get the executable to run EG in the root of the source directory. You can run it where it sits. Be sure to not have any other versions of EG running before launching the one you just compiled.

if the output is not enough for you when it is compiling you can run this command before compiling

Code: Select all

set DISTUTILS_DEBUG=1
If you like the work I have been doing then feel free to Image

steve@rpad
Posts: 48
Joined: Sat May 25, 2013 12:10 pm
Location: Toronto, Canada

Re: Python 3.7

Post by steve@rpad » Thu Jul 30, 2020 1:54 pm

Oh wow, Thanks Kevin, Give me a couple weeks to digest. I'm on it!

very generous.

Stackless Python 2.7 x86
InnoSetup
HTML Help Workshop
Visual C++ Compiler for Python 2.7
2008 Visual C++ Redist
wxPython GUI framework - All installed.

Added Python to Path statements
Stepped down pip to ver. 9.0.1

All pip module installs are confirmed installed. With the exception of:

pip install "https://github.com/EventGhost/eventghos ... ne-any.whl"

I am getting an error telling me that the file is not a valid zipfile. Extension is .whl
Line 811 zipfile.py BadZipfile.

Used your ctype.zip file 2 posts below and worked fine.

Ran python c:\Python27\scripts\pywin32_postinstall.py
But added -install as a command line parameter
python c:\Python27\scripts\pywin32_postinstall.py -install
Last edited by steve@rpad on Mon Aug 03, 2020 5:02 pm, edited 3 times in total.
Thanx,

Steve

Win10 Pro - 2004 - 64bit i7-4771 3.50GHz 32GB RAM 60TB Storage
EG - 0.5.0rc6, FileBot - 4.9.1.0, VidCoder 5.21
USBIRT, O-MEGA, DirWatcher, Keyboard, VLC
MediaPortal ...et al.

steve@rpad
Posts: 48
Joined: Sat May 25, 2013 12:10 pm
Location: Toronto, Canada

Re: Python 3.7

Post by steve@rpad » Sun Aug 02, 2020 9:11 pm

All pip module installs are confirmed installed. With the exception of:

pip install "https://github.com/EventGhost/eventghos ... ne-any.whl"

I am getting an error telling me that the file is not a valid zipfile. Extension is .whl
Line 811 zipfile.py BadZipfile. Any suggestions?

Exception:
Traceback (most recent call last):
File "c:\python27\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\python27\lib\site-packages\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "c:\python27\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "c:\python27\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "c:\python27\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "c:\python27\lib\site-packages\pip\download.py", line 821, in unpack_url
hashes=hashes
File "c:\python27\lib\site-packages\pip\download.py", line 663, in unpack_http_url
unpack_file(from_path, location, content_type, link)
File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 599, in unpack_file
flatten=not filename.endswith('.whl')
File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 484, in unzip_file
zip = zipfile.ZipFile(zipfp, allowZip64=True)
File "c:\python27\lib\zipfile.py", line 770, in __init__
self._RealGetContents()
File "c:\python27\lib\zipfile.py", line 811, in _RealGetContents
raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file
Thanx,

Steve

Win10 Pro - 2004 - 64bit i7-4771 3.50GHz 32GB RAM 60TB Storage
EG - 0.5.0rc6, FileBot - 4.9.1.0, VidCoder 5.21
USBIRT, O-MEGA, DirWatcher, Keyboard, VLC
MediaPortal ...et al.

User avatar
kgschlosser
Site Admin
Posts: 5446
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Python 3.7

Post by kgschlosser » Mon Aug 03, 2020 8:18 am

OK use the attached file instead. You will need to change the extension from .zip to .whl use the same command as before just replace the url with the path and filename where you saved it to on your computer. Be sure to wrap the path and filename with double quotes if there are any spaces in the path.

Code: Select all

pip install "C:\some\path to file\ctypeslib-0.5.6-cp27-none-any.whl"
Attachments
ctypeslib-0.5.6-cp27-none-any.zip
(43.7 KiB) Downloaded 2 times
If you like the work I have been doing then feel free to Image

Post Reply