I've a problem whith my python script,
i chmod'ed it to +x, addes the line :
#!/usr/bin/python2.3
and i verified that /usr/bin/python2.3 exists
but i've something like
: bad interpreter: No such file or dir ...
What's the matter ??
Thanx 10 2855
BaBS wrote: I've a problem whith my python script, i chmod'ed it to +x, addes the line : #!/usr/bin/python2.3 and i verified that /usr/bin/python2.3 exists but i've something like : bad interpreter: No such file or dir ...
What's the matter ??
Remove the hidden CR character which you got at the end of the
lines by moving the file to a Windows system and editing it. ;-)
This one is pretty tricky to figure out the first few times...
-Peter
Le Wed, 26 May 2004 07:08:50 -0400, Peter Hansen a écrit*: BaBS wrote:
I've a problem whith my python script, i chmod'ed it to +x, addes the line : #!/usr/bin/python2.3 and i verified that /usr/bin/python2.3 exists but i've something like : bad interpreter: No such file or dir ...
What's the matter ??
Remove the hidden CR character which you got at the end of the lines by moving the file to a Windows system and editing it. ;-)
This one is pretty tricky to figure out the first few times...
-Peter
Thanks for the tips but ... i don't have CR Character ...
i edit my file with notepad and editplus but no matter what
It's the same message :/
--
Damien
BaBS wrote: Le Wed, 26 May 2004 07:08:50 -0400, Peter Hansen a écrit :BaBS wrote:I've a problem whith my python script, i chmod'ed it to +x, addes the line : #!/usr/bin/python2.3 and i verified that /usr/bin/python2.3 exists but i've something like : bad interpreter: No such file or dir ...
What's the matter ??
Remove the hidden CR character which you got at the end of the lines by moving the file to a Windows system and editing it. ;-)
This one is pretty tricky to figure out the first few times...
Thanks for the tips but ... i don't have CR Character ... i edit my file with notepad and editplus but no matter what It's the same message :/
It's either that or /usr/bin/python2.3 doesn't really exist.
If you type "/usr/bin/python2.3" at the prompt, does the
interpreter come up properly? If it does, try creating a
new file without using an editor. Type the commands below
at the Linux $ prompt:
$ cat >test.py
#!/usr/bin/python2.2
print 'works'
(hit Ctrl-D here to close the file)
$ chmod +x test.py
$ ./test.py
works
If you don't get the final output, but still get the "bad
interpreter" thing, yet if the interpreter works properly
when you execute it directly, then I have no idea and will
be quite interested to learn the final solution.
-Peter
Le Wed, 26 May 2004 07:51:42 -0400, Peter Hansen a écrit*: It's either that or /usr/bin/python2.3 doesn't really exist. If you type "/usr/bin/python2.3" at the prompt, does the interpreter come up properly? If it does, try creating a new file without using an editor. Type the commands below at the Linux $ prompt:
$ cat >test.py #!/usr/bin/python2.2 print 'works' (hit Ctrl-D here to close the file) $ chmod +x test.py $ ./test.py works
If you don't get the final output, but still get the "bad interpreter" thing, yet if the interpreter works properly when you execute it directly, then I have no idea and will be quite interested to learn the final solution.
-Peter
/usr/bin/python2.3 exists, it starts perfectly, when i use
a alias mysoft="/usr/bin/python2.3 /path/to/my_script"
it works perfectly too ...
i got a small script ... it's work perfectly too ...
with the chmod +x and the ./script ...
I'm lost, i've no idea :)
--
Damien
++
I've lost my mind ...
But it's on a backup tape ...
... somewhere ...
Hi!
Am Wed, 26 May 2004 13:21:28 +0200 schrieb BaBS: Thanks for the tips but ... i don't have CR Character ...
Are you sure? Aren't there "^M"s at the line ends, when you
type 'cat -v myscript.py'?
Jan
Peter Hansen wrote: BaBS wrote:
I've a problem whith my python script, i chmod'ed it to +x, addes the line : #!/usr/bin/python2.3 and i verified that /usr/bin/python2.3 exists but i've something like : bad interpreter: No such file or dir ...
What's the matter ??
Remove the hidden CR character which you got at the end of the lines by moving the file to a Windows system and editing it. ;-)
This one is pretty tricky to figure out the first few times...
Should be the other way 'round: If you edit the file under Windows (e.g.
with Notepad), (invisible) CRs are added. Use a windows editor that
supports "Unix" lineendings (e.g. UltraEdit: File->Conversions->DOS to
UNIX).
One way to fix this on a Linux/UNIX system would be:
tr -d '[\r]' <script.py >fixed_script.py
Benjamin Niemann wrote: Peter Hansen wrote: Remove the hidden CR character which you got at the end of the lines by moving the file to a Windows system and editing it. ;-)
This one is pretty tricky to figure out the first few times... Should be the other way 'round: If you edit the file under Windows (e.g. with Notepad), (invisible) CRs are added.
We're saying the same thing. You call them invisible, I call
them hidden, and we're both saying they got added when he
edited the file under Windows. If he were to open the file in, say,
"vi" instead, on Linux, it would display the ^M endings, no doubt,
at least if he entered ":set list" to display invisible characters.
One way to fix this on a Linux/UNIX system would be: tr -d '[\r]' <script.py >fixed_script.py
Good idea.
-Peter
Peter Hansen wrote: Benjamin Niemann wrote:
Peter Hansen wrote:
Remove the hidden CR character which you got at the end of the lines by moving the file to a Windows system and editing it. ;-)
This one is pretty tricky to figure out the first few times...
Should be the other way 'round: If you edit the file under Windows (e.g. with Notepad), (invisible) CRs are added.
We're saying the same thing.
Ah, I see you understood me to be saying that "by moving the
file to a Windows system you can remove the CR characters".
My intended meaning was "you got the CR characters
by moving the file to a Windows system", and I wasn't giving
him any idea how to remove them. :-)
Confusion solved...
-Peter
Le Wed, 26 May 2004 14:57:09 +0200, Benjamin Niemann a écrit*: Peter Hansen wrote: BaBS wrote:
I've a problem whith my python script, i chmod'ed it to +x, addes the line : #!/usr/bin/python2.3 and i verified that /usr/bin/python2.3 exists but i've something like : bad interpreter: No such file or dir ...
What's the matter ??
Remove the hidden CR character which you got at the end of the lines by moving the file to a Windows system and editing it. ;-)
This one is pretty tricky to figure out the first few times... Should be the other way 'round: If you edit the file under Windows (e.g. with Notepad), (invisible) CRs are added. Use a windows editor that supports "Unix" lineendings (e.g. UltraEdit: File->Conversions->DOS to UNIX). One way to fix this on a Linux/UNIX system would be: tr -d '[\r]' <script.py >fixed_script.py
Oké thanx, I probably forget something when i edit it under
EditPlus [which handle the CR] but usualy, emacs show me the ^M :/
Anyway ... i don't use windows anymore :)
Thanx a lot everybody ...
--
Damien
++
I've lost my mind ...
But it's on a backup tape ...
... Somewhere ...
Le Wed, 26 May 2004 09:49:09 -0400, Peter Hansen a écrit*: Peter Hansen wrote:
Benjamin Niemann wrote:
Peter Hansen wrote:
Remove the hidden CR character which you got at the end of the lines by moving the file to a Windows system and editing it. ;-)
This one is pretty tricky to figure out the first few times...
Should be the other way 'round: If you edit the file under Windows (e.g. with Notepad), (invisible) CRs are added.
We're saying the same thing.
Ah, I see you understood me to be saying that "by moving the file to a Windows system you can remove the CR characters".
My intended meaning was "you got the CR characters by moving the file to a Windows system", and I wasn't giving him any idea how to remove them. :-)
Confusion solved...
-Peter
1000 times sory, misunderstand :)
I read too fast :)
Thanx anyway :)
--
Damien
++
I've lost my mind ...
But it's on a backup tape ...
... somewhere ... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Neil Benn |
last post by:
Hello,
I'm looking at a small app which would need a very quick
startup time for the Python interpreter. It doesn't do much (copying
and caching of files, no GUI) but I need the Python...
|
by: Anon |
last post by:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello all
I am a beginner teaching myself python, and I am enjoying it immensely :)
As a language it is great, I real treat to study, I actually...
|
by: Donnie Leen |
last post by:
I wrote a program embbed boost.python, each thread running a sub-interpreter, i made a module implement by boost.python, and i wish this module imported in each sub-interpreter, i find that the...
|
by: Rex Eastbourne |
last post by:
Hi,
I'm interested in running a Python interpreter in Emacs. I have Python
extensions for Emacs, and my python menu lists "C-c !" as the command
to run the interpreter. Yet when I run it I get...
|
by: Ian Giblin |
last post by:
I am an experienced C programmer, learning C++ by writinging a
mathematical toolkit in the framework of a script interpreter. I am
posting here to ask for advice (or references) on the object...
|
by: ozbear |
last post by:
If one were writing a C interpreter, is there anything in the standard
standard that requires the sizeof operator to yield the same value for
two different variables of the same type?
Let's...
|
by: gr |
last post by:
hi.. I must implement an interpreter in C programming language that
will get the source code of a program in text file format and execute
it.
but i don't know C language enough to write this...
|
by: Robin Becker |
last post by:
As part of some django usage I need to get some ReportLab C extensions into a
state where they can be safely used with mod_python.
Unfortunately we have C code that seems incompatible with...
|
by: castironpi |
last post by:
I'm curious about some of the details of the internals of the Python
interpreter:
I understand C from a hardware perspective.
x= y+ 1;
Move value from place y into a register
Add 1 to the...
|
by: Erik Hahn |
last post by:
I'm looking for a standalone Javascript interpreter like the ones of
Perl and Python. Does such a thing exist for Linux?
Thanks in advance.
-Erik
--...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |