AREPL fails in Code 1.23See original GitHub issue
As of updating Visual Studio Code 1.23 AREPL does not work when selecting some code followed by
AREPL: Open Highlighted code in new AREPL session ?
- Created 5 years ago
- Comments:12 (7 by maintainers)
Top GitHub Comments
Yes, AREPL supports PyQT 😃
Currently it supports a hardcoded list of GUI libraries
[“turtle”, “matplotlib”, “tkinter”, “kivy”, “pyforms”, “PyQt4”, “PyQt5”, “wx”, “pyside”, “plotly”, “ggplot”, “bokeh”]
With the next release I’ll turn that into a setting you can change.
It will work with any GUI library in the list but there’s two things to watch out for:
- The window will steal your focus whenever it pops up. On windows you can use alt-tab to quickly switch back to VSCode
- The window might pop up over your code - you should adjust the position of the window so it appears where you want it.
import sys from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtGui import QIcon class App(QWidget): def __init__(self): super().__init__() self.title = 'PyQt5 simple window - pythonspot.com' self.left = 900 # adjust these values so popup doesnt appear over your code self.top = 100 self.width = 640 self.height = 480 self.initUI() def initUI(self): self.setWindowTitle(self.title) self.setGeometry(self.left, self.top, self.width, self.height) self.show() app = QApplication(sys.argv) ex = App() app.exec()
As for the
AREPL: Open Highlighted code in new AREPL session command, I made it create a new document so you don’t end up with junk temporary files in your directory. Now that I think about it what I could do instead is save the new document to a folder like “%Appdata%\AREPL” so you can save and load your snippets from there. Does that sound better?
I got it working quite well actually 👍
Although, when running
AREPL: Open Highlighted code in new AREPL session it would be good if it didn’t create new documents within VSCode and rather wrote to a temporary file of sorts to which I could then load. Especially if experimenting to analyze code snippets etc.
Also can AREPL work with PyQT and the like ?