In [9]:
import os

In [10]:
from subprocess import Popen, PIPE

In [3]:



Out[3]:
0

In [11]:
os.getcwd()


Out[11]:
'/Users/kelty/Desktop/Amazon-Review-Project'

In [16]:



Out[16]:
['.dbfseventsd',
 '.DocumentRevisions-V100',
 '.DS_Store',
 '.file',
 '.fseventsd',
 '.hotfiles.btree',
 '.Spotlight-V100',
 '.Trashes',
 '.vol',
 'Applications',
 'bin',
 'cores',
 'dev',
 'etc',
 'home',
 'Library',
 'mach_kernel',
 'net',
 'Network',
 'opt',
 'private',
 'sbin',
 'System',
 'tmp',
 'User Guides And Information',
 'Users',
 'usr',
 'var',
 'Volumes']

In [17]:
os.system('ssh ec2-user@ec2-54-183-87-221.us-west-1.compute.amazonaws.com')


Out[17]:
0

In [18]:
stdout, stderr = Popen('ssh', )


Out[18]:
32512

In [6]:
output = Popen(['hive' '-e "select * from isura_review_x limit 10";'], stdout=PIPE)


---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-6-a9f72b585cfe> in <module>()
----> 1 output = Popen(['hive' '-e "select * from isura_review_x limit 10";'], stdout=PIPE)

/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.pyc in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
    707                                 p2cread, p2cwrite,
    708                                 c2pread, c2pwrite,
--> 709                                 errread, errwrite)
    710         except Exception:
    711             # Preserve original exception in case os.close raises.

/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.pyc in _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, to_close, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite)
   1324                         raise
   1325                 child_exception = pickle.loads(data)
-> 1326                 raise child_exception
   1327 
   1328 

OSError: [Errno 2] No such file or directory

In [8]:
os.system('quit')


Out[8]:
32512

In [ ]: