Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2008
    Location
    Narnia, with Mr. T
    Posts
    206
    Tokens
    0
    Habbo
    --liger--

    Latest Awards:

    Default Python Help ~ Mandelbrot, The Code Syntax Error

    Hey everyone,

    Right now I'm in terminal programming in the Mandelbrot and MPI codes to create a list of life to compute the life code. Unfortunately I have run into a Syntax error. I'm more than certain it has to do with my raw string code so I'm sure it's an easy fix

    bmp.write_image('image.bmp, nx, ny, image, MAX_ITER)
    ^
    SyntaxError: EOL while scanning string literal


    That's my error. Here's that line of code:

    # convert data to color image and save it in a file
    bmp.write_image('image.bmp, nx, ny, image, MAX_ITER)
    for w in range(1,mpi.size):
    print jobs_completed_by_worker[w],"tasks completed by worker",w


    How do I fix that error and is it caused by raw string coding being off???

    +Rep for help!


    **Note the ^ on the error line may not be in the right spot. It should be after the last parentheses.
    Last edited by --liger--; 10-10-2010 at 03:23 PM.
    User: cazzza
    Date: Mon Oct 26, 2009 @ 10:56 pm
    Message: JB u will be remembered as a legend to everyone love you


  2. #2
    Join Date
    Jul 2006
    Location
    Cambridge, UK
    Posts
    447
    Tokens
    0

    Latest Awards:

    Default

    Your best bet would be to head over onto The New Boston

    Theres a few people on there that will be able to help you out with pretty much anything. Had a few problems with PyQT4 a few times myself etc especially as typically there arent many readily available examples it makes it difficult to problem solve.

  3. #3
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    # convert data to color image and save it in a file
    bmp.write_image('image.bmp', nx, ny, image, MAX_ITER)
    for w in range(1,mpi.size):
    print jobs_completed_by_worker[w],"tasks completed by worker",w
    try tht lol i know nothing about python

    Lew.
    Im not here to be loved, I love to be hated :-}


  4. #4
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    ('image.bmp

    As far as I can see you're missing a '.


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  5. #5
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Agnostic Bear View Post
    ('image.bmp

    As far as I can see you're missing a '.
    Thats what I fixed in my code lol. Possibility of a fix?

    Lew.
    Im not here to be loved, I love to be hated :-}


  6. #6
    Join Date
    Jul 2006
    Location
    Cambridge, UK
    Posts
    447
    Tokens
    0

    Latest Awards:

    Default

    It is due to the apostrophee. Just copy in what Lew put and you'll be good to go.

    Also you will probably need to indent the print statement depending on if Py2 is similiar to Py3 (I would guess so).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •