[Tutor] html checker

Matthew Dalrymple computer_dude15 at hotmail.com
Mon Oct 1 21:24:40 CEST 2012


I don't need to hear how bad my programs are...either you are gonna help or your not...if you have questions about what i have wrote or why i wrote something someway ask...dont just jump to conclusions I forgot to include that i had to write a "stack" function in a "pythonbasic" file to importhttp://pastie.org/4892792 Im here because i want to learn not to be fucking bashed...a few of the functions were copied from my book as they were required for other parts of the lab...so again if you have a problem with those other functions maybe you should take it up with the author... anyway i just don't know where to start to get the htmlChecker function to run...i am not a programmer by any means but is required to learn for my major...this is why im stuggling...i have networking experience not programming 
 Date: Mon, 1 Oct 2012 14:48:39 -0400
From: bgailer at gmail.com
To: computer_dude15 at hotmail.com
CC: tutor at python.org
Subject: Re: [Tutor] html checker


  
    
  
  
    On 10/1/2012 11:45 AM, Matthew
      Dalrymple wrote:

    
    
      
      
        Im trying to write an html syntax checker...pretty much read an
        imported file, if it has all the opening and closing "<" and
        ">" it will return True and if it doesn't it will return
        False.

         

        this is what i have so far

        http://pastie.org/4891833

         

        how can i get it to run correctly?

      
    
    Welcome to the tutor list. I assume this is your first visit. Why?
    because we always request that you tell us what happens to lead you
    to say it does not run correctly. This can mean many things.

    

    So - what happens when you run the program? Be specific.

    

    Also - always reply-all so a copy goes to the list. 

    

    Tell us which version of Python you are using, which OS and what you
    do to run the program.

    

    Put your response(s) after the item(s) you are responding to (as I
    have done here). In other words do not "top-post".

    

    Delete irrelevant text (as I have done here).

    

    A quick glance at your program shows many flaws.

    from pythondsBasic import stack

    This is an unknown (to me and to Google) module. Where did you get
    it? What is stack?

        for line in infile:
        data = infile.readline()


    This will read all the lines in the file. Each line in turn will be
    assigned to data, 

    so at the of the loop data will contain the last line. data is not
    referenced anyweere

    else in the program.

    for ch in infile: 

    Will immediately terminate as the file is now at EOF. If you were to
    remove the for line in infile: loop then ch will contain one line,
    not one character!

    

    Your program does an import and defines functions. There is nothing
    in it to run any of the functions. 

    

    There are many other problems! Too many for me to continue analyzing
    and reporting.

    

    Did you succeed in the previous labs? How did you get this far and
    then fail so miserably?

    -- 
Bob Gailer
919-636-4239
Chapel Hill NC 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121001/6a4fc9ff/attachment.html>


More information about the Tutor mailing list