Note that there are some explanatory texts on larger screens.

plurals
  1. POPython inserting additional \'s?
    primarykey
    data
    text
    <p>Background: I'm working with python 3.2 in Eclipse SDK 4.2.1 (Juno), and I noticed something strange - while my programs run perfectly in Eclipse, they always close with an error if I open them from the file manager. I managed to get a screenshot before the cmd closed: <img src="https://i.stack.imgur.com/4tlr1.png" alt="enter image description here"></p> <p>It seems that the program is inserting an additional "\" between "images" and "Cy.png". However, I can't just remove a slash from my program - in it, I used two slashes because you need to to include a slash in a string. My program is as follows:</p> <pre><code>from PIL import Image def pathConstruction(count, imageName): l = [] l.append('images\\') if count == 1: l.append('Sepia') l.append(imageName) imagePath = ''.join(l) return imagePath def grayscale(pix, width, height): for col in range(width): for row in range(height): r,g,b = pix[col, row] avg = ((r + g + b) / 3) r = int(avg) g = int(avg) b = int(avg) pix[col, row] = r,g,b def sepia(pix, width, height): for col in range(width): for row in range(height): r,g,b = pix[col, row] newR = (r * 0.393 + g * 0.769 + b * 0.189) newG = (r * 0.349 + g * 0.686 + b * 0.168) newB = (r * 0.272 + g * 0.534 + b * 0.131) pix[col, row] = int(newR),int(newG),int(newB) imageName = input("Please input the full name of your image, including extension: ") count = 0 imagePath= pathConstruction(count, imageName) count = count + 1 img = Image.open(imagePath) pix = img.load() width, height = img.size grayscale(pix, width, height) sepia(pix, width, height) imagePath = pathConstruction(count, imageName) img.save(imagePath) img.show() </code></pre> <p>Question: What can I do to run this program outside of Eclipse?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload