본문 바로가기

전체 글410

파이썬(QT) 전화번호 팝업창 띄우기 예제 import sys from PyQt5 import(uic) from PyQt5.QtWidgets import QApplication, QMainWindow import win32api form_class = uic.loadUiType("myqt05.ui")[0] class WindowClass(QMainWindow, form_class): def __init__(self): super().__init__() self.setupUi(self) self.pb0.clicked.connect(lambda :self.myclick(0)) self.pb1.clicked.connect(lambda :self.myclick(1)) self.pb2.clicked.connect(lambda :self.myclick(2).. 2023. 6. 28.
파이썬(QT) 구구단 입력 받아 출력 예제 import sys from PyQt5 import(uic) from PyQt5.QtWidgets import QApplication, QMainWindow form_class = uic.loadUiType("myqt04.ui")[0] class WindowClass(QMainWindow, form_class): def __init__(self): super().__init__() self.setupUi(self) self.pb.clicked.connect(self.myclick) def myclick(self): a=int(self.le.text()) b=""; for i in range(1,9+1): b += str(a) + "*" + str(i) + "=" + str(a*i)+"\n" self.te.. 2023. 6. 28.
파이썬(QT) 로또 출력 예제 import sys from PyQt5 import(uic) from PyQt5.QtWidgets import QApplication, QMainWindow from random import random form_class = uic.loadUiType("myqt03.ui")[0] class WindowClass(QMainWindow, form_class): def __init__(self): super().__init__() self.setupUi(self) self.pb.clicked.connect(self.myclick) def myclick(self): arr = list(range(1,45+1)) for i in range(100) : ran = int(random()*45) a = arr[0].. 2023. 6. 28.
안드로이드(자바) 야구게임 만들기 예제 package kr.co.aiai.app; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; public class MainActivity9 extends AppCompatActivity { String com = "897"; EditText et; TextView tv; @Override protected void.. 2023. 6. 28.
파이썬 야구게임 예제 번호 맞추기 from random import random def getS(com, mine): ret = 0 c1 = com[0:1] c2 = com[1:2] c3 = com[2:3] m1 = mine[0:1] m2 = mine[1:2] m3 = mine[2:3] if c1== m1 : ret += 1 if c2== m2 : ret += 1 if c3== m3 : ret += 1 return ret def getB(com, mine): ret = 0 c1 = com[0:1] c2 = com[1:2] c3 = com[2:3] m1 = mine[0:1] m2 = mine[1:2] m3 = mine[2:3] if c2==m1 or c3==m1 : ret += 1 if c1==m2 or c3==m2 : ret.. 2023. 6. 27.
안드로이드(자바) 전화번호 찍기 예제 package kr.co.aiai.app; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; public class MainActivity8 extends AppCompatActivity { Button[] btn = new Button[10]; Integer[] btn_id = {R... 2023. 6. 27.