Board index   FAQ   Search  
Register  Login
Board index Python Coding Beginners..

AttributeError: 'module' object has no attribute 'tzset'

..just learning Python

Moderators: Taos, KDoiron, python

AttributeError: 'module' object has no attribute 'tzset'

Postby sander » Sun Dec 07, 2008 1:16 pm

I am working on a script that I found and trying to make it work. I am running python 2.5.2 on Windows XP with WAMP installed. So far I have figured out how to send email and some other basic stuff, but I'm stuck on a TimeZone error that I am getting.

>>>
Traceback (most recent call last):
File "C:\test\recipe-496790-1.py", line 659, in <module>
main()
File "C:\test\recipe-496790-1.py", line 589, in main
times = makedate(departure[0], departure[1], departure[3])
File "C:\test\recipe-496790-1.py", line 567, in makedate
time.tzset()
AttributeError: 'module' object has no attribute 'tzset'
>>>

I googled the error and it appears that the code I am using isn't supported by XP.

How should I go about troubleshooting this?
sander
Python Fan
Python Fan
 
Posts: 2
Joined: Sun Dec 07, 2008 1:08 pm

Re: AttributeError: 'module' object has no attribute 'tzset'

Postby ezephyr » Mon Dec 08, 2008 2:41 pm

From the error message you got, I would assume that there is some disconnect between what you personally have installed, and what the person who wrote the code had.
You should check a couple things:

that the time module is being imported correctly
and that the time module actually has a function "tzset()" and that the code has it written EXACTLY the same way as it is written in the module

