-
Notifications
You must be signed in to change notification settings - Fork 63
tSupport for displaying a VPython program (canvas) in a PyQT #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8b53c41
added support for pyqt browser window for display vpython canvas
96abd65
added support for pyqt browser window for display vpython canvas
7c87c36
added support for displaying VPython output in a pyqt window
3112de1
added plotly feature for integration
56cc701
Remove imports and make PEP8 changes
mwcraig fdae97d
Add error message for PyPy/pyqt combination
mwcraig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sys | ||
import PyQt5.QtCore | ||
import PyQt5.QtWebEngineWidgets | ||
from PyQt5.QtWidgets import QApplication | ||
|
||
|
||
if len(sys.argv) > 1: | ||
|
||
if sys.argv[1]: | ||
|
||
app = QApplication(sys.argv) | ||
|
||
web = PyQt5.QtWebEngineWidgets.QWebEngineView() | ||
web.load(PyQt5.QtCore.QUrl(sys.argv[1])) | ||
web.show() | ||
|
||
sys.exit(app.exec_()) | ||
|
||
else: | ||
print("Please give a URL as the first command-line argument " | ||
"when running the program.") | ||
|
||
else: | ||
print("Please give a URL as the first command-line argument " | ||
"when running the program.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@atitus -- does this look OK to you for PyPy error handling? It doesn't avoid an error but it does give a fairly explicit error message. I'm a little reluctant to have PyPy automagically ignore the pyqt browser setting because I imagine it will lead to confusion about why the regular browser is opening, but it would be straightforward to make that happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's fine with me. I don't know for sure that using PyPy and the pyqt browser are incompatible. I just know that the way I originally implemented pyqt in no_notebook.py was solely for non-PyPy cases. It's possible that you or someone else might implement pyqt in a way that is compatible with PyPy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK; I'll merge tomorrow morning to give folks a bit of time to make comments.