LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Basics of running a program (https://www.linuxquestions.org/questions/linux-newbie-8/basics-of-running-a-program-4175506625/)

patrick160356 05-31-2014 03:12 PM

Basics of running a program
 
Hello,

I cannot seem to find an answer to the question I have, so I hope you will bear with me if it has been asked previously (and I am certain that it has been).

I installed Linux Mint today, so that tells you how new I am to Linux. I used the Software Manager to install a program a few hours ago, but this program does not seem to include a menu item to run it. The web site for the program has a "Usage" section that gives a # followed by the name of the program, but nothing else. I entered this string through Terminal, but nothing happens when I enter the string. I just get a new $ line.

I assume there must be a command, such as "run," that must be entered before the string, but in 3 hours of searching sites and reading forum entries (here and elsewhere), I have not found what that command is. Can someone please help me by giving a simple 1, 2, 3 on how to run a program?

And, please, I have read some rather snide and nasty comments from experienced users to people like myself over the past few hours. I know nothing about using Linux. I am not a programmer. I am just a simple computer user who would like to learn how to use Linux so I can get away from Windows. What I need is some simple help, not to be told how stupid I am. I know that I am stupid at Linux and I will work to become less stupid over the next few weeks and months. Right now, I just need to know the basic steps to get an installed program running.

Many thanks for the assistance.

Patrick

sycamorex 05-31-2014 03:37 PM

Hi and welcome to LQ.

What was the name of the program that you installed?

johnsfine 05-31-2014 03:43 PM

The simple way of running a program is to type just the name of the program at the prompt in terminal.

The # you saw in the instructions is not something you were supposed to type. Depending on the distribution used by the person who wrote the instructions, that # was probably supposed to tell you that you must be the root user to run the program (obviously that is not a very beginner friendly way of telling you that).

If # in the instructions meant you must be root, I'm not sure of details of Mint to answer the question of how you accomplish that. Some likely possibilities are:

1) You type sudo then space then the name of the program, rather than just the program name. It probably then asks for your password.

2) You type
sudo su
then it prompts for your password, then the prompt changes to # and you type the name of the program.

3) You type
su
then it prompts for the root password (not your password), then the prompt changes to # and you type the name of the program.

In some distributions and for most programs, any one of those three will work. But other distributions might default to disabling one or two of those and a very few programs can't work with method (1) but can with 2 or 3.

patrick160356 05-31-2014 03:54 PM

Hmmm ... Thanks, Johnsfine. Okay, so I entered the name of the program and I get "Can't open file. No such file or directory."

To answer sycamorex's question, the program is Pykaraoke and the command line given is:

python pykaraoke.py

What I don't understand is why developers don't include a menu item in their distribution. Is that such a big thing to write? It's now 4 hours trying to set this simple karaoke program up for a party.

johnsfine 05-31-2014 04:10 PM

Most Linux programs don't make things that hard.

I hope you don't need to be root for a karaoke program. So I don't know what the # meant, but anyway not something you were supposed to type.

If you knew which directory pykaraoke.py was in, you could cd to that directory and then the command should work.

Ubuntu is very similar to Mint, but easier for non users to check online where things are. I just checked (at packages.ubuntu.com) and found pykaraoke.py is in
/usr/share/pyshared/

So to run it, you might try:

cd /usr/share/pyshared
python pykaraoke.py

snowday 05-31-2014 04:19 PM

"python" is a programming language.

"pykaraoke.py" is the name of a python program that somebody wrote.

"python pykaraoke.py" means in English "run the python program called pykaraoke.py."

It's not particularly complicated or confusing if you think about it for a minute. Now, maybe the website where you downloaded it has confusing instructions, but that's not Linux's fault in general. ;)

Shadow_7 05-31-2014 04:24 PM

Some developers run window managers that DON'T HAVE MENUs. Not that it's a justification. But if you develop something it's assumed that you tested it, which you can't do if you run a window manager which has no menus. Or sometimes your window manager has menus, but it's so off the radar that the distro provides no menu items for it.

From the command prompt you would normally prefix the executeable with ./

$ ./program

But for script languages you would prefix them with the interpreter.

$ bash script.sh
(although ./ uses the shebang / interpreter line to determine the interpreter.)

$ python program.py

$ java -c program.jar

etc...

There's "which" and "find" to help you locate the program if you don't know where it installed to.

jefro 05-31-2014 08:39 PM

