-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
The Spyder "custom IPython" dosn't work correctly #21663
Comments
Hey @GitKia1392, thanks for reporting. Why does your code not work? What problem are you seeing in Spyder? |
Wassup @ccordoba12. My code works flawlessly in VS Code. The main problem is probably becuz of How big spyder is. |
That has nothing to do with it.
Please follow the instructions posted in this page to see if that helps: https://github.com/spyder-ide/spyder/wiki/How-to-run-PyQt-applications-within-Spyder |
Did fix the problem a little but when with the new code: from sys import exit, argv
import platform
import time
from PyQt5.QtWidgets import QApplication as qapp, QMainWindow as qmain, QLabel as qlab, QVBoxLayout as qvbox, QWidget, QPushButton, QInputDialog
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import QEvent as qeve
import subprocess as sp
app = qapp(argv)
class Install(qmain):
def __init__(self):
super().__init__()
self.setWindowIcon(QIcon(r"K:\Dont_Bother\Icon-Taskbar-window.png"))
if platform.system() != "Windows":
# If your OS isn't Windows it will execute this code:
self.setWindowTitle('--NotWindowsError')
self.setGeometry(100, 100, 800, 600) # Adjusted size
# Create a central widget to hold the layout
central_widget = QWidget(self)
layout = qvbox()
label = qlab(f"OS must be Windows 10, 8.1 or 11, this OS is using {platform.system()}")
layout.addWidget(label)
# Set the layout for the central widget
central_widget.setLayout(layout)
# Set the central widget for the main window
self.setCentralWidget(central_widget)
else:
# If your OS is Windows it will execute this code:
self.setWindowTitle('Dont_Bother')
self.setGeometry(100, 100, 800, 600) # Adjusted size
central_widget = QWidget(self)
layout = qvbox()
label = qlab("OS is windows... Do you wish to continue?")
layout.addWidget(label)
# Create a function to handle the user's input
def handle_input():
user_input, ok = QInputDialog.getText(self, 'Input', 'Do you wish to continue? (yes/no)')
if ok and user_input.lower() == "yes":
exit()
else:
exit()
# if the user wants to continue.
button = QPushButton("Continue to Dont_Bother?")
button.clicked.connect(handle_input)
layout.addWidget(button)
central_widget.setLayout(layout)
self.setCentralWidget(central_widget)
# Create an instance of the Install class
install_window = Install()
# Show the window
install_window.show()
# Start the application's event loop
exit(app.exec_()) When i try to exit the app it doesn't let me and it says oh 'PyThOn IsN't ReSpOnDiNg!'
Thanks |
Please change the last line of your code exit(app.exec_()) to be app.exec_() That should fix your problem. |
The thing is that no-one uses the old "Python 3.8" anymore(its the default btw) and plus, when i changed it to Python 3.11.5
it won't work; in VSCode I tried the EXACT same code and it worked unlike it wouldn't in Spyder
Here's my code
The text was updated successfully, but these errors were encountered: