Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以从 pylons 中获取当前的 windows 用户?
我正在启动一个 pylons 应用程序,它将在受控的 Windows 域中使用。
是否可以获取已登录的用户?
就像我在 ASP.NET 中使用 Page.User.Identity.Name 所做的一样。
您可以使用标准的getpass模块执行此操作:
import getpass getpass.getuser()