-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
63 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
from tkinter import * | ||
|
||
def data(): | ||
global d; | ||
|
||
|
||
window = Tk() | ||
window.geometry('350x200') | ||
|
||
window.title("Wecome to Bangladesh") | ||
|
||
lb1 = Label(window,text="Hello",font=("Arial Bold",50)) | ||
lb1.grid(column=0,row=0) | ||
|
||
def clicked(): | ||
lb1.configure(text="Button was clicked!") | ||
|
||
|
||
button = Button(window,text="Click Me",command=clicked) | ||
button.grid(column=0,row=1) | ||
|
||
window.mainloop() | ||
import json | ||
from openpyxl import load_workbook | ||
|
||
# Load the Excel file | ||
wb = load_workbook('fortune_teller.xlsx') | ||
ws = wb.active | ||
|
||
# Load the JSON data | ||
with open('prediction.json') as f: | ||
json_data = json.load(f) | ||
|
||
# Create a dictionary for faster lookup | ||
predictions_dict = {prediction['id']: prediction['name'] for prediction in json_data['predictions']} | ||
|
||
# Add header for the new column | ||
ws.cell(row=1, column=ws.max_column + 1, value='prediction_text') | ||
|
||
# Iterate through rows and add prediction_text | ||
for row in ws.iter_rows(min_row=2, max_row=ws.max_row, min_col=1, max_col=ws.max_column): | ||
id_cell = row[3] # Assuming id is in the first column | ||
prediction_id = id_cell.value | ||
print(f"Processing row {id_cell.row}, id: {prediction_id}") | ||
prediction_text = predictions_dict.get(prediction_id, '') # Get corresponding name from JSON data | ||
print(f"Prediction text: {prediction_text}") | ||
ws.cell(row=id_cell.row, column=ws.max_column, value=prediction_text) | ||
|
||
# Save the modified Excel file | ||
wb.save('fortune_teller_with_prediction.xlsx') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
mahim\n./.tmp.,2023-12-02 01:23:28.000082,in | ||
mahim\n./.tmp.,2023-12-02 01:24:11.771323,in | ||
no_persons_foun,2023-12-02 01:25:14.725041,in | ||
mahi,2023-12-02 01:26:40.609061,in | ||
mahim,2023-12-02 01:27:24.244993,in | ||
alif,2023-12-02 13:42:56.928988,in | ||
sifat,2023-12-10 21:57:28.057116,in |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"predictions": [ | ||
{ "id": 1, "name": "পটল বুনলে ফাগুনে, ফলন বাড়ে দ্বিগুণে। রোমান্সের পালে লাগবে নতুন হাওয়া!" }, | ||
{ "id": 2, "name": "খরা ভুয়ে ঢালবি জল, সারাবছর পাবি ফল। সামনে অনেক সাফল্য, অনেক আনন্দ!" }, | ||
{ "id": 3, "name": "বিপদে করো নহে ভয়, অভিজ্ঞতায় হবে জয়। ধনে-মানে-গৌরবে উজ্জ্বল হয়ে উঠবে চারদিক..." }, | ||
{ "id": 4, "name": "ছায়া ভালো ছাতার তল, বল ভালো নিজের বল। শ্রম কখনও বিফলে যায়না..." }, | ||
{ "id": 5, "name": "তুমি কম্বল ছেড়ে দিয়েছো কিন্তু কম্বল তোমাকে ছাড়ছে না ? চিন্তা করোনা জিপি স্টারের হট অফার আসছে..." }, | ||
{ "id": 6, "name": "এদিক নেই ওদিক আছে, ঈদ আসছে কদিন বাদে, ধামাকা আসছে জিপির সাথে..." }, | ||
{ "id": 7, "name": "চল্লেই চল্লিশ বুদ্ধি, না চল্লেই হতবুদ্ধি, কাছে থাকবে জিপি হোক যতই অসঙ্গতি..." }, | ||
{ "id": 8, "name": "ঠকঠকালে হবে কি, কপালে তোর নেই কো ঘি। ভাবিস না কাছেই আছে জিপি..." }, | ||
{ "id": 9, "name": "ক্ষমার বড় গুণ নাই, দানের বড় পুণ্য নাই। তোমার কোন শত্রু নাই..." }, | ||
{ "id": 10, "name": "কইতে কইতে মুখ বাড়ে,খাইতে খাইতে পেট বাড়ে, দেখতে দেখতে দিন কাটে।" }, | ||
{ "id": 11, "name": "শুভ দিন আসন্ন, সবাই থাকবে প্রসন্ন। তুমি থাকবে উপরে, দেখতে হবে জমিনে..." }, | ||
{ "id": 12, "name": "এখন করলে শুরু, পাবে নাকো কদু। আরম্ভ করলে শেষ হতে আর কতক্ষণ? সামনে উজ্জ্বল দিনের সূত্রপাত ঘটবে..." }, | ||
{ "id": 13, "name": "লোকের ভালো, লোকের মন্দ, লোকের সঙ্গে চলে যায়। কিন্তু জিপি কাছে থাকে..." }, | ||
{ "id": 14, "name": "মিললে মেলা, না মিললে একলা একলা ভালা! অপেক্ষা করছে জাগ্রত এক নববসন্ত..." }, | ||
{ "id": 15, "name": "ঠেলার নাম বাবাজী, তোমরা আবার নবাবি, খাইতে হবে নেহারি তাইলে হবে মন খুশি..." }, | ||
{ "id": 16, "name": "পূর্ব আষাঢ়ে দক্ষিণা বয়, সবাই তোমায় ভাল কয়। আপনার রোমান্সের বৃক্ষে নতুন নতুন ফুল ফুটবে..." }, | ||
{ "id": 17, "name": "বিধি যদি বিপরীত, কেবা করে তার হিত। আস্থা রাখুন জিপির ওপর..." }, | ||
{ "id": 18, "name": "দিন থাকতে বাঁধে আল, তবে খায় তিন শাল। কাজ, সাফল্য ও আনন্দে প্লাবিত হবে জীবনের নদীগুলো..." }, | ||
{ "id": 19, "name": "আগেপাছে লন্ঠন, কাজের বেলায় ঠনঠন। দেখিয়ে দিন সবাইকে আপনিও পারেন..." }, | ||
{ "id": 20, "name": "পূর্বে করা বিনিয়োগে ভবিষ্যতে পাবে সম্পদ ভাণ্ডার" }, | ||
{ "id": 21, "name": "বন্ধুর সাক্ষাৎ পাওয়ার উপযুক্ত সন্নিকটে!" }, | ||
{ "id": 22, "name": "স্বাস্থ্যগত দিক থেকে আপনি বিশ্বের শীর্ষে অবস্থান করবেন।" }, | ||
{ "id": 23, "name": "আজ আপনার ভাগ্যবান দিন, কারণ সব সময় আপনার ভাগ্য সুপ্রসন্ন।" }, | ||
{ "id": 24, "name": "আপনি আপনার এলাকার চোরের মর্যাদাপূর্ণ প্রকল্প বা নিয়োগের জন্য প্রধান বাধা, কেননা আপনি গভীর রাত পর্যন্ত ইন্টারনেট চালান!" }, | ||
{ "id": 25, "name": "আপনার kpi দেখে অন্যরা হবে ঈর্ষণীয়" }, | ||
{ "id": 26, "name": "এই ঈদে আপনার জন্য একটি বিশেষ চমক আছে!" }, | ||
{ "id": 27, "name": "আপনি সারা বছর জিপিস্টার সুবিধা জিতবেন!" }, | ||
{ "id": 28, "name": "আপনার ভ্যালেন্টাইনস ডে আরও উত্তেজনাপূর্ণ হতে চলেছে!" }, | ||
{ "id": 29, "name": "আপনি নেহারি খাওয়ার জন্য হঠাৎ তাগিদ পাবেন এবং একটি বিশেষ ছাড় পাবেন!" } | ||
] | ||
} | ||
|