iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > Python >My first python appl
  • 675
分享到

My first python appl

pythonappl 2023-01-30 23:01:30 675人浏览 独家记忆

Python 官方文档:入门教程 => 点击学习

摘要

''' Authon:WSE_Gordon This application is use for the costomer to login the application. The Costomer need to input his

'''

Authon:WSE_Gordon

This application is use for the costomer to login the application.

The Costomer need to input his or her username and passWord.

But it has a bed part. It is all the password is the same, I need to fix it late. 

'''

seq_usernames=[]
seq_passwords=[]
with open("user_table.txt",'r') as f:
first_username = f.readline()[9:]
print(first_username)
seq_usernames.append(first_username)
first_password = f.readline()[9:]
print(first_password)
seq_passwords.append(first_password)
second_username = f.readline()[9:]
print(second_username)
seq_usernames.append(second_username)
second_password = f.readline()[9:]
print(second_password)
seq_passwords.append(second_password)
f.close()
print(seq_usernames)
print(seq_passwords)
seq_user = dict.fromkeys(seq_usernames,'123456')
print(seq_user)

#用户输入
i = 0
for i in range(3):
username = input("请输入用户名username=")
username = username + '\n'
password = input("请输入密码password=")
if username in seq_user and password == seq_user.get(username):
print(seq_user.get(username))
print("Congrantulation! You're right!")
break
else:
print("Your are wrong,You need test again!")
i = i + 1

else:
print("Sorry,You don't have time anymore")

--结束END--

本文标题: My first python appl

本文链接: https://www.lsjlt.com/news/180454.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • My first python appl
    ''' Authon:WSE_Gordon This application is use for the costomer to login the application. The Costomer need to input his...
    99+
    2023-01-30
    python appl
  • python, my first cod
    # coding:utf-8from random import randintnum=randint(1,100)print "guess the right number ,so please input a number:"a=1wh...
    99+
    2023-01-31
    python cod
  • Head First Python (一
    建立一个数组: cast = ["Cleese","Palin","Jones","Idle"]   列出数组有多少数据项:   print(len(cast))   用列表“方法”在末尾增加一个数据项:  cast.append("...
    99+
    2023-01-30
    Head Python
  • First Day Python介绍
    前言:刚开通的博客,谢谢博客园平台,管理辛苦! Python介绍 Python是一门高级的、面向对象的、解释性、脚本语言。 高级语言:贴近开发者,对应底层语言,底层语言贴近机器;java、C#、php 。 面向对象对应于面向过程,是开发人...
    99+
    2023-01-31
    Day Python
  • hand first python 选读
    列表(list) 基本操作 比如说我要整理一个近期热映的电影列表: movies = ["venom", "My Neighbor Totor", "Aquaman"] print(movies) # ['venom', 'My Neig...
    99+
    2023-01-30
    选读 hand python
  • Python first-order-model怎么实现让照片动起来
    这篇文章主要介绍“Python first-order-model怎么实现让照片动起来”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Python first-order-mode...
    99+
    2023-07-02
  • python datetime 写入my
    最近有个python项目需要更新mysql时间,类型是datetime,参考了网上的建议,将时间转为字符串再写入数据库。def toMysqlDateTime():    dt=datetime.datetime.now().strftim...
    99+
    2023-01-31
    python datetime
  • window-64安装python-my
    第一步:    安装MySQL-python-1.2.3.win-amd64-py2.7.exe    下载地址:http://www.codegood.com/archives/129     如果不安装这个驱动,会报以下错误:    _...
    99+
    2023-01-31
    window python
  • 解决:centos安装python-my
    使用命令pip install mysql-python的时候报错    _mysql.c:2722: warning: implicit declaration of function ‘PyMember_Set’    _mysql.c...
    99+
    2023-01-31
    centos python
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作