Python ile Hesap Makinesi

ByFelez

Uzman üye
9 Tem 2013
1,818
1,774
Selamın Aleyküm.

Konu Gayet Net Bence :)


6fvne1h.PNG


Python:
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QGridLayout, QLineEdit, QPushButton, QStyleFactory
from PyQt5.QtCore import Qt

class CalculatorApp(QWidget):
    def __init__(self):
        super().__init__()

        self.initUI()

    def initUI(self):
        self.setWindowTitle('TurkHackTeam.org')
        self.setGeometry(100, 100, 300, 400)

        self.layout = QGridLayout()

        self.result_display = QLineEdit(self)
        self.result_display.setReadOnly(True)
        self.result_display.setAlignment(Qt.AlignRight)
        self.result_display.setProperty("class", "display")
        self.layout.addWidget(self.result_display, 0, 0, 1, 4)

        buttons = [
            '7', '8', '9', '/',
            '4', '5', '6', '*',
            '1', '2', '3', '-',
            '0', '.', '=', '+',
            'C', '<-',
        ]

        button_grid = [
            (i, j) for i in range(1, 7) for j in range(4)
        ]

        for (i, j), button_text in zip(button_grid, buttons):
            button = QPushButton(button_text, self)
            button.clicked.connect(self.buttonClicked)
            button.setProperty("class", "button")
            self.layout.addWidget(button, i, j)

        self.setLayout(self.layout)

        self.current_expression = ''

    def buttonClicked(self):
        sender = self.sender()
        clicked_text = sender.text()

        if clicked_text == '=':
            try:
                result = eval(self.current_expression)
                self.result_display.setText(str(result))
                self.current_expression = str(result)
            except Exception as e:
                self.result_display.setText('Error')
                self.current_expression = ''
        elif clicked_text == 'C':
            self.result_display.clear()
            self.current_expression = ''
        elif clicked_text == '<-':
            self.current_expression = self.current_expression[:-1]
            self.result_display.setText(self.current_expression)
        else:
            self.current_expression += clicked_text
            self.result_display.setText(self.current_expression)


if __name__ == '__main__':
    app = QApplication(sys.argv)

   
    app.setStyle(QStyleFactory.create("Windows"))

    calc_app = CalculatorApp()
    calc_app.show()
    sys.exit(app.exec_())
 

invisible blood

Uzman üye
15 Eyl 2023
1,177
443
Selamın Aleyküm.

Konu Gayet Net Bence :)


6fvne1h.PNG


Python:
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QGridLayout, QLineEdit, QPushButton, QStyleFactory
from PyQt5.QtCore import Qt

class CalculatorApp(QWidget):
    def __init__(self):
        super().__init__()

        self.initUI()

    def initUI(self):
        self.setWindowTitle('TurkHackTeam.org')
        self.setGeometry(100, 100, 300, 400)

        self.layout = QGridLayout()

        self.result_display = QLineEdit(self)
        self.result_display.setReadOnly(True)
        self.result_display.setAlignment(Qt.AlignRight)
        self.result_display.setProperty("class", "display")
        self.layout.addWidget(self.result_display, 0, 0, 1, 4)

        buttons = [
            '7', '8', '9', '/',
            '4', '5', '6', '*',
            '1', '2', '3', '-',
            '0', '.', '=', '+',
            'C', '<-',
        ]

        button_grid = [
            (i, j) for i in range(1, 7) for j in range(4)
        ]

        for (i, j), button_text in zip(button_grid, buttons):
            button = QPushButton(button_text, self)
            button.clicked.connect(self.buttonClicked)
            button.setProperty("class", "button")
            self.layout.addWidget(button, i, j)

        self.setLayout(self.layout)

        self.current_expression = ''

    def buttonClicked(self):
        sender = self.sender()
        clicked_text = sender.text()

        if clicked_text == '=':
            try:
                result = eval(self.current_expression)
                self.result_display.setText(str(result))
                self.current_expression = str(result)
            except Exception as e:
                self.result_display.setText('Error')
                self.current_expression = ''
        elif clicked_text == 'C':
            self.result_display.clear()
            self.current_expression = ''
        elif clicked_text == '<-':
            self.current_expression = self.current_expression[:-1]
            self.result_display.setText(self.current_expression)
        else:
            self.current_expression += clicked_text
            self.result_display.setText(self.current_expression)


if __name__ == '__main__':
    app = QApplication(sys.argv)

  
    app.setStyle(QStyleFactory.create("Windows"))

    calc_app = CalculatorApp()
    calc_app.show()
    sys.exit(app.exec_())
Elinize sağlık felez hocam
 

Speedy Gonzales

Katılımcı Üye
12 Kas 2021
635
296
in every technology system
Selamın Aleyküm.

Konu Gayet Net Bence :)


6fvne1h.PNG


