PDA

View Full Version : [SOLVED] GladeGen - A very strange error indeed!



MaxVK
November 3rd, 2008, 06:16 PM
Having made a start with wxPython I have had to move to PyGTK. All seems fine, but I rather like the idea of using GladeGen.

The problem is that the program GladeGen.py, seems to be invisible!

Let me describe what I have done:

Downloaded GladeGen ;)
Place this into folder A
Used Glade(3) to create an interface
Saved the interface as Test.glade in the folder A (along with GladeGen.py)
Open a terminal window
CD to folder A
Type 'GladeGen.py Test.glade Test Test

According to the tutorial (http://www.linuxjournal.com/article/7421) this should now produce the required files with the event handlers etc.

However, what I get is this:
"bash: GladeGen.py: command not found"

I'm lost! Am I doing something so silly that I cant even see what it is? Surely since I have CD'ed to the folder GladeGen.py should be available!

I have tried using GladeGen as it came from the archive file, Iv tried making the file executable, but no matter what I do I get that message, which seems to make no sense!

Anyone have any ideas please.

Cheers

Max

happyhamster
November 3rd, 2008, 07:19 PM
Is GladeGen.py a binary? Try:

./GladeGen.py Test.glade Test Test

Else:

python GladeGen.py Test.glade Test Test

MaxVK
November 3rd, 2008, 07:31 PM
python GladeGen.py Test.glade Test Test

Ah now, that did it! Thanks.

But I wonder why I needed to add 'python'? It does not suggest this in the tutorial I was reading, and having made the file executable (I'm now using the original from the archive again) in my fiddlings surely it should have worked!

Anyway, many thanks for your help.

Regards

Max

SeanHodges
November 4th, 2008, 05:04 PM
But I wonder why I needed to add 'python'? It does not suggest this in the tutorial I was reading, and having made the file executable (I'm now using the original from the archive again) in my fiddlings surely it should have worked!

You were omitting the "./" at the beginning of your command. This is fine, as long as you're working directory is in your PATH environment variable. If you type:


echo $PATH

You'll get a list of the paths that will be looked in for the program if you omit "./" in your command; if the program is placed in any of these directories it will be found when typing "commandname [args]".

Usually, in Ubuntu you do not have your working directory in this list, so you need to type "./commandname [args]" to tell BASH that the program is in your current directory.

MaxVK
November 4th, 2008, 06:28 PM
That makes sense - I thought it might be something so blindingly obvious that I was missing it - Cant see the wood for the trees and so on!

Thanks for your reply - Its always nice to know where you are going wrong! ;)

Regards

Max

SeanHodges
November 5th, 2008, 11:22 AM
No problem, happy to be of some help :)