Quantcast

wxDateTime value changes when it shouldn't

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

wxDateTime value changes when it shouldn't

toyotasonice
When my script executes commands like "print('check'), the value of my wxDateTime changes.  I can watch this happen while using PyCharm debug to view the variable.  Problems also occur when I run the code from the terminal.

I’ve run both the mini-program provided here, and my whole project three ways:
  1.  from the terminal,
  2. from PyCharm with Run
  3. from PyCharm with Debug.

The following files are attached for you:


Crazy dates log.docx – all three runs of the mini-program with the code at the end.

 Whole program output.docx – output from all three runs of the whole program.

You will see that the console output from the terminal and PyCharm Run are the same, while the Debug shows that the dates have unexpectedly changed between the end and start of the loop.
Oddly, you will also see that the date used for the output is completely different from any of the dates shown in the consoles. It was expected to be 01/01/01.

So there seems to be a problem with the output regardless of which way I run the program, but PyCharm Debug is the only way to see anything wrong during the run.

I hope you have some ideas for me.

Thanks.

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

crazy dates log.docx (28K) Download Attachment
whole program output.docx (20K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: wxDateTime value changes when it shouldn't

Vadim Zeitlin-4
On Wed, 26 Apr 2017 05:58:05 -0700 (PDT)  wrote:

> When my script executes commands like "print('check'), the value of my
> wxDateTime changes.  I can watch this happen while using PyCharm debug to
> view the variable.  Problems also occur when I run the code from the
> terminal.

 I'm afraid that if the output is different between running the program
normally and debugging it in PyCharm, then it's a PyCharm problem and not
wxDateTime one. Maybe you can find more help in PyCharm support forums, but
unless you can reproduce the problem without it, I don't think anybody here
can help you.

 BTW, why are you using wxDateTime in the first place, instead of using the
standard datetime module in Python anyhow?

> The following files are attached for you:

 Also, I wouldn't recommend posting Microsoft Office documents to public
mailing lists which are not specifically about Microsoft products because I
doubt many people are going to open them in the first place.

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: wxDateTime value changes when it shouldn't

toyotasonice
New information: ---------------------------------------------

This may be a problem with the wx.lib.masked.timectrl.  Apparently it resets the date value to Jan 1, 1970

    • GetWxDateTime(value=None)
    • When called without arguments, retrieves the value of the control, and applies it to the wxDateTimeFromHMS() constructor, and returns the resulting value. The date portion will always be set to Jan 1, 1970. This form is the same as GetValue(as_wxDateTime=True). GetWxDateTime can also be called with any of the other valid time formats settable with SetValue, to regularize it to a single wxDateTime form. The function will raise ValueError on an unconvertable argument.
Removing references to the time does seem to fix the problem. 




On Wednesday, April 26, 2017 at 9:06:49 AM UTC-4, Vadim Zeitlin wrote:
On Wed, 26 Apr 2017 05:58:05 -0700 (PDT)  wrote:

> When my script executes commands like "print('check'), the value of my
> wxDateTime changes.  I can watch this happen while using PyCharm debug to
> view the variable.  Problems also occur when I run the code from the
> terminal.

 I'm afraid that if the output is different between running the program
normally and debugging it in PyCharm, then it's a PyCharm problem and not
wxDateTime one. Maybe you can find more help in PyCharm support forums, but
unless you can reproduce the problem without it, I don't think anybody here
can help you.

 BTW, why are you using wxDateTime in the first place, instead of using the
standard datetime module in Python anyhow?

> The following files are attached for you:

 Also, I wouldn't recommend posting Microsoft Office documents to public
mailing lists which are not specifically about Microsoft products because I
doubt many people are going to open them in the first place.

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               <a onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.tt-solutions.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFhPHTZbdYZYM-AqcnZXykG1ueWhw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.tt-solutions.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFhPHTZbdYZYM-AqcnZXykG1ueWhw&#39;;return true;" href="http://www.tt-solutions.com/" target="_blank" rel="nofollow">http://www.tt-solutions.com/

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Loading...