Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: [Python-mode] compile problem in emacs

Reply
Thread Tools

Re: [Python-mode] compile problem in emacs

 
 
vissen@gmx.net
Guest
Posts: n/a
 
      02-13-2004
hi

i am new to Linux and Python.

I get a syntax error for this line of code.
......
def fib(n): # write Fibonacci series up to n
.........

used Emacs as the editor on a Redhat ver8.0 OS. (This example is included as
part of tutorial/documentation in Python docs)
any suggestions /ideas are useful.
thanks for reading.



--
-Vissen

GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel +++


 
Reply With Quote
 
 
 
 
Peter Otten
Guest
Posts: n/a
 
      02-13-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> i am new to Linux and Python.


Welcome to both!

>
> I get a syntax error for this line of code.
> .....
> def fib(n): # write Fibonacci series up to n
> ........
>
> used Emacs as the editor on a Redhat ver8.0 OS. (This example is included
> as part of tutorial/documentation in Python docs)
> any suggestions /ideas are useful.
> thanks for reading.


The code snippet is correct. Here's what your code *could* look like

<syntaxerror.py>
def test(

def fib(n): # write Fibonacci series up to n
"""Print a Fibonacci series up to n."""
a, b = 0, 1
while b < n:
print b,
a, b = b, a+b
</syntaxerror.py>

This will show the following slightly misleading syntax error:

File "<stdin>", line 3
def fib(n): # write Fibonacci series up to n
^
SyntaxError: invalid syntax

but I cannot be sure, because your post doesn't provide enough context.
In the future, please give a small but _complete_ example that shows the
erroneous/undesired behaviour and the _actual_ traceback (cut and paste
from emacs or the command line).

Peter
 
Reply With Quote
 
 
 
 
Yen-Ting Chen
Guest
Posts: n/a
 
      02-13-2004
Could you post more complete source code or error message?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
compile directive for conditional compile for Java 1.4 versus Java 5 timjowers Java 7 02-02-2011 12:08 AM
computation at compile time i.e. compile time functions usingtemplates Carter C++ 2 03-04-2009 06:43 PM
Compile versus not compile (VS 2005)?? stupid48@gmail.com ASP .Net 1 04-11-2008 08:24 PM
cant compile on linux system.cant compile on cant compile onlinux system. Nagaraj C++ 1 03-01-2007 11:18 AM
Trouble running Emacs-EPL (to run perl in emacs). Adam Funk Perl Misc 4 01-29-2007 10:42 AM



Advertisments