Learn Python

Print a string


In [1]:
import random

import sys
import os
import socket
import time
hosName = (socket.gethostname())
socket.getaddrinfo('74.50.51.32' , 9999)


Out[1]:
[(2, 1, 6, '', ('74.50.51.32', 9999)),
 (2, 2, 17, '', ('74.50.51.32', 9999)),
 (2, 3, 0, '', ('74.50.51.32', 9999))]

In [42]:
import subprocess

In [59]:
callmds = ('ssh', 'drhealsgood@74.50.51.32')
gittest = ('git', 'log')

In [63]:
subprocess.check_output(gittest)


Out[63]:
"commit ab61a0a4f82a709a857ee2eb075b98a29d285050\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Wed Mar 5 21:09:48 2014 +1300\n\n    added other notebooks\n\ncommit 3a77a6fb34ab025a20c4e775729796de757c7ef2\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Wed Mar 5 20:03:00 2014 +1300\n\n    week 3 end\n\ncommit e1912708725a4ebe7a5755534c90673f8564fe32\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Mar 2 09:43:25 2014 +0000\n\n    added more time/list\n\ncommit 46cb66d1e294772d7fcabae3736980651107ec7b\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Mar 2 08:39:05 2014 +0000\n\n    added time and str\n\ncommit d930eff099be98caff876825134a8bf1878b91a6\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sat Mar 1 23:56:40 2014 +0000\n\n    added num to excel\n\ncommit a9a1e7284baf996d021763fb24a671ee34a3ae10\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Thu Feb 27 14:37:40 2014 +0000\n\n    sockets\n\ncommit b59ed1ed3de1f66bf6b8337d56a787c1163ae5f8\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Thu Feb 27 13:11:06 2014 +0000\n\n    added antigravity\n\ncommit 670ebb6e64971e8e3743c3bf3378fd3b5378be70\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Thu Feb 27 12:09:44 2014 +0000\n\n    added example w3 code to tony/bruce\n    ;\n\ncommit 2a9d5d40f48947ba673682bf29c90deec28a7fd0\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Thu Feb 27 10:19:04 2014 +0000\n\n    added sysadmin notes to bruce\n\ncommit 4917835a1aa36b4181d6bafcd36bf63639af022a\nMerge: 22876f4 0e8676e\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Wed Feb 26 07:19:47 2014 +0000\n\n    Merge branch 'master' of https://github.com/hamipy/learnpython\n\ncommit 0e8676e92729aa7079152b56f2de5c8dcd6f20d7\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Wed Feb 26 20:03:21 2014 +1300\n\n    added william\n\ncommit 0d5e299d0e3ade1605cc02afbcb4ee616320e888\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Wed Feb 26 20:01:33 2014 +1300\n\n    added third night class\n\ncommit 22876f4e5b260d3c75d4e1de31c4c59c579da71d\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Tue Feb 25 15:14:41 2014 +0000\n\n    wrote excel/input new notebook\n\ncommit 1a1225eccb47fe37ab6afb16cb1df4e3232e630d\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Tue Feb 25 14:01:19 2014 +0000\n\n    added bash to test\n\ncommit a8832afe8c2c75d2ed86359bb542c61e82bb16ae\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Feb 23 19:32:22 2014 +1300\n\n    rewrite code\n\ncommit 2e1298cde94911e4e96f44bcde6a0bc100c41fb0\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Feb 23 13:54:21 2014 +1300\n\n    added for loop to excel\n\ncommit 42e16d2fd392f57b7cc7bd900700f6ddfd421634\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sat Feb 22 21:07:44 2014 +1300\n\n    added linux meetup\n\ncommit 8ea3f2ca8642a96b46714808d08b94f3b2016a6e\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sat Feb 22 12:37:05 2014 +1300\n\n    added some examples for ian\n\ncommit fdbd9a1803fa110e63a14b21e57f450ff2a5945d\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sat Feb 22 12:36:09 2014 +1300\n\n    added greater number flex\n\ncommit aba02044adb4fb7fdbe7144a1a7daca535a82b02\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sat Feb 22 06:28:08 2014 +1300\n\n    added excel create\n\ncommit a72faedbdff02882f07138cbe50d847b6f549b53\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sat Feb 22 05:56:59 2014 +1300\n\n    added excel example\n\ncommit e72e525e032448511b4033a2b2080a1cd530b276\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sat Feb 22 04:56:25 2014 +1300\n\n    play with string\n\ncommit 5d2aacf8a4f424e5416b8b3bbccc26b4c172be9a\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sat Feb 22 04:40:41 2014 +1300\n\n    wrote more, rearanged\n\ncommit c8c222ad6b37d48acb438964e75e81329f8b2e14\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sat Feb 22 03:03:43 2014 +1300\n\n    notes\n\ncommit 50d6c3cf1024523b61a821c168b4458a4feccd23\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Fri Feb 21 20:59:51 2014 +1300\n\n    wrote more, rearanged\n\ncommit 0f3386aee53051a303b6e0e06d761b4c648142ac\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Fri Feb 21 12:19:05 2014 +1300\n\n    notes added\n\ncommit 7290c325b2e727789f79131ea65f0c4cfc5e7038\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Fri Feb 21 06:02:54 2014 +1300\n\n    wrote more, rearanged\n\ncommit 91638f930df2498cca14f1c64e544f2ebb9eabcb\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Fri Feb 21 03:27:52 2014 +1300\n\n    added bash\n\ncommit 61b1d3fcdde2080e89f578e9ac5bbebf898eb701\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Fri Feb 21 02:59:44 2014 +1300\n\n    added install6\n\ncommit e0f350047c9d28c3d6b85f8ec2b8d3d5ea19ddc0\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Fri Feb 21 01:42:26 2014 +1300\n\n    search folder\n\ncommit 623fb3f76383b20c9800855d6001f67cb69b2d43\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Fri Feb 21 01:38:56 2014 +1300\n\n    added subprocess\n\ncommit d990cb1a5dd4370623439e13fbcba120959d4651\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Thu Feb 20 23:11:57 2014 +1300\n\n    started plan for week3\n\ncommit f99917c931f4f7baeba8b4013a20310798c060cd\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Thu Feb 20 02:42:51 2014 +1300\n\n    added notes about class\n\ncommit 48aa5aaca310090092dd1dd3fe74d476c737ea4a\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Wed Feb 19 19:54:37 2014 +1300\n\n    end of the 2nd class\n\ncommit e220b4bd981ebb24e0c0db4c18c569e8fffc327e\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Wed Feb 19 19:25:51 2014 +1300\n\n    added peoples notebooks from 2nd class\n\ncommit 8e729a194ed04bdbaade6db0ea6106b86503bd0c\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Wed Feb 19 14:33:16 2014 +1300\n\n    bruces file update\n\ncommit a213c0dac5b295366f553c0b218b051935f5e321\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Wed Feb 19 02:48:31 2014 +1300\n\n    added backup\n\ncommit 46ea71f23dc9cd85e4a27db63d52dd0d8569ef79\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Tue Feb 18 20:29:04 2014 +1300\n\n    added clock time\n\ncommit 672ed07d94f2c6d40c0e8dc6c92d07db7a848269\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Tue Feb 18 19:57:46 2014 +1300\n\n    outputs numz\n\ncommit 885b9efb9064920ae270ee7af77f72179e447e4d\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Tue Feb 18 19:35:24 2014 +1300\n\n    added split on rawinput\n\ncommit 2cc99c8ee13cc1db55c75bbfa33185f54a7c18c9\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Tue Feb 18 19:02:17 2014 +1300\n\n    added more inputs\n\ncommit 2424b7e2829051e13fb1ff5e69b0989a60fe8d2b\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Tue Feb 18 18:37:50 2014 +1300\n\n    updated readme with plan\n\ncommit 69835e117306bc322f645707facc2f3790fd25ca\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Tue Feb 18 15:29:27 2014 +1300\n\n    fixed website lookup\n\ncommit 5f7e2861c2eac5ee09e09fcf429f5ad4864bb801\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Tue Feb 18 15:06:47 2014 +1300\n\n    fixed double functions\n\ncommit 5f26a4bdfe8cb9ca35c258641ef439a093984298\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Tue Feb 18 14:27:03 2014 +1300\n\n    added other notebooks\n\ncommit eab584addec0bdc7ebf43f08ecdfaf66ba3ee692\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Mon Feb 17 15:33:38 2014 +1300\n\n    added py terms to ipynb\n\ncommit 130f403f6f685838f23eec516b4c65153bbfda7a\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Mon Feb 17 02:37:32 2014 +1300\n\n    added time sleep\n\ncommit bf120eaf3b32c08c51cf1dea49a17f1c9026566c\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Mon Feb 17 01:17:09 2014 +1300\n\n    added for soup\n\ncommit 7bc2b8bf5c984908d915249f6bad4677ee9e09a9\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Mon Feb 17 00:04:13 2014 +1300\n\n    fixed str * userinput\n\ncommit f31d012dab5d8da67c3e52e02fb6a217959507e1\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Feb 16 14:31:30 2014 +1300\n\n    fixed name output\n\ncommit 1009830bca99d48c9716a5135e2d39444ff5dad4\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Feb 16 14:27:43 2014 +1300\n\n    added usr input\n\ncommit 70f4fbb957caf09cd9790fe79eb1b97a9fce5c13\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Feb 16 01:26:56 2014 +1300\n\n    py doesnt error\n\ncommit 227671e874cd44a3ad8a9a431bccf865560f4466\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Feb 16 01:20:01 2014 +1300\n\n    fixed url in readme\n\ncommit 74c271fc610ebbca5976ff6154d50e3983d93c65\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Feb 16 01:18:20 2014 +1300\n\n    added hostname\n\ncommit 92bafb0baaeb40a95234e52e888f6d4428fc98bc\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Feb 16 01:15:58 2014 +1300\n\n    updated readme. linked notebook\n\ncommit 430dfbc6c4a3ccc8e84c10ecdd4d5de9c1d19ba4\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Feb 16 01:10:34 2014 +1300\n\n    added hostname\n\ncommit 5b05558ef211d3c0c958c65f2a320aac3f6d761a\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Feb 16 01:04:18 2014 +1300\n\n    added hostname and time greeting\n\ncommit 0c0e5145aa1c3ebd256745e161ccc6949e8015da\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Feb 16 00:47:52 2014 +1300\n\n    fixed eror in py\n\ncommit d44b9692a7094f7a6fdc06bb9e1f7e5837798106\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Feb 16 00:39:33 2014 +1300\n\n    added learnpy\n\ncommit ed332e97aabeed01feb58f867fa20f47317ed420\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sun Feb 16 00:24:18 2014 +1300\n\n    added github\n\ncommit 4450348cfaf690ea42dc0345d8b4eea9794f8513\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sat Feb 15 23:38:32 2014 +1300\n\n    added reqests\n\ncommit ebc05b42d35a959cdf91a62bba5c198ba76b57a8\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sat Feb 15 21:10:25 2014 +1300\n\n    created learn notebook with basic\n\ncommit 3012422e18bf45a6f00a42706953f9c4abf9752e\nAuthor: wcmckee <will@artcontrol.me>\nDate:   Sat Feb 15 20:57:19 2014 +1300\n\n    created hello world\n\ncommit 7538ec343f65bd42d5fd388c7f64a4a03ca7c4b4\nAuthor: William Mckee <hammersmake@gmail.com>\nDate:   Fri Feb 14 23:44:01 2014 -0800\n\n    Initial commit\n"

