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

Implementing strings in python #84

Closed
wzao1515 opened this issue Feb 26, 2019 · 3 comments
Closed

Implementing strings in python #84

wzao1515 opened this issue Feb 26, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@wzao1515
Copy link
Contributor

Hi, I am interested in adding Windows support for part of my GSoC goal and I want to start with implementing strings and file in pure python. Intuitively this is not so hard, but I have a question for strings.

I think the naive way is to open a file, and then process it. The overhead of this method is obviously the memory consumption since it would read the whole file into memory at once. Therefore, my question is whether I should take large file into consideration or not worry about that. Thanks.

@PrajwalM2212
Copy link
Contributor

Python provides readline function that you can use to read only one line at a time.

@pdxjohnny
Copy link
Member

I suggest you take a look strings itself to see how it works. strings source code

Looks to me like it looks for valid ASCII and stops printing once...? The logic is here

@pdxjohnny pdxjohnny added the enhancement New feature or request label Feb 28, 2019
@pdxjohnny pdxjohnny changed the title Implementing strings and file in python Implementing strings in python Mar 1, 2019
@pdxjohnny
Copy link
Member

Closed in #86

New issue made for file: #92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants