filtering the recursive ids in a file

i have a file which contains the data as below,

789990
789990
789990
789990
334989
334989
789990
-- here the no 789990 is repeated 5 times and 334989 is 2 times.
i want the output to be,

789990
334989 i.e only one entry of the repeated nos.

check man uniq

alternatively, if you have Python

# python -c "d=open('file').read().split();print ' '.join((set(d)))"
334989 789990

i checked with python, but it throws the below error

Traceback (most recent call last):
File "<string>", line 1, in ?
NameError: name 'set' is not defined

it means you have older version of Python.

#!/usr/bin/env python
d={}
data=open("file").read().split()
for i in data: d=""
print d.keys()

sort command may help in this case

sort -u yourfile.dat