Python:
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QGridLayout, QLineEdit, QPushButton, QStyleFactory
from PyQt5.QtCore import Qt

class CalculatorApp(QWidget):
    def __init__(self):
        super().__init__()

        self.initUI()

    def initUI(self):
        self.setWindowTitle('TurkHackTeam.org')
        self.setGeometry(100, 100, 300, 400)

        self.layout = QGridLayout()

        self.result_display = QLineEdit(self)
        self.result_display.setReadOnly(True)
        self.result_display.setAlignment(Qt.AlignRight)
        self.result_display.setProperty("class", "display")
        self.layout.addWidget(self.result_display, 0, 0, 1, 4)

        buttons = [
            '7', '8', '9', '/',
            '4', '5', '6', '*',
            '1', '2', '3', '-',
            '0', '.', '=', '+',
            'C', '<-',
        ]

        button_grid = [
            (i, j) for i in range(1, 7) for j in range(4)
        ]

        for (i, j), button_text in zip(button_grid, buttons):
            button = QPushButton(button_text, self)
            button.clicked.connect(self.buttonClicked)
            button.setProperty("class", "button")
            self.layout.addWidget(button, i, j)

        self.setLayout(self.layout)

        self.current_expression = ''

    def buttonClicked(self):
        sender = self.sender()
        clicked_text = sender.text()

        if clicked_text == '=':
            try:
                result = eval(self.current_expression)
                self.result_display.setText(str(result))
                self.current_expression = str(result)
            except Exception as e:
                self.result_display.setText('Error')
                self.current_expression = ''
        elif clicked_text == 'C':
            self.result_display.clear()
            self.current_expression = ''
        elif clicked_text == '<-':
            self.current_expression = self.current_expression[:-1]
            self.result_display.setText(self.current_expression)
        else:
            self.current_expression += clicked_text
            self.result_display.setText(self.current_expression)


if __name__ == '__main__':
    app = QApplication(sys.argv)

  
    app.setStyle(QStyleFactory.create("Windows"))

    calc_app = CalculatorApp()
    calc_app.show()
    sys.exit(app.exec_())
Eline sağlık
 

admin44

Katılımcı Üye
6 Kas 2023
453
139
TÜRKİYE
Selamın Aleyküm.

Konu Gayet Net Bence :)


6fvne1h.PNG


Python:
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QGridLayout, QLineEdit, QPushButton, QStyleFactory
from PyQt5.QtCore import Qt

class CalculatorApp(QWidget):
    def __init__(self):
        super().__init__()

        self.initUI()

    def initUI(self):
        self.setWindowTitle('TurkHackTeam.org')
        self.setGeometry(100, 100, 300, 400)

        self.layout = QGridLayout()

        self.result_display = QLineEdit(self)
        self.result_display.setReadOnly(True)
        self.result_display.setAlignment(Qt.AlignRight)
        self.result_display.setProperty("class", "display")
        self.layout.addWidget(self.result_display, 0, 0, 1, 4)

        buttons = [
            '7', '8', '9', '/',
            '4', '5', '6', '*',
            '1', '2', '3', '-',
            '0', '.', '=', '+',
            'C', '<-',
        ]

        button_grid = [
            (i, j) for i in range(1, 7) for j in range(4)
        ]

        for (i, j), button_text in zip(button_grid, buttons):
            button = QPushButton(button_text, self)
            button.clicked.connect(self.buttonClicked)
            button.setProperty("class", "button")
            self.layout.addWidget(button, i, j)

        self.setLayout(self.layout)

        self.current_expression = ''

    def buttonClicked(self):
        sender = self.sender()
        clicked_text = sender.text()

        if clicked_text == '=':
            try:
                result = eval(self.current_expression)
                self.result_display.setText(str(result))
                self.current_expression = str(result)
            except Exception as e:
                self.result_display.setText('Error')
                self.current_expression = ''
        elif clicked_text == 'C':
            self.result_display.clear()
            self.current_expression = ''
        elif clicked_text == '<-':
            self.current_expression = self.current_expression[:-1]
            self.result_display.setText(self.current_expression)
        else:
            self.current_expression += clicked_text
            self.result_display.setText(self.current_expression)


if __name__ == '__main__':
    app = QApplication(sys.argv)

  
    app.setStyle(QStyleFactory.create("Windows"))

    calc_app = CalculatorApp()
    calc_app.show()
    sys.exit(app.exec_())
eline sağlık güzel olmuş
 

Crackmeci

Katılımcı Üye
28 Haz 2020
312
170
Web
Selamın Aleyküm.

Konu Gayet Net Bence :)


6fvne1h.PNG


Python:
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QGridLayout, QLineEdit, QPushButton, QStyleFactory
from PyQt5.QtCore import Qt

