Skip to content

Commit

Permalink
google youtube search with parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshlinux committed Apr 19, 2018
1 parent c258b09 commit c8ad02b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
3 changes: 2 additions & 1 deletion fileCompress.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

def compress():
string = re.sub('[ \t\n]+',' ','The quick brown \n\n \t fox')
print string
print(string)

if __name__ == '__main__':
compress()
3 changes: 1 addition & 2 deletions google.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
@ py "C:\Users\acer\Desktop\pythonbox\pythonPrograms\google.py"
@ pause
@ py "C:\Users\acer\Desktop\pythonbox\pythonPrograms\google.py" %*
3 changes: 1 addition & 2 deletions google.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@
address = "http://www.google.co.in/search?q={}".format(query)
webbrowser.open(address)
else:
webbrowser.open('http://www.google.co.in/search?q=binarynote')

webbrowser.open('http://www.google.co.in/search?q=binarynote')
1 change: 1 addition & 0 deletions youtube.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@ py "C:\Users\acer\Desktop\pythonbox\pythonPrograms\youtube.py" %*
18 changes: 18 additions & 0 deletions youtube.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# !python36
#-------------------------------------------------------------------------------
# Name: google.py
# Purpose: search google using command line
# Author: rakesh kumar
# Created: 03-02-2018
# Copyright: binarynote.com
# Licence: MIT
#-------------------------------------------------------------------------------

import sys,webbrowser
if( len (sys.argv) > 1):
query = "+".join(sys.argv[1:])
address = "http://www.youtube.com/results?search_query={}".format(query)
webbrowser.open(address)
else:
webbrowser.open('http://www.youtube.com/results?search_query=binarynote')

0 comments on commit c8ad02b

Please sign in to comment.