From 806f6364faa87a070f99beb2c745970d8bcd3475 Mon Sep 17 00:00:00 2001 From: jimmy Date: Thu, 27 Jun 2024 20:31:40 -0500 Subject: [PATCH 1/1] early learning in mu editor --- GPIO/blinkLED.py | 12 ++ GPIO/buttonLED.py | 13 ++ GPIO/gpio0LED.py | 8 + __pycache__/calendarQstrt.cpython-37.pyc | Bin 0 -> 1844 bytes __pycache__/readDocx.cpython-37.pyc | Bin 0 -> 360 bytes __pycache__/sheetsAuth.cpython-37.pyc | Bin 0 -> 874 bytes __pycache__/vcnlCounter.cpython-39.pyc | Bin 0 -> 381 bytes calendarQstrt.py | 58 ++++++ calendarWeek.py | 150 +++++++++++++++ checkListfromList.py | 229 +++++++++++++++++++++++ credentials-drive.json | 1 + credentials-sheets.json | 1 + credentials.json | 1 + data_capture/20220511-131832.csv | 0 data_capture/20220513-111448.csv | 0 data_capture/20220726-213605.csv | 0 goodText.py | 24 +++ images/alien.png | Bin 0 -> 2781 bytes images/alien_hurt.png | Bin 0 -> 2816 bytes index.html | 33 ++++ lightLog.txt | 3 + loopButton.py | 23 +++ loopCalWeek.py | 92 +++++++++ loopTest.py | 34 ++++ loopToLabelS.py | 17 ++ luxLog.py | 32 ++++ menubarDemo.py | 18 ++ monthlyCheckList2.py | 43 +++++ monthlyChecklist.py | 48 +++++ msfinstall | 175 +++++++++++++++++ newGT.py | 72 +++++++ octoStatus.py | 109 +++++++++++ pcfText.py | 19 ++ pyportalTEST.py | 20 ++ savedButtons.db | Bin 0 -> 12288 bytes search5.py | 17 ++ searchKeloland.py | 13 ++ senseTemp.py | 13 ++ styledBtn.py | 23 +++ test2.py | 13 ++ testExec.py | 7 + themeDemo.py | 27 +++ thermistorTest.py | 22 +++ tikTakToe.py | 67 +++++++ tkScrolledText101.py | 31 +++ tkinter3.py | 25 +++ tkinterClock.py | 22 +++ tkinterDice.py | 18 ++ tkinterFrame.py | 26 +++ tkinterMenu.py | 35 ++++ tkinterTestUrKnow.py | 60 ++++++ tkinterTutorial.py | 44 +++++ tlvMag.py | 11 ++ toDoBox.py | 73 ++++++++ token-drive.pickle | Bin 0 -> 817 bytes token-gt.json | 1 + token-sheets.json | 1 + token-sheets.pickle | Bin 0 -> 824 bytes token.json | 1 + uart.py | 22 +++ vcnlCounter.py | 17 ++ vemlLuxtest.py | 9 + warHammer.py | 64 +++++++ 63 files changed, 1897 insertions(+) create mode 100644 GPIO/blinkLED.py create mode 100644 GPIO/buttonLED.py create mode 100644 GPIO/gpio0LED.py create mode 100644 __pycache__/calendarQstrt.cpython-37.pyc create mode 100644 __pycache__/readDocx.cpython-37.pyc create mode 100644 __pycache__/sheetsAuth.cpython-37.pyc create mode 100644 __pycache__/vcnlCounter.cpython-39.pyc create mode 100644 calendarQstrt.py create mode 100644 calendarWeek.py create mode 100755 checkListfromList.py create mode 100644 credentials-drive.json create mode 100644 credentials-sheets.json create mode 100644 credentials.json create mode 100644 data_capture/20220511-131832.csv create mode 100644 data_capture/20220513-111448.csv create mode 100644 data_capture/20220726-213605.csv create mode 100644 goodText.py create mode 100644 images/alien.png create mode 100644 images/alien_hurt.png create mode 100644 index.html create mode 100644 lightLog.txt create mode 100644 loopButton.py create mode 100644 loopCalWeek.py create mode 100644 loopTest.py create mode 100644 loopToLabelS.py create mode 100755 luxLog.py create mode 100644 menubarDemo.py create mode 100644 monthlyCheckList2.py create mode 100644 monthlyChecklist.py create mode 100755 msfinstall create mode 100755 newGT.py create mode 100755 octoStatus.py create mode 100644 pcfText.py create mode 100644 pyportalTEST.py create mode 100644 savedButtons.db create mode 100644 search5.py create mode 100644 searchKeloland.py create mode 100644 senseTemp.py create mode 100644 styledBtn.py create mode 100644 test2.py create mode 100644 testExec.py create mode 100644 themeDemo.py create mode 100644 thermistorTest.py create mode 100755 tikTakToe.py create mode 100644 tkScrolledText101.py create mode 100644 tkinter3.py create mode 100644 tkinterClock.py create mode 100644 tkinterDice.py create mode 100644 tkinterFrame.py create mode 100644 tkinterMenu.py create mode 100644 tkinterTestUrKnow.py create mode 100644 tkinterTutorial.py create mode 100644 tlvMag.py create mode 100644 toDoBox.py create mode 100644 token-drive.pickle create mode 100644 token-gt.json create mode 100644 token-sheets.json create mode 100644 token-sheets.pickle create mode 100644 token.json create mode 100644 uart.py create mode 100644 vcnlCounter.py create mode 100644 vemlLuxtest.py create mode 100644 warHammer.py diff --git a/GPIO/blinkLED.py b/GPIO/blinkLED.py new file mode 100644 index 0000000..b336eb9 --- /dev/null +++ b/GPIO/blinkLED.py @@ -0,0 +1,12 @@ +import RPi.GPIO as GPIO +import time + +GPIO.setwarnings(False) +GPIO.setmode(GPIO.BCM) +GPIO.setup(18, GPIO.OUT) + +while True: + GPIO.output(18, True) + time.sleep(1) + GPIO.output(18, False) + time.sleep(1) \ No newline at end of file diff --git a/GPIO/buttonLED.py b/GPIO/buttonLED.py new file mode 100644 index 0000000..a01c18d --- /dev/null +++ b/GPIO/buttonLED.py @@ -0,0 +1,13 @@ +import RPi.GPIO as GPIO +import time + +GPIO.setwarnings(False) +GPIO.setmode(GPIO.BCM) +GPIO.setup(18, GPIO.OUT) +GPIO.setup(25, GPIO.IN) + +while True: + if GPIO.input(25): + GPIO.output(18, False) + else: + GPIO.output(18, True) \ No newline at end of file diff --git a/GPIO/gpio0LED.py b/GPIO/gpio0LED.py new file mode 100644 index 0000000..80c42be --- /dev/null +++ b/GPIO/gpio0LED.py @@ -0,0 +1,8 @@ +from gpiozero import LED +from time import sleep +led=LED(18) +while True: + led.on() + sleep(1) + led.off() + sleep(1) \ No newline at end of file diff --git a/__pycache__/calendarQstrt.cpython-37.pyc b/__pycache__/calendarQstrt.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ed6f32814d5e717ee87c4a49a14631635cecd916 GIT binary patch literal 1844 zcmYjR&5zqe6rXYI#PKF+Hv5?tRqg?*NRYIEI8+GHZc8Z=W!tUPG7_>}&m{4#?MY|G zo88Dkm6mG-N5m;P@*g1|;X?lfPQ01yZfncq_h#Pb@4b2VnoSSEll=ZyxK~5yAI)4m z77$;v${42yZe}`1zUrB1IOI#ykC-u}Lo}ry&Ep3p7p{q$V zZIPCtYsrzpAtvkp+N@fM;$JzTaXBFW7@)P108W_9(ts4MRbEdk(cSFJ4?v|@B{ zfe)M1rp_B}w?!>lJ+pq@oLhypxB^=3rO|l~exIPH=mk3cL#@*qbqhr6Zz}VO>Kt|! z8%wmDIEyY_A0ddkT2$rV zpwrPh6d$0I&x`7P^wY=lT2Z4LT?CSwm(y!Ccx^Mf&;O8;djR!;Jb_m|kjT>_qvuZ~5#P+C}<2GqSm4 z;->U3%56+No_UHNv8;b6c{baL-gVd~a?F^L=0HH{p+AW|;X;*oO56)0#5(>A4%XgN zEHRl~f5?=Iv(d`$1X@iqml2T~G_2o{_pq<5`@toFv*b`7nF&6r==4smdaW8G57NekLLgkd7jaJ=@>V}rJ-Wl8C-9m zNKNLc4raD>H}jdkGd_=^TmTk#{10XCT4`}v+LKU?%PKpGrINyixJh>?cpB(C#6>(~ zG|&hK!#H7O^F$4rzqpRlZSrUFt2tazZSD5_wlG)ZdoNHtec#;2qnOFrZx z4OQuwIRnWU2unMGoOFyV$`vasBc=pQOw{v;qYEpEJ%sr}ob#Zy_c&stqRlo}MgqtR zsw1{^4vyIq4IPMM5d9O0E^zs$!29tP@=0U_MyPQ5xq!Ow>IW6rpjI(tRmS4bv z92+;_^>7=vEE~Iq+r<`cRXV_VxT<%|iEVlKD&Dp_SX=|m(hUM_D+qd<#0y}os$8%j z5PJHH4OpOgWM9`+G!3VY;9@aBEOkV#uSR8Gm$$D(m`UCIFeA-4mZoB)doIMa)TjOT zZozqntjAyQSU`kUR(bj2PB&x4J oq^3cBZ@CI=>3*4VnkVcl-DGkXmIeUlTCSymHLq2*+?y``A4_i)!~g&Q literal 0 HcmV?d00001 diff --git a/__pycache__/readDocx.cpython-37.pyc b/__pycache__/readDocx.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aff40df06e89d8a96614be0cff6c90fb0f341aed GIT binary patch literal 360 zcmYjNy-LJD5T4oWogo;#LM+4=NMjmH5z(u!Q4kJ9mh75K$j_P|h>&38Q&?T>d=y_{ zTPt6|%Gsdc2Q%Ny&U~}GbLsmY5MH0(#0T-GP5!_rxFD+!$Vrfx!5So!&I_zj;xz>P ziz={+&=P_F+7)qqO0Iz|_AugrF$}Cb>M>DRUL-B+T3UsFW(Kl#p~yccP!nPOKWMnb|)~%Rvu0?&1QgeL4$R c02h@^A$!Dt{vA zzsicNa$$a1q77(F?xENHY3}pEV9q;Z-#Ea#Yc#8WuqUHQX6`~&7V?f9^rvJtfR-hUkL2AeMr zp76(g*clzX>avsLMrUJdyr{)7#2ab=pp`dNA|9{wt`pxRnuJ=3ka|W&%?EVt zNQfg2UXbd6r)3bUjPvBYekDz8h&C>bL}vBKyAfCxZt#9a`?(Ph54}EiCvpA%{evXz z@epU>u~7BIDadnaXZ-R!{xuKT43u;-(iO@}0zH_SLQ$vNe)G1|rFK?>nprvFz*(rY zqK&>3QC@_Q;TV{oDv*9Zbz8B3DT;!30lt_mWBLKjo0MCYm_NhVDu^=Iq04-uDr zrEI(ED|FQ{rOlP#=BByotu@5TaGnFvyC zDkzYmc0_^!E$YCISTq2yQNitvLsJrHtepeF$a-r1*%dlqn^4h`wWD>f1Bo9|n|)ap zn(Up2RBu(J%&xz8$7;DUeeXtkVZL3S9w6_1*mldBQ4t6(0|S*~GaaN-Tm&*$q`5NF zw|N})I=zmd_uY}8syi3_X*3yEw|WL~rc*&",MouseWheelHandler) +window.bind("",MouseWheelHandler) +window.bind("",MouseWheelHandler) + +rframe.bind("", lambda event, kanvas=kanvas: updateScrollRegion(kanvas)) + +style=ttk.Style() +style2=ttk.Style() +style3=ttk.Style() + +style.theme_use('default') +style.configure('todo.TButton',foreground='blue4', + background='medium purple') +style.map('todo.TButton', + foreground=[('pressed','maroon'),('disabled','medium purple')], + background=[('active','slate blue'),('disabled','blue4')]) +style2.configure('admin.TButton',forgeground='deep pink', + background='MediumPurple4') +style2.map('admin.TButton', + foreground=[('pressed','DeepPink2'),('focus','hot pink'),('!focus','deep pink')], + background=[('active','DeepPink4'),('focus','MediumOrchid4')]) +style3.configure('admin.TEntry',forgeground='deep pink', + fieldbackground='MediumPurple4') +style3.map('admin.TEntry', + foreground=[('focus','hot pink'),('!focus','deep pink')], + fieldbackground=[('active','DeepPink4'),('focus','MediumOrchid4')]) + +content=tk.StringVar() + +def clear_entry(): + inPut.delete(0,'end') + +def add(): + cOntent=content.get() + entries.append(cOntent) + clear_entry() + count=len(entries) + for entry in entries: + btn=ttk.Button(rframe,text=entry,style='todo.TButton', + command=lambda :done()) + btn.grid(row=(count),column=0,sticky='ew') + if btn['text'].endswith(" DONE"): + btn['state']='disabled' + buttons.append(btn) + for children in rframe.winfo_children(): + if children.winfo_class() =='TButton': + if children not in buttons: + children.destroy() + inPut.focus_set() + updateScrollRegion(kanvas) + kanvas.yview('moveto',1) + + def done(): + btn.configure(text=btn['text']+" DONE",state='disabled') + return btn + +def reset(x): + remove=r'\sDONE' + for btn in buttons: + btn['state']='normal' + btn['text']=re.sub(remove,'',(btn['text'])) + +def save(): + saveData=[] + for button in buttons: + saveData.append(button['text']) + + shelfFile=shelve.open('/home/Jimmy/mu_code/savedButtons') + shelfFile['saveData']=saveData + shelfFile.close() + +def load(): + a=len(entries) + if a==0: + shelfFile=shelve.open('/home/Jimmy/mu_code/savedButtons') + saveData=shelfFile['saveData'] + for item in saveData: + inPut.insert(0,item) + add() + +def delete(): + entries.clear() + for button in buttons: + entries.append(button['text']) + + new=tk.Toplevel(window) + new.title('delete') + new.minsize(width=240, height=50) + new.resizable(width=True,height=True) + new.columnconfigure(0,weight=1) + new.columnconfigure(1,weight=1) + new.transient(window) + + + newFrame=tk.Frame(new) + newFrame.columnconfigure(0,weight=1) + newFrame.grid(row=0,column=0,columnspan=2,sticky='nsew') + +# listbox with vertical(y) scroll + lb=tk.Listbox(newFrame,bg='peach puff',fg='DeepPink2', + selectbackground='maroon3',selectforeground='DarkOrchid4') + lb.grid(column=0,row=0, columnspan=2,sticky='nsew') + yScroll=ttk.Scrollbar(new, orient='vertical') + yScroll.grid(column=2, row=0, sticky='ns') + yScroll['command']=lb.yview + lb.configure(yscrollcommand=yScroll.set) + + reMove=ttk.Button(newFrame,text='remove',style='admin.TButton', + command=lambda :remove()) + reMove.grid(column=0,row=1,sticky='ew') + + for entry in entries: + lb.insert(tk.END,entry) + + def remove(): + rmvdTxt=lb.get(tk.ANCHOR) + lb.delete(tk.ANCHOR) + entries.remove(rmvdTxt) + new.destroy() + reload=[] + for button in buttons: + if button['text']==rmvdTxt: + buttons.remove(button) + entries.clear() + for button in buttons: + entries.append(button['text']) + for entry in entries: + reload.append(entry) + entries.clear() + buttons.clear() + for widget in rframe.winfo_children(): + widget.destroy() + for item in reload: + inPut.insert(0,item) + add() + +def hitenter(event): + add() + +inPut=ttk.Entry(uframe,textvariable=content,style='admin.TEntry') +inPut.grid(row=0,column=0,columnspan=2,sticky='ew') +inPut.focus_set() + +inPut.bind('',hitenter) +aDd=ttk.Button(uframe,text='add',command=add,style='admin.TButton') +aDd.grid(row=1,column=0,sticky='nsew') + +deLete=ttk.Button(uframe,text='delete', +command=delete,style='admin.TButton') +deLete.grid(row=1,column=1,sticky='nsew') + +# make menu bar and drop down items +menubar=tk.Menu(window, background='SlateBlue2', + activebackground='slate blue',disabledforeground='blue4') +optionsmenu=tk.Menu(window,tearoff=0) +optionsmenu.add_command(background='SlateBlue2', + activebackground='slate blue',label='reset ALL',command=lambda x=buttons :reset(x)) +optionsmenu.add_command(background='SlateBlue2', + activebackground='slate blue',label='load',command=load) +optionsmenu.add_command(background='SlateBlue2', + activebackground='slate blue',label='save',command=save) +optionsmenu.add_command(background='SlateBlue2', + activebackground='slate blue',label='exit',command=window.destroy) +menubar.add_cascade(label='options',menu=optionsmenu) +datemenu=tk.Menu(window,tearoff=0) +menubar.add_cascade(label=((datetime.date.today()).strftime("%d-%m-%Y")), + state='disabled',menu=datemenu) +window.config(background='medium purple',menu=menubar) + +window.mainloop() \ No newline at end of file diff --git a/credentials-drive.json b/credentials-drive.json new file mode 100644 index 0000000..7501cc5 --- /dev/null +++ b/credentials-drive.json @@ -0,0 +1 @@ +{"installed":{"client_id":"383597059543-t1vbec53p6cm97rp8qdi8nep80mpkkud.apps.googleusercontent.com","project_id":"eminent-bond-333015","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"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","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}} \ No newline at end of file diff --git a/credentials-sheets.json b/credentials-sheets.json new file mode 100644 index 0000000..648cf1c --- /dev/null +++ b/credentials-sheets.json @@ -0,0 +1 @@ +{"installed":{"client_id":"383597059543-c3gpqitjek4c2tockq267f0vigl9ciii.apps.googleusercontent.com","project_id":"eminent-bond-333015","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"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","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}} \ No newline at end of file diff --git a/credentials.json b/credentials.json new file mode 100644 index 0000000..d9b8ccf --- /dev/null +++ b/credentials.json @@ -0,0 +1 @@ +{"web":{"client_id":"383597059543-nogj55vuhj9ci01sqbh2qcfe0f0fej8j.apps.googleusercontent.com","project_id":"eminent-bond-333015","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"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","redirect_uris":["http://localhost:8080/"],"javascript_origins":["http://localhost:8080"]}} \ No newline at end of file diff --git a/data_capture/20220511-131832.csv b/data_capture/20220511-131832.csv new file mode 100644 index 0000000..e69de29 diff --git a/data_capture/20220513-111448.csv b/data_capture/20220513-111448.csv new file mode 100644 index 0000000..e69de29 diff --git a/data_capture/20220726-213605.csv b/data_capture/20220726-213605.csv new file mode 100644 index 0000000..e69de29 diff --git a/goodText.py b/goodText.py new file mode 100644 index 0000000..2c9b0a1 --- /dev/null +++ b/goodText.py @@ -0,0 +1,24 @@ +#!/usr/bin/python3 +# goodText.py-send sms via email (gmail) + +import ezgmail, ezsheets, random + +# who will be texted (1 recipient at a time) +#recipient='6059295681@vtext.com' #testing +recipient='6055954622@vtext.com' #Katie (LIVE) + +# leave blank, will send text as (subject)body if text here +subject='' + +# spreadsheet title=goodMessage +spreadsheetID='1cEviBnbCudweCIVYzHa1GX9l8feFwXMSdqkpDIX-E-A' +ss=ezsheets.Spreadsheet(spreadsheetID) +sheet=ss[0] + +# message to send +goodMessage=sheet[1,(random.randint(1,(int(sheet['B1']))))] +#print(goodMessage) + +body=goodMessage +# send message to recipient +ezgmail.send(recipient, subject, body) \ No newline at end of file diff --git a/images/alien.png b/images/alien.png new file mode 100644 index 0000000000000000000000000000000000000000..7900bb85cd17c6cb25beaa4a4b363b86529f93f0 GIT binary patch literal 2781 zcmV<33L^E1P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D3UWzAK~#8N?VMe2 z9Y-0*^9}kD@)2?Y0wEy`0wE!aa!aprfy5<|dWVpR5L_U&YE(fbB0DjpO;o5vnwQ#+ zAbb38lypV`@$vptpimwt+Uc6R1@o_Tv_ z&pJDrP!vTY!d_vYFc$#Iq5O!d;>#&k3BrP9g>2C=-TU)#NCYB0xzC&oM`Yd zT5^Gn2Am(#&V?WWK+lVFZR#}R^>N$q+&Uq3NB! zH6!h@0BBes*lBe^g&>i9z@|l^6Xn|E)f3FYP>KWsVEx!?t^QQn4h@8B2T7)f{D5?t zDL8qG*8}2QA&y_54*TeyyM9C3XMr%cP!o)DTf222*aU5-8*a%%RepEH*tf*kZ*V9SAlpGACliwL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~ zAl*xM@nVDIXoi4psA?>fN(flAcnzU(r?j53+ptS)8sRUnkU3WU zP(b;=Oef%XR?dMkxmY0Vtdi{*5EdG+o(GY^<|$FmqWhZ6=&H!p!LRCevbw0R3^uYJ6e1zbnx;iFU`(Sre_`Z zXj%vJM}?gT4n(fhmGbATQZk`04FyaLVps zxo$dclQ$yRB0mtZ9i|k9!*oq2Ijg^5@ljDV#nHHL7CW$LKjL^Zk#?C84$|E zX2c9&n5%cPu1xJkwig^o$yHPq8?;p;;HtU7t2g$}PG*Enokn2+WNp|W!0ML4tH9&_ z>i-j%AyR*aMgx%?$haXU-lxPR#M-cFG!P;4+jV@eqQJ9Ft)tMZupOZO>@H}5B@dbh zqR@ph=)1*&l6v!Zj-~<;xOxv{cm}OaO$8#vnA)EHSi*E;?U^)o&OjhASKXu^jn%2- jt2@@_Hr02k9XtLH!eTa~Mj%!W00000NkvXXu0mjf=eIip literal 0 HcmV?d00001 diff --git a/images/alien_hurt.png b/images/alien_hurt.png new file mode 100644 index 0000000000000000000000000000000000000000..250e6e8b8f0898bd96e0728cc57f20e6d2156f0d GIT binary patch literal 2816 zcmV+b3;*Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D3YAGjK~#8N)tp^x z9mg5R{SEvP{1JT7&`>CKN<*MD#kb8>E(*D1CIdh@l;5GM`2I^evt4y;T8JUkvq#vjn)rT54BjeWbZ3Poh5FIX zR@L<23C1ZS9|`>yqH&utWiTWL^&>LMgu&RQOxiq&5r~cvSQMyx0utz60i*j$0j~-u zcT|`WLWR7uIXOofepv{aD(Db8_oDEF9>B`=rU0jwssB+U4Punbgb~JwvkvwO91KS< z2t`5^H=l^5kppRSeq9w_5?E(qgXno*C=#YqbB>Y9iy{Q0hVW*_Hw_}EDDO%2+?mx&h1@X+4$&Zw`Et!3)urAf6=AFHTV>!7X4qzf zoaS@P%c^VjBo$yE;ybtWbISZs_^I%7;g=S_5Pl{+E11vt@*f7c{ys(?_N_GibjWjp z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mb$XY zFh)Lg$bl2xd+4Aw^0;q0!Nw`CzyPN2O8TKF(}-bo-iaPhw3NMN!%0|~-MpeijLo5Z z$DQPBI3{(PL|pE^5BSR^9`PZ z6A%$0dyUZ5u&*nTPpM--kui}$$g=k_$@Fn;3H{(H)Zv?UTP(`AN zMJ1Mbb$hVn7%IlATTz7^Ww#Zw-`NzINe~Wc>Rm^A1W+4COeIWRb<3kITfPGY0ZA4m SKcE=^0000 + + + + + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+

