MapleStory Finger Point

๐Ÿ’Ž Python/Python_Code 29

ํ”„๋กœ๊ทธ๋ž˜์Šค๋ฐ”๋กœ ๋ฉ€ํ‹ฐ ์Šค๋ ˆ๋“œ ํ‘œํ˜„ํ•˜๊ธฐ

from tkinter import * from tkinter.ttk import * import random import time import threading ## class ThreadProgressBar() : thread = None progress = None def __init__(self,parent): self.progress = Progressbar(parent, orient=HORIZONTAL, length=400) self.progress.pack(side=TOP, fill=X,ipadx=10,padx=10,pady=10) self.thread = threading.Thread(target=self.runProgress,args=(self.progress,)) self.thread...

ํ‘๋ฐฑ ์‚ฌ์ง„ ๋งŒ๋“ค๊ธฐ - ํŒŒ์ด์ฌ for Beginner (2ํŒ)

#raw ํŒŒ์ผ , 256x256 ํ‘๋ฐฑ์ด๋ฏธ์ง€ 0~255 # 0์— ๊ฐ€๊นŒ์šฐ๋ฉด ๊ฒ€์ • / 255์— ๊ฐ€๊นŒ์šฐ๋ฉด ํฐ์ƒ‰ from tkinter import * def loadImage(fname) : global inImage, XSIZE,YSIZE fp = open(fname, 'rb') for i in range (0,XSIZE): tmpList = [] for k in range(0, YSIZE) : data=int(ord(fp.read(1))) tmpList.append(data) inImage.append(tmpList) fp.close() def displayImage(image) : global XSIZE,YSIZE rgbString = "" for i in range(0,XSIZE): tmpString =..

ํŒŒ์ผ ์•”ํ˜ธํ™”/์•”ํ˜ธํ•ด๋… - ํŒŒ์ด์ฌ for Beginner (2ํŒ)

#์•”ํ˜ธํ™” ํ•˜๋Š” ๋ฐฉ๋ฒ• #ord() ๊ธ€์ž์˜๊ณ ์œ ์ˆซ์ž์•Œ๋ ค์คŒ , chr() ์ˆซ์ž์—๋งž๋Š”๊ธ€์ž์•Œ๋ ค์คŒ inFp, outFp = None, None inStr, outStr = "", "" i=0 secu=0 secuYN = input("1.์•”ํ˜ธํ™” 2. ์•”ํ˜ธ ํ•ด์„ ์ค‘ ์„ ํƒ >> ") inFname = input("์ž…๋ ฅ ํŒŒ์ผ๋ช…์„ ์ž…๋ ฅํ•˜์„ธ์š” :") outFname = input("์ถœ๋ ฅ ํŒŒ์ผ๋ช…์„ ์ž…๋ ฅํ•˜์„ธ์š” :") #1๋ฒˆ ์„ ํƒ์‹œ ์•”ํ˜ธํ™”, 2๋ฒˆ ์„ ํƒ์‹œ ๋ณตํ˜ธํ™” if secuYN == "1" : secu = 100 elif secuYN == "2" : secu = -100 inFp = open(inFname, 'r', encoding = 'utf-8') outFp = open(outFname, 'w', encoding = 'utf-8..

๋กœ๋˜ ๋ฒˆํ˜ธ ์ถ”์ฒจ ํ”„๋กœ๊ทธ๋žจ - ํŒŒ์ด์ฌ for Beginner (2ํŒ) // self study 9-2

๋žœ๋คํ•จ์ˆ˜๊ฐ’์„ ๋งŒ๋“ค์–ด์ฃผ๋Š” getNumber ํ•จ์ˆ˜๋ฅผ ๋งŒ๋“ ๋‹ค. ๋กœ๋˜ ๋ฒˆํ˜ธ num , ๋„ฃ์„ lotto ๋ฆฌ์ŠคํŠธ ์ดˆ๊ธฐํ™”, ๋ฌดํ•œ๋ฃจํ”„๋กœ ๋žœ๋ค ์ˆซ์ž๋ฅผ ์ƒ์„ฑํ•ด์ค€๋‹ค. ์กฐ๊ฑด๋ฌธ : ๋ฆฌ์ŠคํŠธ์— num์ˆซ์ž๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธ ! => ์—†์œผ๋ฉด num ๊ฐ’์„ ์ถ”๊ฐ€ํ•œ๋‹ค. ์กฐ๊ฑด๋ฌธ : ๋ฆฌ์ŠคํŠธ ๊ธธ์ด๊ฐ€ 6๋ณด๋‹ค ํฌ๊ฑฐ๋‚˜ ๊ฐ™์œผ๋ฉด ๋ฉˆ์ถ˜๋‹ค ๋กœ๋˜๋ฒˆํ˜ธ๋ฅผ ๋ณด๊ธฐ ์ข‹๊ฒŒ ์ •๋ ฌํ•ด์ฃผ๊ณ  6์ž๋ฆฌ๋ฅผ ์ถœ๋ ฅํ•ด์ฃผ๋ฉด ๋. import random def getNumber(): return random.randrange(1,46) lotto = [] num = 0 print("๋กœ๋˜ ์ถ”์ฒจ์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค!!\n") while True: num = getNumber() if lotto.count(num) == 0: lotto.append(num) if len(lotto) >= 6 : break ..

