Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hyper Link Help
#1
Morning,

I am doing an assignment for class and the teacher doesnt get on to check forum questions till 1800-2200 at night and i dont have time to wait for her help since this is an online class.

Im having an issue with my hyperlink in my code. When i get The Python program to run everything goes smooth and gets posted to my Blog web page that we are doing but the instructor wants the hyper link when clicked to open the .py file for the program. When you click on the hyperlink nothing happens, but when you right click and hit save as you are able to save it. Can someone help me with this. Code is below. I have taken out the raw_input commands that go along with it so if they are required please let me know. I saw some where that it wasrequeted that we take them out while posting the code.
Thank you Wall

def addPost(postTitle, postDesc, postFile):
     file=open("c:\inetpub\wwwroot\iisstart.htm","a")
     file.write("""<p>NewData using variable inputs"""+postTitle+"""</p>""")
     file.write("""<p>Description: """+postDesc+"""</p>""")
     file.write("""<a href="./reports/"""+postFile+"""">"""+postFile+"""</a>)
     file.close()
Reply
#2
Open the browser's developer console (f12, ctrl+j, context menu, there's lots of ways to find it depending on the browser), and see if there's any errors. Otherwise, make sure what you're writing is a valid tag.

The fact that you can open it by right clicking is interesting. The browser could just be refusing to open a file with a .py extension. If there's no errors on the page, I'd try renaming it to .txt instead.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020