Skip to content

Commit

Permalink
Update qt related codes until 21
Browse files Browse the repository at this point in the history
  • Loading branch information
ozcanyarimdunya committed Dec 25, 2019
1 parent 35b16ea commit edb76ef
Show file tree
Hide file tree
Showing 25 changed files with 617 additions and 811 deletions.
7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions 01 - Çarpım Tablosu/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@


def carpim(i, j, r):
if r != -1:
if i * j == r:
if r != "-1":
result = str(i * j)
if result == r:
print("\t\t***** Doğru *****")
else:
print("\t!!! Yanlış cevap %s olacaktı" % (i * j))
print("\t!!! Yanlış cevap %s olacaktı" % result)
else:

secim()
Expand Down Expand Up @@ -51,19 +52,19 @@ def secim():

svy = input(" >> ")

if svy == 1:
if svy == "1":
basla(1, 6)

if svy == 2:
elif svy == "2":
basla(6, 12)

if svy == 3:
elif svy == "3":
basla(12, 25)

if svy == 4:
elif svy == "4":
basla(25, 100)

if svy == -1:
else:
exit(0)


Expand Down
15 changes: 0 additions & 15 deletions 02 - Ligtv'den Haber Çekme/haberler.com.py

This file was deleted.

2 changes: 1 addition & 1 deletion 03 - En Büyük ve En Küçük Sayıyı Bulma/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
flag = True
while flag:
try:
a = int(input("Sayıları girin(çıkış için -1): "))
a = int(input("Sayıları girin(bitirmek için -1): "))
if a == -1:
flag = False
else:
Expand Down
15 changes: 13 additions & 2 deletions 08 - Zamanlayıcı/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,31 @@
"""

import time
import os
import platform


def temizle():
if platform.system() == 'Linux' or platform.system() == 'Darwin':
os.system('clear')
else:
os.system('cls')


while True:

zaman = time.localtime()
yil = zaman[0]
ay = zaman[1]
gun = zaman[2]
saat = zaman[3]
dakika = zaman[4]
saniye = zaman[5]

time.sleep(1)
temizle()

print("""
tarih: {}/{}/{}
saat : {}:{}:{}
""".format(gun, ay, yil, saat, dakika, saniye))

4 changes: 2 additions & 2 deletions 11 - Eskişehir Hava Durumu/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"""

import re
import urllib.request
import requests

url = "http://www.havadurumu15gunluk.net/havadurumu/eskisehir-hava-durumu-15-gunluk.html"
site = urllib.request.urlopen(url).read().decode('utf-8')
site = requests.get(url).content.decode('utf-8')

r_gunduz = '<td width="45">&nbsp;&nbsp;(-?\d+)°C</td>'
r_gece = '<td width="45">&nbsp;(-?\d+)°C</td>'
Expand Down
44 changes: 22 additions & 22 deletions 13 - Öğrenci Kayıt Otomasyonu ( MongoDB )/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""
from pymongo import MongoClient

db = MongoClient()['db_ogrenciler']
db = MongoClient(host='localhost', port=27017)['db_ogrenciler']
table = db['ogrenci']


Expand All @@ -23,10 +23,10 @@ def ogr_ekle():
table.insert({"no": int(no), "ad": ad, "soyad": soyad})
for i in table.find({"no": int(no)}):
print(
""" --- Öğrenci bilgileri eklendi ---
numara : {}
ad : {}
soyad : {}""".format(i['no'], i['ad'], i['soyad']))
""" --- Öğrenci bilgileri eklendi ---
numara : {}
ad : {}
soyad : {}""".format(i['no'], i['ad'], i['soyad']))


def ogr_sil():
Expand All @@ -48,33 +48,33 @@ def ogr_ara():
table.find({"no": no})
for i in table.find({"no": int(no)}):
print(
""" --- Öğrenci bilgileri bulundu ---
numara : {}
ad : {}
soyad : {}""".format(i['no'], i['ad'], i['soyad']))
""" --- Öğrenci bilgileri bulundu ---
numara : {}
ad : {}
soyad : {}""".format(i['no'], i['ad'], i['soyad']))


def ogr_lis():
sonuc = table.find()
for (a, i) in enumerate(sonuc):
print(
"""
--- {} ---
numara : {}
ad : {}
soyad : {} """.format(a, i['no'], i['ad'], i['soyad']))
"""
--- {} ---
numara : {}
ad : {}
soyad : {} """.format(a, i['no'], i['ad'], i['soyad']))


def main():
print(
"""
Öğrenci Kayıt Otomasyonu
1 - Öğrenci ekle
2 - Öğrenci ara
3 - Öğrenci sil
4 - Öğrenci listesi
""")
"""
Öğrenci Kayıt Otomasyonu
1 - Öğrenci ekle
2 - Öğrenci ara
3 - Öğrenci sil
4 - Öğrenci listesi
""")
secim = int(input("Yapmak istediğiniz işlem: "))
while True:
if secim == 1:
Expand Down
7 changes: 1 addition & 6 deletions 14 - Asal Sayı Bulma/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@
asal = []

for i in range(2, deger):
flag = False
for j in range(2, i):
if i % j == 0:
flag = True
break
if not flag:
else:
asal.append(i)

for i in asal:
print(i)

print("\n0 - {} arasında toplam {} tane asal sayı vardır.".format(deger, len(asal)))
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
beautifulsoup ile bir siteden veri çekme
"""

import urllib.request
import requests

from bs4 import *

Expand All @@ -18,13 +18,13 @@
"""

headers = {'user_agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'}
req = urllib.request.Request(url="http://yusufcakmak.com", headers=headers)
url="http://yusufcakmak.com"

html = urllib.request.urlopen(req).read().decode('utf-8')
html = requests.get(url, headers=headers).content.decode('utf-8')

soup = BeautifulSoup(html)
soup = BeautifulSoup(html, "html.parser")

basliklar = soup.findAll("h2", {"class": "post_title"})
basliklar = soup.findAll("h2", {"class": "bwp-post-title entry-title"})

for a, i in enumerate(basliklar):
print(a + 1, i.next.next, i.a['href'])
print(a + 1, i.a.text, i.a['href'])
Loading

0 comments on commit edb76ef

Please sign in to comment.