首页 \ 问答 \ python不在相同的cmd窗口中运行(python is not running in the same cmd window)

python不在相同的cmd窗口中运行(python is not running in the same cmd window)

我已经安装了python 3.当我想使用pip时,它会打开一个新窗口,通过关闭该cmd窗口,消息和日志立即消失,但是在几天前,当我使用pip时,它会在同一个窗口中打开它。 我尝试过很多方法,但问题仍然存在。 我该怎么办?


I have installed python 3. When I want to use pip it opens a new window and the messages and logs disappear immediately by closing that cmd window, but in some days ago when i used pip it open that in the same window. I have tried and search many ways but the problem is still remaining. what should I do?


原文:https://stackoverflow.com/questions/43207723
更新时间:2022-08-16 17:08

最满意答案

一方面,您需要为每个画布提供唯一的ID。 从技术上讲,拥有相同ID的> 1项是不合法的。 使用ng-repeat值中的某些内容构造ID。 也许value.no如果这是一个唯一的数字。 您需要修改您的javascript以获取适当的上下文并写入它们。 可能在页面末尾或页面加载时执行此操作。

或者更好的方法是制作一个包含画布的指令和绘制它的必要函数。 该指令将负责根据传入的值创建唯一ID,然后它将知道如何引用和绘制到上下文中。


You'll need to give each canvas a unique ID,for one thing. Technically it's not legal to have > 1 item with the same ID. Construct the ID using something in the value of your ng-repeat. Maybe value.no if that is a unique number. You'll need to modify your javascript to get the appropriate contexts and write into them. Probably do that at the end of the page or on a page load.

Or the better way is probably to make a directive that contains your canvas and the necessary function to draw into it. The directive will be responsible for creating the unique ID based on the values passed in and it will then know how to reference and draw into the context.

相关问答

更多