Я использую Python 2.6.5 для разработки приложения для Google App Engine - я не слишком знаком с Python, но я учусь.
Я пытаюсь поместить URL в строку, так что переменная = "string http://domain.name"
тогда я распечатаю строку. проблема в том, что если в строке находится двоеточие (после http), я не получаю никакого вывода и не знаю почему.
Я пытался экранировать строку с:
ни один из них, похоже, не работает, и я не уверен, что еще попробовать
Контекст выглядит так
variables.py:
...
HOST_URL = "http://domain.name"
...
пример logout.py
import variables
import sys
...
class Logout(webapp.RequestHandler):
""" RequestHandler for when a user wishes to logout from the system."""
def post(self):
self.get()
def get(self):
print(variables.HOST_URL)
print('hi')
self.redirect(variables.HOST_URL)
sys.exit()
или
в файле functions.py
import variables
import sys
...
def sendhome(requesthandler)
print 'go to '+variables.HOST_URL
requesthandler.redirect(variables.HOST_URL)
sys.exit()
вызывается из контекста, например:
from functions import sendhome
...
class Logout(webapp.RequestHandler):
""" RequestHandler for when a user wishes to logout from the system."""
def post(self):
self.get()
def get(self):
sendhome(self)
любая помощь будет оценена
спасибо