ตัวอย่างการสร้างระบบ Login ด้วยภาษา Python(ไพทอน) เบื้องต้น

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: ตัวอย่างการสร้างระบบ Login ด้วยภาษา Python(ไพทอน) เบื้องต้น

Re: ตัวอย่างการสร้างระบบ Login ด้วยภาษา Python(ไพทอน) เบื้องต้น

โดย บุคคลทั่วไป » 15/08/2022 3:12 pm

โค้ด: เลือกทั้งหมด

#-*- coding: utf8 -*-

print "ยินดีต้อนรับ"
loop = 'true'
while(loop == 'true'):	# ทำการ ใช้ while เพื่อ ลูปหา username password ในระบบ
    username = raw_input("Enter User: ")
    password = raw_input("Enter Pass: ")
    if(username == "admin" and password == "1234"):
        print 'ล็อกอินสำเร็จ' + username
        loop = 'false'              #เมื่อลูปเจอ username password ในระบบแล้ว จะเปลี่ยนตัวแปล loop = 'false' เพื่อ ออกจากลูป
        loop1 = 'true'
        while(loop1 == 'true'):	#ทำการใช้ while อีกครั้งเพื่ออกจากระบบ
            command = raw_input(username + ">> ")
            if(command == "exit"):           #ถ้ามีการพิมคำว่า 'exit' ก็จะออกจากระบบ โดย ใช้ break
                print 'ออกจากระบบสำเร็จ'
                break
            else:
                print "'" +command+ "' คำสั่งผิด!"
    else:
        print 'รหัสผ่านผิด'
มีวีดีโออธิบายมั๊ย

Re: ตัวอย่างการสร้างระบบ Login ด้วยภาษา Python(ไพทอน) เบื้องต้น

โดย mindphp » 27/05/2020 10:45 pm

ทิปเทคนิคต่างๆ การเขียน Python
https://www.mindphp.com/developer/tips-python.html

Re: ตัวอย่างการสร้างระบบ Login ด้วยภาษา Python(ไพทอน) เบื้องต้น

โดย mindphp » 25/07/2019 12:36 pm

ถ้านำไปใช้งานจริงจัง แนะนำดูตามกระทู้นี้
viewtopic.php?f=16&t=58429

และควรศึกษา flask เบื้องต้นให้จบก่อน สามารถศึกษาได้จากบทเรียนนี้
https://www.mindphp.com/%E0%B8%9A%E0%B8 ... flask.html

ตัวอย่างการสร้างระบบ Login ด้วยภาษา Python(ไพทอน) เบื้องต้น

โดย paoonline » 12/10/2017 11:42 am

ตัวอย่างการสร้างระบบ Login(ล็อคอิน) ด้วยภาษา Python(ไพทอน) เบื้องต้น

โค้ด: เลือกทั้งหมด

#-*- coding: utf8 -*-

print "ยินดีต้อนรับ"
loop = 'true'
while(loop == 'true'):	# ทำการ ใช้ while เพื่อ ลูปหา username password ในระบบ
    username = raw_input("Enter User: ")
    password = raw_input("Enter Pass: ")
    if(username == "admin" and password == "1234"):
        print 'ล็อกอินสำเร็จ' + username
        loop = 'false'              #เมื่อลูปเจอ username password ในระบบแล้ว จะเปลี่ยนตัวแปล loop = 'false' เพื่อ ออกจากลูป
        loop1 = 'true'
        while(loop1 == 'true'):	#ทำการใช้ while อีกครั้งเพื่ออกจากระบบ
            command = raw_input(username + ">> ")
            if(command == "exit"):           #ถ้ามีการพิมคำว่า 'exit' ก็จะออกจากระบบ โดย ใช้ break
                print 'ออกจากระบบสำเร็จ'
                break
            else:
                print "'" +command+ "' คำสั่งผิด!"
    else:
        print 'รหัสผ่านผิด'
ตัวอย่างผลลัพธิ์
Python Knowledge-1.png
Python Knowledge-1.png (78.43 KiB) Viewed 2182 times
สำหรับการการทำระบบ Login บนเว็บด้วย Python แนะนำ ลองดูที่นี่
https://www.mindphp.com/บทเรียนออนไลน์/ ... flask.html

ข้างบน