Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3 compatibility How to Do Things with Words.ipynb #34

Closed
pathcl opened this issue Jan 4, 2018 · 4 comments
Closed

Python3 compatibility How to Do Things with Words.ipynb #34

pathcl opened this issue Jan 4, 2018 · 4 comments

Comments

@pathcl
Copy link
Contributor

pathcl commented Jan 4, 2018

Hello,

I'm trying to use 'How to Do Things with Words' notebook but...


NameError Traceback (most recent call last)
in ()
----> 1 TEXT = file('big.txt').read()
2 len(TEXT)

NameError: name 'file' is not defined

  • I think this should be replaced to use open() instead of file().

  • I was able to use 'big.txt' downloading from https://norvig.com/big.txt .Not sure if its the same.

I'll upload a PR to make it py3 compatible.

@norvig
Copy link
Owner

norvig commented Jan 11, 2018

Good catch. Probably best to put 'big.txt', and any other such files, in the data directory (under, say, a /text subdirectory).

@avialfont
Copy link

You will find attached the zipped python 3 code (including links to related stackoverflow pages and the actualized link for the Turing Picture).

Thank you Peter Norvig for this (2.6) very nice code !

How to Do Things with Words_modified_for_PY3.zip

@pathcl pathcl mentioned this issue Aug 17, 2018
@pathcl
Copy link
Contributor Author

pathcl commented Aug 24, 2018

Closing since #50 is merged

@pathcl pathcl closed this as completed Aug 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@pathcl @norvig @avialfont and others