无法同时运行Tkinter和Flask

时间:2018-06-18 17:50:40

标签: multithreading python-3.x asynchronous flask tkinter

我有demo.py代码,我可以在tkinter窗口中打开Web-Cam。现在,我还有烧瓶代码来显示你好@localhost。

当我运行demo.py文件时,它会运行我先编写的函数。例如:

<div class="activate" data-percent="70%" style="transition-timing-function: linear;">C++</div>
<div class="activate" data-percent="80%" style="transition-timing-function: ease";>C#</div>
<div class="activate" data-percent="50%" style="transition-timing-function: ease-in;";>Java</div>
<div class="activate" data-percent="80%" style="transition-timing-function: ease-out;";>HTML</div>
<div class="activate" data-percent="60%" style="transition-timing-function: ease-in-out;";>CSS</div>
<div class="activate" data-percent="10%" style="transition-timing-function: ease";>JavaScript</div>
<div class="activate" data-percent="40%" style="transition-timing-function: ease-out;";>SQL</div>
<div class="activate" data-percent="30%" style="transition-timing-function: ease-out;";>CISCO</div>
<div class="activate" data-percent="10%" style="transition-timing-function: linear;">Python</div>
<div class="activate" data-percent="75%" style="transition-timing-function: ease-in-out;";>Microsoft Office</div>
<div class="activate" data-percent="50%" style="transition-timing-function: ease";>GIMP</div>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<script>
(function() {

        var activateEl = $('div.activate'),
                activateElOffset = activateEl.offset().top/2,
                documentEl = $(document);

        documentEl.on('scroll', function() {
            if (documentEl.scrollTop() > activateElOffset) activateEl.style["width"] = activateEl.getAttribue('data-percent');
        });

})();
</script>

我如何同时运行两个?

0 个答案:

没有答案