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

  • Home
  • SEARCH
  • 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 8531437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:28:57+00:00 2026-06-11T09:28:57+00:00

If I use from time import time , the Python 2.7.3 does not recognize

  • 0

If I use from time import time, the Python 2.7.3 does not recognize time.sleep(60). But if I use import time, then Python does not recognize t=time(). Why does this happen? Is there any way I can use time() and time.sleep(x) in the same program?

from time import time
#import time

intervalInMinute = 1
t = time()
while 1:
    time.sleep(60)

The kind of error I get is:

Traceback (most recent call last): File “myProg.py”, line 9, in

time.sleep(60) AttributeError: ‘builtin_function_or_method’ object has no attribute ‘sleep’

  • 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-11T09:28:58+00:00Added an answer on June 11, 2026 at 9:28 am

    You need to decide what you want the name time to refer to, the module or the function called time in the module. You can write:

    >>> from time import time, sleep
    >>> time()
    1347806075.148084
    >>> sleep(3)
    >>>
    

    or

    >>> import time 
    >>> time.time()
    1347806085.739065
    >>> time.sleep(2)
    >>>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use cast() from the reshape package quite frequently. Almost every time, this warning
So I found this code: #!/usr/bin/python import sys #for cmd line argv import time
attrubuI'm new to python but don't know how to solve this: import wx class
I use ScheduledExecutorService in my application. I need to use it from time to
I use both Firebird embedded and Firebird Server, and from time to time I
What I'm trying to do is to use ajax to get time from another
How to extract time portion from a Date-object and use it as a String
To convert a date from string to Unix time, I can use date --date
I have a COM object that I'm trying to use from C++ (not .NET),
Is there a built parser that I can use from C# that can parse

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.