
-
-
cvp
@RocketBlaster05 very quick and dirty. Before running it the first time, remove your current total.txt file
import ui import os from datetime import date v = ui.View() v.background_color = 'white' fil = 'total.txt' if os.path.exists(fil): with open(fil,mode='rt') as f: r = f.read() t,d = r.split('=') tot = int(t) else: tot = 0 b = ui.ButtonItem() b.title = 'increase' def increase(sender): global tot tot += 1 v.name = str(tot) with open(fil,mode='wt') as f: f.write(str(tot)+'='+str(date.today())) b.action = increase if d == str(date.today()): b.enabled = False v.right_button_items = (b,) v.name = str(tot) v.present()
-
cvp
@RocketBlaster05 you could store in the file, the today date and the total and only enable the button if the stored date is not today
-
cvp
@RocketBlaster05 said:
Its going to revolve around setting daily limits to things if you know anything about that.
English is far to be my mother language, sorry, I don't understand your sentence 🤯
-
-
cvp
@Kasualpython I don't have any hope to see this feature and you can always write here a request. In the past, the developer did read this forum and even wrote answers but not for a long period of time. Personally, I still hope he will come back with a new version but even his Twitter is inactive.
Thus, wait and pray -
-
cvp
@Kasualpython said:
because you cant
Exactly. Don't forget that Google Drive is not a file system...This explains that.
-
cvp
@RocketBlaster05 try
import ui import os v = ui.View() v.background_color = 'white' fil = 'total.txt' if os.path.exists(fil): with open(fil,mode='rt') as f: tot = int(f.read()) else: tot = 0 b = ui.ButtonItem() b.title = 'increase' def increase(sender): global tot tot += 1 v.name = str(tot) with open(fil,mode='wt') as f: f.write(str(tot)) b.action = increase v.right_button_items = (b,) v.name = str(tot) v.present()
-
cvp
@RocketBlaster05 you could save your score in a file, either at each increase, either at close of program. The program would also need to read the file at its begin.