Re: [Tutor] CGI Video collection application File I/O troubles

2004-12-09 Thread Alan Gauld
> When I run the script from my bash shell it creates the videodb > database file, but when I run it from the browser it doesn't > create no file whatsoever. This is usually due to wrong file permissions. The script runs under the web server and this usually has restricted access for security rea

Re: [Tutor] CGI Video collection application File I/O troubles

2004-12-09 Thread Patric Michael
<> > Sorry for the delay but I was busy with soemthing else. > The script prints the values of the variables fine in the > browser so there must be a problem with the file writing part. > When I run the script from my bash shell it creates the videodb > database file, but when I run it from the b

Re: [Tutor] CGI Video collection application File I/O troubles

2004-12-09 Thread Guybrush Threepwood
Quoting Chad Crabtree <[EMAIL PROTECTED]>: > Olli Rajala wrote: > > > > > > > > >>Ok. I tried running the script on my Apache server on Windows NT > and IT > >>WORKS The script saves the values of videodb keys correctly. > DARN!!! > >>I don't get it. Why does the exact same script work on Win

Re: [Tutor] CGI Video collection application File I/O troubles

2004-12-06 Thread Chad Crabtree
Olli Rajala wrote: > > > >>Ok. I tried running the script on my Apache server on Windows NT and IT >>WORKS The script saves the values of videodb keys correctly. DARN!!! >>I don't get it. Why does the exact same script work on Win and not on Linux. >> >>Oh, did I mention I am developing the

Re: [Tutor] CGI Video collection application File I/O troubles

2004-12-06 Thread Olli Rajala
> Ok. I tried running the script on my Apache server on Windows NT and IT > WORKS The script saves the values of videodb keys correctly. DARN!!! > I don't get it. Why does the exact same script work on Win and not on Linux. > > Oh, did I mention I am developing the application on Linux. And

Re: [Tutor] CGI Video collection application File I/O troubles

2004-12-06 Thread Guybrush Threepwood
Quoting "Jacob S." <[EMAIL PROTECTED]>: > Your error message says that you are getting an empty string from your cgi > variable. I IMHO would suggest printing videodb['title'] before writing it > to a file to see what the variable contains. Or you might print out videodb > to see what the dictiona

Re: [Tutor] CGI Video collection application File I/O troubles

2004-12-05 Thread Liam Clarke
Try an intermediate step videodb={'title':title,'year':year,'director':director} x=videodb['title'] #Sometimes this helps print type(x)#Check x is a string print x #see if it's got stuff #save to database try: f=open(filename,'w') except TypeError: print "the error is

Re: [Tutor] CGI Video collection application File I/O troubles

2004-12-05 Thread Jacob S.
Hi! Can I ask a few questions? (Other than this one...) What output did you expect? A string, tuple, or what? I'm not strong with cgi stuff. Also, you don't need the string module 1) because you don't use it 2) because you can use string methods. Jacob Schmidt > Hello! > > I am having some probl

Re: [Tutor] CGI Video collection application File I/O troubles

2004-12-05 Thread Jacob S.
Your error message says that you are getting an empty string from your cgi variable. I IMHO would suggest printing videodb['title'] before writing it to a file to see what the variable contains. Or you might print out videodb to see what the dictionary looks like. My off the wall guess is that 1) Y

Fwd: Re: [Tutor] CGI Video collection application File I/O troubles

2004-12-05 Thread Guybrush Threepwood
Quoting "Jacob S." <[EMAIL PROTECTED]>: > Hi! > > Can I ask a few questions? (Other than this one...) > What output did you expect? A string, tuple, or what? A string output. When I create a dictionary variable from the python shell like this: videodb={'title':'Crash','year':'1996','director':'Da

[Tutor] CGI Video collection application File I/O troubles

2004-12-05 Thread Guybrush Threepwood
Hello! I am having some problems with a simple CGi application I am coding for my gf. It is supposed to be a video collection program. I can't manage to write the value of a dictionary key to a file. Like thisL f.write(videodb['title']) It just creates a blank file. When i try to access the video