« first day (824 days earlier)      last day (1364 days later) » 

2:34 AM
0
Q: Picking a random word in python

Chantal111I have a tuple which contains three lists in python and I want the interpreter to pick a random word from each list to make a sentence. How do I do this? An example of what i'm saying is this: Tuple = (['hi','hey','hello] ['funny','happy',sad']['guy','man','boy']) my actual lists contain 100 w...

 
 
4 hours later…
6:36 AM
0
Q: Am I rigth that anyone can use PyQt free of charge for commercial and closed source applications?

Peter ZagubisaloThis is a question about licening mechanics of PyQt, GPL and Riverbank GPL Exception. The whole point of the question: Am I rigth that anyone can use PyQt free of charge for commercial and closed source applications with some user experience degradation penalty? The main point is that the River...

 
 
2 hours later…
8:33 AM
0
Q: printing out python binary tree from python list

ross.cI want to define a function called list_tree(list) which returns a tree but has the list values laid out in level order and the values that are None have no value at that spot. For example this list [2, 29, 4, 26, None, None, 2, None, None, None, None, None, None, 9, None, end]. Would print out ...

0
Q: Is it legal to distubute Python commercial and closed source application together with QtPy or PyQtGraph linked to PySide?

Peter ZagubisaloThis question is a twin brother of the following question: Am I rigth that anyone can use PyQt free of charge for commercial and closed source applications?. But it's still differs in important details. The previous question is about permission. This question is about restrictions. QtPy and PyQt...

0
Q: How to properly set a different formatter for a specific logger's child?

zezolloFor certain modules or functions, I want to have a different format for the logged messages. I have done this in a way that looks a bit hacky: I have set a special Logger, containing a special Handler, that has the right Formatter. Here is a simplified portion of my configuration file: formatte...

 
 
7 hours later…
3:17 PM
0
Q: Place of a threading module in a MVP design pattern in Python

DRzI am working on a GUI that displays images, 1 image or many (a video). Some processing is needed before displaying an image. Hence, I would like to do some threading in order to keep the GUI interactive while images are repeatedly shown (while a video is being played). I am not comfortable ...

 
3:59 PM
0
Q: simple form validation

maxi've just started to learn python /django .. im coming from php world ...i mostly struggle with None values which are new to me .. in php i mostly did my boll checking with true/false but in python None is favored .. .also collections (list , dictionary) are different here but javascript has prep...

 
4:15 PM
0
Q: Small Python class for Lindenmayer Systems

AnnaL-systems are basically rules for recursively rewriting a string, which can be used to characterize e.g. some fractal and plant growth. I wrote a small class to represent deterministic L-systems and used it for two examples. Any comments would be greatly appreciated, especially about the class d...

 
5:11 PM
-1
Q: Type declaration or dynamic typing in Python?

mynameismevinIn Python, what is the difference in these declarations? my_list = list() my_list = [] my_dict = {} my_dict = dict() Are they interpreted the same, and why would you use one over the other? I haven't seen or noticed a difference.

 
 
2 hours later…
6:41 PM
public DispatcherTimer _timer;
_timer = new DispatcherTimer(DispatcherPriority.Render);
_timer.Interval = TimeSpan.FromSeconds(15);
_timer.Tick += new EventHandler(timer1_Tick);
_timer.Start();
The method that sends the messages:
public void timer1_Tick(object sender, EventArgs e)
{
MessengerInstance.Send<NotificationMessage>(new NotificationMessage("fingerprintTimer"));
MessengerInstance.Send<NotificationMessage>(new NotificationMessage("RebootFriends"));
}
The constructor that register the messages: MessengerInstance.Register<NotificationMessage>(this, (message) =>
{ // Checks the actual content of the message.
switch (message.Notification)
{
case "fingerprintTimer":
au = AuthSingleton.Instance.getAuthUser();
friends.Clear();
auxCheckins.Clear();
Friends.Clear();
loadFriends();
break;
default:
break;
}
});
 
4 messages moved from C#
 
 
2 hours later…
9:09 PM
0
Q: Algorithm for Multiple Choice Test Prep App

doremiI'm working on app that helps students prepare for a specific exam. I have a database of 1000 questions, question categories, multiple choice options, hints and correct answers. Today, the app simply presents random multiple questions with no weighting between categories. Source: https://github...

 
9:33 PM
2
Q: Check that files don't contain Unicode

JonasI use this code to check that all files in a directory are free from Unicode and non-printable characters. Can I improve the structure of the code? #!/usr/bin/env python3 import argparse import os import string import sys def main(input_folder): for directory, subdirs, files in os.walk(in...

 
9:45 PM
0
Q: Maximum profit from buy and sell offers

kazemakaseGiven a list of sell offers and a list of buy offers for an item I want to determine how many units to trade for maximum profit. Each offer consists of a price and a maximum amount of units being traded. Offers can be partially fulfilled (i.e. if a buyer/seller wants to trade 100 units, it's ok ...

 
 
2 hours later…
11:25 PM
0
Q: Histogram of a string

DanI'm teaching myself Python and when a friend posted this sentence Only the fool would take trouble to verify that his sentence was composed often a's, three b's, four c's, four d's, forty-six e's, sixteen f's, four g's, thirteen h's, fifteen i's, two k's, nine l's, four m's, twenty-five...

 

« first day (824 days earlier)      last day (1364 days later) »