Python Forum
why it showed that the argument of my function was not defined?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
why it showed that the argument of my function was not defined?
#1
here is my codes,I wrote a function which should be able to read a csv file and parse it into some useful form.

import csv


def load_atlas(filename):
    edited_file = []
    with open('filename', 'r') as csv_file:
        csv_reader = csv.reader(csv_file, delimiter='|')
        for lines in csv_reader:
            edited_file.append(lines)
    return edited_file
load_atlas(ala-acton.txt)
my problem is whenever i passed a filename into this function, it returns an error
Error:
NameError: name 'ala' is not defined
Reply


Messages In This Thread
why it showed that the argument of my function was not defined? - by Tony - May-17-2018, 05:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  mutable argument in function definition akbarza 1 511 Dec-15-2023, 02:00 PM
Last Post: deanhystad
  Variable is not defined error when trying to use my custom function code fnafgamer239 4 623 Nov-23-2023, 02:53 PM
Last Post: rob101
  Printing the variable from defined function jws 7 1,384 Sep-03-2023, 03:22 PM
Last Post: deanhystad
Information How to take url in telegram bot user input and put it as an argument in a function? askfriends 0 1,130 Dec-25-2022, 03:00 PM
Last Post: askfriends
  Getting NameError for a function that is defined JonWayn 2 1,136 Dec-11-2022, 01:53 PM
Last Post: JonWayn
Question Help with function - encryption - messages - NameError: name 'message' is not defined MrKnd94 4 2,946 Nov-11-2022, 09:03 PM
Last Post: deanhystad
  i want to use type= as a function/method keyword argument Skaperen 9 1,939 Nov-06-2022, 04:28 AM
Last Post: Skaperen
  How to print the output of a defined function bshoushtarian 4 1,337 Sep-08-2022, 01:44 PM
Last Post: deanhystad
  User-defined function to reset variables? Mark17 3 1,686 May-25-2022, 07:22 PM
Last Post: Gribouillis
  Regex - Pass Flags as a function argument? muzikman 6 3,647 Sep-06-2021, 03:43 PM
Last Post: muzikman

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020