AttributeError: 'str' object has no attribute 'localtime'
<p>I usually have sandbox where I try snippets of code out.</p>

<p>When I run the following code in my sandbox it works as expected</p>

<pre><code> tuple_current_time = time.localtime(time.time())

    print("tuple_current_time = ", tuple_current_time) 
</code></pre>

<p>But when I run it in the module I am developing I get the error</p>

<p>AttributeError: 'str' object has no attribute 'localtime'</p>

<pre><code>if not (sched_time) == "TIME":
    print("Its not equal", sched_time)
    #print ("Variable Type : ",  type (tuple_current_time))
    #Create a tuple of current time


    tuple_current_time = time.localtime(time.time())

    print("tuple_current_time = ", tuple_current_time)

    tuple_website = newtuple=(tuple_current_time[0], tuple_current_time[1],            tuple_current_time[2], sched_hour, sched_min, 0, 0, 0, 0)
    print("tuple_website = ", tuple_website)

    if tuple_website &gt; tuple_current_time:
        #print("Website tuple is newer than current time tuple")
    else:
        #print("Current time tuple is newer than website time tuple")
</code></pre>

<p>Please can anybody advise what I am doing wrong?</p>

<p>Thanks</p>