Help - Search - Members - Calendar
Full Version: ls-la unknown color scheme in terminal mode
Linuxhelp > Support > Technical Support
eightbits
Hello, new user here. I recently downloaded and unziped a file that contains examples of python files. Once unziped, in terminal mode the listing of
that directory shows the directories in that directory as a green background and blue foreground. I do not find a reference to that color scheme,
I am using Ubuntu 12.04.
The directories are named such as: Chapter-01 up to Chapter-18 .

The problem: I can not execute the example name.py files using ".\filename.py" as I can do with other py files (using the terminal mode).
I also get an error message that this is not a dirctory.
I CAN execute the file by using "python filename.py"
Other files not in this directory execute as been in the past.
Also, I can not execute the file(s) using the Desktop file menu. I have insured that the py files have execute permission as well.

The pythonfiles/ scripts run as expected using IDLE the python IDE.

This has me stumped and probally a simple way to understand, except for me :-).

I am thinking this has something to do with the way the zipped file was extracted but don't have a clue. I used the archive tool that is executed when I click on the
file.

I am hoping that I can get some insight so I can continue on in learning to use GUI Python code.

Thanks for any help.

PS: I do have a screen capture if required and I know how to post it.
michaelk
Difficult to say what the problem is but here are some things to check.
Make sure you are using the correct shebang in the first line of your program.
Make sure the permissions are set for executable
Make sure you are using the correct syntax to run the program i.e ./filename.py
If there are spaces in the file name make sure you escape the space or use quotes.
The example program might have errors and or expect different directories.
eightbits
Thanks michaelk for the reply. As I mentioned in the OP I set the permissions for execute and used the terminal mode in the same directory as the python file/script and used the command
"./name.py" to execute the file. I get a error message : No such file or directory even though it is in the directory listing. Strange that it is in the directory listing.
As other files execute in this manner I am thinking it has something to do with extracting the zip file (?).
If I go up one level all of the directories then show up with a GREEN background and BLUE foreground. So, I guess there doesn't seem to be an easy answer.
Strange that it does execute if I call the file from python at the command mode, "python name.py". It then executes as expected.

Another question: Is wxpython an active and well supported toolset?

Once again, thanks for your reply.
michaelk
Yes wxpython is active.

Is the permissions for the directory set as execute?
eightbits
QUOTE (michaelk @ Oct 21 2013, 07:36 AM) *
Yes wxpython is active.

Is the permissions for the directory set as execute?

Yes, the directory has mode 777 as the octal value for permissions. I am wondering, can the ./name.py have a path issue? Other scripts do execute (py scripts/files) do just fine.
Really confusing.....

Quaestion: Can a graphics file (bmp, png ...) be inserted on this forum? I called my self searching but didn't find anything.
michaelk
I'm confused too...

The . in ./name.py is a shortcut for current working directory. The command pwd will display the current working directory.
Try using the complete path. If spaces exist in the path or file name then use quotes.
i.e.

"/path/to/file.py"
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.