You Are Here:

Community: Developer Discussion Boards

#1 Old how can i change file name - 2008-08-15, 11:09

Join Date: Aug 2008
Posts: 148
cool_eagle
Offline
Regular Contributor
i m uisng camera module and i save my pic in 'E:\\photo1.jp'
but my all pics name is photo1.jpg.
i want to change it, photo2, photo3, photo4 for each pic

please help me



i m so sory for my bad english
Reply With Quote

#2 Old Re: how can i change file name - 2008-08-15, 11:17

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Online
Forum Nokia Champion
Hi and welcome to the Python discussion board.

Here's an easy way to do it:
Check how many pictures there are in the folder where you save the pictures. Then, each time you take a pic, increase that number and save it with the new number. Here's a basic example:
Code:
import os, camera

#Use a counter to count how many pictures there are
c=0

for i in os.listdir("E:\\"):
   if(i.startswith("photo") and i.endswith(".jpg")):
      c+=1

#Then take a picture and increase the counter, and save the pic
pic=camera.take_photo()
c+=1
pic.save("E:\\photo"+str(c)+".jpg")
#And so on
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i change the icon of executable file? s_mehdi76 Symbian User Interface 4 2008-06-10 10:47
PED and signing. IX Python 11 2008-04-21 02:15
Error with makesis.exe and creating the .pkg file gramya87 Symbian Tools & SDKs 7 2007-10-10 14:53
How to change AVI file or MPEG file to 3GP file Vinit410 Mobile Java Media (Graphics & Sounds) 2 2004-11-05 09:28
does copying file form pc to device change format? Nokia_Archive General Symbian C++ 1 2002-06-02 01:10

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