In [60]:
subprocess.Popen(gittest, bufsize=5)


Out[60]:
<subprocess.Popen at 0x7f8fa017b510>

In [3]:
socket.getservbyport(10000)


Out[3]:
'webmin'

In [6]:
socket.socketpair()


Out[6]:
(<socket object, fd=109, family=1, type=1, protocol=0>,
 <socket object, fd=116, family=1, type=1, protocol=0>)

In [7]:
curtimez = time.strftime('%c')

In [8]:
s = socket.socket()         # Create a socket object
host = socket.gethostname() # Get local machine name
port = 12345                # Reserve a port for your service.
s.bind((host, port))        # Bind to the port

s.listen(5)                 # Now wait for client connection.
while True:
   c, addr = s.accept()     # Establish connection with client.
   print 'Got connection from', addr
   c.send('Thank you for connecting')
   c.close()                # Close the connection


---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-8-c0c6cc83a926> in <module>()
      6 s.listen(5)                 # Now wait for client connection.
      7 while True:
----> 8    c, addr = s.accept()     # Establish connection with client.
      9    print 'Got connection from', addr
     10    c.send('Thank you for connecting')

/usr/lib/python2.7/socket.pyc in accept(self)
    200 
    201     def accept(self):
--> 202         sock, addr = self._sock.accept()
    203         return _socketobject(_sock=sock), addr
    204     accept.__doc__ = _realsocket.accept.__doc__

