我正在创建一个简单的 GUI 程序来管理优先级。
我已经成功地添加了将项目添加到列表框的功能。现在我想将该项目添加到 C# 中称为 List<> 的内容中。Python中存在这样的东西吗?
例如,在 C# 中,要将项目添加到列表视图,我首先要创建:
List<Priority> priorities = new List<Priority>();
Run Code Online (Sandbox Code Playgroud)
...然后创建以下方法:
void Add()
{
if (listView1.SelectedItems.Count > 0)
{
MessageBox.Show("Please make sure you have no priorities selected!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else if (txt_Priority.ReadOnly == true) { MessageBox.Show("Please make sure you refresh fields first!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information); }
else
{
if ((txt_Priority.Text.Trim().Length == 0)) { MessageBox.Show("Please enter the word!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information); }
else
{
Priority p = new Priority();
p.Subject = txt_Priority.Text;
if …Run Code Online (Sandbox Code Playgroud) 我有一个关于 PyCharm IDE 的问题。似乎默认设置为在启动时打开所有最后一个项目,我想从没有打开项目的情况下开始。例如,到目前为止,我一直在从事两个项目,当我启动 PyCharm 时,它同时打开了这两个项目。