New overriden and generated QLineEdit class will not be placed on the MainWindow as expected

2021-10-08 Thread Mohsen Owzar
Hi all
Some days ago, I send a question to this community about a clickable QLineEdit.
After getting the Hint to use QMouseEvent, I've written the program which is 
working almost good but with a small or perhaps big ugliness and that is:
Below is the imgur link to the screenshots of my program after clicking the 
buttons in sequence:
https://imgur.com/a/rfcP3qB
As you will see in the code blow, I override the QlineEdit widget and define a 
new class " CustomLineEdit " to generate a "clicked" signal, when the user 
pressed with mouse on this field.
I use this "CustomLineEdit" class and place it on the MainWindow with the 
desired "layout".
I couldn't figure out, why this widget is placed not in the MainWindow, but 
outside this window, as you can see in the top picture of the attached 
screenshots.
When I take the line 12 (self.show()) from the code, the generated class will 
not appear.
The problem here is that at the beginning, the MainWindow with a LineEdit field 
should appear at the program start.
Then, after clicking on this field, the keypad should come up outside the 
MainWindow.
Could anyone see, where my mistake is?
Thanks for any help.
Mohsen
Here is the code:
&&&
import sys
from PyQt5.QtWidgets import (QApplication, QLineEdit, QPushButton, QMainWindow,
 QVBoxLayout, QHBoxLayout, QGridLayout, QWidget)
from PyQt5.QtCore import pyqtSignal, pyqtSlot

class CustomLineEdit(QLineEdit):
clicked = pyqtSignal()

def __init__(self):
super().__init__()

self.show()

def mousePressEvent(self, QMouseEvent):
self.clicked.emit()


class MainWindow(QMainWindow):
def __init__( self, parent=None ):
super().__init__(parent)

self.title = 'Window 1'
self.left = 700
self.top = 300
self.width = 200
self.height = 200
self.initUI()

def initUI(self):

self.keypad_window = Keypad_Window(self)

hbox = QHBoxLayout()

self.cle = CustomLineEdit()
self.cle.clicked.connect(self.show_keypad_window)
self.cle.setFixedSize(220, 60)
self.cle.setStyleSheet("color: red;"
   "background-color: yellow;"
   "font-family: Arial;"
   "font-weight: Bold;"
   "font-size: 30pt")

hbox.addWidget(self.cle)
self.setLayout(hbox)

self.setWindowTitle(self.title)
self.setGeometry(self.left, self.top, self.width, self.height)
self.show()

def show_keypad_window(self):
self.keypad_window.show()
self.hide()

def close(self):
self.keypad_window.close()
super(MainWindow, self).close()

@pyqtSlot(str)
def update_label(self, txt):
self.cle.setText(txt)

class Keypad_Window(QWidget):
def __init__(self, parent=None):
super().__init__()
self.parent = parent

self.setGeometry(1200, 500, 230, 400)

vbox = QVBoxLayout()
self.display = QLineEdit()
self.display.setFixedSize(220, 60)
self.display.setReadOnly(True)
self.display.setStyleSheet("color: Blue; "
   "background-color: lightgreen;"
   "font-family: Arial;"
   "font-weight: Bold;"
   "font-size: 18pt")
vbox.addWidget(self.display)

"""Create the buttons."""
self.buttons = {}
self.gridlay = QGridLayout()

self.button_name = [['7', '8', '9'],
['4', '5', '6'],
['1', '2', '3'],
['C', '0', '>']]

self.command_name = [['7', '8', '9'],
 ['4', '5', '6'],
 ['1', '2', '3'],
 ['delete', '0', 'accept']]

for i in range(4):
for j in range(3):
text = self.button_name[i][j]

# keep a reference to the buttons
self.buttons[i, j] = QPushButton()
self.buttons[i, j].setText(text)
self.buttons[i, j].setObjectName(text)
self.buttons[i, j].setFixedSize(70, 70)
if i == 3:
if j == 0:
self.buttons[i, j].setToolTip('Each click deletes\na 
digit to the left')

if j == 2:
self.buttons[i, j].setToolTip('The whole 
displayed\nvalue will be taken!')

self.buttons[i, j].clicked.connect(self.call_button_fun(i, j, 
self.command_name))

# add to the GridLayout
self.gridlay.addWidget(self.buttons[i, j], i, j)
self.buttons[i, j].setStyleSheet("color: blue; "
 "background-color: cyan;"
   

EuroPython Society: Launching the EuroPython Society Fellow Grant

2021-10-08 Thread Marc-Andre Lemburg
We are excited to announce the new EuroPython Society Fellow Grant.

The grant is intended to honor and show gratitude towards members of the
EuroPython Society (EPS) and the EuroPython Workgroups who have
contributed significantly towards our mission, the EuroPython conference
and the Society as an organization.


EuroPython Fellows
--

EuroPython Fellows are eligible to a lifetime free attendance of the
EuroPython conference and will be listed on our EuroPython Society
Fellow Grant page.

https://www.europython-society.org/europython-society-fellow-grant/

The EuroPython Board will decide on new Fellowships based on nominations
by the EPS members and its own deliberations.


Our first Fellows
-

To launch the grant, the current board has decided to make all board
members since 2012 who have served at least two terms and are not
members of the current board EuroPython Fellows:

- Alexander Hendorf
- Alexandre Manhaes Savio
- Anthon van der Neut
- Borja Ayerdi
- Christian Calogero Barra
- Darya Chyzhyk
- Fabio Pliger
- Jacob Hallén
- Vicky Twomey-Lee

In our last board call, we added two additional Fellows:

- Laura Creighton (2021)
- Oier Etxaniz Beneitez (2021, posthumously)

The board will announce more Fellows in the coming weeks. If you are an
EPS member and want to nominate another member as a Fellow, please write
to bo...@europython.eu and include the reasons why you believe the
member should become a Fellow.

The EPS Board would like to congratulate all of the above Fellows and
thank them for their tireless work towards our goals.


Help spread the word


Please help us spread this message by sharing it on your social
networks as widely as possible. Thank you !

Link to the blog posts:

https://www.europython-society.org/launching-the-europython-society-fellow-grant/
https://www.europython-society.org/new-europython-society-fellows/

Tweets:

https://twitter.com/europythons/status/1442834034690822147
https://twitter.com/europythons/status/1446446855857086469

Thanks,
--
EuroPython Society
https://www.europython-society.org/

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: HELP - uninstall pyton error

2021-10-08 Thread Mats Wichmann

On 10/7/21 10:18, Almadar Plus wrote:

Could you please help me uninstall python?
see attached screenshots files
Regards



the list doesn't pass on screenshots, so we see nothing.

you'll need to describe your problem.
--
https://mail.python.org/mailman/listinfo/python-list