Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
需要Powershell中Python编程的帮助吗_Python_Powershell_Windows 7_Windows Xp_Wxpython - Fatal编程技术网

需要Powershell中Python编程的帮助吗

需要Powershell中Python编程的帮助吗,python,powershell,windows-7,windows-xp,wxpython,Python,Powershell,Windows 7,Windows Xp,Wxpython,所以,我买了这本书叫《艰苦学习Python》,在学习过程中,这是我的第一门编程语言 我现在面临的问题是无法在Powershell for Windows 7中创建目录。 我完全按照书中所说的“mkdir mystuff”进行操作,得到了以下错误 我只想让目录变成这样 C:\Documents and Settings\User\mystuff 我如何解决这个问题?非常感谢你的帮助 在WindowsXP中一切正常,但不是Windows7 PS C:\Windows\System32\W

所以,我买了这本书叫《艰苦学习Python》,在学习过程中,这是我的第一门编程语言

我现在面临的问题是无法在Powershell for Windows 7中创建目录。 我完全按照书中所说的“
mkdir mystuff
”进行操作,得到了以下错误

我只想让目录变成这样

C:\Documents and Settings\User\mystuff 
我如何解决这个问题?非常感谢你的帮助

在WindowsXP中一切正常,但不是Windows7

    PS C:\Windows\System32\WindowsPowerShell\v1.0> mkdir mystuff
    New-Item : Access to the path 'mystuff' is denied.
   At line:38 char:24
    +         $scriptCmd = {& <<<<  $wrappedCmd -Type Directory @PSBoundParameters
    }
         + CategoryInfo          : PermissionDenied: (C:\Windows\Syst...ll\v1.0\mys
      tuff:String) [New-Item], UnauthorizedAccessException
     + FullyQualifiedErrorId : CreateDirectoryUnauthorizedAccessError,Microsoft
   .PowerShell.Commands.NewItemCommand
PS C:\Windows\System32\WindowsPowerShell\v1.0>mkdir mystuff
新项目:对路径“mystuff”的访问被拒绝。
第38行字符:24

+$scriptCmd={&Windows正在阻止您将目录添加到System32文件夹。默认情况下,您没有这样做的权限,因为您确实不应该这样做

相反,请尝试将目录更改为更合理的位置,并使目录位于该位置。%UserProfile%是一个


顺便说一句,这在XP中起作用的原因是XP对安全性或权限要求不严格。这是错误的。:

根据提示,您正在尝试在PowerShell目录路径中创建文件夹,但您没有相应的权限。请改为尝试以下操作:

mkdir $env:USERPROFILE\mystuff

如果要创建目录
C:\Documents and Settings\User\mystuff
,请尽量明确说明:

cd "C:\Documents and Settings\User\"
mkdir mystuff

享受学习Python的乐趣。:-

您没有创建该目录的权限。使用UAC提升您的权限或在允许您编写“艰苦学习Python”的地方创建一个目录是“困难的”关于使用powershell的部分?我建议您使用,它将linux shell的强大功能带到windows桌面(并且已经包含python)。
%USERPROFILE%
应该指向所有windows系统上的可写路径。如果您需要完整路径,它可能类似于
C:/Users/[username]
Heh虽然%HOME%看起来不错,但我只能让%UserProfile%在WinXP中工作。。。?
cd "C:\Documents and Settings\User\"
mkdir mystuff