개발/Script
로또 6/45 생성 프로그램 (Lotto 6/45 Generator) [ver 0.2]
강서버
2025. 10. 31. 13:17
반응형
(Eng)
1. Download attached file(lotto645_v2.html)
2. Double click the downloaded file (or Downloaded file open in browser)
3. Click the [Generation] button
(Kor)
1. 첨부파일 다운로드(lotto645_v2.html)
2. 다운로드 파일 더블클릭 (또는 다운로드 파일 브라우저에서 열기)
3. [Generation] 버튼 클릭
html source :
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<link rel="stylesheet" href="https://pyscript.net/releases/2024.5.2/core.css">
<script type="module" src="https://pyscript.net/releases/2024.5.2/core.js"></script>
<style>
#loading { outline: none; border: none; background: transparent }
</style>
<script type="module">
const loading = document.getElementById('loading');
addEventListener('py:ready', () => loading.close());
loading.showModal();
</script>
<title>로또 6/45, Lotto 6/45 | v0.2</title>
</head>
<body>
<dialog id="loading">
<h1>Loading...</h1>
</dialog>
<h3>로또 6/45 Lotto 6/45</h3>
<p style="font-size:10px;">version : 0.2</p>
<p style="font-size:10px;">date : 2025-01-06 (Y-M-D)</p>
<p style="font-size:10px;">author : gangserver</p>
<button py-click="generation">Generation</button>
<div id="output"></div>
<script type="py">
import random
from pyscript import document
def generation(event):
result = calculate()
output_div = document.querySelector("#output")
output_div.innerText = result
def calculate():
result = ""
lotto_num = range(1, 46)
for i in range(10):
result += "\nLotto 6/45 result " + ("0" + str(i+1) if i < 9 else str(i+1)) + ": " + str(sorted(random.sample(lotto_num, 6)))
if i == 4:
result += "\n" + "*" * 50
return result
</script>
</body>
</html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<link rel="stylesheet" href="https://pyscript.net/releases/2024.5.2/core.css">
<script type="module" src="https://pyscript.net/releases/2024.5.2/core.js"></script>
<style>
#loading { outline: none; border: none; background: transparent }
</style>
<script type="module">
const loading = document.getElementById('loading');
addEventListener('py:ready', () => loading.close());
loading.showModal();
</script>
<title>로또 6/45, Lotto 6/45 | v0.2</title>
</head>
<body>
<dialog id="loading">
<h1>Loading...</h1>
</dialog>
<h3>로또 6/45 Lotto 6/45</h3>
<p style="font-size:10px;">version : 0.2</p>
<p style="font-size:10px;">date : 2025-01-06 (Y-M-D)</p>
<p style="font-size:10px;">author : gangserver</p>
<button py-click="generation">Generation</button>
<div id="output"></div>
<script type="py">
import random
from pyscript import document
def generation(event):
result = calculate()
output_div = document.querySelector("#output")
output_div.innerText = result
def calculate():
result = ""
lotto_num = range(1, 46)
for i in range(10):
result += "\nLotto 6/45 result " + ("0" + str(i+1) if i < 9 else str(i+1)) + ": " + str(sorted(random.sample(lotto_num, 6)))
if i == 4:
result += "\n" + "*" * 50
return result
</script>
</body>
</html>
Good luck~^^
* 로또 6/45 샘플 웹사이트(Lotto 6/45 sample web site) :
http://gangserver.dothome.co.kr/src/html/lotto645_v2.html
로또 6/45, Lotto 6/45 | v0.2
Loading... 로또 6/45 Lotto 6/45 version : 0.2 date : 2025-01-06 (Y-M-D) author : gangserver Generation
gangserver.dothome.co.kr
반응형