Python 相当于 QList c++ 的 join
Python equivalent of join for QList c++
我正在编写一个简单的文本编辑器,我有一个关键字列表,我在Python中定义如下:
keywords = [
"action" ,
"perform",
]
就像在 C++ 中一样
#define {
QList<QString> keywords
keywords.append("action");
keywords.append("perform");
}; // Is this correct? I am trying to create a constant that would be a list of keywords
在 Python 中,我创建了一个与关键字匹配的正则表达式,如下所示:
keyword_match = r'b(' + r'|'.join(keywords) + r')b'
我的问题是,我怎样才能获得与 c++ 中的"join"相同的效果。
使用 QStringList
,它有一个join()
方法。
相关文章:
- 在std::thread中,joinable()然后join()线程安全吗
- join() 失败,如果在线程内部调用 io_context.run()
- std::future::get()或std::future::wait()是std::thread::join()的替
- c++17 std::thread join() : 没有这样的进程
- std::thread::join() 可以从非父线程调用吗?
- 使用 vector<thread> 和 .join() 未并行运行的多线程C++程序
- 为什么在线程销毁之前必须调用 join() 或 detach()
- thread.join() 的工作原理
- 有没有办法在C++中实现 Python 的 join()?
- 使用Boost :: Join合并多个阵列
- 寻找 std::join 行为的澄清
- 使用 Ranges-v3 视图::join保留双向性
- 在我调用join()之前,std ::线程运行
- 线程:join上是否存在具有synchronized with relationship的隐式内存障碍
- 线程已退出,代码为 1:Join() 和 Detach()
- C++/pthread/join 错误消息的含义 "what(): Invalid argument"
- 当不调用thread.join()时,C 多线程异常
- boost - thread.join() halts the ui
- 从 boost::algorithm::join 返回值的范围是什么?
- 使用或不使用join()方法与无限循环