Errors when system-calling script, otherwise fine

This is the place for queries that don't fit in any of the other categories.

Errors when system-calling script, otherwise fine

Postby tnknepp » Wed May 08, 2013 11:21 am

I'm running a system call on a script I wrote to generate daily figures for data we are collecting. When I run the plotting script by itself it runs without any errors, but when I do the system call I get:

Traceback (most recent call last):
File "C:\Python27\lib\site-packages\matplotlib\backends\backend_qt4.py", line 156, in <lambda>
lambda: self.close_event())
File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line 1564, in close_event
self.callbacks.process(s, event)
RuntimeError: wrapped C/C++ object of type FigureCanvasQTAgg has been deleted

This error does not halt the process, rather the plotting script continues to execute (and generate figures!) quite happily otherwise. While it seems to be working, I am concerned about these errors (benign as they seem). Unfortunately, there are no lines in the plotting script being flagged as being in error. The script that is calling the plotting script is posted below. Since the plotting script is rather long (really it is just the same thing being done for four different gases) I add it as an attachment in .txt. I give the whole script here for the sake of being thorough, though I don't expect anyone to read the whole thing (actually, I suspect the issue is with the system call and has nothing to do with the plotting script, which makes the need to post it moot...).

Does anyone have any idea regarding why this error is occurring?

Code: Select all
import os, time
import datetime as dt

def waitToTomorrow():
    """Forces the code to sleep until tomorrow morning at 06:00."""
    print 'Sleeping...'
    today = time.localtime()
    today = time.mktime(today[:3] + (0,0,0) + today[6:]) # Midnight time. 
    time.sleep(today + 24*3600 + 6*3600 - time.time())
    print '\n'*5
   
while True:
    # Print current date.
    print dt.datetime.strftime(dt.datetime.today(),'%Y %m %d %H:%M:%S')
   
    # Run code to grab data from remote machine.
    print 'Grabbing/unzipping data.'
    os.system('python Grab_and_Unzip.py')
   
    # Run code to process data. 
    print 'Processing to l2/3.'
    os.chdir('../Pan_executable')
    os.system('PanPS.exe')
   
    # Run code to create plots. 
    print 'Creating plots.'
    os.chdir('../Posting_Plots')
    os.system('Pan_Plotter_2.0_LOOP.py')
   
    # Run code to make posting data files. 
    print 'Creating data files for posting.'
    os.chdir('../Pan_scripts')
    os.system('mk_PostingData.py')
   
    # Post data. 
    print 'Posting data to web.'
    os.system('Pan_ftpPush.py')
    waitToTomorrow()


Attachments
Pan_Plotter_2.0_LOOP.txt
(12.03 KiB) Downloaded 37 times
Python: 2.7 via Anaconda
Numpy: 1.7
Pandas: 0.11
OS: Windows 7
IDE: Spyder/IPython
User avatar
tnknepp
 
Posts: 119
Joined: Mon Mar 11, 2013 7:41 pm

Return to General Coding Help

Who is online

Users browsing this forum: snippsat and 4 guests