NaNoGenMo / 2019

National Novel Generation Month, 2019 edition.
97 stars 5 forks source link

Ordering a sandwich with... #86

Closed lishap closed 4 years ago

lishap commented 4 years ago

ingredients.txt

lishap commented 4 years ago

https://github.com/dariusk/corpora/blob/master/data/foods/sandwiches.json

lishap commented 4 years ago

NanMoGenMo2019_Sandwich.txt

This is the source code, written in Python 3.7.2, for Computational Approaches to Narrative with Allison Parrish.

hugovk commented 4 years ago

I just ran it, this is fun! :)

Please could you also add an example novel created by the code?

lishap commented 4 years ago

Yes! Do you know how to export into a .txt file from the code specifically? I was trying to use "sys.stdout = open('NaMoGenMo_novel.txt', 'wt')" put it only exported an empty file.

On Thu, Nov 28, 2019 at 5:16 PM Hugo van Kemenade notifications@github.com wrote:

I just ran it, this is fun! :)

Please could you also add an example novel created by the code?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_NaNoGenMo_2019_issues_86-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAH6BPK77L5SUGTZMORHMOH3QWA7LPA5CNFSM4JNBM5HKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFNP5IA-23issuecomment-2D559611552&d=DwMCaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=rq1wOX4cigGTaNcmBfUYtw&m=eV8j90R9BGFTM0AKG40WUDaEIrEJ8lV83LuijRoyFtA&s=v3Arrqpppk5z3oDsXtwRuNFG-hyiNsMPlJOeWH8N910&e=, or unsubscribe https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AH6BPK26J663OKS2ZX5VTT3QWA7LPANCNFSM4JNBM5HA&d=DwMCaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=rq1wOX4cigGTaNcmBfUYtw&m=eV8j90R9BGFTM0AKG40WUDaEIrEJ8lV83LuijRoyFtA&s=oF0wLyuSFnWMiAEd9uzJ6kcnkWaUKlOCO1wK2nQ-fPE&e= .

hugovk commented 4 years ago

One way is to use the special > character on the command line. This redirects the output so instead of it printing to screen, send it into a file. For example:

$ python my-python-script.py > NaNoGenMo_novel.txt

Could you try something like that?

lishap commented 4 years ago

[image: Screen Shot 2019-11-29 at 11.04.53 AM.png]

I'm getting this error! Maybe it's because it's on my desktop and not in a specific place?

On Fri, Nov 29, 2019 at 2:02 AM Hugo van Kemenade notifications@github.com wrote:

One way is to use the special > character on the command line. This redirects the output so instead of it printing to screen, send it into a file. For example:

$ python my-python-script.py > NaNoGenMo_novel.txt

Could you try something like that?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_NaNoGenMo_2019_issues_86-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAH6BPK3BRARS7WOW62MVZB3QWC5CBA5CNFSM4JNBM5HKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFOBHLQ-23issuecomment-2D559682478&d=DwMCaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=rq1wOX4cigGTaNcmBfUYtw&m=YWLdHGQnubyFipFdvyHuzyoFaHo73n-7CKP-MFsFLW4&s=LsbF8_x55S6JvO862nDhFJORtu_tRkRVR5McxEQmV0Y&e=, or unsubscribe https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AH6BPK7LRN5NVUFWW4WU45TQWC5CBANCNFSM4JNBM5HA&d=DwMCaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=rq1wOX4cigGTaNcmBfUYtw&m=YWLdHGQnubyFipFdvyHuzyoFaHo73n-7CKP-MFsFLW4&s=RL9vMvLjAhbBhOZ5dvDxhiC2GNH8gHqXJWhmBMQXPY4&e= .

hugovk commented 4 years ago

The screenshot didn't get added when replying by email, please can you add it by dragging and dropping at the GitHub website?

lishap commented 4 years ago
Screen Shot 2019-11-29 at 11 04 53 AM
hugovk commented 4 years ago

Try it with python at the start:

python NaMoGenMo_2019.py > NaNoGenMo_novel.txt
lishap commented 4 years ago

Awesome thank you @hugovk. Here is a .txt file of my novel! NaNoGenMo_novel.txt

lishap commented 4 years ago

NaMoGenMo19_SourceCode.txt

I changed the source code a little bit. Here's the updated code.

hugovk commented 4 years ago

Congratulations, have a "completed" label!

lishap commented 4 years ago
Screen Shot 2019-11-30 at 5 08 13 PM
greg-kennedy commented 4 years ago

@lishap hey, you might want to re-open this issue, we tend to leave issues open so people can find them with the default search!