python read a file on web to get variable -


I have a file on my web server and I would like to read this python script to this file so that Variables from this file can be imported as, but I tried to use urlparse but I was not able to work at all.

My code: Urlib.parse import urlparse moregc = urlparse ('http://www.xxxx.com/xxxx/moregc) from

  ..... ') If cde == seccode: ...  

from moregc import cde I was using this code to read it from a local file and it was right in the job : -

  reg import CD if CD == Securecode:  

The issue is that keeping this file safe without using any permission Will be in the form of online configuration.

How about, instead of downloading a module that you import, you read the page directly ?

  data = urllib.urlopen ("http://www.xxxx.com/xxxx/ Moregc"). Read () if the data in "Permission": Continue with #Program: Print "Sorry, you are no longer authorized to run this script"  

Then you can only send your moregc The word "permission" on the page must be entered when you want to allow the script, and when you do not want to allow it, delete the word.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -