TypeError: 'int' object is not callable

A

autobotprime.17

dear friends when i try to execute following lines

import time
a = time.daylight()
print(a)


result is
TypeError: 'int' object is not callable


why is this error and how can i solve this problem?
 
K

Krishnan Shankar

Hi,

The problem is in the second line.

a = time.daylight()

The daylight is not a method in time module. It is clear here,
http://docs.python.org/2/library/time.html

Since it is not a method we cannot call it. It is just a integer variable .
It returns zero if DST timezone is not defined and returns non zero if
defined.
Traceback (most recent call last):
<type 'int'>

Regards,
Krishnan
 
T

Terry Reedy

dear friends when i try to execute following lines

import time
a = time.daylight()
print(a)


result is

You left out the traceback that shows which line had the error. In this
case, Krishnan could tell, but in other code snippets people post, it is
not always so obvious. Post the whole trackeback with errors. It is
printed for a reason ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top