Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: sorting nested dict according to values
Post: RE: sorting nested dict according to values
Thanks a lot for your suggestions!
A version without lambda probably doesn't exist in Python 3, I fear?
lambda is too much magic for me, I prefer understanding what I am doing.
About the hardcoded k... |
|
merlem |
General Coding Help |
6 |
17,697 |
Apr-01-2017, 08:17 PM |
|
|
Thread: sorting nested dict according to values
Post: sorting nested dict according to values
What I have: a nested dict (see code), with integer values as lowest "level".
What I wish to reach: a couple of lists with pairs of the highest level key and the values, while the intermediate keys ar... |
|
merlem |
General Coding Help |
6 |
17,697 |
Apr-01-2017, 06:09 PM |
|
|
Thread: update a variable in parent window after closing its toplevel window
Post: RE: update a variable in parent window after closi...
I'm not sure whether I really understand this problem.
However, if the publisher is not a solution, it would be helpful to know in which line of your code the error occurs. I can't assing that until ... |
|
merlem |
GUI |
5 |
9,195 |
Mar-13-2017, 12:32 PM |
|
|
Thread: Determine Number Fulfilling Three Inputs
Post: RE: Determine Number Fulfilling Three Inputs
(Mar-13-2017, 02:33 AM)Larz60+ Wrote: then add together
Wouldn't that give the result for how many characters fullfill any of the conditions? Or did I misunderstood?
Assuming that the three alread... |
|
merlem |
Homework |
3 |
3,639 |
Mar-13-2017, 12:26 PM |
|
|
Thread: update a variable in parent window after closing its toplevel window
Post: RE: update a variable in parent window after closi...
You could also consider to use the module 'Publisher'. Prepare a publisher in the toplevel window that sends a message in case of being destroyed (or a publisher at the same point where you give the c... |
|
merlem |
GUI |
5 |
9,195 |
Mar-12-2017, 05:10 PM |
|
|
Thread: if with range
Post: RE: if with range
(Mar-08-2017, 08:36 PM)Federer Wrote: I want to check if any of this variable over 200 must print not within range
If the only necessary check is whether any variable is (not) above 200, maybe this ... |
|
merlem |
Homework |
6 |
5,204 |
Mar-09-2017, 04:49 PM |
|
|
Thread: Use of Multiple Object
Post: RE: Use of Multiple Object
The problem is the position of the second line.
In this way, *all* instances of the class will share the same array. So, the array of the second one starts with the same elements as the array of the ... |
|
merlem |
General Coding Help |
5 |
4,666 |
Mar-08-2017, 10:04 AM |
|
|
Thread: Adding text to files easy but I need help
Post: RE: Adding text to files easy but I need help
You already have a nice description of the necessary steps in the task.
Now, search for the appropriate commands: what to use for user input, file handling (opening and closing, reading from and writ... |
|
merlem |
Homework |
2 |
4,367 |
Mar-08-2017, 09:53 AM |
|
|
Thread: LibreOffice python makros: official documentation?
Post: LibreOffice python makros: official documentation?
Actually I try to teach myself writing python makros for LibreOffice. However, I can't find the official documentation for this. I came across some tutorials and examples when searching the web, but t... |
|
merlem |
Bar |
0 |
2,406 |
Mar-07-2017, 12:21 PM |
|
|
Thread: Encapsulation issue
Post: RE: Encapsulation issue
I only know the answer for wxpython. There an own module exist for that kind of things, the 'Publisher':
https://wxpython.org/docs/api/wx.lib.pub...class.html
I guess that other toolkits also have an... |
|
merlem |
General Coding Help |
4 |
4,006 |
Mar-07-2017, 12:11 PM |
|
|
Thread: separating different parts of a listbox
Post: RE: separating different parts of a listbox
If I understand the problem (I'm far from being sure in that point), then you might consider using .split(). |
|
merlem |
GUI |
3 |
3,839 |
Mar-04-2017, 08:50 AM |
|
|
Thread: How to exit after a try exception?
Post: RE: How to exit after a try exception?
I would recommend to omit the 'else'.
try:
result = x / y
print("result is", result)
except ZeroDivisionError:
print("division by zero!")If you predefine a 'result', you can also do:
resu... |
|
merlem |
General Coding Help |
11 |
57,662 |
Mar-04-2017, 08:44 AM |
|
|
Thread: Is Python Suitable?
Post: RE: Is Python Suitable?
I would also say, yes, it's surely worth a try.
And: you should consider using numpy from the beginning. There are some tutorials online, but I can't evaluate the quality. Probably those who work with... |
|
merlem |
Data Science |
3 |
4,190 |
Feb-28-2017, 12:19 PM |
|
|
Thread: TypeError: request for something already fulfilled?
Post: RE: TypeError: request for something already fulfi...
Thanks a lot, that makes it much more clear to me! |
|
merlem |
GUI |
11 |
9,314 |
Feb-24-2017, 11:06 AM |
|
|
Thread: I need someone to write an algorithm!!!!
Post: RE: I need someone to write an algorithm!!!!
In Python, I guess?
# prerequisite: have a username for output
username = "has-to-come-from-somewhere"
# output
print(username) |
|
merlem |
General Coding Help |
3 |
3,768 |
Feb-24-2017, 11:04 AM |
|
|
Thread: TypeError: request for something already fulfilled?
Post: RE: TypeError: request for something already fulfi...
Oh. Unfortunately, 'item' is nowhere explained in the docs (as far as I can say).
How do I make one, then?
Edit:
I checked the tutorials
https://wiki.wxpython.org/GridBagSizerTutorial
https://github.... |
|
merlem |
GUI |
11 |
9,314 |
Feb-23-2017, 01:55 PM |
|
|
Thread: TypeError: request for something already fulfilled?
Post: RE: TypeError: request for something already fulfi...
Yes. That's the 'item'. The 'pos' is the second argument. |
|
merlem |
GUI |
11 |
9,314 |
Feb-23-2017, 01:24 PM |
|
|
Thread: TypeError: request for something already fulfilled?
Post: RE: TypeError: request for something already fulfi...
One case more in these things...
import wx
gridcontent = [["1", "2", "3", "4"],
["5", "6", "7", "8"]]
class Mainframe(wx.Frame):
def __init__(self, parent, id, title):
wx... |
|
merlem |
GUI |
11 |
9,314 |
Feb-23-2017, 01:03 PM |
|
|
Thread: Solutions to this questions
Post: RE: Solutions to this questions
Maybe the indentation of the second-to-last row may cause problems? |
|
merlem |
Homework |
8 |
148,319 |
Feb-23-2017, 10:48 AM |
|
|
Thread: typing farsi (persian) in python
Post: RE: typing farsi (persian) in python
Wasn't that me, mentioning XP? :-o
(I tried to find some information about what OS gray is using but could not find some. Did I miss it?) |
|
merlem |
GUI |
33 |
207,938 |
Feb-23-2017, 08:39 AM |