KeyboardInterrupt: 

In [9]:
addrinfos = raw_input('Website to get ip: ')


---------------------------------------------------------------------------
StdinNotImplementedError                  Traceback (most recent call last)
<ipython-input-9-8c07f4b921e7> in <module>()
----> 1 addrinfos = raw_input('Website to get ip: ')

/usr/lib/python2.7/dist-packages/IPython/zmq/ipkernel.pyc in <lambda>(prompt)
    343             raw_input = lambda prompt='': self._raw_input(prompt, ident, parent)
    344         else:
--> 345             raw_input = lambda prompt='' : self._no_raw_input()
    346 
    347         if py3compat.PY3:

/usr/lib/python2.7/dist-packages/IPython/zmq/ipkernel.pyc in _no_raw_input(self)
    686         """Raise StdinNotImplentedError if active frontend doesn't support
    687         stdin."""
--> 688         raise StdinNotImplementedError("raw_input was called, but this "
    689                                        "frontend does not support stdin.") 
    690 

StdinNotImplementedError: raw_input was called, but this frontend does not support stdin.

In [10]:
sitesoc = socket.getaddrinfo(addrinfos, 80)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-10-68ac3f67764d> in <module>()
----> 1 sitesoc = socket.getaddrinfo(addrinfos, 80)

