Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8941925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:24:42+00:00 2026-06-15T11:24:42+00:00

I have a file containing a list of event spaced with some time. Here

  • 0

I have a file containing a list of event spaced with some time. Here is an example:

0, Hello World
0.5, Say Hi
2, Say Bye

I would like to be able to replay this sequence of events. The first column is the delta between the two consecutive events ( the first starts immendiately, the second happens 0.5s later, the third 2s later, … )

How can i do that on Windows . Is there anything that can ensure that I am very accurate on the timing ? The idea is to be as close as what you would have listneing some music , you don’t want your audio event to happen close to the right time but just on time .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:24:43+00:00Added an answer on June 15, 2026 at 11:24 am

    This can be done easily by using the sleep function from the time module. The exact code should work like this:

    import time
    
    # Change data.txt to the name of your file
    data_file = open("data.txt", "r")
    
    # Get rid of blank lines (often the last line of the file)
    vals = [i for i in data_file.read().split('\n') if i]
    
    data_file.close()
    
    for i in vals:
        i = i.split(',')
        i[1] = i[1][1:]
        time.sleep(float(i[0]))
    
        print i[1]
    

    This is an imperfect algorithm, but it should give you an idea of how this can be done. We read the file, split it to a newline delimited list, then go through each comma delimited couplet sleeping for the number of seconds specified, and printing the specified string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file containing some data (for example, 00927E2B112DB958......). This data is a
I have a file containing a list of filenames: esocket.c esocket.h dockwin.cpp dockwin.h makefile
I have an service application that reads a config file containing a list of
I have a list containing about 1000 file names to search under a directory
I have a file containing some lines of code followed by a string pattern.
Basically I have converted a tab delimited txt file into a list containing a
I have an Excel file containing data(list of Phone numbers), and i want that
i have a file containing list paths and other related information of all the
I have text file containing a list of 16 bit hex numbers (e.g. '61C7393AA9B3474DB081C7B7CCE1C545')
I have a input.txt file containing a list of number: 1719 194 1719 1719

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.