[Tutor] newbie: Reading text file

2007-05-31 Thread Preecha Bundrikwong
Dear Tutors, I have a text file (mylist.py actually), it contains exactly below: --- # file mylist.py jobs = [ 'Lions', 'SysTest', 'trainDD', 'Cats', 'train', 'sharks', 'whale', ] I want to write another script

Re: [Tutor] (no subject)

2007-05-31 Thread Rikard Bosnjakovic
On 5/30/07, Treloar, Nick <[EMAIL PROTECTED]> wrote: > how do you import sounds Do you mean a module named "sounds", or sounds in general? If the latter, what do you mean by "import" sounds? Read a sound-file? Play a sound-file? There is a wav-module you can use: http://docs.python.org/lib/modul

Re: [Tutor] creating a buffer object from a file ?

2007-05-31 Thread Alan Gauld
"Jerry Hill" <[EMAIL PROTECTED]> wrote >> I think this got lost among the threads: > > I think it got lost because you haven't given us enough information > to > answer your question. > >> in reality what is a buffer object used for ? reading >> a file itself creates a string as in itself, > > W

Re: [Tutor] configparser -- suggestions on when "name: value" entries are incomplete

2007-05-31 Thread Iyer
--- Kent Johnson <[EMAIL PROTECTED]> wrote: > Iyer wrote: > > Regarding the configparser module, if there is a > > configuration file to be read that has incomplete > > "name: value" entries, what would be the best way > to > > handle this situation ? > > Do you mean incomplete as in not syntact

Re: [Tutor] configparser -- suggestions on when "name: value" entries are incomplete

2007-05-31 Thread Kent Johnson
Iyer wrote: > Regarding the configparser module, if there is a > configuration file to be read that has incomplete > "name: value" entries, what would be the best way to > handle this situation ? Do you mean incomplete as in not syntactically correct? I would tell the user to fix it. If you mean

Re: [Tutor] creating a buffer object from a file ?

2007-05-31 Thread Jerry Hill
On 5/31/07, Iyer <[EMAIL PROTECTED]> wrote: > I think this got lost among the threads: I think it got lost because you haven't given us enough information to answer your question. > in reality what is a buffer object used for ? reading > a file itself creates a string as in itself, We don't know

[Tutor] configparser -- suggestions on when "name: value" entries are incomplete

2007-05-31 Thread Iyer
Regarding the configparser module, if there is a configuration file to be read that has incomplete "name: value" entries, what would be the best way to handle this situation ? I was thinking of catching the exemption parsingerror and deleting the sections that have incomplete "name:value" entries,

Re: [Tutor] How can I see properly my korean.

2007-05-31 Thread Kent Johnson
Young-gyu Park wrote: > Do you have anything which you want to let me know, when I develop the > ajax application by Django? Well, it's off topic for this list, and I don't really want to be a JavaScript / AJAX tutor, but I will say that it is easy to serve JSON directly from a Django view and

Re: [Tutor] How can I see properly my korean.

2007-05-31 Thread Young-gyu Park
Yes, It works. Thank you so much kent. you make the time when I spent two days for solving this problem useless. you are genious ^^ Why I didn't know that *"from django.utils.simplejson import dumps" !!!* Do you have anything which you want to let me know, when I develop the ajax application

Re: [Tutor] creating a buffer object from a file ?

2007-05-31 Thread Iyer
I think this got lost among the threads: in reality what is a buffer object used for ? reading a file itself creates a string as in itself, file_handle = file ("path_to_file") file_data = file_handle.read() # file_data is a string, so why is a buffer object is needed ? the data in the binary

Re: [Tutor] How can I see properly my korean.

2007-05-31 Thread Kent Johnson
Young-gyu Park wrote: > fileHandle = open ( > '/var/chroot/www/htdocs/django/js/model.js', 'w' ) > fileHandle.write( codecs.BOM_UTF8 ) > print >> fileHandle, 'var blog = ' > print >> fileHandle, blog > fileHandle.close() > > This is t

Re: [Tutor] How can I see properly my korean.

2007-05-31 Thread Young-gyu Park
user = User.objects.get(userID__exact=user_id) user.blog_set.all() blogData = user.blog_set.get(id__exact=user.id) section_list = blogData.section_set.all() latest_content_list = blogData.content_set.all ().order_by('-pub_date')[:5] blog = dict()

Re: [Tutor] How can I see properly my korean.

2007-05-31 Thread Kent Johnson
Young-gyu Park wrote: > fileHandle = open ( > '/var/chroot/www/htdocs/django/js/model.js', 'w' ) > fileHandle.write( codecs.BOM_UTF8 ) > print >> fileHandle, 'var blog = ' > print >> fileHandle, blog > fileHandle.close() > > > this

Re: [Tutor] leave tutorial

2007-05-31 Thread Kent Johnson
Kriti Satija wrote: > i want to leave the tutorial If you mean you want to unsubscribe to the tutor list, click the link at the bottom of each posting and you will get to a form that lets you unsubscribe. Kent ___ Tutor maillist - Tutor@python.org

Re: [Tutor] How can I see properly my korean.

2007-05-31 Thread Young-gyu Park
Yes I did I added the locale code at the top of my python code. What I want to do is that I want to convert to python dict to javascript associative array. and I will get the javascript array to display in the html page. But the korean letter which is in the python dict is displayed raw format

Re: [Tutor] How can I see properly my korean.

2007-05-31 Thread Alan Gauld
>I input the data which is from the database into array. > and then I print out the array to the file > but the letter I can not figure out. > >> fileHandle = open ( >> '/var/chroot/www/htdocs/django/js/model.js', >> 'w' ) >> fileHandle.write( codecs.BOM_UTF8 ) >> print >>