LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-18-2018, 01:13 PM   #1
vysero
Member
 
Registered: May 2018
Posts: 137

Rep: Reputation: Disabled
Problems converting pyqt4 script to pyqt5 using pyqt4topyqt5.py


I am attempting to us a script I found on GitHub called pyqt4topyqt5.py: https://github.com/rferrazz/pyqt4topyqt5

The README says:

pyqt4topyqt5

pyqt4 -> pyqt5
Usage

usage: pyqt4topyqt5.py [-h] [--nosubdir] [--followlinks] [-o O]
[--diff [DIFF]] [--diffs] [--nolog] [--nopyqt5]
path

Basic example: porting the content of pyqt4app to pyqt5 in the directory pyqt5app:

pyqt4topyqt5.py pyqt4app -o pyqt5app

So I downloaded and unzipped the file and I figured all I would need to do is bring my pyqt4 script into the folder, open up a terminal and type pyqt4topyqt5 myscript -o myscript_qt5, that did not work:
Code:
pyqt4topyqt5: command not found
So I tried a few other things:
$ pyqt4topyqt5 myscript -o pyqt5app
$ pyqt4topyqt5 myscript.py -o newscript.py
$ pyqt4topyqt5 myscript
$ pyqt4topyqt5 myscript -o newscript

All yielding the same result as before.

I tried opening pyqt4topyqt5 in my IDE and running it and the error is:

Code:
usage: pyqt4topyqt5.py [-h] [--nosubdir] [--followlinks] [-o O]
                       [--diff [DIFF]] [--diffs] [--nolog] [--nopyqt5]
                       path
pyqt4topyqt5.py: error: the following arguments are required: path
Which makes sense, the script needs to know where my pyqt4 script is located. This is why originally I thought just bringing the script directly into the pyqt4topyqt5-master folder (the folder created after unzipping the file) would work.

So now I am left wondering how I am supposed to use this script. I am pretty green when it comes to Linux. Anyone have any idea how to use this script or rather, what I am doing wrong?
 
Old 07-18-2018, 02:08 PM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,136
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
Is pyqt4topyqt5.py executable? Or are you trying to run it with:
Code:
python pyqt4topyqt5.py
A python script that has not been made executable, or run with python won't execute.
If the folder isn't in your $PATH, you will either need to specify the complete path, or ./myscript.py from the directory that it is in.

You may find it easier to look over pyqt5 and make the changes to the script. Or just make a new script with pyqt5.

http://pyqt.sourceforge.net/Docs/PyQt5/
https://pythonspot.com/pyqt5/
 
1 members found this post helpful.
Old 07-18-2018, 02:56 PM   #3
vysero
Member
 
Registered: May 2018
Posts: 137

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by teckk View Post
Is pyqt4topyqt5.py executable? Or are you trying to run it with:
Code:
python pyqt4topyqt5.py
A python script that has not been made executable, or run with python won't execute.
If the folder isn't in your $PATH, you will either need to specify the complete path, or ./myscript.py from the directory that it is in.

You may find it easier to look over pyqt5 and make the changes to the script. Or just make a new script with pyqt5.

http://pyqt.sourceforge.net/Docs/PyQt5/
https://pythonspot.com/pyqt5/
Ah, of course, thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Issue with PyQt5 aihaike Slackware 4 04-01-2018 04:18 PM
32-bit PyQt5 CollieJim Linux - Software 2 03-30-2018 01:51 AM
[SOLVED] Internal Compiler Error trying to compile qt5 and PyQt5 maew Slackware 20 04-03-2017 03:29 AM
[SOLVED] Why does my pyqt4 script take over 1GB of memory? sharky Programming 8 06-01-2015 02:38 PM
Converting a .bat script to sh script to work in linux server newtounix Programming 3 07-21-2011 07:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration