Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Combinations of list of lists
Post: RE: Combinations of list of lists
Thanks Buran.
I'm new to itertools, but I'll have a look tomorrow.
Danny
I've just found a thread from heiner55 which solves my problem in 1 line:
https://python-forum.io/Thread-How-to-fi...t-of-l... |
|
dannyH |
General Coding Help |
2 |
3,354 |
May-14-2018, 09:54 PM |
|
|
Thread: Combinations of list of lists
Post: Combinations of list of lists
I have a list of 25 lists of integers:
L = [[1,2,3], [4,5,6], [7,8],[9], …]
I want to create all possible combinations using all the integers from each list:
answer = [[1,4,7,9,...], [2,4,7,9,...],... |
|
dannyH |
General Coding Help |
2 |
3,354 |
May-14-2018, 05:29 PM |
|
|
Thread: Unwanted variable change in module
Post: RE: Unwanted variable change in module
Many thanks for the reply.
In my main program I had the line:
next1 = old1[:]
before I called the module, which I thought would be OK. copy.deepcopy() solves the problem.
Regards, Danny |
|
dannyH |
General Coding Help |
2 |
2,691 |
May-08-2018, 05:33 PM |
|
|
Thread: Unwanted variable change in module
Post: Unwanted variable change in module
I have a module that takes 2 lists and creates a new list from them, but somehow it manages to change one of the input lists when I don't want it to:
def repeatAddCode(newList, oldList):
# Version: ... |
|
dannyH |
General Coding Help |
2 |
2,691 |
May-08-2018, 04:08 PM |
|
|
Thread: Instances in classes
Post: RE: Instances in classes
Thanks. That looks like a safer solution. |
|
dannyH |
General Coding Help |
6 |
4,988 |
Apr-20-2017, 05:55 PM |
|
|
Thread: Instances in classes
Post: RE: Instances in classes
Many thanks for that again. My actual code (not working yet) is:
class gridSquare(superGrid):
new = [['0',' ','F','O','W','E','K','T','A','H'],\
['1','A','G','O','X','E','L','U',... |
|
dannyH |
General Coding Help |
6 |
4,988 |
Apr-20-2017, 03:24 PM |
|
|
Thread: Instances in classes
Post: RE: Instances in classes
Many thanks for that - I don't think I would ever have found it without help.
It doesn't immediately solve my problem, as the new square is actually filled with 100 different initial values - the exa... |
|
dannyH |
General Coding Help |
6 |
4,988 |
Apr-20-2017, 03:01 PM |
|
|
Thread: Instances in classes
Post: Instances in classes
When I create 2 instances of a class and modify one, the other also gets modified. What am I doing wrong?
class superGrid:
def __init__(self, square, size = 10):
self.square = squar... |
|
dannyH |
General Coding Help |
6 |
4,988 |
Apr-20-2017, 01:02 PM |
|
|
Thread: Update value in Entry widget
Post: RE: Update value in Entry widget
Many thanks. That is the functionality I was looking for, although the code is a bit more complicated than I am used to writing. Now that I have more free time I will investigate tkinter, classes and ... |
|
dannyH |
GUI |
7 |
27,685 |
Apr-02-2017, 10:12 AM |
|
|
Thread: Update value in Entry widget
Post: RE: Update value in Entry widget
Hi Barrowman.
Thanks for the reply. I'll have a look at the after method and see if I can get it to work. |
|
dannyH |
GUI |
7 |
27,685 |
Mar-31-2017, 09:54 PM |
|
|
Thread: Update value in Entry widget
Post: RE: Update value in Entry widget
Hi metulburr.
Thanks for the quick reply. Your solution is not quite what I want. I have been "programming" in python for quite a few years as a means of solving some cryptographic puzzles, but with... |
|
dannyH |
GUI |
7 |
27,685 |
Mar-26-2017, 07:05 AM |
|
|
Thread: Update value in Entry widget
Post: Update value in Entry widget
I'm very new to tkinter. How do I get a value to display every time it changes? The code below only shows the last entry in the Entry widget, but print shows all the values (python 3.6.0)
from tkinte... |
|
dannyH |
GUI |
7 |
27,685 |
Mar-25-2017, 11:18 PM |