Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8992195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:53:53+00:00 2026-06-15T22:53:53+00:00

Background: I’m working with python 3.2 in Eclipse SDK 4.2.1 (Juno), and I noticed

  • 0

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: enter image description here

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:

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()

Question: What can I do to run this program outside of Eclipse?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:53:54+00:00Added an answer on June 15, 2026 at 10:53 pm

    I think the problem is not the extra backslash you’re seeing between the directory and the file name (which I think it just from the repr of the string), but instead the \r that’s added at the end. I’m not sure why you’d get that included in the value from input, but you can remove it by calling strip on the string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background Windows 7 x 64 Python 2.7 Django 1.4 Celery with Redis bundle While
Background: I'm using the (fantastic) Vim plugin python-mode , which includes the pep8 linter.
Background I am working with a monad built of a stack of transformers one
Background: Using unix, codeigniter from localhost. I'd like to run a controllers via a
Background: I have a performance-critical query I'd like to run and I don't care
Background: I know, via pypi, about DOAP . Is there something similar to describe
Background: This is a request for something that may not exist yet, but I've
Background: While reading about the smart pointers I came across the following sample implementation
Background: * using Corona SDK and the physic's functions here * have tracked down
Background I'm learning Objective-C and Cocoa, and I thought creating simple programs to answer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.