and you should post the code (at the very least the makedate() function) so that we can check if the time.tzset() function is being called correctly
(that is if you aren't capable of checking that yourself, of course)

FYI: if you have a problem with some code, and are asking for help with it, posting the relevant portion of the code is ALWAYS a good idea. At worst, it won't be helpful... at best, it will mean less effort involved by everyone (e.g. multiple posts, longer waiting times etc.)
~Nothing is ever easy.

How to Ask Smart Questions. This should be required reading. For everyone.
ezephyr
Python User
Python User
 
Posts: 81
Joined: Mon Nov 03, 2008 10:36 pm

Re: AttributeError: 'module' object has no attribute 'tzset'

Postby sander » Tue Dec 09, 2008 6:59 am

Code: Select all
#! /usr/local/bin/python
# ========================================================================
# (c) Copyright belongs to Ken Washington
# All rights reserved
# ========================================================================

# imports
import re
import os
import sys
import time
import sched
import string
import urllib
import httplib
from HTMLParser import HTMLParser

# ========================================================================
# you MUST change these parameters to the values for your flight
# the DEBUG_SCH should be 0 to run delayed scheduling automatically
# set to 1 to skip the scheduler if we are not within 24 hours
#          immediate calls to the Internet will be made within 24 hrs
# set to 2 to simulate Internet calls. Locally saved .htm files
#          must be present with specific names for this to work
# The names are listed here - they must be EXACTLY as shown
# 1) Southwest Airlines - Retrieve Itinerary.htm
# 2) Southwest Airlines - Schedule.htm
# 3) Southwest Airlines - Check In and Print Boarding Pass.htm
# 4) Southwest Airlines - Print Boarding Pass.htm
# 5) Southwest Airlines - Retrieve-Print Boarding Pass.htm
# ========================================================================
confirmation = ''
firstname = ''
lastname = ''
DEBUG_SCH = 0
# ========================================================================
# fill in these parameters if you want the script to email you
# to disable make the emailaddr = None
#emailaddr = "one@example.com, two@example.com"
#emailaddr = "one@example.com"
emailaddr = ""
emailfrom = ""
smtpserver = ""
smtpauth = False
smtpport = 25
smtpuser = "username"
smtppass = "password"

# ========================================================================
# fixed page locations and parameters
# DO NOT change these parameters
main_url = 'www.southwest.com'
checkin_url = '/content/travel_center/retrieveCheckinDoc.html'
retrieve_url = '/travel_center/retrieveItinerary.html'
defaultboxes = ["recordLocator", "firstName", "lastName"]
# ========================================================================


# =========== function definitions =======================================

# this is a parser for the Southwest pages
class HTMLSouthwestParser(HTMLParser):

    def __init__(self, swdata):
        self._reset()
        HTMLParser.__init__(self)

        # if a web page string is passed, feed it
        if swdata != None and len(swdata)>0:
            self.feed(swdata)
            self.close()

    def _reset(self):
        self.searchtags = {}
        self.hiddentags = []
        self.searchaction = ""
        self.formaction = ""
        self.is_search = False
        self.textnames = []
       
    # override the feed function to reset our parameters
    # and then call the original feed function
    def feed(self, formdata):
        self._reset()
        HTMLParser.feed(self, formdata)

    # handle tags in web pages
    # this is where the real magic is done
    def handle_starttag(self, tag, attrs):
        if tag=="input":
            ishidden = False
            ischeckbox = False
            istext = False
            issubmit = False
            thevalue = ""
            thename = None
            for attr in attrs:
                if attr[0]=="type":
                    if attr[1]=="hidden":
                        ishidden= True
                    elif attr[1]=="checkbox" or attr[1]=="radio":
                        ischeckbox = True
                    elif attr[1]=="text":
                        istext = True
                    elif attr[1]=="submit":
                        issubmit = True
                elif attr[0]=="name":
                    thename= attr[1]
                    istext = True
                elif attr[0]=="value":
                    thevalue= attr[1]

            # store the tag for search forms separately
            # from the tags for non-search forms
            if ishidden or ischeckbox:
                if self.is_search:
                    self.searchtags[thename] = thevalue
                else:
                    self.hiddentags.append((thename, thevalue))

            # otherwise, append the name of the text fields
            elif istext and self.is_search==False and issubmit==False:
                self.textnames.append(thename)

        elif tag=="form":
            for attr in attrs:
                if attr[0]=="action":
                    theaction = attr[1]
                   
                    # check to see if this is a search form
                    if theaction.find("search") > 0:
                        self.searchaction = theaction
                        self.is_search = True
                    else:
                        self.formaction = theaction
                        self.is_search = False

# This returns the timezone for a given airport code
def airportCodeTZ(code):
    airportzone = {}
    airportzone["ALB"] = "US/Eastern"
    airportzone["ABQ"] = "US/Mountain"
    airportzone["AMA"] = "US/Central"
    airportzone["AUS"] = "US/Central"
    airportzone["BWI"] = "US/Eastern"
    airportzone["BHM"] = "US/Central"
    airportzone["BOI"] = "US/Mountain"
    airportzone["BUF"] = "US/Eastern"
    airportzone["BUR"] = "US/Pacific"
    airportzone["MDW"] = "US/Central"
    airportzone["CLE"] = "US/Eastern"
    airportzone["CMH"] = "US/Eastern"
    airportzone["CRP"] = "US/Central"
    airportzone["DAL"] = "US/Central"
    airportzone["DEN"] = "US/Mountain"
    airportzone["DTW"] = "US/Eastern"
    airportzone["ELP"] = "US/Mountain"
    airportzone["FLL"] = "US/Eastern"
    airportzone["RSW"] = "US/Eastern"
    airportzone["HRL"] = "US/Central"
    airportzone["BDL"] = "US/Eastern"
    airportzone["HOU"] = "US/Central"
    airportzone["IND"] = "US/Eastern"
    airportzone["JAN"] = "US/Central"
    airportzone["JAX"] = "US/Eastern"
    airportzone["MCI"] = "US/Central"
    airportzone["LAS"] = "US/Pacific"
    airportzone["LIT"] = "US/Central"
    airportzone["ISP"] = "US/Eastern"
    airportzone["LAX"] = "US/Pacific"
    airportzone["SDF"] = "US/Eastern"
    airportzone["LBB"] = "US/Central"
    airportzone["MHT"] = "US/Eastern"
    airportzone["MAF"] = "US/Central"
    airportzone["BNA"] = "US/Central"
    airportzone["MSY"] = "US/Central"
    airportzone["ORF"] = "US/Eastern"
    airportzone["OAK"] = "US/Pacific"
    airportzone["OKC"] = "US/Central"
    airportzone["OMA"] = "US/Central"
    airportzone["ONT"] = "US/Pacific"
    airportzone["SNA"] = "US/Pacific"
    airportzone["MCO"] = "US/Eastern"
    airportzone["PHL"] = "US/Eastern"
    airportzone["PHX"] = "US/Arizona"
    airportzone["PIT"] = "US/Eastern"
    airportzone["PDX"] = "US/Pacific"
    airportzone["PVD"] = "US/Eastern"
    airportzone["RDU"] = "US/Eastern"
    airportzone["RNO"] = "US/Pacific"
    airportzone["SMF"] = "US/Pacific"
    airportzone["SLC"] = "US/Mountain"
    airportzone["SAT"] = "US/Central"
    airportzone["SAN"] = "US/Pacific"
    airportzone["SJC"] = "US/Pacific"
    airportzone["SFO"] = "US/Pacific"
    airportzone["SEA"] = "US/Pacific"
    airportzone["GEG"] = "US/Pacific"
    airportzone["STL"] = "US/Central"
    airportzone["TPA"] = "US/Eastern"
    airportzone["TUS"] = "US/Arizona"
    airportzone["TUL"] = "US/Central"
    airportzone["IAD"] = "US/Eastern"
    airportzone["PBI"] = "US/Eastern"

    return airportzone[code]

# function to send an simple text email message
def sendEmail(wdata, emailaddr, smtpserver, smtpport= 25, \
              smtpauth=False, smtpuser="", smtppass=""):
    import smtplib, sys, MimeWriter, base64, StringIO
    from email.MIMEText import MIMEText

    fd = open("boardingpass.htm", "r")
    boardingpass = fd.read(-1)
    fd.close()

    # Change a few things on boardingpass so that images resolve correctly via email:
    bpmod = re.sub('/styles/', 'http://www.southwest.com/styles/', boardingpass)
    boardingpass = re.sub('img src="/', 'img src="http://www.southwest.com/', bpmod)

    # Create a MIME Multipart message
    message = StringIO.StringIO()
    writer = MimeWriter.MimeWriter(message)
    writer.addheader("Subject", "Results of Southwest Check-In Script")
    writer.addheader('MIME-Version', '1.0')
    writer.addheader('To', emailaddr)
    writer.startmultipartbody('mixed')

    # Text Segment
    part = writer.nextpart()
    body = part.startbody('text/plain')
    body.write(wdata)

    # HTML Segment (Boarding Pass)
    part = writer.nextpart()
    body = part.startbody('text/html')
    body.write(boardingpass)

    # finish email
    writer.lastpart()

    # Send the email
    # connect on the designated port - will be 25 or 80
    s = smtplib.SMTP()
    try:
        s.connect(smtpserver, smtpport)
    except Exception, connerror:
        print connerror.__class__, connerror
        return False

    if smtpauth:
        try:
            s.login(smtpuser, smtppass)
        except Exception, connerror:
            print connerror.__class__, connerror
            return False
    try:
        s.sendmail(emailfrom, emailaddr, message.getvalue())
    except Exception, connerror:
        print connerror.__class__, connerror
        return False
   
    s.close()
    return True

# this function reads a URL and returns the text of the page
def ReadUrl(host, req):
    wdata = ""

    try:
        conn = httplib.HTTPConnection(host)
        conn.request("GET", req)
        resp = conn.getresponse()
    except:
        print "Error: Cannot connect in GET mode to ", host+req
        sys.exit(1)

    if resp.status == 200:
        wdata = resp.read()
    else:
        print "Error: Cannot read data from ", host+req
        print "Response: ", resp.status, resp.reason
        sys.exit(1)

    return wdata

# this function sends a post just like you clicked on a submit button
def PostUrl(host, req, dparams):
    wdata = ""
    params = urllib.urlencode(dparams)
    headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}

    try:
        conn = httplib.HTTPConnection(host)
        conn.request("POST", req, params, headers)
        resp = conn.getresponse()
    except:
        print "Error: Cannot connect in POST mode to ", host+req
        print "Params = ", dparams
        sys.exit(1)
       
    if resp.status == 200:
        wdata = resp.read()
    else:
        print "Error: Cannot post data to ", host+req
        print "Params = ", dparams
        print "Response: ",resp.status, resp.reason
        sys.exit(1)

    return wdata

def setInputBoxes(textnames, conf_number, first_name, last_name):
    if len(textnames) == 3:
        boxes = textnames
    else:
        boxes = default_boxes

    params = {}
    params[boxes[0]] = conf_number
    params[boxes[1]] = first_name
    params[boxes[2]] = last_name
   
    return params

# this routine extracts the departure date and time
def getFlightTimes(the_url, conf_number, first_name, last_name):

    if DEBUG_SCH > 1:
        fd = open("Southwest Airlines - Retrieve Itinerary.htm","r")
        swdata = fd.read(-1)
        fd.close()
    else:
        swdata = ReadUrl(main_url, the_url)

    if swdata==None or len(swdata)==0:
        print "Error: no data returned from ", main_url+the_url
        sys.exit(1)

    gh = HTMLSouthwestParser(swdata)

    # get the post action name from the parser
    post_url = gh.formaction
    if post_url==None or post_url=="":
        print "Error: no POST action found in ", main_url+the_url
        sys.exit(1)

    # load the parameters into the text boxes
    params = setInputBoxes(gh.textnames, conf_number, first_name, last_name)

    # submit the request to pull up the reservations on this confirmation number
    if DEBUG_SCH > 1:
        fd = open("Southwest Airlines - Schedule.htm","r")
        reservations = fd.read(-1)
        fd.close()
    else:
        reservations = PostUrl(main_url, post_url, params)

    if reservations==None or len(reservations)==0:
        print "Error: no data returned from ", main_url+post_url
        print "Params = ", dparams
        sys.exit(1)

    # parse the returned file to grab the dates and times
    # the last word in the table above the first date is "Routing Details"
    # this is currently a unique word in the html returned by the above
    dateloc_0 = reservations.find("Details")
    dateloc_1 = reservations.find("bookingFormText", dateloc_0)
    i1 = reservations.find(">", dateloc_1)
    i2 = reservations.find("<", i1)
    to_date = reservations[i1+1:i2]

    # narrow down the search to the line with the word depart
    timeloc = reservations.find("Depart", dateloc_1)
    timeline = reservations[timeloc:timeloc+80]

    # use a regular expression to find the two times
    tm = re.compile("\d{1,2}\:\d{1,2}[apAP][mM]")
    ts = tm.findall(timeline)

    to_depart_time = ts[0]
    to_arrive_time = ts[1]

    # Use a regular expression to find the departing Airport
    reap = re.compile("\((...)\)")
    ts = reap.findall(timeline)
    to_tz = airportCodeTZ(ts[0])
    to_dest_tz = airportCodeTZ(ts[1])

    if(len(to_tz) < 1):
        print "Error, could not find timezone for airport code ", ts[0], ". Using PST"
        to_tz = "US/Pacific"
    if(len(to_dest_tz) < 1):
        print "Error, could not find timezone for airport code ", ts[1], ". Using PST"
        to_dest_tz = "US/Pacific"

    # now find the return flight date and time information
    dateloc_2 = reservations.find("Details", timeloc)
    dateloc_3 = reservations.find("bookingFormText", dateloc_2)
    i1 = reservations.find(">", dateloc_3)
    i2 = reservations.find("<", i1)
    fr_date = reservations[i1+1:i2]

    # narrow down the search to the line with the word depart
    timeloc = reservations.find("Depart", dateloc_3)
    timeline = reservations[timeloc:timeloc+80]
    ts = tm.findall(timeline)
    fr_depart_time = ts[0]
    fr_arrive_time = ts[1]
   
    departure = (to_date, to_depart_time, to_arrive_time, \
                 fr_date, fr_depart_time, fr_arrive_time)
   
    return departure

def getBoardingPass(the_url, conf_number, first_name, last_name):

    # read the southwest checkin web site
    if DEBUG_SCH > 1:
        fd = open("Southwest Airlines - Check In and Print Boarding Pass.htm","r")
        swdata = fd.read(-1)
        fd.close()
    else:
        swdata = ReadUrl(main_url, the_url)

    if swdata==None or len(swdata)==0:
        print "Error: no data returned from ", main_url+the_url
        sys.exit(1)

    # parse the data
    gh = HTMLSouthwestParser(swdata)

    # get the post action name from the parser
    post_url = gh.formaction
    if post_url==None or post_url=="":
        print "Error: no POST action found in ", main_url+the_url
        sys.exit(1)

    # load the parameters into the text boxes by name
    # where the names are obtained from the parser
    params = setInputBoxes(gh.textnames, conf_number, first_name, last_name)

    # Keep trying until we successfully get our boarding pass. This can happen if we're a bit early
    count = 0
    while True:
        count = count + 1
        if count > 180:
            print "Been trying for two hours to check in - giving up!"
            sys.exit(1)
        #print "Params = ", params
        # submit the request to pull up the reservations
        if DEBUG_SCH > 1:
            fd = open("Southwest Airlines - Print Boarding Pass.htm","r")
            reservations = fd.read(-1)
            fd.close()
        else:
            reservations = PostUrl(main_url, post_url, params)

        if reservations==None or len(reservations)==0:
            print "Error: no data returned from ", main_url+post_url
            print "Params = ", params
            #sys.exit(1)
            print "Trying again in 60 seconds."
            time.sleep(60)
            continue

        # parse the returned reservations page
        rh = HTMLSouthwestParser(reservations)

        # Extract the name of the post function to check into the flight
        final_url = rh.formaction

        # the returned web page contains three unique security-related hidden fields
        # plus a dynamically generated value for the checkbox or radio button
        # these must be sent to the next submit post to work properly
        # they are obtained from the parser object
        hiddenparams = rh.hiddentags
        if len(hiddenparams) < 4:
            print "Error: Fewer than the expect 4 special fields returned from ", main_url+post_url
            print "Params = ", params
            #sys.exit(1)
            print "Trying again in 60 seconds."
            time.sleep(60)
        else:
            break

    # finally, lets check in the flight and make our success file
    if DEBUG_SCH > 1:
        fd = open("Southwest Airlines - Retrieve-Print Boarding Pass.htm","r")
        checkinresult = fd.read(-1)
        fd.close()
    else:
        checkinresult = PostUrl(main_url, final_url, hiddenparams)

    # write the returned page to a file for later inspection
    if checkinresult==None or len(checkinresult)==0:
        print "Error: no data returned from ", main_url+final_url
        print "Params = ", hiddenparams
        sys.exit(1)

    # always save the returned file for later viewing
    fd = open("boardingpass.htm","w")
    fd.write(checkinresult)
    fd.close()

    # look for what boarding letter and number we got in the file
    myre = re.compile("boarding[ABC]\.gif")
    bgroup = myre.findall(checkinresult)
    myre2 = re.compile("boarding(\d).gif")
    bnumber = myre2.findall(checkinresult)
    if(len(bnumber) > 0):
        bnumber = bnumber[0] + bnumber[1] # String concatenation

    if len(bgroup)>0 and len(bnumber)>0:
        bletter = bgroup[0][8]
        msg = "Boarding group = " + bletter + "   Boarding number = " + bnumber
    else:
        msg = "Boarding group and number are unknown"

    # email this information to self if requested
    if DEBUG_SCH==0 and emailaddr:
        try:
            sendEmail(msg, emailaddr, smtpserver, smtpport, smtpauth, smtpuser, smtppass)
        except:
            print "Unable to email result to %s %s" % (first_name, last_name)

    return msg

# determine the time when we can submit checkin successfully
def getDelay(leave_time):

    # start with 24 hours before departure and pad it by 3 minutes just to be sure
    sched_time = leave_time - 24.0*3600.0
#    sched_time = sched_time + 180.0

    now = time.time() # UTC
    min_left = int(sched_time - now) / 60
    absmin = abs(min_left)
    days = absmin / 60 / 24
    hours = (absmin - days*24*60) / 60
    minutes = absmin - days*24*60 - hours*60
    # print "Departure time: ", time.strftime("%A %B %d, %Y  at  %I:%M %p",leave_time)

    # print a different message if the time to check in ahead of time is in the past
    if ( min_left <= 0 ):
        msg = "You were ready to check in %d days, %d hours, and %d minutes ago." % \
              (days, hours, minutes)
    else:
        msg = "You have %d days, %d hours, and %d minutes remaining to check in." % \
              (days, hours, minutes)

    # print msg
    return sched_time, msg

# print some information to the terminal for confirmation purposes
def displayFlightInfo(to_time, to_arrive, fr_time, fr_arrive):
    print "Confirmation number: ", confirmation
    print "Passenger name:      ", firstname, lastname
    print "Departure date/time: ", to_time," Arriving: ", to_arrive
    print "Return date/time:    ", fr_time," Arriving: ", fr_arrive

def makedate(monthday, daytime, TZ):
    now = time.time()
    current_time = time.gmtime(now)

    os.environ['TZ'] = TZ
    time.tzset()
    to_time = "%s %s %s" % (monthday, daytime, str(current_time[0]))
    time_struct = time.strptime(to_time, "%b %d %I:%M%p %Y")
    if time.mktime(time_struct) < (now - (6 * 30 * 24 * 60 * 60)):
        to_time = "%s %s %s" % (monthday, daytime, str(current_time[0]+1))
        time_struct = time.strptime(to_time, "%b %d %I:%M%p %Y")