๋ฌธ์ž์—ด ๋ฌธ์ž์˜ ๋ฐœ์ƒ ๋นˆ๋„ ์„ธ๊ธฐ - ํŒŒ์ด์ฌ for Beginner (2ํŒ)

๋”•์…”๋„ˆ๋ฆฌ = ๋นˆ๋„์ˆ˜ ๊ธฐ๋ก ๋ฆฌ์ŠคํŠธ = ์ •๋ ฌํ•  ํŠœํ”Œ๋ฆฌ์ŠคํŠธ ์ฒ˜์Œ์€ for ๋ฌธ์„ ํ†ตํ•ด์„œ ์›๋ฌธ์„ ๋ฌธ์ž ํ•˜๋‚˜์”ฉ ์ฝ์–ด์™€์„œ ๋”•์…”๋„ˆ๋ฆฌ ๊ฐ’์— ๋ˆ„์ ์‹œ์ผœ์ค€๋‹ค. ch ๊ธ€์”จ๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๋ฌธ์žฅ => ch in countDic =>True False ๋”•์…”๋„ˆ๋ฆฌ๋ฅผ ์ •๋ ฌํ•ด์ค€๋‹ค . ํŠœํ”Œ -> ๋ฆฌ์ŠคํŠธ๋กœ ๋ณ€ํ™˜ ๋ฆฌ์ŠคํŠธ [a][b] a ์—๋Š” ๋ฌธ์ž b ๋Š” ๋นˆ๋„ ์ˆ˜ ๊ฐ€ ์ €์žฅ๋˜์–ด์žˆ์œผ๋ฏ€๋กœ ์ถœ๋ ฅ. import operator inStr = '''๋‚ด๊ฐ€ ๋‚ด๊ฐ€.. ๋‚ด๊ฐ€ ๊ทธ ์ด๋ฆ„์„ ๋ถˆ๋ €์„๋•Œ ๋‚ด๊ฐ€ ๊ทธ ๋ญ์ง€ .. ์ด๋ฆ„์„ ๋ถˆ๋ €๋‚˜ ๋‚ด๊ฐ€ ๊ทธ ์ด๋ฆ„์„ ์žŠ๊ณ ์žˆ์—ˆ๋‚˜ ๋‚ด๊ฐ€ ์ด๋ฆ„์„ ๋ถˆ๋ €๋‹ค๊ฐ€ ๋ง์•˜๋‹ค๊ฐ€ ์ด๋ฆ„์„...''' countDic = {} countList = [] if __name__ == "__main__": for ch in inStr : if 'ใ„ฑ'

๋Œ€์†Œ๋ฌธ์ž ์ƒํ˜ธ ๋ณ€ํ™˜ํ•˜๊ธฐ - ํŒŒ์ด์ฌ for Beginner (2ํŒ)

swapcase() ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ๋ณ€ํ™˜ํ•˜๋Š” ์ฝ”๋“œ๋‹ค. lower ๊ณผ upper ์€ ๋ฌธ์ž ํ•˜๋‚˜์”ฉ ์ถ”์ถœํ•ด์„œ ๋ณ€ํ™˜ํ•ด์•ผํ•œ๋‹ค. ์กฐ๊ฑด๋ฌธ์„ ํ†ตํ•ด ๋Œ€๋ฌธ์ž๋ฉด lower ์†Œ๋ฌธ์ž๋ฉด upper ๊ฐ€ ์‹คํ–‰๋˜๋„๋ก ํ•œ๋‹ค. ๋Œ€์†Œ๋ฌธ์ž๋„ ์•„๋‹ˆ๋ฉด ๊ทธ๋Œ€๋กœ ์ถœ๋ ฅ. inStr, outStr = "", "" ch = "" count, i = 0,0 if __name__ == "__main__" : inStr = input("๋ฌธ์ž์—ด ์ž…๋ ฅ =>") count = len(inStr) for i in range (0,count) : ch = inStr[i] if (ord(ch)>=ord("A") and ord(ch) =ord("a") and ord(ch)

๊ธ€์ž,์ˆซ์ž,๊ธ€์ž+์ˆซ์ž ๋“ฑ๋“ฑ ๋ฌธ์ž์—ด ํŒ๋ณ„ ํ”„๋กœ๊ทธ๋žจ - ํŒŒ์ด์ฌ for Beginner (2ํŒ)

ss = input("๋ฌธ์ž์—ด ์ž…๋ ฅ == >") if ss.isdigit() == True : print("์ˆซ์ž์ž…๋‹ˆ๋‹ค") elif ss.isalpha() == True : print("๊ธ€์ž์ž…๋‹ˆ๋‹ค") elif ss.isalnum() == True : print("์ˆซ์ž+๊ธ€์ž์ž…๋‹ˆ๋‹ค") else : print('๋ชจ๋ฅด๊ฒŒ์จ์šฉ')