class CalculatorApp(QWidget):
    def __init__(self):
        super().__init__()

        self.initUI()

    def initUI(self):
        self.setWindowTitle('TurkHackTeam.org')
        self.setGeometry(100, 100, 300, 400)

        self.layout = QGridLayout()

        self.result_display = QLineEdit(self)
        self.result_display.setReadOnly(True)
        self.result_display.setAlignment(Qt.AlignRight)
        self.result_display.setProperty("class", "display")
        self.layout.addWidget(self.result_display, 0, 0, 1, 4)

        buttons = [
            '7', '8', '9', '/',
            '4', '5', '6', '*',
            '1', '2', '3', '-',
            '0', '.', '=', '+',
            'C', '<-',
        ]

        button_grid = [
            (i, j) for i in range(1, 7) for j in range(4)
        ]

        for (i, j), button_text in zip(button_grid, buttons):
            button = QPushButton(button_text, self)
            button.clicked.connect(self.buttonClicked)
            button.setProperty("class", "button")
            self.layout.addWidget(button, i, j)

        self.setLayout(self.layout)

        self.current_expression = ''

    def buttonClicked(self):
        sender = self.sender()
        clicked_text = sender.text()

        if clicked_text == '=':
            try:
                result = eval(self.current_expression)
                self.result_display.setText(str(result))
                self.current_expression = str(result)
            except Exception as e:
                self.result_display.setText('Error')
                self.current_expression = ''
        elif clicked_text == 'C':
            self.result_display.clear()
            self.current_expression = ''
        elif clicked_text == '<-':
            self.current_expression = self.current_expression[:-1]
            self.result_display.setText(self.current_expression)
        else:
            self.current_expression += clicked_text
            self.result_display.setText(self.current_expression)


if __name__ == '__main__':
    app = QApplication(sys.argv)

  
    app.setStyle(QStyleFactory.create("Windows"))

    calc_app = CalculatorApp()
    calc_app.show()
    sys.exit(app.exec_())
Hocam Elinize sağlık, ama trigonometrik fonksiyonlar v.b. 3 4 5 6. Derecelerden kök alma, logaritma, mutlak değer , üs alma gibi özellikler de eklerseniz güzel olur tekrardan elinize sağlık
 

ByFelez

Uzman üye
9 Tem 2013
1,818
1,774
Hocam Elinize sağlık, ama trigonometrik fonksiyonlar v.b. 3 4 5 6. Derecelerden kök alma, logaritma, mutlak değer , üs alma gibi özellikler de eklerseniz güzel olur tekrardan elinize sağlık
Teşekkür ederimmmm...
Ya benim istediğim yorumlar bunlar düz eline sağlığı herkes yazar bak konuya fikrini belirtt :) Tekrardan teşekkürler dostum cansın...
 

Zwo

Katılımcı Üye
Selamın Aleyküm.

Konu Gayet Net Bence :)


6fvne1h.PNG


Python:
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QGridLayout, QLineEdit, QPushButton, QStyleFactory
from PyQt5.QtCore import Qt

class CalculatorApp(QWidget):
    def __init__(self):
        super().__init__()

        self.initUI()

    def initUI(self):
        self.setWindowTitle('TurkHackTeam.org')
        self.setGeometry(100, 100, 300, 400)

        self.layout = QGridLayout()

        self.result_display = QLineEdit(self)
        self.result_display.setReadOnly(True)
        self.result_display.setAlignment(Qt.AlignRight)
        self.result_display.setProperty("class", "display")
        self.layout.addWidget(self.result_display, 0, 0, 1, 4)

        buttons = [
            '7', '8', '9', '/',
            '4', '5', '6', '*',
            '1', '2', '3', '-',
            '0', '.', '=', '+',
            'C', '<-',
        ]

        button_grid = [
            (i, j) for i in range(1, 7) for j in range(4)
        ]

        for (i, j), button_text in zip(button_grid, buttons):
            button = QPushButton(button_text, self)
            button.clicked.connect(self.buttonClicked)
            button.setProperty("class", "button")
            self.layout.addWidget(button, i, j)

        self.setLayout(self.layout)

        self.current_expression = ''

    def buttonClicked(self):
        sender = self.sender()
        clicked_text = sender.text()

        if clicked_text == '=':
            try:
                result = eval(self.current_expression)
                self.result_display.setText(str(result))
                self.current_expression = str(result)
            except Exception as e:
                self.result_display.setText('Error')
                self.current_expression = ''
        elif clicked_text == 'C':
            self.result_display.clear()
            self.current_expression = ''
        elif clicked_text == '<-':
            self.current_expression = self.current_expression[:-1]
            self.result_display.setText(self.current_expression)
        else:
            self.current_expression += clicked_text
            self.result_display.setText(self.current_expression)


if __name__ == '__main__':
    app = QApplication(sys.argv)

  
    app.setStyle(QStyleFactory.create("Windows"))

    calc_app = CalculatorApp()
    calc_app.show()
    sys.exit(app.exec_())
Elinize sağlık hocam
 
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.