Python Projects for Beginners a ten-Week Bootcamp Approach to Python Programming



Download 2,61 Mb.
bet102/200
Sana20.06.2022
Hajmi2,61 Mb.
#681748
1   ...   98   99   100   101   102   103   104   105   ...   200
Bog'liq
Python Projects for Beginners A Ten Week Bootcamp Approach to Python

User Database with CSV Files.

Final Design


This week’s project is all about logic. We need to understand how to set up a step-by- step process for logging users in and out. There are three main parts to this program, registering a user, logging a user in, and the main loop that will run the program. Knowing that the first two are tasks, we can make functions out of them and call them when necessary in the main loop. Let’s go ahead and lay out the logical process for this program:
1. Check to see if user is logged in.

  1. If logged in, ask if they would like to log out/quit.

    1. Either quit or log out user and restart.

  2. Else, ask if they would like to log in/register/quit.

    1. If log in, ask user for e-mail/password.

      1. If correct, log user in and restart.

      2. Else, display error and restart.

    2. If register, ask for e-mail/password/password2.

      1. If passwords match, save user and restart.

      2. Else, display error and restart.

    3. If quit, say thank you and exit program.

This is the program flowchart for our main loop. Now that you know exactly how the program should run, I urge you to try and build it yourself before continuing. By doing so, you’ll be able to reference my code, see where you may have made mistakes, etc. The loop will continue to run until the user quits and allow them to register or log in. Once logged in, you’ll only be able to log out or quit. It’s simple but will provide some insight on how to handle menu systems.

Setting Up Necessary Imports


First, let’s start by importing the necessary files and functions we need to run the program:

1| # import all necessary packages to be used
2| import csv
3| from IPython.display import clear_output

We’ll be writing all the code in a single cell, so no need to run the cell right now. We’ve gone ahead and imported the CSV library to be able to work with CSV files, as well as the clear output function that allows us to clear our notebook statements from the cell.

Download 2,61 Mb.

Do'stlaringiz bilan baham:
1   ...   98   99   100   101   102   103   104   105   ...   200




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish