Write a 440 Hz Sine Wave to .wav-File using Python and SciPy
After some experimenting i came up with the following:

#!/usr/bin/env python3

import numpy as np
from scipy.io import wavfile

sampleRate = 44100
frequency = 440
length = 5

t = np.linspace(0, length, sampleRate * length)  #  Produces a 5 second Audio-File
y = np.sin(frequency * 2 * np.pi * t)  #  Has frequency of 440Hz

wavfile.write('Sine.wav', sampleRate, y)


I pulled out one of my math-books and figured out how to write the sine-function:

Since sin(x) has a period of 2*pi, sin(2*pi*x) has a period of 1/Frequency of 1Hz. Thus, sin(440*2*pi*x) has a Frequency of 440Hz. 

The last thing that was unclear to me was how to get the array-length and element-count right!

Opting for a File that has a sample rate of 5 seconds at 44.1 kHz Sample Rate, i need 5 * 44.1k samples, so that was already ok. But since sin(440*2*pi*x) performs 440 periods until t == 1, the array simply has to have a duration of 5 (5 seconds in my case to be precise). enlarging the array boundaries would have squished the array-values together, resulting in a higher pitched sound.

Sorry to anyone that has already scratched their head, i probably should have thought for a little bit longer!