repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
cgutierr3z/proyecto-eees
eees/tests.py
<reponame>cgutierr3z/proyecto-eees<filename>eees/tests.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from .models import * # Create your tests here. class DepartamentoTest(TestCase): def setUp(self): self.depto1, self.create1 = Departamento.objects.ge...
cgutierr3z/proyecto-eees
eees/views.py
<filename>eees/views.py<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render from django.http import HttpResponse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, render #from django.template import RequestContext f...
cgutierr3z/proyecto-eees
eees/migrations/0005_estudiante.py
<reponame>cgutierr3z/proyecto-eees<filename>eees/migrations/0005_estudiante.py # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-18 20:39 from __future__ import unicode_literals from django.conf import settings import django.contrib.auth.models from django.db import migrations, models import django.db.mo...
yubocai-poly/CSE102
Tutorial_6/Tutorial_6 solution.py
<reponame>yubocai-poly/CSE102 #! /usr/bin/env python3 # -------------------------------------------------------------------- import math # -------------------------------------------------------------------- class Node: def __init__(self, value, left=None, right=None): self.value = value self.lef...
yubocai-poly/CSE102
Tutorial_6/trees.py
""" <NAME> CSE102 Tutorial_6 2022.03.28 """ import math class Node: def __init__(self, value, left=None, right=None): self.value = value self.left = left self.right = right T1 = Node(0, Node(1, Node(2), Node(3)), Node(4, Node(5))) T2 = Node(0, Node(1), Node(2, Node(3), Node(4, Node(5)))...
yubocai-poly/CSE102
TD1-CYB/containers.py
<filename>TD1-CYB/containers.py # Question 8 class Rdict: def __init__(self): self.__fwd = {} self.__bwd = {} def associate(self, a, b): if a in self.__fwd or b in self.__bwd: print('Runtime Erro') raise RuntimeError self.__fwd[a] = b self.__bwd[b...
yubocai-poly/CSE102
Tutorial_4 Yubo Cai/maze.py
""" <NAME> CSE102 Tutorial_4 """ # Exercise 1, 2 def maze(m, n, i, j): if i == n - 1 and j == n - 1: return [(n - 1, n - 1)] position = [(i, j + 1), (i + 1, j)] for new_i, new_j in position: if new_i >= n or new_j >= n: continue if m[new_i][new_j] == 0: co...
yubocai-poly/CSE102
TD5_Yubo Cai/dice.py
<reponame>yubocai-poly/CSE102 """ <NAME> CSE102 Tutorial_5 """ import random # Exercise 3 def roll(D): total = [D[0]] k = len(D) for i in range(1, k): total.append(D[i] + total[i - 1]) x = random.random() for i in range(k): if total[i] > x: return i + 1 # 按照d的概率随机构建...
yubocai-poly/CSE102
TD5_Yubo Cai/torus.py
<gh_stars>0 """ <NAME> CSE102 Tutorial_5 """ import random def torus_volume_cuboid(R, r, N=100000): c = 0 for _ in range(N): xr = random.uniform(-R - r, R + r) yr = random.uniform(-R - r, R + r) zr = random.uniform(-r, r) left = (((xr**2 + yr**2)**0.5) - R)**2 + zr**2 ...
yubocai-poly/CSE102
TD1-CYB/fractions.py
<gh_stars>0 import math # Question 1, 2 class Fraction: def __init__(self, numerator=1, denominator=1): self.__numerator = numerator self.__denominator = denominator self.__reduced = False @property def numerator(self): self.reduce() return self.__numerator @p...
yubocai-poly/CSE102
Tutorial_3 Yubo Cai/dpseq.py
""" <NAME> CSE102 Tutorial_3 """ def fibonacci(n): # Initially, r0 = F_0 & r1 = F_1 r0, r1 = 0, 1 for _ in range(n): # At each iteration, assuming that r0 contains F_n and # r1 contains F_(n+1), we can compute F_(n+2). # # We then "slide" the window s.t. after the assignme...
yubocai-poly/CSE102
TD5_Yubo Cai/penney.py
""" <NAME> CSE102 Tutorial_5 """ import random # Exercise 2 def penny(): lis = [] while True: lis.append(random.choice([True, False])) if len(lis) > 3: lis.pop(0) if lis == [True, True, False]: return True if lis == [False, True, True]: retur...
yubocai-poly/CSE102
TD5_Yubo Cai/streak.py
""" <NAME> CSE102 Tutorial_5 """ import random # Exercise 1 def experiment1(N, k): count = 0 for i in range(N): if random.choice([True, False]) is True: count += 1 if count >= k: return True else: count = 0 return False def experiment(N...
yubocai-poly/CSE102
Tutorial_3 Yubo Cai/dpcatalan.py
""" <NAME> CSE102 Tutorial_3 """ # Exercise 1 def catalan(n): if n < 0: pass if n == 0: return 1 num = 0 for i in range(0, n): num += catalan(i) * catalan(n - i - 1) return num # Exercise 2 def catalan_td(n, cache=None): cache = {} if cache is None else cache if n...
yubocai-poly/CSE102
Tutorial_2_CYB/recursion.py
<filename>Tutorial_2_CYB/recursion.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 14 12:38:27 2022 @author: <NAME> """ # Question 1 # -------------------------------------------------------------------- def binom(n, k): if k == 0: return 1 if k > n: return 0 retu...
yubocai-poly/CSE102
Tutorial_4 Yubo Cai/dice.py
""" <NAME> CSE102 Tutorial_4 """ # Exercise 3 def slice_dice(n, s, dice): return [dice[i * s:i * s + s] for i in range(n)] # Exercise 4 def win_probability(die1, die2): n = len(die1) case = 0 for d1 in die1: for d2 in die2: if d1 > d2: case += 1 return case...
yubocai-poly/CSE102
Tutorial_2_CYB/generators.py
<reponame>yubocai-poly/CSE102<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 14 12:38:27 2022 @author: <NAME> """ # Question 9 # -------------------------------------------------------------------- def fibs(): index, a, b = 0, 0, 1 while True: yield a a, b = ...
yubocai-poly/CSE102
Tutorial_4 Yubo Cai/subseq.py
<filename>Tutorial_4 Yubo Cai/subseq.py """ <NAME> CSE102 Tutorial_4 """ # Exercise 1 def subseq(seq): if seq == []: yield seq else: for sub in subseq(seq[1:]): yield sub yield [seq[0]] + sub for i in subseq([1,2,3]): print(i)
yubocai-poly/CSE102
Tutorial_3 Yubo Cai/dpcomb.py
<reponame>yubocai-poly/CSE102<filename>Tutorial_3 Yubo Cai/dpcomb.py """ <NAME> CSE102 Tutorial_3 """ import sys sys.setrecursionlimit(10**6) import datetime def binom(n, k): if (k == 0): return 1 if (k > n): return 0 return binom(n - 1, k) + binom(n - 1, k - 1) # Exercise 7 # The nu...
yubocai-poly/CSE102
Tutorial_3 Yubo Cai/dpcoin.py
<filename>Tutorial_3 Yubo Cai/dpcoin.py """ <NAME> CSE102 Tutorial_3 """ import math as math import sys sys.setrecursionlimit(10**6) CURRENCY = [1, 3, 7, 9] # credit to <NAME> def transacts_num(n, cache=None): cache = {} if cache is None else cache if n == 0: return 0 if n in CURRENCY: ...
medhatelhady/Classify-flower-images
predict.py
import argparse from PIL import Image import numpy as np import json from torchvision import transforms, models import torch from torch import nn, optim def process_image(image): ''' load image and Scales, crops, and normalizes a PIL image for a PyTorch model Args: image(str): store path ...
medhatelhady/Classify-flower-images
train.py
import argparse import torch from torchvision import datasets, transforms, models from torch import nn, optim import matplotlib.pyplot as plt import numpy as np import json from collections import OrderedDict # create parse and terminal arguments parser = argparse.ArgumentParser(description='A test program.') parser.a...
dogancantorun8/python-application
Numpy/numpy_7.py
<gh_stars>0 #csv dosyası okurken numpy dizisi şeklinde okumalıyım #numpy.loadtxt ile csv dosyasını okuyabiliriz import numpy as np import datetime import matplotlib.pyplot as plt #usecols: parametresiyle okuyacağımız sütunları veriyoruz #csv nin başlığından kurtulmak istiyorsam(özelliklerin açıklandığı satırlar vs.)...
dogancantorun8/python-application
cryptograpy&exe_creation/python_exe_create.py
# -*- coding: utf-8 -*- """ Created on Sun Apr 18 16:36:02 2021 @author: <NAME> """ #python programlarının exe hale getirilmesi #python exe formatı platform bağımlıdır. farklı işletim sistemlerinde çalışamıyor. #import için pyinstaller indirmeliyim proje pathine #dizinde pyinstaller --onefile pythondosyası.py yapa...
dogancantorun8/python-application
pandas/pandas_3.py
<gh_stars>0 #read_csv olarak okursam dataframe olarak okurum dosyamı #iki tırnaklı olanlarda read_csv olarak oku import pandas as pd import numpy as np import matplotlib.pyplot as plt btc = pd.read_csv('bitcoin_price.csv', delimiter=',') date = btc['Date'] max_price = btc['High'] max_price.index = date.values max_p...
dogancantorun8/python-application
serialization-deserialization/komut_satiri_intro.py
# -*- coding: utf-8 -*- """ Created on Wed Oct 28 00:12:59 2020 @author: <NAME> """ ###################### Python_programlarında komut satırı argümanları ################# import sys if __name__=='__main__': # ============================================================================= # for s in sys.argv...
dogancantorun8/python-application
GUI_tkinter_all/dialog_pencereleri.py
<gh_stars>0 import tkinter as tk from tkinter import messagebox from tkinter import simpledialog from tkinter import filedialog import os #kullanıcıdan giris almak istersek kullanıyoruz class GUI: def __init__(self, master): master.geometry('800x600') master.title('Sample DialogBox') self....
dogancantorun8/python-application
GUI_tkinter_all/pack_geometry_using.py
<gh_stars>0 import tkinter as tk import tkinter.filedialog import tkinter.messagebox #pixel hesabı yapmadan pack manager ile genisletilebilir bir pencere olusturdum class GUI: def __init__(self, master): master.title('Sample Messagebox') self.master = master self.toolbar = tk.Frame(master...
dogancantorun8/python-application
PYQT/layout_1.py
# -*- coding: utf-8 -*- """ Created on Tue Apr 27 12:55:12 2021 @author: dogancan """ #Layout Nesneleri : #QHbox Layout= Horizontal yerleştirme yapıyor #QVboxLayout=Düşey yerleştirme yapıyor #QGridLayout =Satır sütun belirterek yerleştirme yapıyor #QStackedLayout ,QFormlayout #Önemli Not:Bİr pencereye tek bir ...
dogancantorun8/python-application
Numpy/numpy_example1.py
#standart sapma islemini numpy ile atma import numpy as np a = [3, 4, 7, 3, 2, 4, 1] a = np.array(a) #burada a üzerinde yapılan np islemleri vektörel işlemler olduğundan her elemana tek tek yapılıyor std = np.sqrt(np.sum((a - np.mean(a)) ** 2)) / a.shape[0] print(std) #rastgele nd array yaratmak istersem x = np.ndarra...
dogancantorun8/python-application
PYQT/pyqt_11_resize_sinyali.py
<reponame>dogancantorun8/python-application<filename>PYQT/pyqt_11_resize_sinyali.py # -*- coding: utf-8 -*- """ Created on Fri Mar 26 17:27:32 2021 @author: Doğancan """ #bazi sinyaller sinyal slot mekanizmasıyla işlenmez.Bunun için kendimiz fonksiyon yazmalıyız. #örneğin pencere boyutunu büyütmek istersek resizeEve...
dogancantorun8/python-application
GUI_tkinter_all/message_box.py
import tkinter as tk from tkinter import messagebox from tkinter import simpledialog class GUI: def __init__(self, master): master.geometry('800x600') master.title('Sample Messagebox') self.master = master self.button_ok = tk.Button(master, text='Ok', command=self.button_ok_handler) ...
dogancantorun8/python-application
GUI_tkinter_all/ttk_intro_code.py
<reponame>dogancantorun8/python-application import tkinter as tk import tkinter.ttk as ttk import tkinter.messagebox #fbot ve anzelijg.github.io ttk icin referans sitelerim #bu GuI de grid geometry manager kullanarak oluşturdum. #combobox tk de olmayıp ttk de mevcuttur. class GUI: def __init__(self, master): ...
dogancantorun8/python-application
PYQT/pyqt_6_multiline_edit.py
<filename>PYQT/pyqt_6_multiline_edit.py # -*- coding: utf-8 -*- """ Created on Sat Mar 20 18:09:44 2021 @author: Asus """ #Multiline Text edit ile girdi alabiliyorum import sys from PyQt5.QtWidgets import * from PyQt5.Qt import * class MainWindow(QWidget): def __init__(self): super().__init__() ...
dogancantorun8/python-application
db_learn_first_step/db_learn.py
#db connection ve python ile querry oluşturma import sqlite3 conn = sqlite3.connect("student.db") #projeyle aynı dizinde oldugundan yalnızca db adının yazdım cur = conn.cursor() cur.execute("INSERT INTO ogr VALUES (1081,'<NAME>');") #querry bu kısım içinde olacak conn.commit() # veritabanında değişiklik yapan inse...
dogancantorun8/python-application
PYQT/cizimPYQT_2.py
# -*- coding: utf-8 -*- """ Created on Sat Apr 10 19:22:45 2021 @author: dogancan """ #sinüs eğrisini çizmek istersek; import sys from PyQt5.Qt import * import math XORG = 640 // 2 YORG = 480 // 2 XSCALE = 50 YSCALE = 100 class MainWindow(QWidget): def __init__(self): super().__init__() self.r...
dogancantorun8/python-application
GUI_tkinter_all/grid_example.py
<reponame>dogancantorun8/python-application import tkinter as tk from PIL import Image from PIL import ImageTk class GUI: def __init__(self, master): master.title('Sample Messagebox') self.label_name = tk.Label(master, text='<NAME>') self.label_name.grid(row=0, column=0, pady=(10, 5), padx...
dogancantorun8/python-application
regex.py
# -*- coding: utf-8 -*- """ Created on Wed Oct 21 16:49:54 2020 @author: <NAME> """ #Düzenli ifadeler:(Regular-Expressions(Reg-Ex)) : #Komplex aramaları( belli bir kalıba uygun parçaları aramak )için kullanılıyor #Bu kavram pythona özgü değildir.Bu tip aramaları yapan modüllere reguler expression engine denir #i...
dogancantorun8/python-application
PYQT/pyqt_4_butonlar.py
# -*- coding: utf-8 -*- """ Created on Sun Mar 14 19:43:19 2021 @author: """ #Qwidget sınıfından türetilmiş=> QAbstractbutton altından; #CheckBox,RadioButton,PushButton buradan üretilir #Push button kullanımı: import sys from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * clas...
dogancantorun8/python-application
GUI_tkinter_all/gui_oop_intro.py
import tkinter as tk class GUI: def __init__(self,master): self.master=master #penceremin ustundeki configler icin master tanımımı kullandım self.label_name=tk.Label(master,text='Adı soyadı:',font=('Arial',10)) self.label_name.place(x=10,y=10) #text fieldlerdan tkinter uygulamala...
dogancantorun8/python-application
GUI_tkinter_all/data_binding.py
<reponame>dogancantorun8/python-application<filename>GUI_tkinter_all/data_binding.py #data binding islemiyle text field yazılan ne varsa herhangi bir variable a alıp islem yaparız #textboxta yaptıgım degisiklik degiskeni etkiledi degiskendeki degisiklik de testboxu etkiledi #entry get methodunu kullanmadan dogrudan fi...
dogancantorun8/python-application
PYQT/pyqt_2.py
# -*- coding: utf-8 -*- """ Created on Sun Mar 14 17:00:59 2021 @author: Doğancan """ #Qt de Sinyal Slot mantığı: Sinyal =Olay ,Slot=Olay gerçekleştiğinde yapılacak aksiyon(fonksiyon) #Bir sinyale slotta bağlanabilir,bir sinyale sinyalde bağlanabilir ##Sinyale slot bağlamak: import sys from PyQt5.QtWidgets impo...
dogancantorun8/python-application
PYQT/cizimPYQT_3.py
# -*- coding: utf-8 -*- """ Created on Sat Apr 10 20:07:12 2021 @author: dogancan """ #kalem değiştirme ve özellik ekleme import sys from PyQt5.Qt import * class MainWindow(QWidget): def __init__(self): super().__init__() self.resize(640, 480) def paintEvent(self, pe): painter = QP...
dogancantorun8/python-application
GUI_tkinter_all/ttk_code2.py
<reponame>dogancantorun8/python-application import tkinter as tk import tkinter.ttk as ttk class GUI: def __init__(self, master): master.geometry('900x800') master.title('Sample Messagebox') self.notebook = ttk.Notebook(master, width=400, height=400) self.frame_students = ttk.Fram...
dogancantorun8/python-application
GUI_tkinter_all/checkbox_example.py
<reponame>dogancantorun8/python-application<filename>GUI_tkinter_all/checkbox_example.py #checkbox durumuna göre import tkinter as tk class GUI: def __init__(self, master): master.geometry('400x350') master.title('Sample Data Binding') self.master = master self.confim_result = tk.IntVa...
dogancantorun8/python-application
PYQT/pyqt_13_combobox2.py
# -*- coding: utf-8 -*- """ Created on Fri Mar 26 17:56:12 2021 @author: doğancan """ import sys import csv from PyQt5.Qt import * class MainWindow(QWidget): def __init__(self): super().__init__() self.resize(640, 480) self.cb = QComboBox(self) self.cb.setGeometry(10, 10, 300, 3...
dogancantorun8/python-application
cryptograpy&exe_creation/cyripto_2.py
<reponame>dogancantorun8/python-application # -*- coding: utf-8 -*- """ Created on Sun Apr 18 16:10:30 2021 @author: <NAME> """ #hmac kullanımı import hmac text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, qui...
dogancantorun8/python-application
GUI_tkinter_all/ttk_ikinci_ana pencere_yaratma.py
import tkinter as tk from PIL import Image from PIL import ImageTk class GUI: def __init__(self, master): master.geometry('800x600') master.title('Tk Sınıfından Ana pencere') self.master = master self.text = tk.Text(master) self.text.pack(side='top', fill='both', expand=Tru...
dogancantorun8/python-application
PYQT/pyqt_18_menuaction_trigger.py
<filename>PYQT/pyqt_18_menuaction_trigger.py # -*- coding: utf-8 -*- """ Created on Fri Mar 26 18:47:15 2021 @author: dogancan """ #Menu barda her action ile oluşan sinyalimi trigger ile yakalayacağım import sys from PyQt5.QtWidgets import * from PyQt5.Qt import * class MainWindow(QMainWindow): def __init__(...
dogancantorun8/python-application
PYQT/pyqt_24_progressbar.py
<reponame>dogancantorun8/python-application # -*- coding: utf-8 -*- """ Created on Sat Mar 27 20:09:42 2021 @author: dogancan """ #Progressbar yaratma : import sys from PyQt5.Qt import * class MainWindow(QMainWindow): def __init__(self): super().__init__() self.resize(640, 480) self.pr...
dogancantorun8/python-application
Numpy/numpy_4.py
<reponame>dogancantorun8/python-application<gh_stars>0 #numpy dizilerinde axis kavramı : #0.eksen:satır ekseni #1.eksen:sütun ekseni #3.eksen:z ekseni import numpy as np #3 boyutlu bir dizide axis işlemi a = np.arange(24).reshape(3, 4, 2) print(a) print('---------') x = np.sum(a, axis=0) print(x) #expand_dims fonks...
dogancantorun8/python-application
Numpy/numpy_ozellikleri3.py
import numpy as np a = np.array([[1, 2, 3, 4], [4, 5, 6, 7], [8, 9, 10, 11], [12, 13, 14, 15]]) print(a) print() #numpy elemanlarıma erişiyorum b = a[1:3, 1:4] #1.satır ve 3.satır al ve 1. satır ve 4.sütunu al print(b) print() c = a[3, :] print(c) # 1)list index a = np.arange(12) print(a) b = a[[2, 5, 7]] #2,5 ve 7....
dogancantorun8/python-application
GUI_tkinter_all/ttk_code3.py
<reponame>dogancantorun8/python-application import tkinter as tk import tkinter.ttk as ttk class GUI: def __init__(self, master): master.geometry('900x800') master.title('Sample Messagebox') self.ddict = {'Deri Mantarı': 'Deri mantarı tehlikeli olmayan kronik bir hastalıktır.', ...
dogancantorun8/python-application
PYQT/pyqt26_diyalog_pencereleri_giris.py
<reponame>dogancantorun8/python-application # -*- coding: utf-8 -*- """ Created on Sun Mar 28 18:18:11 2021 @author: <NAME> """ #Diyalog pencereleri iki şekilde olur #Arka tarafla etkileşemeyen,modal ,etkileşemeyen modless olarak adlandırılır #Bir Gui üzerinde modal ve modless tasarımı yapacağım #Ana menü üzerind...
dogancantorun8/python-application
XML_operation/xml_olusturma_2.py
<filename>XML_operation/xml_olusturma_2.py # -*- coding: utf-8 -*- """ Created on Sat Apr 17 18:34:08 2021 @author: dogancan """ ##Hiç bir xml dosyasından okuma yapmadan manuel girisle olusturdugumuz XMl'i yeni bir dosyay yazma import xml.etree.ElementTree as ET fruits = ET.Element('fruits', {'a': '123', 'b': '566'...
dogancantorun8/python-application
GUI_tkinter_all/canvas_resim.py
import tkinter as tk from PIL import Image from PIL import ImageTk #mouse a tıkladığında image yaratıyor class GUI: def __init__(self, master): master.geometry('800x600') master.title('Sample Messagebox') img = Image.open('abbey_road.jpg') img = ImageTk.PhotoImage(img) sel...
dogancantorun8/python-application
PYQT/pyqt_12_combobox.py
# -*- coding: utf-8 -*- """ Created on Fri Mar 26 17:40:46 2021 @author: doğancan """ #combobox ile csvden okuduklarımı comboboxa ekliyorum import sys from PyQt5.Qt import * import csv class MainWindow(QWidget): def __init__(self): super().__init__() self.resize(640, 480) ...
dogancantorun8/python-application
GUI_tkinter_all/frame_example.py
import tkinter as tk #burada main frame üzerine ikinci bir frame yaratıp componentlerimi ikinci yarattığım frame üzerinde gruplandırıyorum class GUI: def __init__(self, master): self.master = master master.geometry('800x600') self.frame = tk.Frame(master, bg='yellow') self.frame.pla...
dogancantorun8/python-application
PYQT/Qt_designer_example/qtdesign.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'qtdesigner_giris.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtC...
dogancantorun8/python-application
GUI_tkinter_all/ttk_code4.py
##ttk_styles:tk de style nesnesi yaratıp işlem yapmam #ttk widgeetları icin gecerlidir.bir style nesnesi yarat ve istediğin widgetların configürasyonlarının bu nesne üzerinden yap #TButton dersem tum butonlarımı config ederim yani style nesnem ile configleri yapabilirim #tcl.tk şeklinde aratırsam bu konuda help alabi...
dogancantorun8/python-application
XML_operation/xml_parse.py
<reponame>dogancantorun8/python-application # -*- coding: utf-8 -*- """ Created on Thu Apr 15 13:10:49 2021 @author: <NAME> """ #getitem,setitem,iter ,find finall ile xml #1)basic parse operation import xml.etree.ElementTree as ET et = ET.parse('sample.xml') #dosya adını veriyoruz root = et.getroot() #element tree...
dogancantorun8/python-application
GUI_tkinter_all/start_stop_buton_disabled_example.py
<gh_stars>0 #start stop mechanism example import tkinter as tk class GUIDatabase: def __init__(self, master): self.master = master master.geometry('360x180') self.button_start = tk.Button(master, text='Start', command=self.button_start_handler) self.button_start.place(x=10, y=10, width...
dogancantorun8/python-application
PYQT/cizimPYQT_1.py
# -*- coding: utf-8 -*- """ Created on Sat Apr 10 18:36:06 2021 @author: dogancan """ ##Tüm çizim elemanları Qpainter sınıfında herhangi bir çizim için Qpainter kullanmalıyız import sys from PyQt5.Qt import * class MainWindow(QWidget): def __init__(self): super().__init__() def paintEvent(self...
dogancantorun8/python-application
python_getter setter_yazma.py
# -*- coding: utf-8 -*- """ Created on Sun Mar 28 17:25:22 2021 @author: Asus """ ##Pythonda getter setter yazmak istersem import math class Circle: def __init__(self, radius): self.radius = radius def area(self): return self.radius ** 2 * math.pi def setArea(self, ...
dogancantorun8/python-application
PYQT/pyqt_5_edit_box.py
#kullanıcıdan girdi almak için aşağıdaki şekilde dizayn edebilirim import sys from PyQt5.QtWidgets import * from PyQt5.Qt import * class MainWindow(QWidget): def __init__(self): super().__init__() self.labelName = QLabel('<NAME>', self) self.labelName.move(20, 10) self.lineEd...
dogancantorun8/python-application
GUI_tkinter_all/menu_bar_examples.py
<filename>GUI_tkinter_all/menu_bar_examples.py<gh_stars>0 import tkinter as tk import tkinter.filedialog import tkinter.messagebox class GUI: #self arayuz boyunca üzerinde islem yaptıgım nesnem, def __init__(self, master): master.geometry('800x600') master.title('Menu Bar Tool Bar ') ma...
dogancantorun8/python-application
PYQT/Qt_designer_example/qtden-pythona_gecisimiz.py
# -*- coding: utf-8 -*- """ Created on Sat Apr 3 18:23:05 2021 @author: dogancan """ import sys import qtdesign import fruitsdialog from PyQt5.Qt import * class MainWindow(QMainWindow): def __init__(self): super().__init__() self.uiTest = qtdesign.Ui_MainWindow() #designer do...
dogancantorun8/python-application
PYQT/pyqt_25_spinbox.py
<reponame>dogancantorun8/python-application<filename>PYQT/pyqt_25_spinbox.py # -*- coding: utf-8 -*- """ Created on Sat Mar 27 20:42:57 2021 @author: dogancan """ #spinbox yaratma ve spinboxta seçilen değeri alma: import sys from PyQt5.Qt import * class MainWindow(QMainWindow): def __init__(self): sup...
dogancantorun8/python-application
pandas/pandas_intro.py
<reponame>dogancantorun8/python-application<gh_stars>0 #pandas:sütunlu veri tablosu oluşturabilmesi,numpydan daha gelişmiş bir kütüphanedir #pandasta sütunlara series nesneleri deniyor. #pandasta sütunlar ayrı birer nesnedir, serieslar birleşerek dataframe oluşturur. #pandas seriese nesneleri nump array şeklinde verile...
dogancantorun8/python-application
GUI_tkinter_all/canvas_create_text.py
<gh_stars>0 import tkinter as tk import datetime class GUI: def __init__(self, master): master.geometry('800x600') master.title('Sample Messagebox') self.canvas = tk.Canvas(master, bg='white') self.canvas.pack(fill='both', expand=True) #yazının hangi koordinatlarda olacağı...
dogancantorun8/python-application
pandas/pandas_5.py
# -*- coding: utf-8 -*- """ Created on Sun Jan 10 17:50:04 2021 @author: <NAME> """ import pandas as pd import numpy as np df = pd.read_csv(r'CoinDatasets\ripple_price.csv') print(df) #Dataframe indexlenmesi : #1)Sütunsal indexleyebilirim ve sütun indexini verip çağırabilirim #2)dataframe iloc-loc ile ...
dogancantorun8/python-application
PYQT/pyqt_intro.py
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Sat Mar 13 19:17:16 2021 @author: <NAME> """ #QT bir C++ kütüphanesidir. #QT crossplatform bir librarydir.[PYQT de crossplatform çalışabiliyors] # from PyQt5.QtWidgets import * =>bu anatosyonla Q ile başlayan sınıfların QT sınıfı olduğunu anlayabiliriz #Arayüz elem...
dogancantorun8/python-application
GUI_tkinter_all/pack_geometry_example2.py
import tkinter as tk import tkinter.filedialog import tkinter.messagebox class GUI: def __init__(self, master): master.title('Sample Messagebox') self.frame1 = tk.Frame(master) self.label_name = tk.Label(self.frame1, text='<NAME>', width=10) self.label_name.pack(side='left') ...
dogancantorun8/python-application
GUI_tkinter_all/gui_intro_1.py
# -*- coding: utf-8 -*- """ Created on Sun Oct 25 16:54:49 2020 @author: <NAME> """ #Pythonda GUI Uygulamaları #WİDGET:Program açıldığında karşımıza çıkan ilk yapıya denir altında sibling windowlar olabilir #aynı widget uzerindeki childwindowlar widgetin uzerine cıkamazken owned windowlar widgetin uzerine cıkabilir...
dogancantorun8/python-application
PYQT/Qt_designer_example/fruitsdialog.py
<reponame>dogancantorun8/python-application # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'fruitsdialog.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know wha...
dogancantorun8/python-application
GUI_tkinter_all/text_editor_example.py
<gh_stars>0 import tkinter as tk class GUI: def __init__(self, master): master.geometry('800x600') master.resizable(width=False, height=False) master.title('Sample Text Widget') self.master = master self.text = tk.Text(master, font='Consolas 14', bg='light blue') self.tex...
dogancantorun8/python-application
memory_db.py
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Sat Oct 10 17:01:13 2020 @author: <NAME> """ #executescript soru işaretleriyle kullanılamaz import sqlite3 conn = None try: conn = sqlite3.connect('student3.sqlite') cur = conn.cursor() cur.executescript(""" CREATE TABLE IF NOT EXISTS student(...
dogancantorun8/python-application
GUI_tkinter_all/listbox_using.py
<filename>GUI_tkinter_all/listbox_using.py import tkinter as tk class GUI: def __init__(self, master): master.geometry('400x350') master.title('Sample Data Binding') self.master = master self.listbox_cities = tk.Listbox(root, height=15, font='Arial 12', bg='light blue', fg='red', select...
dogancantorun8/python-application
GUI_tkinter_all/surukle_birak_ops.py
<gh_stars>0 import tkinter as tk import tkinter.messagebox class GUI: def __init__(self, master): master.geometry('800x600') master.title('Sample Messagebox') master.resizable(width=False, height=False) self.master = master self.button = tk.Button(master, text='Ok') ...
dogancantorun8/python-application
PYQT/pyqt_3_message_box.py
# -*- coding: utf-8 -*- """ Created on Sun Mar 14 18:26:00 2021 @author: Doğancan """ #Butona basıldığında message box çıksın istersem: import sys from PyQt5.QtWidgets import * from PyQt5.QtCore import * class MainWindow(QWidget): def __init__(self): super().__init__() self.pushButtonOk = QPush...
dogancantorun8/python-application
Numpy/numpy_ozellikleri 2.py
<filename>Numpy/numpy_ozellikleri 2.py #dizinin belli bir elemanına erişmek istersem #darrayin içindeki herhangi bir elemana erişmek istersem virgü kulanıyorum #numpy dizisi farklı tip elemandan oluşamaz import numpy as np a = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) print("3 değerine erişmek istersem=",a[0,2]) pr...
dogancantorun8/python-application
Numpy/numpy_8.py
#csv de date okuma ve split işlemleri import numpy as np import datetime def conv(s): k = s.replace(',', '.') return float(k) a = np.loadtxt('şebekeson.csv', delimiter=';', skiprows=2, usecols=(0, 2, 3, 4), converters={2: conv}, encoding='utf-8') print(a) #0 lardan oluşan b numparrayine okuduğumu kopyaladı...
dogancantorun8/python-application
GUI_tkinter_all/os_ve_ttktreeview_code.py
<gh_stars>0 import tkinter as tk import tkinter.ttk as ttk import os import os.path import datetime ROOT_PATH = 'C:\\' class GUI: def __init__(self, master): master.geometry('900x800') master.title('Sample Messagebox') self.frame = tk.Frame(master) self.treeview = ttk.Treeview(sel...
dogancantorun8/python-application
PYQT/deneme.py
import sys from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * class MainWindow(QWidget): def __init__(self): super().__init__() self.checkBox = QCheckBox('Printer', self) self.checkBox.move(150, 50) self.checkBox.setFont(QFont('Times New Roman', 16)...
dogancantorun8/python-application
Numpy/numpy_9.py
<reponame>dogancantorun8/python-application #csv dosyamı string olarak almak istersem ve string operasyonları yaparsam #buradsa np array üzerinde string işlemleri yapıyorum import numpy as np import datetime a = np.loadtxt('rossman-train.csv', skiprows=1, max_rows=100, dtype='str', delimiter=',') print(a) b = np.zer...
dogancantorun8/python-application
Scipy&Sympy/sympy_intro.py
#symbolik:herhangi bir denklemi çözsün sonucunu x ler vs şeklinde sembolik bir şekilde işlem yapsın istersem Sympy kullanıyorum #belirsiz sembolik matematiksel işlemleri yapmak için kullanıyorum #yani özet olarak manuel yaptığımız x lerden y lerden oluşam matematik işlemlerimizi bu kütüphaneyle yapabiliriz #denklem(dif...
dogancantorun8/python-application
mysql_config/dbm_calismam.py
<gh_stars>0 import dbm db=dbm.open('sample.dbm','w') #nesne elde ettim önce sample dbm create ettim #atayacagım degerler bytes yada string olmalı db['name']='veli' db['no']='123' val=db['name'] print(val) #bytes verdi anahtar deger tabanlı sistemler bu şekilde tutar keys=db.keys() print(keys) #value degerlerine e...
dogancantorun8/python-application
GUI_tkinter_all/canvas_cizim.py
<filename>GUI_tkinter_all/canvas_cizim.py import tkinter as tk import tkinter.messagebox #canvas kullanınca mouse ile cizim yapabiliyorum class GUI: def __init__(self, master): master.geometry('800x600') master.title('Sample Messagebox') master.resizable(width=False, height=False) ...
dogancantorun8/python-application
serialization-deserialization/serialization-deserialization.py
# -*- coding: utf-8 -*- """ Created on Sat Oct 24 17:01:11 2020 @author: <NAME> """ #Subject:Serialization-Deserialization #Nesnelerin seri hale getirilmesi:Object serialization #bir nesnenin içindeki herbilginin bir diske veya sockete yazıp tekrardan geri alınmasına serialization denir #object serialization pick...
dogancantorun8/python-application
PYQT/pyq21_aracCubuklari_kullanimi.py
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Sat Mar 27 17:07:54 2021 @author: dogancan """ #araccubukları QToolbar sınıfından yaratılıyor. #yani ana pencere üzerinde yeni bir pencere ekliyoruz #burada daha önce menü barda oluşturduğumuz actionları toolbarımıza ekleyebiliriz #toolbarı is Visible ile görün...
dogancantorun8/python-application
GUI_tkinter_all/canvas_resim2.py
<reponame>dogancantorun8/python-application import tkinter as tk from PIL import Image from PIL import ImageTk #taşıma işlemi yaptım ve arka tarafta herhangi bir etki bırakmadım. class GUI: def __init__(self, master): master.geometry('800x600') master.title('Sample Messagebox') #ilk konum...
dogancantorun8/python-application
PYQT/pyqt_8_listbox.py
<filename>PYQT/pyqt_8_listbox.py # -*- coding: utf-8 -*- """ Created on Sat Mar 20 19:30:25 2021 @author: <NAME> """ ## QListWidget sınıfının methodlarıyla işlem yapıyorum import sys from PyQt5.QtWidgets import * from PyQt5.Qt import * class MainWindow(QWidget): def __init__(self): super().__init__() ...
dogancantorun8/python-application
XML_operation/xml_create_update.py
<reponame>dogancantorun8/python-application # -*- coding: utf-8 -*- """ Created on Sat Apr 17 17:46:59 2021 @author: dogancan """ #Kendi xmlimizi oluşturmak istersek; import xml.etree.ElementTree as ET root = ET.Element('root', {'a': '123', 'b': '566'}, text='this is a test') ET.dump(root) #Root elemana ekleme...
dogancantorun8/python-application
GUI_tkinter_all/event_binding.py
# mesaj baglamaları #klavye mouse gibi hareketlerde message binding islemi oluşur ve aksiyon alırız import tkinter as tk class GUI: def __init__(self, master): master.geometry('800x600') master.title('Sample Messagebox') master.resizable(width=False, height=False) self.master = ma...
dogancantorun8/python-application
GUI_tkinter_all/widget_client_area.py
<gh_stars>0 #bir widgetin tum clien area yı kaplamasını istersem import tkinter as tk class GUI: def __init__(self, master): master.title('Sample Messagebox') self.text = tk.Text(master, bg='white', font='Arial 20') self.text.pack(side='top', expand=True, fill='both') root = tk.Tk() gdb =...
dogancantorun8/python-application
PYQT/pyqt14_icon_islemleri.py
# -*- coding: utf-8 -*- """ Created on Fri Mar 26 18:09:21 2021 @author: dogancan """ import sys import csv from PyQt5.Qt import * class MainWindow(QWidget): def __init__(self): super().__init__() self.resize(640, 480) self.cb = QComboBox(self) self.cb.setGeometry(10, 10, 300, 30...
dogancantorun8/python-application
PYQT/pyqt17_menuislemleriActionnesneleri.py
# -*- coding: utf-8 -*- """ Created on Fri Mar 26 18:33:17 2021 @author: dogancan """ #QAction nesnelerini oluşturma ve kulanma :Bir menü elemanı seçildiğinde bir işlem yapmak istersek Qaction Eventleriyle işlem yapabiliriz import sys from PyQt5.QtWidgets import * from PyQt5.Qt import * class MainWindow(QMainWin...
dogancantorun8/python-application
PYQT/pyqt_16_menu2.py
<filename>PYQT/pyqt_16_menu2.py import sys from PyQt5.QtWidgets import * from PyQt5.Qt import * class MainWindow(QMainWindow): def __init__(self): super().__init__() self.resize(640, 480) self.filePopup = QMenu('File', self) #File pop ekliyorum self.menuBar().addMenu(self.filePo...
dogancantorun8/python-application
GUI_tkinter_all/radio_button_example.py
<filename>GUI_tkinter_all/radio_button_example.py<gh_stars>0 import tkinter as tk class GUI: def __init__(self, master): master.geometry('400x350') master.title('Sample Data Binding') self.master = master self.radio_result = tk.StringVar() self.radio_result.set(None) self...
dogancantorun8/python-application
PYQT/layout_2_grid_control.py
# -*- coding: utf-8 -*- """ Created on Tue Apr 27 13:45:53 2021 @author doğancan """ #geometry yapısı olarak grid kullanırsam matrissel olarak bir yerleşim sağlıyor #dizilim hücresel olarak gerçekleşir import sys from PyQt5.Qt import * class MainWindow(QWidget): def __init__(self): super().__init__()...