

Need help!: Python [Errno 13] Permission denied: 'artsciimg.png' - bl00djack

Hi guys, I really need help figuring out this error on Python.
This python script works fine on my local computer, but when I push it to my server, it is showing error when the script tries to save an Image.
Here&#x27;s my code:<p>def magic(usrInput):<p>.<p>.<p>.<p><pre><code>     im = Image.new(&quot;RGB&quot;,(x,y))

     for j in range(y):

         for i in range(x):
</code></pre>
.<p>.<p>.<p><pre><code>     im.save(&quot;artsciimg.png&quot;)
</code></pre>
#End of code<p>And the error says:
&quot;[Errno 13] Permission denied: &#x27;artsciimg.png&#x27;&quot;<p>My local PC is running on Windows, and my server is on Ubuntu. I really need to know what&#x27;s going on, the project is due in less than 36 hours :(
======
nkuttler
The people in #python on the freenode IRC network are usually quite helpful.
Try
[http://webchat.freenode.net/?channels=%23python&uio=OT10cnVl...](http://webchat.freenode.net/?channels=%23python&uio=OT10cnVlde)
if you don't have a real IRC client.

------
casca
Try im.save("/tmp/artsciimg.png"). This will most likely show that it's a
local permission error.

Then identify which directory it's trying to write to with os.system("pwd")
and chmod 777 that directory.

~~~
bl00djack
Holy shit! The error stopped. Thanks soo much. In fact, the error is, I was
supposed to give absolute path for im.save() but your answer
("/tmp/artsciimg.png") showed me the way, Thank you :)

------
mr_timppa
U should check your server rights were you are writing image. Is there write
permission (-rw-rw-r--). Check it like command ls -l your/directory. If not
add chmod a+r your/directory

------
bl00djack
I have tried chmod to all the folders, and files, it still doesn't work :(

------
erekel
man chown man chmod

