English 中文(简体)
我怎么能够用捷径在晚上开斋呢?
原标题:How can I open jupyter in a venv with a shortcut?

我在视窗10的虚拟环境中安装了Jupyter,使用以下权力指挥:

virtualenv --python C:PathToPythonpython.exe venv-name
.venv-nameScriptsactivate
pip install numpy matplotlib jupyter notebook pandas joblib scipy sympy
jupyter notebook

I have done absolutely nothing beyond this other than having Python and virtualenv on my computer. To get into Jupyter notebook, I run lines 2 and 4 of this in Powershell, which works just fine.

我如何利用桌面/Taskbar捷径启用Jupyter笔记本发挥同样的作用?

我阅读了

问题回答

根据您对互动动力学会议(第2条和第4条)发行Jupyter Notebook的描述,你需要把短篇文件“>,Windows PowerSh CLI,附上述声明。

一、导 言 Shell create create create create create

# Path to the shortcut file; adjust as needed.
$shortcutFile = "$env:USERPROFILEDesktopJupyter Notebook.lnk"

# Create the shortcut file...
$shortcut = (New-Object -ComObject WScript.Shell).CreateShortcut($shortcutFile)

# ... and set its properties.

# Specify the target executable and its arguments.
$shortcut.TargetPath =  powershell.exe  
$shortcut.Arguments =
   -NoExit -Command .venv-nameScriptsactivate; jupyter notebook 

# Specify the working directory.
$shortcut.WorkingDirectory =  %USERPROFILE% 

# Set the window style, if needed.
$shortcut.WindowStyle = 7 # Open the PowerShell console window minimized.

$shortcut.Save()

# Test invocation (simulate opening the shortcut interactively)
Invoke-Item $shortcutFile

Note:

  • -NoEx使PowerShell会议继续开放,以便你能够检查启动时发生的情况;一旦你核实启动该笔记本的工作是按预期进行的,你可以撤销。

  • <编码>$shortcut.WindowStyle = 7, 开始使用PowerShell sessionminimized (因为你可能不愿看到ole窗。) 因此,如果你想要检查启动时发生的事情,则与<代码>-NoExit相结合,你就不得不通过任务栏激活最小的窗口。

  • 指定为<代码>。

    • 如果您指定mere file name - e.gpowershell.exe,则在这条道路上,即在标准 $env:PATH环境变量上列名的名录中找到。

      • Caveat: If an executable by that name happens to exist in the same directory as the shortcut file, IT is used.
    • 因此,为了充分有力,你可能希望指定一个full path,例如:

      • 2. 采用字面或环境变化的道路,例如:

         .TargetPath = "$env:windirSystem32WindowsPowerShellv1.0powershell.exe"
        
      • 或者,通过执行<代码>$env:PATH,在设计时间上看;例如:

         .TargetPath = (Get-Command powershell.exe).Path
        
  • 启动的流程工作目录按规定如下:

    • http://www.un.org (如典型;通过任务栏或从桌面或从档案探索者那里)

    • 相比之下,在programmatic的援引中,它取决于stationer s workingDirectory,但有一处微妙的区别。

      • with Invoke-Item, it is the the working directory of the caller s process - which typically differs from PowerShell s working directory.
      • with Start-Process, it is the calling the working directory (location) of the calling PowerShell session.
    • 因此,最好在上指定一份工作名录,指定在<代码>上。 工作名录财产。

  • 如以上<代码>.WorkingDirectory sign, 您可使用cmd.exe-type environment-variable reference,例如%USERPROFILE%,并在上同样支持这些参考资料。 TargetPath,.Arguments and .IconLocation nature.

  • 文件链接:





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签