Hello,
I'm designing a small "briefcase" program that will allow me to quickly
upload, download, and delete files in a briefcase. The only real
things that I have left to do are to design a method for checking if
the file exists, preventing it from overwriting files from other
directories, and set
Here is a basic overview of the variables included there.
params = cgi.FieldStorage()
I accidentally made a mistake when typing what the "thefile" variable
is.
thefile = params["upfile"].file
"upfile" is the CGI field that contains the file that I'm uploading.
As you can see, the if statement just
I'm afraid on my interpreter, this works.
>>> if os.path.getsize("C:\\Documents and Settings\\Joey\\Desktop\\file.txt")
>>> <= 1000:
>>> print "<= 1000."
<= 1000.
No problems there, as you can see.
--
http://mail.python.org/mailman/listinfo/python-list
Oh, I'm sorry, I didn't understand what you meant at first.
Then I read your reply over again and noticed that you said that the
problem lied in os.path.getsize() when I tried to run it on the
contents of an open file.
I'll try the method you outlined now.
--
http://mail.python.org/mailman/listi
Yes, I see that now. I tried your method and it seemed to work fine
until I tried printing the filesize out.
def checkfilesize(thefile):
# Check the Size of the File
global filesize
thefile.seek(0,2)
filesize = thefile.tell()
thefile.seek(0)
print filesize
print conf["upmax"]
Hello.
I'm writing a program that creates a series of batch operations to
convert movies to be used on iPodLinux. The programs that do the
encoding and conversions are seperate from mine and all mine does is
use os.system() to call the program.
However, it needs to get an input file and an output
Okay, thank you. This worked very well.
--
http://mail.python.org/mailman/listinfo/python-list
To reply to many of your messages (I'm using Google right now due to
lack of a better newsreader at the moment), the issue with the
temporary file is that when I write something new to it, if the old
contents of the file was larger, not all of it will be overwritten.
So, the truncate() method will
When I'm using Windows, I have found the Syn TextEditor
(http://syn.sourceforge.net) to be quite useful. It has basic syntax
highlighting, about enough for me and is quite compatible with FTP and
such. It supports Python pretty well. Its user interface is quite
easy yet pretty powerful. All in
enough. Thanks for all of your help and I'm sorry if this is a
question that has been asked 15 million times.
Joey C.
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
> It's not a common question, but it's relatively easily answered. You are
> splitting everything but the filename off with os.path.split and then
> complaining about the result! Once you stop doing that your problem is
> solved.
Thus, it's a stupid newbie question. Thanks a l
11 matches
Mail list logo