├── .gitattributes ├── .gitignore └── python_ödev_proje.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # poetry 98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 102 | #poetry.lock 103 | 104 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 105 | __pypackages__/ 106 | 107 | # Celery stuff 108 | celerybeat-schedule 109 | celerybeat.pid 110 | 111 | # SageMath parsed files 112 | *.sage.py 113 | 114 | # Environments 115 | .env 116 | .venv 117 | env/ 118 | venv/ 119 | ENV/ 120 | env.bak/ 121 | venv.bak/ 122 | 123 | # Spyder project settings 124 | .spyderproject 125 | .spyproject 126 | 127 | # Rope project settings 128 | .ropeproject 129 | 130 | # mkdocs documentation 131 | /site 132 | 133 | # mypy 134 | .mypy_cache/ 135 | .dmypy.json 136 | dmypy.json 137 | 138 | # Pyre type checker 139 | .pyre/ 140 | 141 | # pytype static type analyzer 142 | .pytype/ 143 | 144 | # Cython debug symbols 145 | cython_debug/ 146 | 147 | # PyCharm 148 | # JetBrains specific template is maintainted in a separate JetBrains.gitignore that can 149 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 150 | # and can be added to the global gitignore or merged into this file. For a more nuclear 151 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 152 | #.idea/ 153 | -------------------------------------------------------------------------------- /python_ödev_proje.txt: -------------------------------------------------------------------------------- 1 | import time 2 | kimlik=[] 3 | 4 | try: 5 | kullanıcı_dosyası= open("kullanıcı_dosyası.txt", "x", encoding="UTF-8") 6 | kullanıcı_dosyası.close() 7 | 8 | except: 9 | kullanıcı_dosyası=open("kullanıcı_dosyası.txt","r",encoding="UTF-8") 10 | 11 | try: 12 | gelir_dosyası=open("gelir_dosyası.txt", "x") 13 | gelir_dosyası.close() 14 | except: 15 | gelir_dosyası=open("gelir_dosyası.txt","r") 16 | 17 | 18 | def kullanıcı_girisi(): 19 | with open("kullanıcı_dosyası.txt") as f: 20 | isim=input("Kullanıcı ismi..:") 21 | soy_isim=input("Kullanıcı soyadı..:") 22 | parola=input("Kullanıcı şifre..:") 23 | içerik = f.readlines() 24 | uzunluk=len(içerik) 25 | b=0 26 | for i in range(uzunluk): 27 | ad = içerik[b].split("%&")[0] 28 | soyad=içerik[b].split("%&")[1] 29 | sifre=içerik[b].split("%&")[2] 30 | b+=1 31 | 32 | if isim==ad and soy_isim==soyad and sifre==parola: 33 | print("Giriş başarılı") 34 | print("*"*10) 35 | menü() 36 | 37 | else: 38 | print("Giriş başarısız") 39 | baslangıc() 40 | 41 | 42 | def hesap_olusturma(): 43 | print("Hesap oluşturma işlemine başlanıyor \nYapılan işlemler sonradan değiştirilemez") 44 | ad=input("Ad..:") 45 | soyad=input("Soyad..:") 46 | sifre=input("Şifre..:") 47 | kullanıcı_dosyası=open("kullanıcı_dosyası.txt","a") 48 | kullanıcı_dosyası.write(ad) 49 | kullanıcı_dosyası.write("%&") 50 | kullanıcı_dosyası.write(soyad) 51 | kullanıcı_dosyası.write("%&") 52 | kullanıcı_dosyası.write(sifre) 53 | kullanıcı_dosyası.write("%&") 54 | kullanıcı_dosyası.write("\n") 55 | kullanıcı_dosyası.close() 56 | print("Bilgiler kaydedildi\n") 57 | print("*"*10) 58 | baslangıc() 59 | 60 | 61 | def menü(): 62 | print("1) Gelir girişi\n2) Gider girişi\n3) Rapor\n4) Oturumu kapat") 63 | islem=input("Yapmak istediğiniz işlem numarasını giriniz..:") 64 | if islem=="1": 65 | print("Gelir girişine yönlendiriliyor") 66 | print("*"*20) 67 | 68 | gelir_dosyası = open("gelir_dosyası.txt", "a") 69 | print("Gelir işlemleri başlatılıyor") 70 | gelir_islemleri() 71 | 72 | elif islem=="2": 73 | print("Gider girişine yönleniriliyor") 74 | print("*"*20) 75 | gider_islemleri() 76 | 77 | 78 | elif islem=="3": 79 | rapor() 80 | 81 | elif islem=="4": 82 | print("Oturumunuz kapatılıyor") 83 | print("*"*10) 84 | baslangıc() 85 | 86 | else: 87 | print("Lütfen geçerli bir değer giriniz") 88 | menü() 89 | 90 | def gelir_islemleri(): 91 | gelir_dosyası=open("gelir_dosyası.txt", "a") 92 | tarih=input("Tarih..:") 93 | acıklama=input("Açıklama..:") 94 | gelir=input("Gelir miktarı..:") 95 | 96 | gelir_dosyası.write(tarih) 97 | gelir_dosyası.write("%&") 98 | gelir_dosyası.write(acıklama) 99 | gelir_dosyası.write("%&") 100 | gelir_dosyası.write(gelir) 101 | gelir_dosyası.write("%&") 102 | gelir_dosyası.writelines("0") 103 | gelir_dosyası.write("\n") 104 | gelir_dosyası.close() 105 | print("Veriler kaydedildi") 106 | menü() 107 | 108 | 109 | def gider_islemleri(): 110 | gelir_dosyası=open("gelir_dosyası.txt", "a") 111 | tarih=input("Tarih..:") 112 | acıklama=input("Açıklama..:") 113 | gider=input("Gider miktarı..:") 114 | gelir_dosyası.write(tarih) 115 | gelir_dosyası.write("%&") 116 | gelir_dosyası.write(acıklama) 117 | gelir_dosyası.write("%&") 118 | gelir_dosyası.write("0") 119 | gelir_dosyası.write("%&") 120 | gelir_dosyası.write(gider) 121 | gelir_dosyası.write("\n") 122 | gelir_dosyası.close() 123 | print("Veriler kaydedildi") 124 | menü() 125 | 126 | def yenideger(abc): 127 | deger="" 128 | i =len(abc) 129 | deger=abc + " "*(20-i) 130 | return deger 131 | 132 | 133 | def rapor(): 134 | with open("gelir_dosyası.txt") as f: 135 | gelir_degeri=0 136 | gider_degeri=0 137 | içerik=f.readlines() 138 | uzunluk=len(içerik) 139 | print(yenideger("Tarih"),yenideger("Açıklama"),yenideger("Gelir"),yenideger("Gider")) 140 | b=0 141 | 142 | for i in range(uzunluk): 143 | tarih=içerik[b].split("%&")[0] 144 | açıklama=içerik[b].split("%&")[1] 145 | gelir=içerik[b].split("%&")[2] 146 | gider=içerik[b].split("%&")[3] 147 | gider=gider.replace("\n","") 148 | gelir_degeri+=int(gelir) 149 | gider_degeri+=int(gider) 150 | b+=1 151 | print(yenideger(tarih),yenideger(açıklama),yenideger(gelir),yenideger(gider)) 152 | print("\n","Toplam..:",gelir_degeri-gider_degeri,"\n","*"*20) 153 | time.sleep(2) 154 | menü() 155 | 156 | 157 | def baslangıc(): 158 | islem=input("Hoş geldiniz\nKullanıcı girişi yapmak için 1,\nHesap oluşturmak için 2'yi tuşlayınız..:") 159 | if islem=="1": 160 | kullanıcı_girisi() 161 | 162 | elif islem=="2": 163 | hesap_olusturma() 164 | 165 | else: 166 | print("Lütfen geçerli bir değer girin") 167 | baslangıc() 168 | 169 | baslangıc() --------------------------------------------------------------------------------