Search results

  1. fukurou

    🐍 python python grimoire

    scedule run the code online : pythonanywhere.com and create an account 1 files, upload the pythone project files respective of the directories set up 2 consoles, bash (or click the main.py, bash to just test), type : python3 main.py if you see the smtplib.SMTPAuthenticationError : go to the...
  2. fukurou

    🐍 python python grimoire

    # auto sender # csv example : # name,email,year,month,day # Test,[email protected],1961,12,21 from datetime import datetime import pandas import random import smtplib MY_EMAIL = "YOUR EMAIL" MY_PASSWORD = "YOUR PASSWORD" today = datetime.now() today_tuple = (today.month, today.day) # tuple as...
  3. fukurou

    🐍 python python grimoire

    python sending emails programmatically set up gmail : manage acc, security, set use phone to sign in -> off set 2 step verification -> off less secure apps -> on set up yahoo mail account info, acc security generate new app pass other app, custom name: python code, generate copy the...
  4. fukurou

    🐍 python python grimoire

    tkinter timer manipulations inside a function : global current_card, flip_timer window.after_cancel(flip_timer) flip_timer = window.after(3000, func=flip_card)
  5. fukurou

    🐍 python python grimoire

    tkinter image button : from tkinter import * check_image = PhotoImage(file="images/right.png") known_button = Button(image=check_image, highlightthickness=0, command=is_known) known_button.grid(row=1, column=1 pandas csv to dictionary type (.to_dict()) parameter list ...
  6. fukurou

    🐍 python python grimoire

    JSON format : import json def save_json(): website = "supremegents.club" email = "[email protected]" password = "qwerty" new_data = { website: { "email": email, "password": password } } with open("data.json", "w") as data_file...
  7. fukurou

    🐍 python python grimoire

    # raise custom error h = float(input("height")) if h > 3: raise ValueError("shingeki kyoujin")
  8. fukurou

    🐍 python python grimoire

    try try code snippet except err_type code to run on fail or key word 'pass' to not do anything else code to run on no err finally runs anyways try: file = open("non_existing_file.txt") except: print("Ha Ha file not fount err") file = open("non_existing_file.txt", "w") # create the...
  9. fukurou

    🐍 python python grimoire

    clipboard management import pyperclip # https://pypi.org/project/pyperclip/ pyperclip.copy(str) # copy str to the clipboard
  10. fukurou

    🐍 python python grimoire

    reverse split list into a string str1.join(list) # "" to join without buffer string between elements focus on entry : e1 = Entry(width=35) e1.focus() e1.insert(0, "text") # insert text to entry, use END for the last index e1.delete(0,END) # clear entry
  11. fukurou

    🐍 python python grimoire

    tkinter timer example import math from tkinter import * # ---------------------------- CONSTANTS ------------------------------- # # color pallets hex codes : colorhunt.co PINK = "#e2979c" RED = "#e7305b" GREEN = "#9bdeac" YELLOW = "#f7f5dd" FONT_NAME = "Courier" WORK_MIN = 25...
  12. fukurou

    🐍 python python grimoire

    TKinter Layout managers place layout manager : from tkinter import * # window GUI for the program window = Tk() window.title("GUI test") window.minsize(width=500, height=300) # add a label : lbl1 = Label(text="label1", font=("Times", 24, "bold")) lbl1.place(x=0, y=0) #precise layout manager...
  13. fukurou

    [MEDIA]

  14. fukurou

    ⚡ arduino PID formula

    PID = P + I + D err = setpoint-processValue P = K(err) reset = reset + k/tau_i*err I = reset //once err changes direction or zero reset =0 D = K/tau_i*(error-lastError); lastErr = err; K : gain : this is twicked K/tau_i : can also be twicled for optimal performance tau_i : second per repeat...
  15. fukurou

    👨‍💻 dev active task

    translate to python : Cerabellum : public class Cerabellum { // runs an algorithm private int fin; private int at; private enumFail failType; private Boolean incrementAt = false; public void advanceInAlg() { if (incrementAt) { incrementAt = false...
  16. fukurou

    🐍 python Chii's python suit

    RegexUtil and ZeroTimeGate ''' ----------------- REGEXUTIL ---------------- ''' import re from typing import Match, Pattern from collections import Counter from math import sqrt class Point: def __init__(self, x_init, y_init): self.x = x_init self.y = y_init def...
  17. fukurou

    [MEDIA]

  18. fukurou

    zerotimegate add explicit vars

    :skn::skn::skn::skn::skn::skn:
  19. fukurou

    zerotimegate add explicit vars

    ''' --------------- ZEROTIMEGATE --------------- ''' import time import datetime from datetime import timedelta ''' ZEROTIMEGATE CLASS ''' class ZeroTimeGate: # a gate that only opens x minutes after it has been set def __init__(self, minutes) -> None: self.pause = 1...
Top