在Java中我可以調用類或方法,無需通過引用它的完全合格的名稱將其導入: public class Example {
void example() {
//Use BigDecimal without importing it
new java.math.BigDecimal(1);
}
}
類似的語法顯然不會使用工作的Python: clas
我需要從任何類(在同一個程序集中)調用任何方法並傳遞參數。到目前爲止這麼好(我相信),但Invoke問我一個對象數組(我可以得到),但是按照方法中預定義的順序。 我做了這個類的參數爲: public class Parametros {
public string type { get; set; }
public string name { get; set; }
從WinForms應用程序考慮以下代碼示例: public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
我有以下代碼工作正常,直到我在程序結束時添加了while循環,基本上試圖保持循環運行永遠(更新屏幕),直到窗口關閉。 while 1:
tk.update_idletasks()
tk.update()
time.sleep(0.01)
在加入上面的代碼,以現有的代碼,程序運行,但在出口,與此錯誤出現: _tkinter.TclError: can't in