#    print time_struct, time.gmtime(time.mktime(time_struct)) , time.mktime(time_struct)

    return (time_struct, time.gmtime(time.mktime(time_struct)), time.mktime(time_struct))

# main program
def main():

    # get the departure times in a tuple
    departure = getFlightTimes(retrieve_url, confirmation, firstname, lastname)

    # get the current time
    now = time.time()
    current_time = time.gmtime(now)

    # Convert times to UTC times
    times = makedate(departure[0], departure[1], departure[3])
    to_time = time.strftime("%b-%d-%Y %I:%M%p ", times[0]) + departure[3]
    leave_time_1 = times[2]

    times = makedate(departure[0], departure[2], departure[4])
    to_arrive = time.strftime("%I:%M%p ", times[0]) + departure[4]

    times = makedate(departure[5], departure[6], departure[8])
    fr_time = time.strftime("%b-%d-%Y %I:%M%p ", times[0]) + departure[8]
    leave_time_2 = times[2]

    times = makedate(departure[5], departure[7], departure[9])
    fr_arrive = time.strftime("%I:%M%p ", times[0]) + departure[9]

    # print some information to the terminal for confirmation purposes
    displayFlightInfo(to_time, to_arrive, fr_time, fr_arrive)
    print "Current time: ", time.strftime("%b %d %I:%M%p %Y UTC",current_time)

    # find the time when we can check in within the 24 hour time window
    sched_1, msg_depart = getDelay(leave_time_1)

    # get a scheduler object
    sch = sched.scheduler(time.time, time.sleep)

    # schedule the checkin of the flights if it is in the future
    # also we check to see if we have at least an hour before departure
    # if not then we skip to the return flight - if that fails we do nothing
    msg1 = "Please wait for the scheduler to check in the departing flight..."
    msg2 = "Departing flight has been checked in - see boardingpass.htm for details"
    msg3 = ""
    if sched_1 > now:
        print msg_depart
        ev1 = sch.enterabs(sched_1, 1, getBoardingPass, (checkin_url, confirmation, firstname, lastname))
    elif (leave_time_1-3660.0) > now:
        print msg_depart
        print "Obtaining departing flight boarding pass right now..."
        msg3 = getBoardingPass(checkin_url, confirmation, firstname, lastname)

    # run the scheduled events
    # nothing will be printed during this long pause, so run in the background
    if not sch.empty():
        print msg1
        if DEBUG_SCH==0: sch.run()

    print msg2
    print msg3

    # schedule the second pass or call it now if we are within an hour
    msg1 = "Please wait for the scheduler to check in the returning flight..."
    msg2 = "Returning flight has been checked in - see boardingpass.htm for details"
    sched_2, msg_depart = getDelay(leave_time_2)
    print msg_depart
    if sched_2 > now:
        ev2 = sch.enterabs(sched_2, 1, getBoardingPass, (checkin_url, confirmation, firstname, lastname))
    elif (leave_time_2-3660.0) > now:
        print "Obtaining returning flight boarding pass right now..."
        msg3 = getBoardingPass(checkin_url, confirmation, firstname, lastname)
    else:
        msg2 = "It is too late to check in the returning flight"

    # run the scheduled events
    # nothing will be printed during this long pause, so run in the background
    if not sch.empty():
        print msg1
        if DEBUG_SCH==0: sch.run()

    print msg2
    print msg3

if __name__=='__main__':
    main()
sander
Python Fan
Python Fan
 
Posts: 2
Joined: Sun Dec 07, 2008 1:08 pm

Re: AttributeError: 'module' object has no attribute 'tzset'

Postby ezephyr » Wed Dec 17, 2008 11:20 am

So your problem with tzest() is that windows doesn't support that function. As I see it you have two options 1) get a unix-based system (like Ubuntu!) and fiddle with this code on that. or 2) see if you can make your script work without using the tzset function.

Look in the documentation on the tzset function, it seems to me that it gives a way that you could manually specify timezone but I don't know if that will work in this specific case. I also don't know how critical the timezone being correct is to the functioning of the script (if it's not you could just comment out that line and see if it goes)

Good luck!
~Nothing is ever easy.

How to Ask Smart Questions. This should be required reading. For everyone.
ezephyr
Python User
Python User
 
Posts: 81
Joined: Mon Nov 03, 2008 10:36 pm


Return to Beginners..

Who is online

Users browsing this forum: jbos1190, q81101, snippsat and 8 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.