"A. Joseph" <[EMAIL PROTECTED]> wrote
I want to search through a directory and re-arrange all the files
into e.g
All .doc files go into MS WORD folder, all .pdf files goes into PDF
Folder.
I`m thinking of doing something with the os.walk(path) method from
os
Which aspect is puzzling you
When = raw_input ( " please enter a number " ) = int
() is run as part of a python script It should take in the user
stored input and store it as an integer. Am I correct. The string represented
by in memory is now represented by 5 for example?If this is correct
why do I get an error regardi
The way I'd do it is create a dict mapping extensions to folders
(something like {'doc': 'word', 'pdf': 'acrobat'} ), then use
os.renames(old, new), which works the same as moving when you give it
a different path for new, and also magically handles creating new
directories for you. The documentat
On Thu, Sep 18, 2008 at 5:14 AM, <[EMAIL PROTECTED]> wrote:
> When = raw_input ( " please enter a number " )
> = int () is run as part of a python script It should
> take in the user stored input and store it as an integer. Am I correct. The
> string represented by in memory is now represented
On Thu, Sep 18, 2008 at 6:14 AM, <[EMAIL PROTECTED]> wrote:
> When = raw_input ( " please enter a number " )
> = int () is run as part of a python script It should
> take in the user stored input and store it as an integer. Am I correct. The
> string represented by in memory is now represented
On Wed, Sep 17, 2008 at 9:14 PM, Hans Dushanthakumar <
[EMAIL PROTECTED]> wrote:
> G'day everyone.
>
> I'm experimenting with a custom console application, and trying to add
> command history functionality to it. It seems to basically work ok except
> for the fact that when I press the Up arrow ke
[EMAIL PROTECTED] wrote:
When = raw_input ( " please enter a number " )
= int () is run as part of a python script It
should take in the user stored input and store it as an integer. Am I
correct. The string represented by in memory is now
represented by 5 for example?
If this is correct w
*Pycon 2009 (US) – Call for Tutorials*
The period for submitting tutorial proposals for Pycon 2009 (US) is now open
and will continue through Friday, October 31th. This year features two
"pre-conference" days devoted to tutorials on Wednesday March 25 & Thursday
March 26 in Chicago. This allows fo
i want to check if a dir does not exist. how do i change this statement
to evaluate is NOT existing? ==False or ! operator. Also, is sys.exit
appropriate to use to quit out of the program?
if(os.access(target_dir, os.F_OK)):
print "File does not exist!"
sys.exit
Disclai
"jeremiah" <[EMAIL PROTECTED]> wrote
i want to check if a dir does not exist. how do i change this
statement
to evaluate is NOT existing? ==False or ! operator. Also, is
sys.exit
appropriate to use to quit out of the program?
if(os.access(target_dir, os.F_OK)):
print "File does not exist!"
s
[EMAIL PROTECTED] wrote on 09/18/2008 06:12:30 PM:
> i want to check if a dir does not exist. how do i change this statement
> to evaluate is NOT existing? ==False or ! operator. Also, is sys.exit
> appropriate to use to quit out of the program?
>
> if(os.access(target_dir, os.F_OK)):
>print
On Thu, Sep 18, 2008 at 07:19:29PM -0400, [EMAIL PROTECTED] wrote:
> if not os.access(target_dir, os.F_OK):
> if os.access(target_dir, os.F_OK)==False:
> if os.access(target_dir, os.F_OK)!=True:
IMHO it's generally bad form to use numeric == or != operators to compare
values against True, False, a
Title: Signature.html
What's the problem here. It seems right to me. line 9 is diff =...
import time
from datetime import datetime
def adjust_ftime(afilename, sec):
# Vmmdd_hhmmss+tag, seconds in, new mmdd_hhmmss out
ts = afilename[1:-7] # use time stamp portion
format
On Thu, Sep 18, 2008 at 8:38 PM, Wayne Watson
<[EMAIL PROTECTED]>wrote:
> What's the problem here. It seems right to me. line 9 is diff =...
>
> import time
> from datetime import datetime
>
> You've imported the datetime class from the datetime module.
>
> def adjust_ftime(afilename, sec):
>
On 9/18/08, Wayne Watson <[EMAIL PROTECTED]> wrote:
> What's the problem here. It seems right to me. line 9 is diff =...
>>
>> import time
>> from datetime import datetime
>> def adjust_ftime(afilename, sec):
>> # Vmmdd_hhmmss+tag, seconds in, new mmdd_hhmmss out
>> ts = afilename[1
Title: Signature.html
Well, that works. Thanks. How do I know what modules (?) or methods are
in datetime?
greg whittier wrote:
On Thu, Sep 18, 2008 at 8:38 PM, Wayne Watson <[EMAIL PROTECTED]>
wrote:
What's the problem here. It
seems right to me. line 9 is diff =...
import ti
On Thu, Sep 18, 2008 at 9:01 PM, Wayne Watson
<[EMAIL PROTECTED]> wrote:
> Well, that works. Thanks. How do I know what modules (?) or methods are in
> datetime?
>From the docs:
http://docs.python.org/lib/node78.html
or ask:
In [4]: import datetime
In [5]: dir(datetime)
Out[5]:
['MAXYEAR',
'MIN
Title: Signature.html
Thanks for the tips to all.
Ah, yes, Help. I'll check out the link at the bottom.
After I'm done arm wrestling my current program into being, I'll go
back to the documentation for a review. I'm in the clean up stages now
of checking and validating user input. Otherwise
18 matches
Mail list logo