小编vic*_*rcd的帖子

我可以有一个带域的 heroku 免费应用程序吗?

我想在我的免费 heroku 应用程序中放置一个域,因为我没有国际信用卡(我想付款,如果可以使用借记卡,如果可以,我如何使用借记卡付款? )。该域是巴西域,我想知道是否可以使用免费帐户,我该怎么做?非常感谢!

dns heroku

7
推荐指数
1
解决办法
7781
查看次数

如何在kivy中删除小部件?

我试图像添加这些小部件那样做,但没有成功.我正在使用kv语言和绑定函数.使用下面的代码可以动态添加按钮,但不可能删除它们.

的.py

class PrimeiroScreen(Screen):
    def __init__(self, **kwargs):
        self.name = 'um'
        super(Screen,self).__init__(**kwargs)


    def fc2(self):
        btn = Button(text="Botão",size_hint=(.1,.1))
        self.ids.grade2.add_widget(btn)     
        btn.bind(on_press=self.printa)

    def printa(self,*args):
        #btn2 = Button(text="Btn2",size_hint=(.1,.1))#I can add another btn succesfully
        self.ids.grade2.add_widget(btn2)#but I can do the same by this way
        self.remove_widget(btn)
        grade2.remove_widget(self.btn)
Run Code Online (Sandbox Code Playgroud)

和.kv

<RootScreen>:
    PrimeiroScreen:

<PrimeiroScreen>:
    GridLayout:
        cols: 1
        size_hint: (.5,1)
        id: grade
        Button:
            text: "hi!"
            on_press: root.fc2()

    StackLayout:
        orientation: 'bt-rl'
        GridLayout:
            cols: 2
            size_hint: (.5,1)
            id: grade2
Run Code Online (Sandbox Code Playgroud)

有谁知道我犯的错误?Python向我显示以下消息:

self.remove_widget(btn)
NameError: global name 'btn' is not defined
Run Code Online (Sandbox Code Playgroud)

python kivy

4
推荐指数
1
解决办法
9000
查看次数

推送失败的heroku

我需要一些帮助来解决这个问题。我在另一个heroku帐户中有其他网站,但是我没有进入空帐户。我正在使用python3.5.0(但我尝试在没有成功的情况下更改python版本)和Django 1.10。我的git储存库中有runtime.txt,procfile.txt,但是我有这个问题:(终端)

    Counting objects: 105, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (97/97), done.
Writing objects: 100% (105/105), 2.22 MiB | 113.00 KiB/s, done.
Total 105 (delta 34), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Installing python-3.5.0
remote:  !     Requested runtime (python-3.5.0) is not available for this stack (heroku-16).
remote:  !     Aborting.  More info: https://devcenter.heroku.com/articles/python-support
remote:  !     Push rejected, failed to compile Python …
Run Code Online (Sandbox Code Playgroud)

python git django heroku

1
推荐指数
1
解决办法
2555
查看次数

标签 统计

heroku ×2

python ×2

django ×1

dns ×1

git ×1

kivy ×1