Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Passing by reference or value
Post: RE: Passing by reference or value
Thanks, I'll look into those alternative methods. These are custom classes, so I suppose if I wanted something more elegant, I could code something myself. Good to know there are alternatives. |
|
CanadaGuy |
General Coding Help |
4 |
2,984 |
Nov-12-2018, 08:44 PM |
|
|
Thread: Passing by reference or value
Post: RE: Passing by reference or value
(Nov-12-2018, 08:36 PM)Gribouillis Wrote: You could use
new_list = [copy.copy(x) for x in (a, b, a, b, a)]
Thanks. That is definitely cleaner so +1 for that. Is the copy module the only way to achie... |
|
CanadaGuy |
General Coding Help |
4 |
2,984 |
Nov-12-2018, 08:39 PM |
|
|
Thread: Passing by reference or value
Post: Passing by reference or value
Being new to Python, I figured I was bound to run into something like this. I'm used to programming where values are passed around, and I had to go to great lengths to operate on references. Now in Py... |
|
CanadaGuy |
General Coding Help |
4 |
2,984 |
Nov-12-2018, 07:57 PM |
|
|
Thread: Dynamically Sized Widget
Post: RE: Dynamically Sized Widget
(Nov-12-2018, 12:42 AM)Larz60+ Wrote: Read about sizers: https://wxpython.org/Phoenix/docs/html/s...rview.html
Is there a particular section you had in mind? I'm using sizers for layout (i.e. no abs... |
|
CanadaGuy |
GUI |
3 |
3,913 |
Nov-12-2018, 12:47 AM |
|
|
Thread: Dynamically Sized Widget
Post: Dynamically Sized Widget
I have a wx.Dialog box. In that dialog, I have widgetA. WidgetA contains widgetB. WidgetB can change its size at runtime in response to user selections.
When widgetB gets larger, then widgetA, and th... |
|
CanadaGuy |
GUI |
3 |
3,913 |
Nov-11-2018, 10:48 PM |
|
|
Thread: How to customize x axis in matplotlib.pyplot for a scatter plot?
Post: RE: How to customize x axis in matplotlib.pyplot f...
Your first step would probably be to convert your date list from the current format, to a Python supported date format. Once you have that, then plotting the date list should look like the link I post... |
|
CanadaGuy |
Homework |
9 |
8,218 |
Nov-09-2018, 08:02 PM |
|
|
Thread: How to customize x axis in matplotlib.pyplot for a scatter plot?
Post: RE: How to customize x axis in matplotlib.pyplot f...
Can't promise anything, but you could post a truncated version of your data (maybe 10 points or so) so we can see exactly what it looks like. |
|
CanadaGuy |
Homework |
9 |
8,218 |
Nov-09-2018, 07:36 PM |
|
|
Thread: How to customize x axis in matplotlib.pyplot for a scatter plot?
Post: RE: How to customize x axis in matplotlib.pyplot f...
Or this, which I think directly addresses setting an axis to a date range:
https://matplotlib.org/gallery/text_labe.../date.html |
|
CanadaGuy |
Homework |
9 |
8,218 |
Nov-09-2018, 07:03 PM |
|
|
Thread: Responsibility in MVP Pattern
Post: RE: Responsibility in MVP Pattern
(Nov-08-2018, 10:09 PM)Larz60+ Wrote: I've worked 'under the covers' all my programming life (since 1968), always avoiding the middle man, so probably not one to contribute here. Hope I haven't mess... |
|
CanadaGuy |
GUI |
10 |
5,323 |
Nov-09-2018, 12:54 AM |
|
|
Thread: Responsibility in MVP Pattern
Post: RE: Responsibility in MVP Pattern
Maybe I can narrow down my question to make it a little more general.
After studying a few concrete examples, I think I noticed a pattern to the patterns. Rather than one object (model, view, or pres... |
|
CanadaGuy |
GUI |
10 |
5,323 |
Nov-08-2018, 08:52 PM |
|
|
Thread: Responsibility in MVP Pattern
Post: RE: Responsibility in MVP Pattern
(Nov-08-2018, 03:18 PM)Larz60+ Wrote: It doesn't, my confusion with Advanced User Interface (AUI) ( https://wxpython.org/Phoenix/docs/html/w...index.html ). Sorry,
you may still be interested in the... |
|
CanadaGuy |
GUI |
10 |
5,323 |
Nov-08-2018, 03:20 PM |
|
|
Thread: Responsibility in MVP Pattern
Post: RE: Responsibility in MVP Pattern
(Nov-08-2018, 03:56 AM)Larz60+ Wrote: Quote: I thought I was on the Phoenix code base, but I'll check tomorrow (I'm python 3.7)
you may be, if you installed with pip using:
pip install wxpythonyou p... |
|
CanadaGuy |
GUI |
10 |
5,323 |
Nov-08-2018, 02:11 PM |
|
|
Thread: Responsibility in MVP Pattern
Post: RE: Responsibility in MVP Pattern
(Nov-08-2018, 02:08 AM)Larz60+ Wrote: you must be running the old wxpython.
What about my post suggests I'm running old wxpython? I thought I was on the Phoenix code base, but I'll check tomorrow (I... |
|
CanadaGuy |
GUI |
10 |
5,323 |
Nov-08-2018, 02:13 AM |
|
|
Thread: Responsibility in MVP Pattern
Post: Responsibility in MVP Pattern
I'm new to the concept of enforcing some kind of design pattern in the application (using wxPython) I'm trying to write according to MVP (model-view-presenter) principles. I'm having some difficulty i... |
|
CanadaGuy |
GUI |
10 |
5,323 |
Nov-08-2018, 12:48 AM |
|
|
Thread: Nested Imports
Post: RE: Nested Imports
(Nov-08-2018, 12:19 AM)Larz60+ Wrote: 'if' statements will not stop error events from crashing system, try/except will
True. That gives me something to think about. |
|
CanadaGuy |
General Coding Help |
4 |
2,770 |
Nov-08-2018, 12:20 AM |
|
|
Thread: Nested Imports
Post: RE: Nested Imports
Thanks for the reply. Is try/except a better approach than using an if statement? In this case, I know exactly what statement will work under each condition so try except seems a little less direct. |
|
CanadaGuy |
General Coding Help |
4 |
2,770 |
Nov-07-2018, 10:48 PM |
|
|
Thread: Nested Imports
Post: Nested Imports
I'm trying to create modules for my application that are themselves testable on their own. I would like to have the following directory structure:
\application.py
\support\module1.py
\support\module2... |
|
CanadaGuy |
General Coding Help |
4 |
2,770 |
Nov-07-2018, 06:44 PM |
|
|
Thread: Messenger Library for MVC-like Patterns
Post: RE: Messenger Library for MVC-like Patterns
(Nov-05-2018, 04:34 PM)nilamo Wrote: I'm not sure you need a library for it. The model/view/controller are just classes.
*snip*
Is there something you currently use in another language that you'r... |
|
CanadaGuy |
General Coding Help |
2 |
2,417 |
Nov-05-2018, 04:46 PM |
|
|
Thread: Messenger Library for MVC-like Patterns
Post: Messenger Library for MVC-like Patterns
I'm new to Python, and while I've done a fair bit of programming in general, the bulk has been highly unstructured and almost entirely for my own purposes. I'm doing a small application that has a few... |
|
CanadaGuy |
General Coding Help |
2 |
2,417 |
Nov-05-2018, 04:00 PM |
|
|
Thread: Python Attributes
Post: RE: Python Attributes
(Nov-02-2018, 02:57 PM)Gribouillis Wrote: From the point of view of OOP design, I'd say that there is a design problem if a class has too many attributes. It means that some of these attributes coul... |
|
CanadaGuy |
General Coding Help |
4 |
3,006 |
Nov-02-2018, 03:05 PM |