Questions tagged [del]

Short for delete, this is a keyword/command/function that deletes objects (Python, et al.) or files (Windows/DOS cmd / batch).

Short for delete, this is a command/keyword that deletes... - files in Windows cmd (command prompt) / batch. Another equivalent to this is the erase command, also in cmd / batch. - a keyword/function name in Python and various languages and software libraries, that deletes objects - also often used in other places to denote a deletion operation - a key on the keyboard

313 questions
-1
votes
1 answer

If the "del" command is executed from a batch file it won't delete files whose names contain odd characters. But it will work from a CMD shell

Problem: The "del" command won't delete certain files when it is executed from a batch file but it will delete those files if it is executed from the CMD shell command line interpreter. The problem appears to be related to the fact that the…
Mike Walsh
  • 1
  • 1
  • 1
-1
votes
1 answer

Create new Thread clear file and folder c#

I created a Thread to automatically delete files and folders in "C:\Classified Defects\data". First I use timer to check disk space, if it is more than 80% then call delete function to run. if it is less than 50% it will stop.Here I use the…
Quân Nè
  • 7
  • 8
-1
votes
3 answers

How to delete randomly inserted characters at specific locations in a string?

I was previously working on a problem of String encryption: How to add randomly generated characters in specific locations in a string? (obfuscation to be more specific). Now I am working on its second part that is to remove the randomly added…
-1
votes
2 answers

Del list and next list element in list if string exist

I have an example: list = [['2 a', 'nnn', 'xxxx','last'], ['next, next'], ['3', '4', 'next']] for i in range(len(list)): if list[i][-1] == "last": del(list[i+1]) del(list[i]) I'd like to delete this list where the last item is "last" and…
DeepSea
  • 305
  • 2
  • 15
-1
votes
2 answers

How to delete a value from a dictionary?

How can I delete a value, for example John, out of the dictionary? data = {'Player': ['John','Steffen'], age: [25,26]} data.pop("Player","John") I just can’t find how I can delete a key like Player.
-1
votes
1 answer

Automatically freeing memory of no more used variables in python

I'm new in Python. Let's say, I use large pandas data frames. My code looks something like: all_data = pd.read_csv(huge_file_name) part_data = all_data.loc['ColumnName1', 'ColumnName2','ColumnName3'] data_filtered =…
-1
votes
3 answers

how to delete elements from a list using del and indices

I have a list from which all 2s need to be deleted: L = [1, 2, 3, 2, 4, 8, 2] I also have the index of all the 2s in L: myIndex = [1, 3, 6] How can I use del to remove all the 2s from L? I've tried del L[myIndex] but it didn't work.
-1
votes
1 answer

gulp-clean and del does not work to clean the folder i want

I don't understand what i'm doing wrong. I want to clean up my dist/browser folder, but absolutely noothing happens, not even an error. const gulp = require("gulp"); const gulpElm = require('gulp-elm'); const clean = require('gulp-clean'); const…
AIon
  • 12,521
  • 10
  • 47
  • 73
-1
votes
1 answer

Is it useful to delete entry objects before leaving the function?

Python has an embedded garbage collector, but it is good to explicit write command gc.collect() before leaving the function. Before that, it is welcome to delete the local variable with del command. What is not clear to me is whether the input…
-1
votes
1 answer

removing the words after a specific sign in every sentence in a string

this is the string for example: 'I have an apple. I want to eat it. But it is so sore.' and I want to convert it to this one: 'I have an apple want to eat it is is so sore'
-1
votes
1 answer

Python List Del & Reconciliation

I'm trying to delete multiple elements from a list. The elements are having their indexes evaluated dynamically, and stored in a list called "dstry". It may look something like this: arr = [1, 2, 2, 3, 5, 6, 7, 8, 9, 2] dstry = [1, 2, 9] However,…
KuboMD
  • 684
  • 5
  • 16
-1
votes
2 answers

I can delete files in shell when in the directory, but I get a File not found error from outside the directory

I know this is a rudimentary question, but I am dumbfounded. Let us say that I have two files in the following directory structure: C:\Program Files\Program\Directory\Subdirectory\one.txt and C:\Program…
brian-welch
  • 441
  • 1
  • 7
  • 19
-1
votes
1 answer

Remove a part of Hexa Message in order to have a good message

I tried to convert a String of Hex chars to a String using this method: public String HexToString(String inputString){ StringBuilder output = new StringBuilder(); for (int i = 0; i < inputString.length(); i+=2) { String str =…
Rondi
  • 1
  • 1
-2
votes
3 answers

how to add keys from an existing dictionary to a new dictionary

I have a dictionary that looks like this: pris = {'äpplen': [12,13,15,16,17], 'bananer': [14,17,18,19], 'citroner': [20,13,14,15,16], 'hallon': [23,34,45,46,57], 'kokos': [12,45,67,89]} an another: t={'äpplen', 'bananer', 'hallon'} What I'm…
Shelyy
  • 1
  • 1
-2
votes
1 answer

The concept under the hood about "delete" in Python

I create a varibale temp = [10] Then I put temp into another list variable ls After that, I use del temp to delete the temp variable However, I check ls and still find that [10] is in ls In my intuition, ls should be printed as [], but things don't…
Jet C.
  • 126
  • 8
1 2 3
20
21