Cat is {state}

+

Red is {Rstate}

+

Green is {Gstate}

+ + \ No newline at end of file diff --git a/lightLog.txt b/lightLog.txt new file mode 100644 index 0000000..59b43d4 --- /dev/null +++ b/lightLog.txt @@ -0,0 +1,3 @@ +Ambient Light: 28 17:8:30 5/28/2023 +Ambient Light: 28 17:9:31 5/28/2023 +Ambient Light: 28 17:10:31 5/28/2023 diff --git a/loopButton.py b/loopButton.py new file mode 100644 index 0000000..b8f0ce4 --- /dev/null +++ b/loopButton.py @@ -0,0 +1,23 @@ +import tkinter as tk +from tkinter import ttk + +class App(tk.Tk): + def __init__(self): + super().__init__() + + self.geometry('300x100') + + button=ttk.Button(self,text='Save') + button.pack(expand=True) + + style=ttk.Style(self) + style.configure('TButton',font=('Helvetica',16)) + style.map('TButton', + foreground=[('pressed','blue'), + ('active','red')]) + + print(style.layout('TButton')) + +if __name__== "__main__": + app=App() + app.mainloop() \ No newline at end of file diff --git a/loopCalWeek.py b/loopCalWeek.py new file mode 100644 index 0000000..a5731c9 --- /dev/null +++ b/loopCalWeek.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python3 +# display events for next 7 days +from __future__ import print_function +import datetime +import os.path + +import tkinter as tk +from tkinter import ttk + +from google.auth.transport.requests import Request +from google.oauth2.credentials import Credentials +from google_auth_oauthlib.flow import InstalledAppFlow +from googleapiclient.discovery import build +from googleapiclient.errors import HttpError + +SCOPES=['https://www.googleapis.com/auth/calendar.readonly'] + +"""Shows basic usage of the Google Calendar API. +Prints the start and name of the next 7 days on the user's calendar +""" +creds=None +if os.path.exists('token.json'): + creds=Credentials.from_authorized_user_file('token.json', SCOPES) +if not creds or not creds.valid: + if creds and creds.expired and creds.refresh_token: + creds.refresh(Request()) + else: + flow=InstalledAppFlow.from_client_secrets_file( + 'credentials-sheets.json',SCOPES) + creds=flow.run_local_server(port=0) + with open('token.json','w') as token: + token.write(creds.to_json()) + +try: + service=build('calendar','v3',credentials=creds) + window=tk.Tk() + window.title('next 7 days') + + # Call the Calendar API + now=datetime.datetime.utcnow().isoformat()+'Z' #datetime in crrct frmt + today=datetime.datetime.now() + max=(today+datetime.timedelta(days=7)).isoformat()+'Z' + print("Getting the week's events") + events_result=service.events().list(calendarId='primary', + timeMin=now,timeMax=max,singleEvents=True, + orderBy='startTime',prettyPrint=True).execute() + events=events_result.get('items',[]) #list of dict (event=dict) + #second calendar + events_result2=service.events().list(calendarId='greendaygirl0123@gmail.com', + timeMin=now,timeMax=max,singleEvents=True, + orderBy='startTime').execute() + events2=events_result2.get('items',[]) + + if not events: + print('No upcoming events found.') + + if not events2: + print('No upcoming events2 found.') + + + + for event in events: + start=datetime.datetime.fromisoformat( + event['start'].get('dateTime',event['start'].get('date'))) + Start=start.strftime("%a %m-%d %I:%M %p") + description=event.get('description','') + eventLblJ=tk.Label(window,text=(Start, event['summary'], description), + fg='cyan',bg='black',relief='sunken') + eventLblJ.grid(stick='nsew') + + keyLblJ=tk.Label(window,text="Jimmy",bg='black',fg='cyan', + relief='sunken') + keyLblJ.grid(sticky='nsew') + keyLblK=tk.Label(window,text="Katie",bg='cyan',relief='sunken') + keyLblK.grid(sticky='nsew') + + for event2 in events2: + start2=datetime.datetime.fromisoformat( + event2['start'].get('dateTime',event2['start'].get('date'))) + Start2=start2.strftime("%a %m-%d %I:%M %p") + description2=event2.get('description','') + eventLblK=tk.Label(window,text=(Start2, event2['summary'], description2), + bg='cyan',relief='sunken') + eventLblK.grid(sticky='nsew') + + print(Start, event['summary'], description,"\n", + Start2, event2['summary'], description2,"\n") + + + window.mainloop() +except HttpError as error: + print('An error occurred: %s' % error) \ No newline at end of file diff --git a/loopTest.py b/loopTest.py new file mode 100644 index 0000000..f2a6ac5 --- /dev/null +++ b/loopTest.py @@ -0,0 +1,34 @@ +from tkinter import * + +root=Tk() + +files=['bill1','bill2'] +btn=[] +content=StringVar() +"""for i in range(3): + files.append("Button"+str(i))""" + +def clear_entry(): + tYpe.delete(0,'end') + +def addTofiles(): + cOntent=content.get() + files.append(cOntent) + clear_entry() + + +for i in range(len(files)): + btn.append(Button(root,text=files[i], + command=lambda c=i: print(btn[c].cget("text")))) + btn[i].pack() + +tYpe=Entry(root,textvariable=content) +tYpe.pack() +filebtn=Button(root,text='add',command=addTofiles) +filebtn.pack() +menubar=Menu(root) +optionsmenu=Menu(root,tearoff=0) +optionsmenu.add_command(label='exit',command=root.quit) +menubar.add_cascade(label='options',menu=optionsmenu) +root.config(menu=menubar) +root.mainloop() \ No newline at end of file diff --git a/loopToLabelS.py b/loopToLabelS.py new file mode 100644 index 0000000..597e128 --- /dev/null +++ b/loopToLabelS.py @@ -0,0 +1,17 @@ +import tkinter as tk +import datetime +events=[{'kind': 'calendar#event', 'etag': '"3283203974568000"', 'id': 'n9tmirpipd7arjg8k72bnvr66q_20220117T203000Z', 'status': 'confirmed', 'htmlLink': 'https://www.google.com/calendar/event?eid=bjl0bWlycGlwZDdhcmpnOGs3MmJudnI2NnFfMjAyMjAxMTdUMjAzMDAwWiBqaW1pcHVuazg4QG0', 'created': '2020-02-16T21:37:44.000Z', 'updated': '2022-01-08T00:33:07.387Z', 'summary': 'Lifescape Shift', 'description': 'work', 'colorId': '2', 'creator': {'email': 'jimipunk88@gmail.com', 'self': True}, 'organizer': {'email': 'jimipunk88@gmail.com', 'self': True}, 'start': {'dateTime': '2022-01-17T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'end': {'dateTime': '2022-01-17T23:00:00-06:00', 'timeZone': 'America/Chicago'}, 'recurringEventId': 'n9tmirpipd7arjg8k72bnvr66q_R20220117T203000', 'originalStartTime': {'dateTime': '2022-01-17T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'iCalUID': 'n9tmirpipd7arjg8k72bnvr66q_R20220117T203000@google.com', 'sequence': 1, 'reminders': {'useDefault': False}, 'eventType': 'default'}, {'kind': 'calendar#event', 'etag': '"3283204004964000"', 'id': 'o70jch4k13ma7escsbl97esvs5_20220119T203000Z', 'status': 'confirmed', 'htmlLink': 'https://www.google.com/calendar/event?eid=bzcwamNoNGsxM21hN2VzY3NibDk3ZXN2czVfMjAyMjAxMTlUMjAzMDAwWiBqaW1pcHVuazg4QG0', 'created': '2020-02-10T21:37:34.000Z', 'updated': '2022-01-08T00:33:22.654Z', 'summary': 'LifeScape Shift', 'description': 'work', 'colorId': '2', 'creator': {'email': 'jimipunk88@gmail.com', 'self': True}, 'organizer': {'email': 'jimipunk88@gmail.com', 'self': True}, 'start': {'dateTime': '2022-01-19T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'end': {'dateTime': '2022-01-19T23:00:00-06:00', 'timeZone': 'America/Chicago'}, 'recurringEventId': 'o70jch4k13ma7escsbl97esvs5_R20220119T203000', 'originalStartTime': {'dateTime': '2022-01-19T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'iCalUID': 'o70jch4k13ma7escsbl97esvs5_R20220119T203000@google.com', 'sequence': 1, 'reminders': {'useDefault': False}, 'eventType': 'default'}, {'kind': 'calendar#event', 'etag': '"3283204024001000"', 'id': 'i611bn6sae4skpt1s5845jc4ph_20220120T203000Z', 'status': 'confirmed', 'htmlLink': 'https://www.google.com/calendar/event?eid=aTYxMWJuNnNhZTRza3B0MXM1ODQ1amM0cGhfMjAyMjAxMjBUMjAzMDAwWiBqaW1pcHVuazg4QG0', 'created': '2020-02-16T21:38:42.000Z', 'updated': '2022-01-08T00:33:32.068Z', 'summary': 'Lifescape Shift', 'description': 'work', 'colorId': '2', 'creator': {'email': 'jimipunk88@gmail.com', 'self': True}, 'organizer': {'email': 'jimipunk88@gmail.com', 'self': True}, 'start': {'dateTime': '2022-01-20T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'end': {'dateTime': '2022-01-20T23:00:00-06:00', 'timeZone': 'America/Chicago'}, 'recurringEventId': 'i611bn6sae4skpt1s5845jc4ph_R20220120T203000', 'originalStartTime': {'dateTime': '2022-01-20T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'iCalUID': 'i611bn6sae4skpt1s5845jc4ph_R20220120T203000@google.com', 'sequence': 1, 'reminders': {'useDefault': False}, 'eventType': 'default'}] +[{'kind': 'calendar#event', 'etag': '"3283203974568000"', 'id': 'n9tmirpipd7arjg8k72bnvr66q_20220117T203000Z', 'status': 'confirmed', 'htmlLink': 'https://www.google.com/calendar/event?eid=bjl0bWlycGlwZDdhcmpnOGs3MmJudnI2NnFfMjAyMjAxMTdUMjAzMDAwWiBqaW1pcHVuazg4QG0', 'created': '2020-02-16T21:37:44.000Z', 'updated': '2022-01-08T00:33:07.387Z', 'summary': 'Lifescape Shift', 'description': 'work', 'colorId': '2', 'creator': {'email': 'jimipunk88@gmail.com', 'self': True}, 'organizer': {'email': 'jimipunk88@gmail.com', 'self': True}, 'start': {'dateTime': '2022-01-17T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'end': {'dateTime': '2022-01-17T23:00:00-06:00', 'timeZone': 'America/Chicago'}, 'recurringEventId': 'n9tmirpipd7arjg8k72bnvr66q_R20220117T203000', 'originalStartTime': {'dateTime': '2022-01-17T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'iCalUID': 'n9tmirpipd7arjg8k72bnvr66q_R20220117T203000@google.com', 'sequence': 1, 'reminders': {'useDefault': False}, 'eventType': 'default'}, {'kind': 'calendar#event', 'etag': '"3283204004964000"', 'id': 'o70jch4k13ma7escsbl97esvs5_20220119T203000Z', 'status': 'confirmed', 'htmlLink': 'https://www.google.com/calendar/event?eid=bzcwamNoNGsxM21hN2VzY3NibDk3ZXN2czVfMjAyMjAxMTlUMjAzMDAwWiBqaW1pcHVuazg4QG0', 'created': '2020-02-10T21:37:34.000Z', 'updated': '2022-01-08T00:33:22.654Z', 'summary': 'LifeScape Shift', 'description': 'work', 'colorId': '2', 'creator': {'email': 'jimipunk88@gmail.com', 'self': True}, 'organizer': {'email': 'jimipunk88@gmail.com', 'self': True}, 'start': {'dateTime': '2022-01-19T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'end': {'dateTime': '2022-01-19T23:00:00-06:00', 'timeZone': 'America/Chicago'}, 'recurringEventId': 'o70jch4k13ma7escsbl97esvs5_R20220119T203000', 'originalStartTime': {'dateTime': '2022-01-19T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'iCalUID': 'o70jch4k13ma7escsbl97esvs5_R20220119T203000@google.com', 'sequence': 1, 'reminders': {'useDefault': False}, 'eventType': 'default'}, {'kind': 'calendar#event', 'etag': '"3283204024001000"', 'id': 'i611bn6sae4skpt1s5845jc4ph_20220120T203000Z', 'status': 'confirmed', 'htmlLink': 'https://www.google.com/calendar/event?eid=aTYxMWJuNnNhZTRza3B0MXM1ODQ1amM0cGhfMjAyMjAxMjBUMjAzMDAwWiBqaW1pcHVuazg4QG0', 'created': '2020-02-16T21:38:42.000Z', 'updated': '2022-01-08T00:33:32.068Z', 'summary': 'Lifescape Shift', 'description': 'work', 'colorId': '2', 'creator': {'email': 'jimipunk88@gmail.com', 'self': True}, 'organizer': {'email': 'jimipunk88@gmail.com', 'self': True}, 'start': {'dateTime': '2022-01-20T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'end': {'dateTime': '2022-01-20T23:00:00-06:00', 'timeZone': 'America/Chicago'}, 'recurringEventId': 'i611bn6sae4skpt1s5845jc4ph_R20220120T203000', 'originalStartTime': {'dateTime': '2022-01-20T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'iCalUID': 'i611bn6sae4skpt1s5845jc4ph_R20220120T203000@google.com', 'sequence': 1, 'reminders': {'useDefault': False}, 'eventType': 'default'}] +[{'kind': 'calendar#event', 'etag': '"3283203974568000"', 'id': 'n9tmirpipd7arjg8k72bnvr66q_20220117T203000Z', 'status': 'confirmed', 'htmlLink': 'https://www.google.com/calendar/event?eid=bjl0bWlycGlwZDdhcmpnOGs3MmJudnI2NnFfMjAyMjAxMTdUMjAzMDAwWiBqaW1pcHVuazg4QG0', 'created': '2020-02-16T21:37:44.000Z', 'updated': '2022-01-08T00:33:07.387Z', 'summary': 'Lifescape Shift', 'description': 'work', 'colorId': '2', 'creator': {'email': 'jimipunk88@gmail.com', 'self': True}, 'organizer': {'email': 'jimipunk88@gmail.com', 'self': True}, 'start': {'dateTime': '2022-01-17T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'end': {'dateTime': '2022-01-17T23:00:00-06:00', 'timeZone': 'America/Chicago'}, 'recurringEventId': 'n9tmirpipd7arjg8k72bnvr66q_R20220117T203000', 'originalStartTime': {'dateTime': '2022-01-17T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'iCalUID': 'n9tmirpipd7arjg8k72bnvr66q_R20220117T203000@google.com', 'sequence': 1, 'reminders': {'useDefault': False}, 'eventType': 'default'}, {'kind': 'calendar#event', 'etag': '"3283204004964000"', 'id': 'o70jch4k13ma7escsbl97esvs5_20220119T203000Z', 'status': 'confirmed', 'htmlLink': 'https://www.google.com/calendar/event?eid=bzcwamNoNGsxM21hN2VzY3NibDk3ZXN2czVfMjAyMjAxMTlUMjAzMDAwWiBqaW1pcHVuazg4QG0', 'created': '2020-02-10T21:37:34.000Z', 'updated': '2022-01-08T00:33:22.654Z', 'summary': 'LifeScape Shift', 'description': 'work', 'colorId': '2', 'creator': {'email': 'jimipunk88@gmail.com', 'self': True}, 'organizer': {'email': 'jimipunk88@gmail.com', 'self': True}, 'start': {'dateTime': '2022-01-19T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'end': {'dateTime': '2022-01-19T23:00:00-06:00', 'timeZone': 'America/Chicago'}, 'recurringEventId': 'o70jch4k13ma7escsbl97esvs5_R20220119T203000', 'originalStartTime': {'dateTime': '2022-01-19T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'iCalUID': 'o70jch4k13ma7escsbl97esvs5_R20220119T203000@google.com', 'sequence': 1, 'reminders': {'useDefault': False}, 'eventType': 'default'}, {'kind': 'calendar#event', 'etag': '"3283204024001000"', 'id': 'i611bn6sae4skpt1s5845jc4ph_20220120T203000Z', 'status': 'confirmed', 'htmlLink': 'https://www.google.com/calendar/event?eid=aTYxMWJuNnNhZTRza3B0MXM1ODQ1amM0cGhfMjAyMjAxMjBUMjAzMDAwWiBqaW1pcHVuazg4QG0', 'created': '2020-02-16T21:38:42.000Z', 'updated': '2022-01-08T00:33:32.068Z', 'summary': 'Lifescape Shift', 'description': 'work', 'colorId': '2', 'creator': {'email': 'jimipunk88@gmail.com', 'self': True}, 'organizer': {'email': 'jimipunk88@gmail.com', 'self': True}, 'start': {'dateTime': '2022-01-20T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'end': {'dateTime': '2022-01-20T23:00:00-06:00', 'timeZone': 'America/Chicago'}, 'recurringEventId': 'i611bn6sae4skpt1s5845jc4ph_R20220120T203000', 'originalStartTime': {'dateTime': '2022-01-20T14:30:00-06:00', 'timeZone': 'America/Chicago'}, 'iCalUID': 'i611bn6sae4skpt1s5845jc4ph_R20220120T203000@google.com', 'sequence': 1, 'reminders': {'useDefault': False}, 'eventType': 'default'}] +window=tk.Tk() +window.title('loop to labels') + +for event in events: + start=datetime.datetime.fromisoformat( + event['start'].get('dateTime',event['start'].get('date'))) + description=event.get('description','') + eventLbl=tk.Label(window,text=(start, event['summary'], description), + relief='sunken') + eventLbl.pack() + +window.mainloop() \ No newline at end of file diff --git a/luxLog.py b/luxLog.py new file mode 100755 index 0000000..66cf48a --- /dev/null +++ b/luxLog.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +import time +import datetime +import board + +import adafruit_veml7700 +import adafruit_bh1750 + +i2c = board.I2C() + +veml7700=adafruit_veml7700.VEML7700(i2c) +bh1750=adafruit_bh1750.BH1750(i2c) + + +logFile=open('lightLog.txt','w') +while True: + tH=time.strftime('%H', time.localtime()) + time.sleep(1) + while int(tH) <= 7: + ti=datetime.datetime.now() + logFile.write("Ambient Light: %d lux\n" % veml7700.light) + logFile.write("Light: %d lux\n" % bh1750.lux) + logFile.write(ti.strftime("%I:%M %p %d/%m/%y\n")) + logFile.flush() + print("Ambient Light: %d lux" % veml7700.light) # print statements are for debugging + print("Light: %d lux" % bh1750.lux) + print(ti.strftime("%I:%M %p %d/%m/%y\n")) + time.sleep(60.0) + else: + logFile.close() + print("out of time") + quit("after 7 am") \ No newline at end of file diff --git a/menubarDemo.py b/menubarDemo.py new file mode 100644 index 0000000..82bd7b2 --- /dev/null +++ b/menubarDemo.py @@ -0,0 +1,18 @@ +import tkinter as tk + +def donothing(): + x=0 + +window=tk.Tk() + +menubar=tk.Menu(window) +filemenu=tk.Menu(menubar,tearoff=0) +"""filemenu.add_command(label='New',command=donothing) +filemenu.add_command(label='Open',command=donothing) +filemenu.add_command(label='Save',command=donothing) +filemenu.add_separator()""" +menubar.add_command(label='exit',command=window.quit) +menubar.add_cascade(label='file',menu=filemenu) + +window.config(menu=menubar) +window.mainloop() \ No newline at end of file diff --git a/monthlyCheckList2.py b/monthlyCheckList2.py new file mode 100644 index 0000000..3f88f08 --- /dev/null +++ b/monthlyCheckList2.py @@ -0,0 +1,43 @@ +import tkinter as tk +from tkinter import ttk +import datetime + +month=(datetime.date.today()).strftime("%B") # get current MONTH + +window=tk.Tk() +window.title(month) # title is current MONTH +content=tk.StringVar() + +btn=[] # button list +entries=[] # list to fill from entry widget +count=len(entries) +entry=ttk.Entry(window, textvariable=content) +entry.grid(row=0,column=0) + +def clear_entry(): + entry.delete(0,'end') + +def add(): + global content + cOntent=content.get() + entries.append(cOntent) + global count + for i in range(len(entries)): + btn.append(ttk.Button(window,text=cOntent, + command=lambda i=i :done())) + + def done(): + btn.append(ttk.Button(window,text=cOntent+" DONE", + state='disabled')) + btn[-1].grid(row=count+1,column=0,sticky='nsew') + + btn[-1].grid(row=count+2,column=0,sticky='nsew') + count += 1 + clear_entry() + print(entries[0:(len(entries))],len(entries)) + #print(window.grid_slaves(),cOntent) + + +add=tk.Button(window,text='Add',command=add) +add.grid(row=1,column=0) +window.mainloop() \ No newline at end of file diff --git a/monthlyChecklist.py b/monthlyChecklist.py new file mode 100644 index 0000000..ecfebdc --- /dev/null +++ b/monthlyChecklist.py @@ -0,0 +1,48 @@ +import tkinter as tk +from tkinter import ttk +import datetime + +month=(datetime.date.today()).strftime("%B") # get current MONTH + +window=tk.Tk() +window.title(month) # title is current MONTH +content=tk.StringVar() +reminder=[] # button list +item=[] # list of input from entry +cOntent=content.get() +count=0 +style=ttk.Style() +style.theme_use('default') +style.configure('styled.TButton',foreground='blue',background='yellow') +style.map('styled.TButton', + foreground=[('pressed','red'),('focus','green'),('disabled','yellow')], + background=[('active','yellow'),('disabled','blue')]) + +reminderEntry=ttk.Entry(window, textvariable=content) +reminderEntry.grid(row=0,column=0) + +def clear_entry(): + reminderEntry.delete(0,'end') +def add(): + global content + cOntent=content.get() + global count + reminder.append(ttk.Button(window,text=cOntent,command=lambda :done(), + style='styled.TButton')) + + def done(): + for i in range(len(cOntent)): + reminder[i].configure(text=reminder[i]['text']+" DONE", + state='disabled') + print((reminder[i]).configure()) + + reminder[-1].grid(row=count+2,column=0,sticky='nsew') + count += 1 + clear_entry() + + + +add=tk.Button(window,text='Add',command=add) +add.grid(row=1,column=0) +print(window.grid_slaves(),cOntent) +window.mainloop() \ No newline at end of file diff --git a/msfinstall b/msfinstall new file mode 100755 index 0000000..9cea684 --- /dev/null +++ b/msfinstall @@ -0,0 +1,175 @@ +#!/bin/sh + +print_pgp_key() { + cat <<-EOF +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBFDAy/0BEAC8I5bw5gLQqHKx5JCacYcXFL6AZowl3qIOTxo5yfBl8CepNpWY +OOERvIUJb17WehhhbWOo9Wj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q0FOpBhv2WIh291BQ +bqgmGbNvABEBAAGJAjwEGAEIACYCGwwWIQQJ5V+vT3hizW1ViZfN+1+lIAe5VAUC +XXEvjgUJH3xmkQAKCRDN+1+lIAe5VJueD/4+6ldtpXYin+lWcMyHM8487GczLi8S +XgxZJu/2GzEpgdke8xoQWv6Jsk2AQaPLciIT7yU7/gTWsOiY7Om+4MGqZY+KqZ/X +eI8nFsGQx2yI7TDUQasN4uB5y6RnMGSH8DbAIWydVP2XWNVCHcVNMbeAoW7IiOOh +I2wT4bCmzrjfVsJRo8VvpykPhm7+svsU2ukMW0Ua77bA1gzdvPpRzN2I1MY/6lJk +x7BwtYsiAZt0+jII31IdCNpz4BlU3eadG+QbEH/q5FrHPBtkRWmziJpKXZDWdAg/ +I7yim36xfxjMtcv8CI3YKmy5jYcGKguA2SGApQpPEUkafLZc62v8HVmZZFKmLyXR +XM9YTHz4v4jhruJ80M6YjUtfQv0zDn2HoyZuPxAW4HCys1/9+iAhuFqdt1PnHBs/ +AmTFlQPAeMu++na4uc7vmnDwlY7RDPb0uctUczhEO4gT5UkLk5C9hcOKVAfmgF4n +MNgnOoSZO2orPKh3mejj+VAZsr1kfEWMoFeHPrWdxgRmjOhUfy6hKhJ1H306aaSQ +gkE3638Je/onWmnmZrDEZq7zg0Qk3aOOhJXugmRnIjH341y/whxvAdJIyXrjLN4z +qCU0JkA1rVqS6PXZabKb9DOqYa4pr9thGS5rU+Gn3GWiSq2PtVW6Hh83WOFcEsMk +2vTa24LE0J2DQg== +=Qa/n +-----END PGP PUBLIC KEY BLOCK----- +EOF +} + +install_deb() { + LIST_FILE=/etc/apt/sources.list.d/metasploit-framework.list + PREF_FILE=/etc/apt/preferences.d/pin-metasploit.pref + echo -n "Adding metasploit-framework to your repository list.." + echo "deb $DOWNLOAD_URI/apt lucid main" > $LIST_FILE + print_pgp_key | apt-key add - + if [ ! -f $PREF_FILE ]; then + mkdir -p /etc/apt/preferences.d/ + cat > $PREF_FILE < /dev/null + echo "OK" + echo "Checking for and installing update.." + apt-get install -y --allow-downgrades metasploit-framework +} + +install_rpm() { + echo "Checking for and installing update.." + REPO_FILE=/etc/yum.repos.d/metasploit-framework.repo + GPG_KEY_FILE=/etc/pki/rpm-gpg/RPM-GPG-KEY-Metasploit + echo -n "Adding metasploit-framework to your repository list.." + + cat > /etc/yum.repos.d/metasploit-framework.repo < ${GPG_KEY_FILE} + yum install -y metasploit-framework +} + +install_suse() { + echo "Checking for and installing update.." + GPG_KEY_FILE_DIR=/etc/pki/rpm-gpg + GPG_KEY_FILE=${GPG_KEY_FILE_DIR}/RPM-GPG-KEY-Metasploit + echo -n "Adding metasploit-framework to your repository list.." + if [ ! -d $GPG_KEY_FILE_DIR ]; then + mkdir -p $GPG_KEY_FILE_DIR + fi + zypper ar -f $DOWNLOAD_URI/rpm metasploit + print_pgp_key > ${GPG_KEY_FILE} + rpmkeys --import ${GPG_KEY_FILE} + zypper install -y metasploit-framework +} + +install_pkg() +{ + ( + cd ~/Downloads + + echo "Downloading package..." + curl -O "$DOWNLOAD_URI/osx/metasploitframework-latest.pkg" + + echo "Checking signature..." + + if pkgutil --check-signature metasploitframework-latest.pkg; then + echo "Installing package..." + installer -pkg metasploitframework-latest.pkg -target / + fi + + echo "Cleaning up..." + rm -fv metasploitframework-latest.pkg + ) +} + +DOWNLOAD_URI=http://downloads.metasploit.com/data/releases/metasploit-framework +PKGTYPE=unknown +ID=`id -u` + +if [ -f /etc/redhat-release ] ; then + PKGTYPE=rpm +elif [ -f /etc/system-release ] ; then + # If /etc/system-release is present, this is likely a distro that uses RPM. + PKGTYPE=rpm +else + if uname -sv | grep 'Darwin' > /dev/null; then + PKGTYPE=pkg + elif [ -f /usr/bin/zypper ] ; then + PKGTYPE=sus + else + PKGTYPE=deb + fi +fi + +if [ "$ID" -ne 0 ]; then + if ! hash sudo 2>/dev/null; then + echo "This script must be executed as the 'root' user or with sudo" + exit 1 + else + echo "Switching to root user to update the package" + sudo -E $0 $@ + exit 0 + fi +fi + +case $PKGTYPE in + deb) + install_deb + ;; + sus) + install_suse + ;; + rpm) + install_rpm + ;; + *) + install_pkg +esac diff --git a/newGT.py b/newGT.py new file mode 100755 index 0000000..4156205 --- /dev/null +++ b/newGT.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +import os.path +import random +import itertools +import base64 +from email.mime.text import MIMEText +from google.auth.transport.requests import Request +from google.oauth2.credentials import Credentials +from google_auth_oauthlib.flow import InstalledAppFlow +from googleapiclient.discovery import build + + +SCOPES=['https://www.googleapis.com/auth/spreadsheets.readonly', +'https://mail.google.com/'] +SPREADSHEET='1cEviBnbCudweCIVYzHa1GX9l8feFwXMSdqkpDIX-E-A' +RANGE='goodMessages!A:A' + +# authorization from credentials to token +creds=None +"""the file token-gt.json stores access/refresh tokens, and is +created automatically when auth flow completes first time""" +if os.path.exists('token-gt.json'): + creds=Credentials.from_authorized_user_file('token-gt.json',SCOPES) +# If there are no (valid) credentials available, let the user log in +if not creds or not creds.valid: + if creds and creds.expired and creds.refresh_token: + creds.refresh(Request()) + else: + flow=InstalledAppFlow.from_client_secrets_file( + 'credentials-sheets.json', SCOPES) + creds=flow.run_local_server(port=0) + # Save credentials for next run + with open('token-gt.json','w') as token: + token.write(creds.to_json()) + +# build sheets +sheetsServ=build('sheets','v4', credentials=creds) +result=sheetsServ.spreadsheets().values().get(spreadsheetId=SPREADSHEET,\ +range=RANGE).execute() +rows=result.get('values',[]) +texts=list(itertools.chain(*rows)) +text=texts[(random.randint(0,(len(texts)-1)))] +#print(text) + +# build gmail +mailServ=build('gmail','v1', credentials=creds) + +def create_message(sender,to, subject, message_text): + """Create a message for an email. + Args: + sender: Email address of sender + to: Email address of receiver + subject: The subject of the email message + message_text: the text of the email message + + returns: + an object containing a base64url encoded email object + """ + message=MIMEText(message_text) + message['to']=to + message['from']=sender + message['subject']=subject + return{'raw':base64.urlsafe_b64encode(message.as_string().encode()). + decode()} + +LIVE='6055954622@vtext.com' #KATIE +TESTING='6059295681@vtext.com' #JIMMY +message=create_message(sender='me',to=LIVE, +subject='',message_text=text) +#print(message) +eMessage=(mailServ.users().messages(). +send(userId='me', body=message).execute()) \ No newline at end of file diff --git a/octoStatus.py b/octoStatus.py new file mode 100755 index 0000000..0f19efe --- /dev/null +++ b/octoStatus.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 +# octoStatus-ping octoCams and light LED to show status + +from gpiozero import LED +from time import sleep +import os + +ledg0=LED(4) #1 +ledr0=LED(17) #3 +ledg1=LED(27) #5 +ledr1=LED(22) #7 +ledg2=LED(23) #9 +ledr2=LED(6) #11 +ledg3=LED(21) #13 +ledr3=LED(20) #15 +ledg4=LED(19) #17 +ledr4=LED(13) #19 +ledg5=LED(18) #21 +ledr5=LED(24) #23 +ledg6=LED(12) #25 +ledr6=LED(16) #27 + +octoCam0='192.168.0.60' +octoCam1='192.168.0.34' +octoCam2='192.168.0.32' +octoCam3='192.168.0.33' +octoCam4='192.168.0.36' +octoCam5='192.168.0.37' +octoCam6='192.168.0.38' + +while True: + # octoCam0 + response=os.system('ping -c1 '+octoCam0) + if response==0: + ledg0.on() + ledr0.off() + sleep(0.1) + else: + ledg0.off() + ledr0.on() + sleep(0.1) + + # octoCam1 + response=os.system('ping -c1 '+octoCam1) + if response==0: + ledg1.on() + ledr1.off() + sleep(0.1) + else: + ledg1.off() + ledr1.on() + sleep(0.1) + + # octoCam2 + response=os.system('ping -c1 '+octoCam2) + if response==0: + ledg2.on() + ledr2.off() + sleep(0.1) + + else: + ledg2.off() + ledr2.on() + sleep(0.1) + + # octoCam3 + response=os.system('ping -c1 '+octoCam3) + if response==0: + ledg3.on() + ledr3.off() + sleep(0.1) + else: + ledg3.off() + ledr3.on() + sleep(0.1) + + # octoCam4 + response=os.system('ping -c1 '+octoCam4) + if response==0: + ledg4.on() + ledr4.off() + sleep(0.5) + else: + ledg4.off() + ledr4.on() + sleep(0.5) + + # octoCam5 + response=os.system('ping -c1 '+octoCam5) + if response==0: + ledg5.on() + ledr5.off() + sleep(0.5) + else: + ledg5.off() + ledr5.on() + sleep(0.5) + + # octoCam6 + response=os.system('ping -c1 '+octoCam6) + if response==0: + ledg6.on() + ledr6.off() + sleep(0.5) + else: + ledg6.off() + ledr6.on() + sleep(0.5) +# sleep(23) diff --git a/pcfText.py b/pcfText.py new file mode 100644 index 0000000..384869c --- /dev/null +++ b/pcfText.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +import time +import board + +import adafruit_pcf8591.pcf8591 as PCF +from adafruit_pcf8591.analog_in import AnalogIn +from adafruit_pcf8591.analog_out import AnalogOut + +i2c=board.I2C() +pcf=PCF.PCF8591(i2c) + +pcf_in_0=AnalogIn(pcf,PCF.A0) +pcf_out=AnalogOut(pcf,PCF.OUT) + +pcf_out.value=65535 +raw_value=pcf_in_0.value +scaled_value=(raw_value/65535)*pcf_in_0.reference_voltage +print("Pin 0: %0.2fV" % (scaled_value)) +print("") \ No newline at end of file diff --git a/pyportalTEST.py b/pyportalTEST.py new file mode 100644 index 0000000..d98de1c --- /dev/null +++ b/pyportalTEST.py @@ -0,0 +1,20 @@ +import board, time, adafruit_touchscreen +from adafruit_pyportal import PyPortal + +ts = adafruit_touchscreen.Touchscreen(board.TOUCH_XL, board.TOUCH_XR, board.TOUCH_YD, board.TOUCH_YU) + +meals=["/breakfastTime.bmp","/lunchTime.bmp","/dinnerTime.bmp"] + +pyportal = PyPortal() + +mealtime=0 + +while True: + tou=ts.touch_point + if tou: + # TODO: do something when touch is detected + pyportal.set_background(meals[mealtime]) + mealtime=mealtime+1 + if mealtime==3: + mealtime=0 + time.sleep(3) \ No newline at end of file diff --git a/savedButtons.db b/savedButtons.db new file mode 100644 index 0000000000000000000000000000000000000000..5f350d330ea7ca6828bff3ef9318e181b1a39ca2 GIT binary patch literal 12288 zcmeI&J#P~+7zc1Cg|wxlX=w{g$OA(VYN0A(uLw#JFO3u-yny6ho-|hPe0R2Kl}=3E z_$n-X5_b3;tk~yEm250X4F5>?5-#64S%eJ8^)UPvT*)+ z@Qf{gXKer1-nXmIF%){t`gHw$sQdAC@@alNX5tJ12tWV=5P$##AOHafKmY;|fB*y_ z009U<00Izz00bZa0SG_<0uX?}zYqv}^z-}tP1agx?cW`LUKpRv{Wtsnp(pnLXJWWQ z00Izz00bZa0SG_<0ucCL1R7tKK9;O2!b{&-ZrrInrLrN~{wt-FIHMBYJAU`FYzqIM zkR_C+#U$4h2bZcur5zbfE{@$0cSE9~k#andX2gqWrt9EM(ec4FmwJA*Rh3w&$N6=7 zk?PoQS={#}Z`7EEi7cqDyAH329Und-nYsyor7iCcj|Puo>8iL_m&V8e_Y0ZWI(n;` z^@TJs_", calculate) +# Tkinter event loop +root.mainloop() \ No newline at end of file diff --git a/tlvMag.py b/tlvMag.py new file mode 100644 index 0000000..1021e3c --- /dev/null +++ b/tlvMag.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 +import time +import board +import adafruit_tlv493d + +i2c = board.I2C() +tlv=adafruit_tlv493d.TLV493D(i2c) + +while True: + print("X: %s, Y: %s, Z: %s mT" % tlv.magnetic) + time.sleep(1) \ No newline at end of file diff --git a/toDoBox.py b/toDoBox.py new file mode 100644 index 0000000..846c9c0 --- /dev/null +++ b/toDoBox.py @@ -0,0 +1,73 @@ +from tkinter import * +from tkinter import messagebox + +def newTask(): + task=my_entry.get() + if task !="": + lb.insert(END, task) + my_entry.delete(0, "end") + else: + messagebox.showwarning("warning","please enter some task.") + +def deleteTask(): + lb.delete(ANCHOR) + +ws=Tk() +ws.geometry('500x450+500+200') +ws.title('PythonGuides') +ws.config(bg='#223441') +ws.resizable(width=True,height=True) + +frame=Frame(ws) +frame.pack(pady=10) + +lb=Listbox( + frame, + width=25, + height=8, + font=('Times',18), + bd=0, + fg='#464646', + highlightthickness=0, + selectbackground='#a6a6a6', + activestyle='none', +) +lb.pack(side=LEFT,fill=BOTH) + +task_list=[] +for item in task_list: + lb.insert(END,item) + +sb=Scrollbar(frame) +sb.pack(side=RIGHT,fill=BOTH) + +lb.config(yscrollcommand=sb.set) +sb.config(command=lb.yview) + +my_entry=Entry( + ws, + font=('times',24)) +my_entry.pack(pady=20) + +button_frame=Frame(ws) +button_frame.pack(pady=20) + +addTask_btn=Button( + button_frame, + text='Add Task', + font=('times', 14), + bg='#c5f776', + padx=20, + pady=10, + command=newTask) +addTask_btn.pack(fill=BOTH,expand=True, side=LEFT) + +delTask_btn=Button(button_frame, text='Delete Task', + font=('times',14), + bg='#ff8b61', + padx=20, + pady=10, + command=deleteTask) +delTask_btn.pack(fill=BOTH,expand=True,side=LEFT) + +ws.mainloop() \ No newline at end of file diff --git a/token-drive.pickle b/token-drive.pickle new file mode 100644 index 0000000000000000000000000000000000000000..26639554b92d541c3ecebc15bcc88544860f044e GIT binary patch literal 817 zcmZ8f*>2N76b&tHXu46BvOMsDkl-Pkvzj+I&ElqUY$s{Qk&rbRPaHeW*kg~gNl5U( z10TZo@D=zWSExG-cBE`xk*V8Sfu1gYACnI=Acr;onU zosVEIkw`FiiV58XzoK~sIX(k(g6bQvlNJl>i=0RFs*neUbCSL6rHk&I> zYi&}lEycEcTQfCLPz9kWC_QP>NMG}!PdLdQ&NVXXmbx~Sf`K->aWAX0>TRHncz+CY zeb$!@rCbk+=|N*SxmtxYrPriNCqJrqbDe1P5FEr7EMxookpz-45FppX0X_agPr!!= zm@wuApR?J;Vv*T&3Oy^xAa|CHtIZm|HOKT6g4397;4usxcCYeO0;w3j3#f;_MbE(d z2cp~S_)mAUj%OPxa;)fZBA@g*XhqaQwNTLtC*w!r*dEU~wvmuv z!GaIr)7bD8*iDKmc2{R~&zy75`L>M=*EMXMcVWQHQXctuh8<=>n`WhZGs(RFP9A(E zTkpV5CX-?A0y|_I{7U8+mV`VkibH<}dsEd8G`A7gY^3$|T709GlwPYdWRj<}Mm0$k z>y1x>F$jZ*iAe6%Dk0Bzo0nZI;E9AT;>HT8*Tq&OwS=v-T6%)KQ2 zsH=|!GTRyunW#BQGE`X{iegK=8Yy8jcPYqzx2lIh+?>4GOE^_#!a__ zH5G7mzu|RtB-m|kRMqU-4Vq7eN=3{yb1pdm`>6zLw)y=~0edMxk?Ubfjy{uP@F4+A z#ytA5Pzb{?zs?kT7R@7fSxBQTP|wG3Moo+vB_|M^q$D$}!@y>DWRDe)P2pRg)4;dL zDR_I2dsCAC=+{?yvR*~DmGmc(OP+#uvdUlZ6`@+J2$eFQL%iV;i_P((j7rQ!3sO3- z>cy31*aEUFD-S)7Zqx@9`^a@z!j_sK&(=|F_$f}B%EVrl!Y&xcFBUoA(U&t9aO`VazWpL{G?i{0Al`j->(>Sv(k{{mZf3SR&K literal 0 HcmV?d00001 diff --git a/token.json b/token.json new file mode 100644 index 0000000..810c1ec --- /dev/null +++ b/token.json @@ -0,0 +1 @@ +{"token": "ya29.A0ARrdaM8LfNgPEblmpHzcHgeOMxntZKuD0CvH-o3aThmUQA8HUOu9HKDg0FKcPOR3dCqcjnwb7E7CdtemQLViNvlg7yl2mXhCYy7eSNj39MBbjEEVtuw0oUYtskhhLYOlAj7jGwdYa_ya44XF2CZZ6b9gaHrJFkg", "refresh_token": "1//04_gG0Ce3LrzTCgYIARAAGAQSNwF-L9IrRvAD1TnhMTquSsDTBN3mW57DTI6IYQq3nsvvz3ctfk00mtFKxkzpOMl3qXRhi6puyLI", "token_uri": "https://oauth2.googleapis.com/token", "client_id": "383597059543-c3gpqitjek4c2tockq267f0vigl9ciii.apps.googleusercontent.com", "client_secret": "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", "scopes": ["https://www.googleapis.com/auth/calendar.readonly"], "expiry": "2022-03-31T17:18:21.171843Z"} \ No newline at end of file diff --git a/uart.py b/uart.py new file mode 100644 index 0000000..b551674 --- /dev/null +++ b/uart.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +import serial, time + +ser=serial.Serial('/dev/ttyACM0', 9600,timeout=.5) # serial connection + +logFile=open('lightLog.txt','w') # open and write to lightLog.txt + +while True: + now = time.localtime() # year[0], month[1], day[2], hour[3], minute[4], second[5], weekday[6], yearday[7] + timestamp=(str(now[3])+":"+str(now[4])+":"+str(now[5])+" "+str((now[1]))+"/"+str(now[2])+"/"+str(now[0])) + if int(now[3]) == 7: # if hour is 7 am or greater, STOP collecting data + logFile.close() + exit() # no error message, or breaks crontab + else: + data=ser.readline() + light=str(data).encode("utf-8") + a=light.strip(b"b'") # remove beginning empty space + Light=int(float(a[:-4])) # remove last 4 bits, leaving only float->int of light_val + logFile.write("Ambient Light: "+str(Light)+" "+timestamp+"\n") + logFile.flush() + print((Light),timestamp) + time.sleep(60) # how often to sample data line \ No newline at end of file diff --git a/vcnlCounter.py b/vcnlCounter.py new file mode 100644 index 0000000..eb7c668 --- /dev/null +++ b/vcnlCounter.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +import time +import datetime +import board +import adafruit_vcnl4040 + +i2c = board.I2C() +sensor = adafruit_vcnl4040.VCNL4040(i2c) +logFile=open('lightLog.txt','w') +while True: + ti=datetime.datetime.now() + logFile.write("Light: %d lux\n" % sensor.lux) + logFile.write(ti.strftime("%I:%M %p\n")) + logFile.flush() + print("Light: %d lux" % sensor.lux) + print(ti.strftime("%I:%M %p")) + time.sleep(60.0) \ No newline at end of file diff --git a/vemlLuxtest.py b/vemlLuxtest.py new file mode 100644 index 0000000..2c0adbb --- /dev/null +++ b/vemlLuxtest.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 +import time +import board +import adafruit_veml7700 +i2c=board.I2C() +veml7700=adafruit_veml7700.VEML7700(i2c) +while True: + print("ambient light:",veml7700.light) + time.sleep(60) \ No newline at end of file diff --git a/warHammer.py b/warHammer.py new file mode 100644 index 0000000..b3cefbb --- /dev/null +++ b/warHammer.py @@ -0,0 +1,64 @@ +from machine import Pin, PWM +import time +import _thread + +red=PWM(Pin(15)) +red.freq(5000) +red.duty_u16(65535) +blue=PWM(Pin(14)) +blue.freq(5000) +blue.duty_u16(0) +green=PWM(Pin(13)) +green.freq(5000) +green.duty_u16(0) + +led0=Pin(16,Pin.OUT) #BR1 +led1=Pin(17,Pin.OUT) #BR2 +led2=Pin(18,Pin.OUT) #BR3 +led3=Pin(19,Pin.OUT) #BR4 +led4=Pin(20,Pin.OUT) #BR5 +br=[led0,led1,led2,led3,led4] #br[i].toggle() + +ledD=Pin(22,Pin.OUT) #blue LED +ledD.value(0) +ledA=Pin(21,Pin.OUT) #red LED +ledA.value(1) + +button0=Pin(12,Pin.IN,Pin.PULL_DOWN) #control ledD&ledA +global button0_pressed +button0_pressed=False +def button0_reader_thread(): + global button0_pressed + while True: + if button0.value()==1: + button0_pressed=True + time.sleep(0.01) +_thread.start_new_thread(button0_reader_thread,()) +while True: + if button0_pressed==True: + ledA.toggle() + ledD.toggle() + time.sleep(1) + button0_pressed=False + +button1=Pin(11,Pin.IN,Pin.PULL_DOWN) #control RGB and phases +global button1_pressed +global i +global p +button1_pressed=False +i=0 +p=0 +def button1_reader_thread(): + global button1_pressed + while True: + if button1.value()==1: + button1_pressed=True + time.sleep(0.01) +while True: + if button1_pressed==True: + + +# button0 will handle switching ledD(blue) and ledA(red) to indicate player turn +# led0-4 indicate battle round (1-5), light when command phase starts +# RGB indicates battle phase (command, movement, psychic, shooting, charge, fight, morale) +# button1 change battle phase, loop through 7 phases;start start new command phase=new battle round \ No newline at end of file -- 2.47.3