[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Fuck the Daily Programming Thread.

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 15
Thread images: 1

File: bticon.png (13KB, 481x329px) Image search: [Google]
bticon.png
13KB, 481x329px
Back again. Still in the same place.
Need to use python (or perl!) to take an entire directory of .7z files and then iterate over them, POSSIBLY:
-unzip them one at a time (unzipping all of them would take space I do not have), move a single file (has "[!]" inside of the filename) that up one directory, and then delete the unzipped folder and archive
OR
-extract a single file (has the string "[!]" in the name) from the archive, then delete the archive

How do I go about this?
>>
Motherfucking bump
>>
>>>/g/dpt

Polite sage
>>
>>55171409
Just look at that fucking thread and see why that is a hard pass.
>>
>>55170954
import subprocess
subprocess.call(exe + "7z e cp.7z *[!]* -r")
>>
>>55170954

GoodROMs collection?

This would be easy in bash script. No idea about python.
>>
>>55170954

Why not just
1) create a folder
2) unzip the first to that folder
3) move all the [!] somewhere else
4) delete the .7z
5) delete the contents of the folder
6) repeat

It's a for loop with like 5 lines, you could write it in windows batch.
>>
>>55170954

just do it manually senpai. thats the expert way.
>>
>>55170954
why the fuck would you use Python for that
>>
>>55170954
Fuck off cancer
>>
>>55171691
How did you know?
Also, how would I do it bash style?
>>55171635
The files have different filenames.
>>55171756
My reasoning is that Python is good for iteration, and this is a fuckton of iteration.
>>
>>55170954
I could tell you how to do this in php but I don't have a clue about python or perl.
>>
>>55171951
Just give me the basic programming idea so I can implement it from there.
>>
>>55170954
https://docs.python.org/2/library/glob.html
https://docs.python.org/2/library/subprocess.html#module-subprocess
http://linux.die.net/man/1/7z

If you can't do it with all this information then do it manually and think about how you could git gud.
Spoiler alert: it involves not asking stupid questions on /g/ and actually using your head.
>>
>>55171999
>Just give me the basic programming idea so I can implement it from there.
see >>55170954
Thread posts: 15
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

If you need a post removed click on it's [Report] button and follow the instruction.
If you like this website please support us by donating with Bitcoin at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties. Posts and uploaded images are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that website. If you need information about a Poster - contact 4chan. This project is not affiliated in any way with 4chan.