NameError: name 'addrinfos' is not defined

In [11]:
eleone = sitesoc[0]


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-11-c2ce9838ff60> in <module>()
----> 1 eleone = sitesoc[0]

NameError: name 'sitesoc' is not defined

In [12]:
print eleone


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-12-afb1093794cb> in <module>()
----> 1 print eleone

NameError: name 'eleone' is not defined

In [13]:
elz = eleone[4]


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-13-1f157eccb338> in <module>()
----> 1 elz = eleone[4]

NameError: name 'eleone' is not defined

In [14]:
print elz[0]


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-14-26fb1d8654b1> in <module>()
----> 1 print elz[0]

NameError: name 'elz' is not defined

In [15]:
len(sitesoc)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-15-5d18c9baa5e3> in <module>()
----> 1 len(sitesoc)

NameError: name 'sitesoc' is not defined

In [16]:
ipstr = str(elz[0])


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-16-177814ef9766> in <module>()
----> 1 ipstr = str(elz[0])

NameError: name 'elz' is not defined

In [17]:
greet = ('Hello ' + hosName + ' currently it is ' + curtimez + ' IP address: ' + ipstr)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-17-7a1f91eb372b> in <module>()
----> 1 greet = ('Hello ' + hosName + ' currently it is ' + curtimez + ' IP address: ' + ipstr)

NameError: name 'ipstr' is not defined

In [18]:
print greet


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-18-ce9fbf6f0ce7> in <module>()
----> 1 print greet

NameError: name 'greet' is not defined

In [19]:
print ('hello world!')


hello world!

Some basic math


In [20]:
print (3 * 5)


15

Variables


In [21]:
x = ('Hamilton Computer Club! ')

In [22]:
print x


Hamilton Computer Club! 

Add some math into that


In [23]:
print x * 6


Hamilton Computer Club! Hamilton Computer Club! Hamilton Computer Club! Hamilton Computer Club! Hamilton Computer Club! Hamilton Computer Club! 

In [24]:
i = ('bleh bleh bleh')

In [25]:
print i


bleh bleh bleh

In [26]:
upi = str.upper(i)

In [26]:


In [27]:
import requests

In [27]:


In [28]:
print newci[raci]


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-28-d4fc4f7ec1df> in <module>()
----> 1 print newci[raci]

NameError: name 'newci' is not defined

In [29]:
print upi


BLEH BLEH BLEH

In [30]:
print upi + i


BLEH BLEH BLEHbleh bleh bleh

modules are fun


In [31]:
import random

In [32]:
newRand = random.randint(0,666)

In [33]:
upi * newRand


Out[33]:
'BLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEHBLEH BLEH BLEH'

In [34]:
import requests

I used requests to get website data


In [35]:
newSite = requests.get('http://tlcxpress.ac.nz/tlc-website/notices/')

In [36]:
newFile = open('site','w')

In [37]:
newFile.close()

In [38]:
import os

In [39]:
getHost = os.path

In [40]:
for d in getHost:


  File "<ipython-input-40-0ff333799589>", line 1
    for d in getHost:
                     ^
SyntaxError: unexpected EOF while parsing

In [ ]:


In [35]:
import antigravity

In [36]:
antigravity.webbrowser.


Out[36]:
<module 'webbrowser' from '/usr/lib/python2.7/webbrowser.pyc'>

In [37]:
from __future__ import braces


  File "<ipython-input-37-2aebb3fc8ecf>", line 1
SyntaxError: not a chance

In [43]:
import antigravity

def main():
    antigravity.webbrowser.subprocess

if __name__ == '__main__':
    main()

In [44]:
main()

In [45]:
print main()


None

In [ ]: