how to read a file in python and return something else [closed]

122
December 04, 2019, at 09:00 AM
Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 21 hours ago.

I built a function that opens a specific file and actually takes what is in the file (in my example it is a matrix) and basically returns it to the list differently. If I have a file in my computer How can I call that specific file in pycharm's settings and from there simply return what I want?

in other words, What am I supposed to put into the function when I call it?

"print(read_matrix_file())" ?

thank you!

def read_matrix_file(filename):
    matrix_lines_list = []
    with open(filename, "r") as read_file:
        for line in read_file:
            matrix_lines_list.append(line.split(","))
        return matrix_lines_list:
Rent Charter Buses Company
READ ALSO
Django Blogg App using Heroku: SyntaxError at / invalid syntax (parser.py, line 158)

Django Blogg App using Heroku: SyntaxError at / invalid syntax (parser.py, line 158)

I am a beginner programmer and I followed a django blog tutorial to deploy an app to HerokuI have been stuck on the problem for quite a while now

121
Why “conv1d” is different in C code, python and pytorch

Why “conv1d” is different in C code, python and pytorch

I want to reproduce "Conv1D" results of pytorch in C code

84
Determining the type of pattern on its structure

Determining the type of pattern on its structure

I Need an example of a machine learning algorithm to find previously defined patterns of code block structuresThat is, it is important that the algorithm can determine by structure which pattern the code block belongs input example

107
Atom `script` add-on doesn't recognize Django Model/settings when running a script

Atom `script` add-on doesn't recognize Django Model/settings when running a script

It seems I run into some dependencies issues when trying to run a python script within my Django based web application using the atom add-on script

121