我想在Windows中看到CPU临时和CPU负载.我不得不自己编写,而不是像Core Temp这样的软件.我如何访问此信息?
我读了一个与我相似的问题,但没有有用的答案:(.
我的任务是使用 Python 从任何网页获取命名函数列表。
我有一个使用 JavaScript 编写的脚本。它做我需要的。
当页面加载时,我可以从 JS 控制台(例如从 GoogleChrome 中的开发工具)运行脚本。结果我得到了函数名称的数组。好吧,但我转到页面并手动从浏览器执行脚本。但问题是从 Python 中做同样的事情。它看起来像这样:
def get_named_functions_list(url):
myscript = settings.get_js_code() # here I get script that I told above
tool.open(url)
while not tool.document.READY: # here I wait while the page will completely loaded
pass
js_result = tool.execute_from_console(myscript)
return list(js_result.values())
Run Code Online (Sandbox Code Playgroud)
那么,Python 中有没有什么工具可以帮助自动解决问题呢?
更新:为了更清楚,我可以将任务划分为子任务列表(在 Python 中):
因此,我想练习使用智能指针的技能。我创建了具有以下构造函数的类(单链列表)模板:
template <class Type>
class list
{
//...
public:
list( std::initializer_list < Type > initlist ) { ... }
//...
};
Run Code Online (Sandbox Code Playgroud)
在主函数中,我想构造初始化器列表并将其作为一件事传递给类构造器(类似这样,我认为这是可能的,但我不知道该怎么做):
typedef int Type;
int main ()
{
//...
size_t count; // to know How many elements initlist will have
std :: initializer_list < Type > initlist;
cout << "Enter, please, count of elements and their values\n";
cin >> count;
Type temp_data;
for (size_t i = 0; i < count; i++)
{
cin >> temp_data; //user input data and …Run Code Online (Sandbox Code Playgroud)