Posts

Showing posts from May, 2021

An antidotes to dissatisfaction

Everybody is familiar with the feeling that things are not as they should be.  That you're not successful enough.  Your relationships not satisfying enough.  That you don't have the things you crave.  A chronic dissatisfaction that makes you look outwards with envy  and inwards with disappointment.  Pop culture, advertising, and social media made this worse  by reminding you that aiming for anything less than your dream job is a failure,  you need to have great experiences constantly,  be conventionally attractive, have a lot of friends,  and find your soulmate, and that others have all of these things,  and are truly happy.  And of course, a vast array of self-improvement products  implies that it's all your fault for not working hard enough on yourself.  In the last two decades, researchers have been starting to  investigate how we can counteract these impulses.  The field of positive psychology emerged....

I am not sure!

Is it really a RED color? or am I the only person who sees "this" object like this? Does everybody see the objects as I see? What if I am the only person who has been manipulating by the rest of the world?  What if it does not really exist at all? What if, it just an illusion and what I have seen was just a forgery ?   It's maybe the symptoms of feeling loneliness. Anyway, sometimes it feels good but mostly it kills.   This is just a teaser question my brain asks me. Every day and second it asks me so many bizarre questions like this. It's really hard to manifest my thoughts as it runs in my mind. It's really hard to catch and stitch on paper or on a computer's note.    I am not sure whether this statement is correct or not? I presume, we have to have the courage to live with ourselves, alone. I mean to say we must have the guts to live within ourselves. Living alone is really hard. It is really hard to deal with our own minds, maybe that's why we ofte...

Python Script to import CSV data into MySQL Database

import pandas as pd  import mysql.connector as msql  from mysql.connector import Error  HOST = "localhost"  DATABASE = "Employees"  USER = "root"  PATH = "data/employees.csv"  data = pd.read_csv(PATH)  data = data.to_dict(orient="records")  val = [(dept["emp_no"], dept["emp_title_id"],dept["birth_date"], dept["first_name"], dept["last_name"], dept["sex"], dept["hire_date"]) for dept in data]  try: conn = msql.connect(host= HOST, database=DATABASE, user=USER, password='')        if conn.is_connected():             cursor = conn.cursor()             sql = "INSERT INTO employees (emp_no,emp_title,                          birth_date,first_name,last_name,gender,hire_date) VALUES (%s, %s, %s, %s, %s, %s, %s)" cursor.executemany(sql, val)   ...

Automatically Send Happy Birthday Message using Python Code

 Introduction:  This application will help you to send happy birthday wishes to your friend without any hassle. The code will automatically send an email when the birthday will come. This simple python code will strengthen your friendship.  CODE: main.py import smtplib my_email = "youremail@gmail.com" password = "1234abcd()" to_email = " nandalalsun@gmail.com" def send_quots(quots, day): with smtplib.SMTP( 'smtp.gmail.com' , 587) as connection: connection.starttls() connection.login(user=my_email, password=password) connection.sendmail( from_addr=my_email, to_addrs= to_email , msg= f"Subject: { day } Quots \n\n { quots } " ) import datetime as d import random day = d.datetime.now() today = day.strftime( "%A" ) if today.upper() == "FRIDAY" : while True : with open( "wishes.txt" , mode= "r" ) as quots: # d...

Password Manager Application in Python

Image
Introduction:  This application will help to generate a very strong password, save passwords and find whenever is needed.  This is a very simple application builted in Python.  It is very suitable for python beginner learners and students who want to learn python and useful for college projects . This application also has Copied to clipboard Feature, in which, while generating a new password, you don't have to copy it. It automatically saves in your clipboard, you can directly paste wherever you need. CODE: from tkinter import * from tkinter import messagebox from random import randint, choice, shuffle import pyperclip import json letters = [ 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' , 'j' , 'k' , 'l' , 'm' , 'n' , 'o' , 'p' , 'q' , 'r' , 's' , 't' , 'u' , 'v' , 'w' , 'x' , 'y...

Blind Auction Application: Python Project

 Introduction: Blind Auction is a very simple python project, suitable for python beginners. It has very simple logic, the user will input as many as a bidder and their price and program will compare their bidding price and shows up the highest bidder as a winner.  Code: main.py from replit import clear #HINT: You can call clear() to clear the output in the console. from art import logo print(logo) name_add = True dictionary = {} price_list = [] name_list = [] while name_add is not False: name = input("What is your name?\n") price = input("What is your bid price?\n") name_list.append(name) price_list.append(price) clear() is_another = input("Do you want to add another bidder? Y or N\n").lower() if is_another != "y": name_add = False clear() dictionary["name"] = name_list dictionary["bid"] = price_list max_price = max(dictionary["bid"]) print(f"Winner is: {(dictionary['name'][diction...

Pomodoro timer application using Python

Image
 Introduction:  The  Pomodoro Technique  is a time management  method  developed by Francesco Cirillo in the late 1980s. The  technique  uses a timer to break down work into intervals, traditionally 25 minutes in length, separated by short breaks. CODE: main.py from tkinter import * import math # ---------------------------- CONSTANTS ------------------------------- # PINK = "#e2979c" RED = "#e7305b" GREEN = "#9bdeac" YELLOW = "#f7f5dd" FONT_NAME = "Courier" WORK_MIN = 25 SHORT_BREAK_MIN = 5 LONG_BREAK_MIN = 20 rept = 0 timer_v = None # ---------------------------- TIMER RESET ------------------------------- # def timer_cancle(): window.after_cancel(timer_v) timer_txt.config( text = "Timer" ) canvas.itemconfig(timer_text, text = "00:00" ) check_mark.config( text = "" ) global rept rept = 0 # ---------------------------- TIMER MECHANISM ------------------------------- # def start(): ...

U.S State guessing game using Python

Image
 Introduction: This game is very simple and easy to make. Using python and turtle library, this game is made in a simple way. User guesses the name of the U.S states and if the guess is right, the name will be printed in respective coordinate. And if the user guesses all the state right game will end, or if the user type secret code: "exit" the game will again exit. How to exit the game: 1. Complete all the answers 2. or Type "exit" as a secret code Code: main.py import turtle import pandas data = pandas.read_csv( "50_states.csv" ) all_state = data[ "state" ].to_list() title_score = 0 screen = turtle.Screen() image = "blank_states_img.gif" screen.addshape(image) turtle.shape(image) correct_answer = [] while len (correct_answer) < 50 : answer = screen.textinput( title = f" { len (correct_answer) } /50 States correct" , prompt = "Enter the name of states:" ).title() if answer == "Exit" : mi...