Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8588023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:42:52+00:00 2026-06-11T22:42:52+00:00

This is quite likely something simple that I have an issue with, but I

  • 0

This is quite likely something simple that I have an issue with, but I do not have another machine to figure out if it’s my laptop’s python version right now.

When I run my program, I recieve the following error: “Type Error: function open() requires no arguments (2 given)”

The code snippet in question:

    import tkinter as tk
    from tkinter import filedialog as fdg

    def update_queue():
            conf_file = open("config.txt", "a")
            fd = fdg.LoadFileDialog(master)
            file = fd.go(pattern="*.jpg")
            conf_file.write(file)
            conf_file.close()

I’m not yet too good with Python, and would appreciate any pointers (“Your code looks twistier than last night’s burnt spaghetti” counts as well) as to why the open() function fails.

Also of note, if I call open outside of a defined function, it opens the file, and can complete all actions done on it, but if I close the file, I cannot re open the file from within a function. I attempted to use the os file functions, but recieved the error “LoadFileDialog does not work with buffer-defined file functions.” Understandable.

If I use conf_file.flush(), assuming I opened it outside of a function, will it flush whatever I write/append, so that I can read from the file again later?

EDIT: What I mean, is, will this work all the time, or would this be considered a hack?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:42:53+00:00Added an answer on June 11, 2026 at 10:42 pm

    is that the whole code? make sure you did not import another open function somewhere. or redefined it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this quite popular problem, but have failed to find a solution that
I'm likely doing something very simply wrong, but I'm not quite sure what it
I realize that the answer to this question is likely quite obvious (if somewhat
This is quite a simple question - although one that is on my mind
This is likely something easy to accomplish, but I'm having difficulty even articulating clearly,
I think it's quite likely the answer is no, but someone might know something
Why does this quite simple xquery takes 10min to execute in sql server (the
This is quite the pickle... I have a regular HTML form with a couple
This is quite weird but my search function can search for any word except
Im quite annoyed at having to ask this but I cant get it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.