Hostgator отображает все мои HTML-файлы вместо индекса

Хотя правильные текущие ответы потенциально не завершены.

eg

a = TestClass()
b = a - 5
print type(b)

Показать b как целое число, где вы можете захотеть, чтобы это был TestClass.

Вот улучшенный ответ

class positive(int):
    def __new__(cls, value, *args, **kwargs):
        if value < 0:
            raise ValueError, "positive types must not be less than zero"
        return  super(positive, cls).__new__(cls, value)

    def __add__(self, other):
        res = super(positive, self).__add__(other)
        return self.__class__(max(res, 0))

    def __sub__(self, other):
        res = super(positive, self).__sub__(other)
        return self.__class__(max(res, 0))

    def __mul__(self, other):
        res = super(positive, self).__mul__(other)
        return self.__class__(max(res, 0))

    def __div__(self, other):
        res = super(positive, self).__div__(other)
        return self.__class__(max(res, 0))

Теперь тот же самый тип теста

a = positive(10)
b = a - 9
print type(b)

будет печатать «положительный»

1
задан yacine benzmane 18 March 2019 в 23:19
поделиться

1 ответ

Вы должны поместить все свои общедоступные страницы в папку public_html. Это основная точка входа или корень вашего доменного имени. Также переименуйте файл Index.html в index.html.

0
ответ дан yacine benzmane 18 March 2019 в 23:19
поделиться
Другие вопросы по тегам:

Похожие вопросы: