473,320 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Deleting a file located in particular location

440 256MB
Hi,

I would like to delete a file created at a particular location .

Say :

I/P : ( If the 'C:\Sample' has one file by Sample.bak)

C:\Sample\Sample1.bak

O/P:

C:\Sample

-PSB
Apr 25 '07 #1
1 1139
ilikepython
844 Expert 512MB
Hi,

I would like to delete a file created at a particular location .

Say :

I/P : ( If the 'C:\Sample' has one file by Sample.bak)

C:\Sample\Sample1.bak

O/P:

C:\Sample

-PSB
Use the os module:
Expand|Select|Wrap|Line Numbers
  1. import os
  2. os.remove("C://Sample//Sample1.bak")
  3.  
The os module is always useful in situations like these.
Apr 25 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Stuart Norris | last post by:
Dear Readers, I am developing an application that stores "messages" in array list and writes new entries to a disk file at the end. This file is used incase the user choses to restart the...
3
by: Andrew | last post by:
Hi all, I am still learning ASP.Net, and .Net in general. Though I feel I have much of the "basics" down, I am running into some gray areas in more advanced topics. My question is how I make...
7
by: serge calderara | last post by:
Dear all, I am building an ASP 1.1 application based on a n-Tier architecture. I have my datalayer class that need to read the connection string of my sql server database from a configuration...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
6
by: John J. Hughes II | last post by:
I am creating a new windows service and will have a windows form for setting the runtime settings. In the past I have used the registry for this but since MS seems to think this is a bad thing I...
0
by: John Yale | last post by:
I am using an XmlDocument to save some data. Periodically I add new data and save the XmlDocument to a file: Me.fXmlDoc.Save(Me.fFilename) When I have added all the data I need, I want to move...
5
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based...
1
by: Xicon | last post by:
I am looking to create a program that is able to edit a text file that is not located within the program. This particular text file is always in the exact same location and is always named the exact...
2
by: Reggie | last post by:
Hi and TIA! I have a class file located in my root directory with all me web pages. I call/use the class and it works fine. I have no imports statements aspx or codebehind. My question is why? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.