Output is indented [SOLVED]

I don’t want to dedent this because it doesn’t look nice, but the output is indented, which is not what I wanted.

        f.write("""\
    ```aosr-deck-config
    {
    	"rule": {
    		"conditions": {
    			"all": [{
    				"fact": "card",
    				"operator": "regexMatch",
    				"value": "RandTest",
    				"path": "$.path"
    			}]
    		},
    		"event": {
    			"type": "match"
    		}
    	}
    }
    ```""")

Have you tried textwrap.dedent?

1 Like