Anki add-on - Help needed
Is anybody here able to help me finish off an Anki add-on? If you're not
familiar with it, Anki (http://ankisrs.net/) is an open source, cross
platform flashcard learning program, in PyQT. It's extensible, with add-
ons.
Thing is, I'm not a programmer, but I've managed to make my own add-on by
trying to figure out how other people's add-ons work. I've got something
that works, but it needs finishing off.
There is a lot I don't understand, but I've got this snippet which will
retrieve a value associated with the key 'dictKey' from a dictionary held
in a file. However, it will only do it if I open the Options dialog in
Anki (I'm guessing that's what DeckConf.loadConf is about). How can I get
that value for use in another function, without having to open the dialog?
[code]
from aqt.deckconf import DeckConf
from anki.hooks import wrap
def load_dictVal(self):
c = self.conf
x = c.get('dictKey')
print(x)
DeckConf.loadConf = wrap(DeckConf.loadConf, load_dictVal)
[/code]
The dictionary is in a file at (on Linux) ~/Anki/User 1/collection.anki2.
'User 1' may vary, and each user has their own collection.anki2 file. The
file's header says it's 'SQLite format 3'.
Secondly, separate from the above, I want to get a True/False value from
whether a deck is currently being studied? Maybe whether the review screen
is open, or something?
Any help would be greatly appreciated.
--
Stew
--
https://mail.python.org/mailman/listinfo/python-list
cmd prompt does not recognizes python command on Windows 7
Hi Everyone i have installed python 3.5 , but the python command is not recognized C:\Users\sharmaaj>python 'python' is not recognized as an internal or external command, operable program or batch file. what should i do to run python commands. thanks everyone for reading my post. >From Ajay -- https://mail.python.org/mailman/listinfo/python-list
Re: Assigning a function to sys.excepthook doesn't work in WSGI
On Wednesday, February 18, 2015 at 7:52:19 PM UTC+3, Ian wrote: > > sys.excepthook is called just before the interpreter exits due to an > exception. In a mod_wsgi environment, having the interpreter exit just > because of an exception would be undesirable. I don't know exactly > what it's doing under the hood, but I would assume that the exception > never makes it to sys.excepthook because the gateway itself is > catching the exception in order to generate the 500 response. > > > I looked through the documentation, but unable to find the answer. Are > > there any ways to handle uncaught by try..except exceptions under mod_wsgi? > > Here is what PEP has to say about error handling: > https://www.python.org/dev/peps/pep-/#error-handling Thank you for your reply, it clarifies everything. Actually, I've missed that PEP in my studies. -- https://mail.python.org/mailman/listinfo/python-list
robust optimisation
Dear all, I have a LP model here as follow: Min = .42*x1 + .56*x2 + .70*x3; S.t. x1 + x2 + x3 = 900; x1 <= 400 * y1; x2 <= 700 * y2; x3 <= 600 * y3; 30*x1 <= 12500; 40*x2 <= 2; 50*x3 <=15000; .15*x1 + .2*x2 +.15*x3 >= 100; .2*x1 + .05*x2 + .2*x3 >= 100; .25*x1 + .15*x2+ .05*x3 >= 150; y1+y2+y3 = 2; xi>=0, yi=0, if x=o yi=1, if x>=o The constraints .15*x1 + .2*x2 +.15*x3 >= 100; .2*x1 + .05*x2 + .2*x3 >= 100; .25*x1 + .15*x2+ .05*x3 >= 150; have uncertainties in x1, x2, and x3 coefficients. I want to know how can I make a robust optimisation model for this LP model? for example, if we know that all the coefficients have variations about 30%. Thank you, Shab -- http://mail.python.org/mailman/listinfo/python-list
Re: Am I doing this wrong? Why does this seem so clumsy (time, datetime vs. DateTime)
On Sep 19, 7:22 pm, Schif Schaf wrote:
> The other day I needed to convert a date like "August 2009" into a
> "seconds-since-epoch" value (this would be for the first day of that
> month, at the first second of that day).
You could use Time::Piece:
[ss...@localhost ~]$ perl -lMTime::Piece -e'$t=Time::Piece->strptime
("August 2009","%b %Y"); print $t->epoch'
1249084800
--
http://mail.python.org/mailman/listinfo/python-list
You [email protected] are not member (linux-sh ML)
You are not a member of this mailing list <[EMAIL PROTECTED]>. If you know the general guide of this list, please send mail with the mail body guide to the address [EMAIL PROTECTED] where guide is equal to GUIDE for case insensitive. -- http://mail.python.org/mailman/listinfo/python-list
