Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
choco list --localonlyから一括処理用のXMLファイルを作る
import sys
print("""<?xml version="1.0" encoding="utf-8"?>
<packages>""")
for line in sys.stdin:
l = line.strip().split(" ")
if l[1] != "packages":
print(f' <package id="{l[0]}" version="{l[1]}" />')
print("</packages>")
@TakamiChie
Copy link
Author

TakamiChie commented Jun 13, 2021

ファイルをパスの通ったフォルダに置き、choco list --localonly | chocolateyxml.py > PC.configのような感じで呼び出すと良い。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment