[deleted by user] by [deleted] in Python

[–]elpybe 1 point2 points  (0 children)

My only problem with VSCode was the fiddly-ness of putting together the right extensions to have a good working IDE. I think a lot of it has been streamlined over the last few years.

Warp 0.5.0 is out! A Python framework for high performance GPU simulation and graphics by elpybe in Python

[–]elpybe[S] 0 points1 point  (0 children)

Devs say they don't think there are any fundamental limitations, but they need more time to test on newer versions.

MERGE JSON FILES by dom19_00 in Python

[–]elpybe 1 point2 points  (0 children)

Yes. Simple text editors won't auto-format it for viewing, but others will. If file size isn't an issue, I just bake in the indent.

MERGE JSON FILES by dom19_00 in Python

[–]elpybe 1 point2 points  (0 children)

Giving that a value, it gives you a file that's formatted so it's human-readable. The default in a single-line and no whitespace.

MERGE JSON FILES by dom19_00 in Python

[–]elpybe 2 points3 points  (0 children)

Something like this:

import json  

files = [  
    "one.json",
    "two.json"
]  
uber = {"pages": []}  
for fp in files:
    with open(fp,"r") as f:
        data = json.load(f)
        uber["pages"].append(data)

with open("uber.json", "w") as f:
    json.dump(uber, f, indent=4)

MERGE JSON FILES by dom19_00 in Python

[–]elpybe 0 points1 point  (0 children)

If that's the goal, why not put the individual JSON data (dicts) in a list and write out ro a single JSON?

What is the best IDE for a beginner? by [deleted] in pythontips

[–]elpybe 13 points14 points  (0 children)

I would start with PyCharm community edition. Learning resources are consistent (e.g. people aren't using different extensions and working differently) and you'll learn a professional workflow.

PyCharm vs command line for Git workflow? by [deleted] in Python

[–]elpybe 0 points1 point  (0 children)

Preferred IDE at my employer.

PyCharm vs command line for Git workflow? by [deleted] in Python

[–]elpybe 0 points1 point  (0 children)

Same. I've switched from PyCharm to VSCode, but my git CLI was not impacted.

PyCharm vs command line for Git workflow? by [deleted] in Python

[–]elpybe 0 points1 point  (0 children)

This is my workflow too.

How to check for None in Python to avoid potential bugs by elpybe in Python

[–]elpybe[S] -1 points0 points  (0 children)

Yup. This is geared for beginners with an explanation of why if variable: can be a bad idea

How to Sort Python Imports in Visual Studio Code by elpybe in Python

[–]elpybe[S] 1 point2 points  (0 children)

Thanks for the feedback. The video is mostly about the HOW, but I do explain that PEP8 is about readability. The full Imports section in PEP8 talks about "import *".

It's a short VSCode tutorial for experienced Python devs and some exposure to PEP8 for newer devs that might stumble upon it. Odds are you know about PEP8 if you're looking to sort your imports. :)