jkahn / samyro

Samyro text generation kit built on RNNs.
MIT License
3 stars 1 forks source link

cli entry points should be runnable as scripts #4

Open wpm opened 8 years ago

wpm commented 8 years ago

All the files in cli that have main console entry points should also be made runnable as standalone scripts by adding the following

if __name__ == "__main__":
    main()

This makes it possible to debug them in an IDE like Pycharm which requires you to set up run configurations for entire scripts.

jkahn commented 8 years ago

Can you make the changes and send me a pull request?

For bonus points, adding extra docs on how to use this in pycharm would be nice. On Jun 17, 2016 9:06 AM, "W.P. McNeill" notifications@github.com wrote:

All the files in cli that have main console entry points should also be made runnable as standalone scripts by adding the following

if name == "main": main()

This makes it possible to set up configurations to run and debug them in an IDE like Pycharm.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jkahn/samyro/issues/4, or mute the thread https://github.com/notifications/unsubscribe/AAEbfPDBfsi6sembzqGT1y8PheoaB67Kks5qMsYFgaJpZM4I4gQp .

wpm commented 8 years ago

Where do you want documents on how to set up Pycharm? Putting them in the README seems atypical.

You can probably assume that knowing how to set up debugging in your favorite IDE is background Python knowledge that doesn't need to be documented in individual projects.

jkahn commented 8 years ago

On reflection, I don't want anything that's within "ordinary idiom for this IDE"; I agree with your comment that IDEs are code smell.

Pycharm requires a particular piece of configuration cruft (as Eclipse often does in Java projects, even if it shouldn't), I'm willing to include it (probably in a separate pull request).