"Can't open file. No such file or directory."

Just type in python and see what it returns. I assume it will work. If so then it can't find the script you have as Shadow7 suggests. Not sure what the software manager did to install it either. I'd find where it is from command line and then issue command to start or make direct full path in what ever directory you are in.

Guess it wouldn't be too hard to make a launcher for that app so that you can run it from desktop or start menu.

The program you want to run is not a mainstream type of app. You have to accept this stuff. People like yourself may write a program in the only way they know how and offer it to others. In this case you do run the program as you stated. You have the program Python execute/run the script.

http://www.kibosh.org/pykaraoke/installation.php has exact requirements too. It may be that you have to add in other files or apps. We usually call that dependencies.

patrick160356 05-31-2014 11:50 PM

Many thanks for all the help. I've been fiddling with this for another couple of hours now and simply cannot get the program to run. I think it needs one of the add-on programs, but since that program has zero help in how to install it, I can't do that either.

I may change to another version of Linux. In the research I did, Mint came up with lots of claims of its ease of use and the large quantity of software available for it. It also came up as one of the top 2 for those with little programming knowledge, but I guess that's not correct.

Long-story short, I went out searching for a Windows karaoke program that would install (and work! :-)) through Wine. I tried about 30 of them. I got 5 of those to actually install and a simple little program called Karaoke Builder Player actually works. So, I'm set for this party later today.

Thanks, again, and I'm sure I'll be back with more head-scratching questions in the not-too-distant future.

jdkaye 06-01-2014 12:22 AM

I think you downloaded the source code rather than the compiled program. Debian has a package called pykaraoke with an executable placed in /usr/games. Since /usr/games is in the system's PATH variable you don't need to specify a location. The command to run the program is most definitely
Code:

pykaraoke
You can run it from a terminal or from a desktop shortcut or from your desktop's "Run Command:" window. Note that pykaraoke.py is not included in the package pykaraoke but rather in the package python-pykaraoke which is one of the dependencies for the pykaraoke package.

Hope that clears up the matter.
jdk

rtmistler 06-02-2014 07:41 AM

Quote:

Originally Posted by patrick160356 (Post 5180104)
Many thanks for all the help. I've been fiddling with this for another couple of hours now and simply cannot get the program to run. I think it needs one of the add-on programs, but since that program has zero help in how to install it, I can't do that either.

I may change to another version of Linux. In the research I did, Mint came up with lots of claims of its ease of use and the large quantity of software available for it. It also came up as one of the top 2 for those with little programming knowledge, but I guess that's not correct.

I'd consider continuing to give MINT a try; this sounds more like the case you stated in your first paragraph which is that the author may have not provided too much information for a python uninitiate to know in order to get the program running. If you're just getting going with Linux, hopping from one distro to another may add to frustration. Personally I find that most of the main ones include a good suite of browser, mail, multimedia (viewing not mixing/editing/creating), and office-like softwares; as well as most of the normal Linux command capabilities. There are design differences, desktop view differences; however if you want your desktop to look different, you can work at that in any distribution and attain it; I feel. I care more that it's stable, it does work as expected, and that it performs well.

A question to consider asking in a thread would be if any persons have some recommendations for karaoke software which runs under Linux and what they think about it. Because I think most distributions do not include that type of software; you'd then have to install it via package manager, compile it, or grab something like what you've gotten here. Also I've found that a lot of multimedia editing software may require special packages; unless it's been around for a bit and it turns out that those packages are already included in most distributions. Editing, mixing, or creating multimedia tries to be very open about formats, as well as cutting edge. It's just either a programming direction which has gotten a lot of attention, or it hasn't. Doesn't mean there's anything wrong with MINT by the way, and doesn't mean that karaoke software for Linux doesn't exist that's easy to use and works well; unfortunately I do not have any recommendation on that particular front.

patrick160356 06-02-2014 07:49 AM

Hi rtmistler. The Pykaraoke is the only Linux karaoke program I've seen. It's not critical for me to have this, I just needed it for this particular evening because of a problem I have with my Windows installation (for which I will probably start another thread :-)). The karaoke program I got to work through Vine worked perfectly for last night's party, so that sorts that problem.

I won't switch from Mint because I like the interface and, other than the karaoke program, everything I've downloaded has been simple to install and use.

Thanks, again, for the thoughts.


All times are GMT -5. The time now is 11:02 PM.