> For the complete documentation index, see [llms.txt](https://wiki.solids.group/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.solids.group/computing/python-on-windows.md).

# Python on Windows

{% hint style="warning" %}
This is old and kind of dated and should probably be cleaned or replaced.
{% endhint %}

## Option 1: Google Colaboratory

Google Colaboratory is the preferred option for many course and research-adjacent Python tasks. Go to [Google Colab](https://colab.research.google.com/) to create an interactive Python Jupyter notebook.

## Option 2: WinPython and Spyder

If you need to run Python locally on Windows, you can use Spyder through WinPython.

1. Download [WinPython](https://winpython.github.io/).
2. Install it on your PC.
3. Open the Spyder application.

Spyder provides a script editor and an output panel.

![Spyder on Windows](https://685164709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeANVOBYNJa4QbJRfCyTX%2Fuploads%2Fgit-blob-a9b2d2f17e19bf1d5f3f8fc1d33e4bf38f0cb5df%2Fspyder-1024x611.png?alt=media)

## Plotting Example: sin(x)

Use the following code to plot a simple trigonometric function:

```python
import numpy
import pylab

X = numpy.linspace(0, 1, 100)
Y = numpy.sin(2 * X * numpy.pi)

pylab.plot(X, Y)
pylab.show()
```

To save a figure instead of showing it interactively:

```python
# pylab.show()
pylab.savefig(r'C:\Users\brunnels\Desktop\myfile.png')
```

The output format is determined by the file extension.

## Plotting Example: Singularity Brackets

The following script plots functions using singularity brackets by defining a `bracket` function.

```python
import numpy
import pylab

def bracket(x, n):
    return 0.5 * (numpy.sign(x) + 1) * (x**n)

L = 1
X = numpy.linspace(0, 2, 1000)

Y0 = bracket(X - L, 0)
Y1 = bracket(X - L, 1)
Y2 = bracket(X - L, 2)

pylab.plot(X, Y0, label="^0")
pylab.plot(X, Y1, label="^1")
pylab.plot(X, Y2, label="^2")

pylab.legend()
pylab.show()
```

Example output:

![Singularity bracket plot](https://685164709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeANVOBYNJa4QbJRfCyTX%2Fuploads%2Fgit-blob-80c199570db7346af8b9b22d4b2f345e51593041%2FUntitled.png?alt=media)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://wiki.solids.group/computing/python-on-windows.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
