好的,所以我是C#的新手,但已经学到了一点.但我有一个问题,如何用"*"替换键入控制台的字符或者只是完全隐藏它们?
var pw = "eric123";
Console.WriteLine("Password: ");
var value = Console.ReadLine();
if (value == pw)
{
Console.WriteLine("Permitted, Play online? (Y/N)?");
var getGameOnlineStatus = Console.ReadLine();
//Rest Of the Code is just for me :)
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激!
好的,所以我有问题。我正在尝试制作一个 GUI 十六进制转换器,但我一直收到同样的错误。我对 Tkinter 没有经验,所以有人可以帮助我吗?这是代码:
from Tkinter import *
def getNum():
hex1 = e1.get()
dec1 = int(hex1, 16)
ol.configure(text=dec1)
root = Tk()
introLabel = Label(root, text='Input Hex Code: ').pack()
e1 = Entry(root)
e1.pack()
e1.focus_set()
inputButton = Button(root, text='Submit Hex Code', command=getNum).pack()
ol = Label(root, text='Hex Code will appear here.').pack()
root.mainloop()
Run Code Online (Sandbox Code Playgroud)
我不断收到此错误:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1470, in __call__
return self.func(*args)
File "C:/Users/The Lodges/Desktop/Python/test.py", line 6, in getNum
ol.configure(text=dec1)
AttributeError: 'NoneType' object has …Run Code Online (Sandbox Code Playgroud)