0
xlsx- 'saito'という名前のユーザー名を検索しようとしています(xslxに手動で追加しました)。ほとんどの回答は、特定のセルを検索するときにのみ機能します。私の意図は、私はユーザー名を検索することができますログインプログラムを作成すると、ユーザー名がファイル内に存在する場合は、その後、関連するパスワードを依頼し、まだ文字列を検索する方法を見つけることができません。以下はpython 3を使ってxlsxファイルのデータを検索するには?
は
counter = 0
print('type L to log in or C to create an account')
decision = input().lower()
if decision == 'l':
while counter == 0:
print('please enter your user name')
username = input()
while username == '':
print('please enter a valid username')
username = input()
if username in Accounts.xlsx:
print('please enter your password')
counter = counter + 1
else:
print('The username you have entered has not been recognised, please try again')
elif decision == 'c':
print('I'll do the user creation later')
else:
print('please log in or create a user')
Accounts.xlsxは私がユーザ名を検索するために使用されるファイルです...私の現在のコードです。
この回答であるかどうかをチェック参考になるかもしれません:https://stackoverflow.com/questions/38056233/python-search-excel-sheet-for-specific-strings-in-a-column-and-extract-those-ro –
あなたはパンダを学ぶことができます。 https://stackoverflow.com/questions/17063458/reading-an-excel-file-in-python-using-pandas –