我有一个作为服务器的 Flask 应用程序,我有一个作为服务器前端的 kivy 应用程序。如何运行flask然后运行kivy应用程序,以便它们同时运行?
烧瓶应用程序:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello'
if __name__ == "__main__":
app.run()
Run Code Online (Sandbox Code Playgroud)
基维应用程序:
from kivy.app import App
from kivy.builder import Builder
from kivy.uix.screenmanager import Screen, ScreenManager
kivy.require('1.10.0')
Builder.load_file('kivy.kv')
sm = ScreenManager()
class MainScreen(Screen)
pass
class OtherScreen(Screen)
pass
sm.add_widget(MainScreen(name='main'))
sm.add_widget(OtherScreen(name='other'))
class MyApp(App):
def build(self):
return sm
MyApp().run()
Run Code Online (Sandbox Code Playgroud)
更新: 如果有人在使用 apache 实现网络服务器时遇到问题,在我看来,尝试使用 docker,更简单、更快的解决方案!
我想知道如何创建一个像这样的自定义表?
body {
background-color: white;
}
table {
border: 1px solid black;
border-radius: 15px;
background: lightgrey;
color: black;
padding-left: 15px;
padding-right: 15px;
}
.t_head {
background-color: dodgerblue;
}
td {
padding-left: 10px;
padding-right: 10px;
}
#t_body {
background-color: grey;
}Run Code Online (Sandbox Code Playgroud)
<div id="test_div">
<table>
<thead>
<tr>
<div class="t_head">
<th>Test Header</th>
<th>Test Header</th>
<th>Test Header</th>
</div>
</tr>
</thead>
<tbody>
<div id="t_body">
<tr>
<th>Test data</th>
<th>Test data</th>
<th>Test data</th>
</tr>
<tr>
<th>Test data</th>
<th>Test data</th>
<th>Test data</th>
</tr>
</div>
</tbody>
</table>
</div>Run Code Online (Sandbox Code Playgroud)
我试图为 …