Ubuntu :: Python Works In Interpreter But Not Actual Script?

Aug 17, 2010

I wrote a script to use egrep to search files for '#!/usr/bin/python' so I could tell what my Python scripts were/where they were. It grabs 'ls' and separates it into an array. It uses ls -F so I can pop anything with a / in it; giving me just files. It then egrep's them. Here's the code.

Code:
#!/usr/bin/python
import commands as com
ls = com.getoutput("ls -F")
ls = ls.split("

[Code]....

When I run all that code in the interpreter, it works. If I run it from Bash (eg ./egrep) it throws me an error like this 'egrep: [Screenshot.png]: No such file or directory' for every file in the directory. Also, it doesn't filter out the directories either.

View 5 Replies


ADVERTISEMENT

General :: Build ONLY Python Interpreter?

Oct 26, 2010

I am using ubuntu hardy and python 2.6.5 (built from sources). For a custom python packager I need to rebuild python interpreter (python executable). I am new to linux and don't have much knowledge of gcc and other stuff. Here is the process:1. Copy python.c as myapp.c. myapp.c is in the same directory (python2.6.5) in which I have all the required files. 2. Using the syntax from makefile of python sources, here is my first command to produce myapp.o

Code:
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I/home/zeno/installed/Python-2.6.5/Include -fPIC -DPy_BUILD_CORE -c myapp.c -o myapp.o
This produce myapp.o but throws a warning:

Code:
myapp.c:24:2: warning: no newline at end of file
Next is to produce the executable or python interpreter:
Code:
gcc -pthread -Xlinker -export-dynamic -o $@ myapp.o -L. -lpython2.6 -lpthread -ldl -lutil -lm -o myapp
This is causing an error:
Code:
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'

[Code]...

View 1 Replies View Related

Ubuntu :: Bad Interpreter: Can't Find Perl In Synaptic Either

Oct 31, 2010

I downloaded a Perl script from off a page on the Internet, and tried to run it. It displayed its source in the web browser. First of all, I am in the cg-bin containing my cgi file and the file permissions are set to 755. I open the Terminal in this folder and run ls, which lists my file called hello.cgi; I run hello.cgi, and get a not found error, and run ./hello.cgi and get source code less comments:

Code:

me@fast:~/Files/Website/perl-dropdown/cgi-bin$ ls
hello.cgi redir.cgi
me@fast:~/Files/Website/perl-dropdown/cgi-bin$ hello.cgi

[code]....

Next I open my Synaptic and search for perl, so I can reinstall it. I find nothing. I navigate to /usr/bin and eventually find perl and perl5.xx as well.

View 4 Replies View Related

Programming :: Implement The OOP In Interpreter?

Mar 7, 2011

I have a partially completed interpreter that has first-calss functions and can store scopes in variables. That way it is possible to implement a simple class like this:

Code:

MyClass = func () {
value = 0;
setValue = func (x) value = x;;

[code]....

But what about inheritance, and what if I want to know the type of the object?

View 6 Replies View Related

Ubuntu :: Matlab Latex Interpreter - Broken Fonts In EPS And PDF

May 27, 2011

Our Matlab users met the problem in Ubuntu while using Latex interpreter in Matlab. Namely, eps and pdf files generation out of Matlab plot outputs plot legend and axes lables incorrectly. All the letters are mixed, impression that character spaces are too dense. We can't blame Matlab, since exactly the same examples with the same Matlab version work fine on CentOS. We tested Ubntu 9.10, 10.4 and 10.10 -- same problem. Matlab version R2010b.

In addition, jpg, png generated with no problems. It's eps and pdf only
Matlab example:
plot(1:1:10)
xlabel('example','Interpreter','latex')
ylabel('ExAmPlE','Interpreter','latex')
a=legend('EXAMPLE example ExAmPle')
set(a,'Interpreter','latex','Fontsize',13)
print -depsc2 figure1
I am attaching a PDF, looks same as eps, but easier to display.

View 9 Replies View Related

Debian :: Java Interpreter Not Working?

Jul 25, 2010

I installed openjdk 6. The compiler works fine, but when I try to run the .class file, I get:

Exception in thread "main" java.lang.NoClassDefFoundError: hello/java
Caused by: java.lang.ClassNotFoundException: hello.java
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)

[code]...

View 5 Replies View Related

Fedora :: 'ld-linux.so.2 Bad Elf Interpreter' Error

Nov 12, 2009

I have installed fc11 x86_64 on my machine. When I try to install .bin files, it displays 'ld-linux.so.2 bad elf interpreter no such file or directory' error. I have also installed glibc but it didn't fix the problem.

View 1 Replies View Related

Fedora :: Installing Maya2010 - Bad ELF Interpreter?

Jan 22, 2010

I just wanted to install Maya 2010 on Fedora 12 x86_64, but setup alway ends with the following error (right after having started that):

Code:
bash: ./setup: /lib/ld-linux.so.2: bad ELF interpreter
Autodesk recommends Fedora 9 for Maya, but I wanted to give it a try on F12. So before giving up on that one, I've got some questions:

1. What's an ELF interpreter, anyway?

2. Is there any workaround for that problem, or do you have some suggestions on what I might try?

View 3 Replies View Related

Programming :: Perl - Interpreter For Fib Numbers

Apr 1, 2010

As some of you know that I am new to this forum. I have another problem that I got stuck on. I have this file called "Fib.rbb" and my instructor told us to write an interpreter program by using Fib.rbb.

"You are to write an interpreter in Perl for Rongs Basic Basic (RBB) as explained in class. The BNF description for RBB and a test file called Fib.rbb are part of the RBB.zip file which is available in the Course Documents folder on blackboard. If you call your interpreter myIntp.pl, you would execute the program via perl myIntp.pl Fib.rbb

Code: Print "A few Fibonacci numbers:"

View 3 Replies View Related

General :: /bin/sh: Bad Interpreter: Permission Denied?

Nov 5, 2010

I am installing Oracle 11g on Oracle Enterprise Linux 5.0 32 bit (virtual machine)i did all the mandatory steps, i am trying to run the installer but i am facing the below:bash: ./runInstaller: /bin/sh: bad interpreter: Permission deniedknowing that the run isntaller is found in an iso file, in which i linked the VMwarre CD/DVD drive to it

View 4 Replies View Related

Software :: Bad ELF Interpreter / No Such File Or Directory?

Jul 11, 2011

Starting sshd: /etc/init.d/sshd: /usr/sbin/sshd: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

---------- Post added 07-11-11 at 01:29 AM ----------

and btw i have install al glibc.x86_64

uname -m
x86_64

View 1 Replies View Related

Programming :: C++ Compilation And Attach In Tcl Interpreter?

Mar 25, 2011

i am working with ad hoc network but the problem is not getting any good documentation of how to compile c++ code then how to add the code into Tcl intrepreter and how to work with make file. i want to run my own algorithm using c++ and then want to incorporate it into tcl interpreter and then want to run.

View 2 Replies View Related

Programming :: Objects And Assignment In Interpreter?

Feb 9, 2011

I have it so that an Env object contains all the variables in the current scope, and the parent scope. You can also save them to variables like objects, and my idea is to use the "." operator to get values from them.

First, how do I assign to them? I currently have it that only a variable name can be assigned to, but you should be able to assign to an "obj.value" expression, too. How do I keep track of what variable to set and still be able to say it in an expression and have it evaluate to the variable?

Second, these object don't really have a "type", they're just containers that contain any values you want under any name you want. How can I, for example, define a primitive "boolean" object and have things like if statements recognize it?

View 14 Replies View Related

Programming :: Make Python Programs Run Without Entering The Command Python?

Mar 22, 2009

I want to be able to do

sudo ./program.py

instead of always having to do

sudo python program.py

What do I need to change?

View 5 Replies View Related

Programming :: Python - Get Text File Data Into An Array On Python?

Nov 30, 2009

I've already used line split stuff to transform my data into something like this in a text file:

Code:

['1', '1', '3', '20.7505207']
['2', '1', '3', '23.0488319']
['3', '1', '3', '-1.5768747']
['4', '1', '3', '-26.4772491']

[code]....

How can I get this on a python program so I can manipulate it as an array?

View 3 Replies View Related

General :: Get Apt-get To Install Python Packages For A Different Version Of Python?

Oct 27, 2010

in ubuntu 10.10, I have installed python 2.7. I would like to use apt-get to install packages to this version of python but I haven't been able to figure out howThings I have tried without success:changing the symlink at /usr/bin/python to point to /usr/bin/python2.7 - even after doing this apt-get still installs stuff to python2.6.Set up python2.7 as the primary alternative using update-alternatives - doesn't work

View 3 Replies View Related

Software :: Command For Installing Ruby Interpreter In Distro?

Jun 13, 2010

Would a representative from each Linux distro be kind enough to tell me what the command is for installing the Ruby interpreter in their distro? In Gentoo it is "emerge Ruby".

View 4 Replies View Related

CentOS 5 Server :: Error In SQL Ledger - Perl Interpreter

Jun 30, 2010

I've been running SQL-Ledger on Centos 5.5 (x86_64) for some time. At some point in time I must have done something to either perl or CPAN and I now get the following error in SQL-Ledger.
Not an ARRAY reference at SL/Form.pm line 1047.
Attempt to free unreferenced scalar: SV 0x18034630, Perl interpreter: 0x17363010 during global destruction.
Attempt to free unreferenced scalar: SV 0x18034630, Perl interpreter: 0x17363010 during global destruction

View 6 Replies View Related

Software :: Python 3 Want Situation For Python 2 And Become Stop?

Jul 17, 2010

Python 3 want situation for python 2?Python 2 become stop?

View 1 Replies View Related

CentOS 5 :: Yum - Python-devel / Python Dependency

Jan 7, 2011

yum dependency problem please? I am running Centos 5.5. I need to install python-devel, but when I do so I get:

[Code]....

View 2 Replies View Related

Fedora :: Real Player / Error Bad ELF Interpreter: No Such File Or Directory?

Dec 18, 2010

I am using fedora 14 and after i have installed RealPlayer11GOLD.rpm , i didnot work and it give me the following error

./realplay: /opt/real/RealPlayer/realplay.bin: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

View 14 Replies View Related

General :: Starting A Command Line Interpreter When Using Gnome Desktop?

Mar 30, 2010

I'm studying Information Technology and doing Linux as part of it. One of the questions in my text book is: Describe three different ways to start a command line interpreter when using the Gnome desktop of openSUSE Linux. I can't for the life of me make sense out of it.

View 8 Replies View Related

Programming :: Write A Replacement For Shell Command Line Interpreter?

Sep 2, 2010

If say, I want to read the input given by user at the command prompt and write a code to execute the cmd given then which commands do i use to implement this ( Im writing the code in C )?

View 8 Replies View Related

General :: Shell Script File - Pass Multiple Parameters To Interpreter?

Feb 2, 2011

I have a Python script that I run which needs to execute under a special environment, so I would run the program like so from my working directory (~/project/src):

python manage.py shell

This opens up an interactive shell for me to start typing my own commands.I have another set of administrative activities that I would like to house in another directory (~/project/admin). The manage.py is really finicky about running from the working directory. So, to make this whole thing work, I made a script which starts off like so:

#!/usr/bin/python ../src/manage.py shell

There are a couple problems with this. The first is that it doesn't work:

/usr/bin/python: can't open file '"/../src/manage.py" shell': [Errno 2] No such file or directory

How do you specify multiple parameters to the interpreter?How do I change the working directory?

View 2 Replies View Related

Programming :: Python 2.x - Represent The Same In Python 3.x

Mar 4, 2010

I have a function definition in a Python 2.x script which take a tuple as one of its arguments, but 2to3 has no answers nor any of my searching on how to represent the same in Python 3.x

Code:

def blah(self, (string1, string2))

View 4 Replies View Related

CentOS 5 :: Upgrade Python-2.4.3 To Python-2.5?

Mar 30, 2011

How can I upgrade python-2.4.3 to python-2.5?

View 1 Replies View Related

Ubuntu :: Nothing Updates On Actual Desktop

Sep 1, 2011

I've been having some problems with my desktop. My windows and my sidebar work fine, it's just nothing updates on my actual desktop(like the wallpaper, files, etc.). For example, if I mouseover one of my files on my desktop, nothing happens. I can right click on it and it comes up with the right menu, but it doesn't select the file or anything. I just changed my wallpaper and nothing happened.

View 2 Replies View Related

Ubuntu :: No Actual Audio From USB Speakers / Get That?

Apr 1, 2010

I'm well aware this is a common issue among Linux users, but have exausted every method I've researched.

On Xubuntu, I have a small set of USB speakers. Now, the system does detect the output. The mute and volume controls on the speakers work properly (I can see the sound bar move on the screen when doing so).

I've tried various applications such as pavucontrol, to try and fix the problem.

When I try playing audio, sound bars are moving in pavucontrol, but alas, no actual audio from the speakers.

View 3 Replies View Related

Ubuntu Security :: Anti Malware Filtering Works In Open Dns Works?

Jan 13, 2010

using ubuntu and the corporate edition of open dns? >Im curious to find out how the anti malware filtering works in open dns works.

View 4 Replies View Related

Ubuntu :: Does F-spot Edit Actual Files

Jul 15, 2010

Having just spent many hours going through my entire photo collection tagging, rotating and editing (red eye, cleaning up etc), I am now sat with the window open deciding whether or not it's safe to close it.

I cannot find a save or apply button so I'm not sure if these changes are only made in F-spot itself or if I have to do anything else to make sure it saves to the files.

I DID check the option about storing data in the files where possible but I don't want to just assume it and have to do all this again.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved