[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Fuck the Daily Programming Thread.
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 15
Thread images: 1
File: bticon.png (13 KB, 481x329) Image search: [Google]
bticon.png
13 KB, 481x329
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 replies: 15
Thread images: 1

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

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.