PIL Question

P

PyNewbie

Hi,

I'm new with Python and PIL. I have a very simple question regarding an image capture function I'm attempting.

Here is the code:


Question: I can't seem to find the captured image, where does it go? The python Shell IDE does not display an error, and the code appears to have been processed.

Additional Info: I'm using Python 2.6, and PIL 1.1.7 for Python 2.6 Windows.
 
C

Chris Rebert

Hi,

I'm new with Python and PIL. I have a very simple question regarding an image capture function I'm attempting.

Here is the code:



Question: I can't seem to find the captured image, where does it go?  The python Shell IDE does not display an error, and the code appears to have been processed.

Additional Info: I'm using Python 2.6, and PIL 1.1.7 for Python 2.6 Windows.

I would think to a file named "screen_capture.jpg" in the current
working directory. What that is for IDLE, I don't know. You can
determine what folder that is by running this in your Python shell:

from os import getcwd
print(getcwd())

Also, I would suggest using absolute file paths in the future, rather
than relative ones; e.g. "C:/Documents and Settings/Your
username/Desktop/screen_capture.jpg" rather than just
"screen_capture.jpg".

Cheers,
Chris
 
T

Terry Reedy

I would think to a file named "screen_capture.jpg" in the current
working directory. What that is for IDLE, I don't know.

At least on windows with 3.2, if one just starts up the shell, it is in
the Pythonxy directory. If one runs a file from an edit window, it
changes to the directory of the file, so it operates much as if one had
run with the command python -i file.py in the directory of file.py.
You can
determine what folder that is by running this in your Python shell:

from os import getcwd; print(getcwd())

Yes, this gives two different answers in the two cases noted above.
 
N

nirinA raseliarison

[PyNewbie]
Question: I can't seem to find the captured image, where does it go?

for me, it just goes to the current working directory:

$ python -i
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.['.appcfg_cookies', '.appcfg_nag', '.bash_history', '.idlerc',
'.inputrc', '.povray',
'bootex.log', 'buildBasicDemo.txt', 'glsample.cpp', 'glsample.o',
'log.txt',
'screen_capture.jpg', 'test.c']
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top