question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reading/Loading a file

See original GitHub issue

How can i read a file in the project directory with python? i.e.

with open('chatbot.txt','r', encoding='utf8', errors ='ignore') as fin:
    raw = fin.read().lower()

or where should put it for easier loading

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mhsmithcommented, Feb 6, 2021

In Chaquopy 6.3.0 and later, you can access data files using a path relative to __file__.

[Example moved to the documentation]

0reactions
sarthaksharma058439commented, Jan 12, 2021

Finally I got a solution after a long time, this guy explains in simple way how to open and read file data using chaquopy in android studio Check this link

Read more comments on GitHub >

github_iconTop Results From Across the Web

Opening files and reading from files
Opening files and reading their data is something we learn how to do with a simple double-click in our earliest interactions with computers....
Read more >
Read files in JavaScript - web.dev
To read a file, use FileReader , which enables you to read the content of a File object into memory. You can instruct...
Read more >
How do I read data into R? | SAMHDA
Reading R Data Files​​ The command > ls() can be used to print out all of the objects currently loaded into R. The...
Read more >
How to Read a Text file In Python Effectively
First, open a text file for reading by using the open() function. Second, read text from the text file using the file read()...
Read more >
Reading Files with Python - Stack Abuse
In this short guide - learn how to read files in Python, using the seek(), open(), close(), read(), readlines(), etc. methods.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found