![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Apr 2005
Location: Uk
Posts: 68
Rep Power: 4
![]() |
hehe, my girlfriend is obsessed, and likes to read all my msn chat logs, and it's hard to find the time to delete them without her watching.. So I thought i would let something else do my dirty work, and stop her watching me, so they all get removed in double click time!!!
Ain't sure if this would help anyone else, I think it's just me with the physco!!! import os
path = "WHERE YOUR CHAT LOGS ARE STORED END WITH \\"
rem = []
for file in os.listdir(path):
if file.endswith(".xml"): #My chat logs are xml files, if your's are different
#change the ending ending here
try:
rem = []
rem.append(path)
rem.append(file)
rem = "".join(rem)
os.remove(rem)
except:
IOErrorhope some one is in need for it as much as me!!! LOL
__________________
while me is alive: make(life,simple) |
|
|
|
|
|
#2 | |
|
Professional Programmer
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4
![]() |
Quote:
I am the fizz-co in my relationship.. so send this file to my wife ![]()
__________________
-Steven "Is this a piece of your brain?" - Basil Fawlty |
|
|
|
|
|
|
#3 |
|
Programming Guru
![]() |
Why is your ex-gf able to get to your computer to see your chat logs?
__________________
|
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Why not just not save the logs?
|
|
|
|
|
|
#5 |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
I'm curious as to your method of string concatenation. What inspired the concatenation via a list?
The best way to concatenate string representations of paths is via os.path.join. The function is kind enough to decide whether or not it needs to add a slash in the joined string, so os.path.join("/home/foo", "file.txt") and os.path.join("/home/foo/", "file.txt") both give you "/home/foo/file.txt". |
|
|
|
|
|
#6 |
|
Programmer
Join Date: Apr 2005
Location: Uk
Posts: 68
Rep Power: 4
![]() |
Hmm, i've never seen that before!! Thanks for that,
![]()
__________________
while me is alive: make(life,simple) |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|