User Profile

Collapse

Profile Sidebar

Collapse
excite
excite
Last Activity: Dec 22 '06, 06:34 PM
Joined: Oct 21 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thanks. But why this code will not work for more than a day? Does the timer will be initialized every day? (Sorry that I am not very good at Python, I will check it later). If it is true, I think I can put the "next_time=time .time()" into the first while block, like this:
    Code:
    import time
    while True:
        [B]next_time=time.time()[/B]
        hourly_function()
        next_time=(next_time+3600) #sets the next occurrence of
    ...
    See more | Go to post

    Leave a comment:


  • Thanks. The program does not have a GUI, running on a windows system, and I would like to run some functions every hour. The current programs are written in both C and python language, and I packed all the files by Python. Actually, the input files of my programs will be updated every hour externally, so I can run the functions after I detect the input files have been modified. However, if something wrong and the input files have not been updated...
    See more | Go to post

    Leave a comment:


  • excite
    started a topic How to run a program periodically by using Python

    How to run a program periodically by using Python

    I want to run a function periodically by using Python, and I found that
    time.sleep() may be of help, however, I think it may not be safe and flexible. Can somebody give me some suggestions on it? Thanks.
    See more | Go to post

  • "EOL while scanning single-quoted string", what is the meaning?

    I am trying to write a long string into a txt file, the string includes some backslash, looks like:
    'd:\#########\# ######\####### d:\######\####\ ####\### d:\###\###\'
    then I got a error saying 'EOL while scanning single-quoted string'. But it works when I just delete the last backslash or add one more backslash in the end.
    Can someone tell me what is the meaning of this error, and how to handle this problem? Thanks.
    See more | Go to post

  • excite
    started a topic About different delimiter in CSV file

    About different delimiter in CSV file

    I am now trying to use Python for data process, and I encounted a CSV file with different delimiter within a row, such as the following format:
    2006/10/17 6.88, 9.88, ............... .......
    so when I read the file, the first string in each row will actually be a combination of two information, i.e. '2006/10/17 6.88'.
    I can further split the first string to seperate the two information, however, I wonder if there is better idea...
    See more | Go to post
No activity results to display
Show More
Working...