CmdLine Google Search Results in New Firefox Tab

This is a script that was supposed to be very basic, just running a command with my scripts arguments attached. I didn't realize that if user 'cj' opens firefox, when user 'root' does 'firefox -new-tab' it doesn't work. Firefox will just open a new window, and thats exactly what I didn't want to happen. The whole point was to open in a new-tab. So finding the user that logged onto the desktop, when the script was ran by root became the challenge. You can find out who ran the script alot of ways, but thats not what I wanted. Sometimes i'm doing things in my terminal as root and I want to just "gsearch Something" and have it open in a new tab, not a new window. The 'commands' module came in handy here, but if there is a breaking point for this script, it will be in using the 'users' command to get the logged in desktop user.
Another thing about this is it uses 'urllib' to make the search terms compatible URLS. Like:google.com/search?q="This Is My Search" becomes google.com/search?q="This%20Is%20My%20Search"

Anyway, once again, this is my second week with Python and I'm loving it, there may be better ways to do some of this stuff, but I am still learning. It's part of the process. Part of the reason I'm posting this code is so maybe someone might find something in it and say "hey, you could've just did this in 2 lines", or maybe someone new like me can use it for good. After all, I had to do alot of searching myself to figure some of this stuff out.

I would actually use a shell variable set and exported when starting each desktop. I would then use this saved username for current desktop (screen) to invoke browser, probably by having a statup script for browser using su with the shell variable name to open passed in url in a new tab. Then also it would work in multiuser Linux/x (including multiple X servers like Xvnc also running) and windows enpvironment and also without Firefox installed. So it would be generally applicable and system independent.

Hi. so this is actually a continuation from another question of mine[Here](https://www.daniweb.com/programming/software-development/threads/506795/dynamically-add-values-into-datagridview-cell-from-listbox-vb2010) but i was advised to start a new thread as the original question …

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...