Use a default of None
and detect that.
def save_file(self, outputfilename=None):
if outputfilename is None:
outputfilename = self.image_filename
self.file.read(outputfilename)
....
More Related Contents:
- How do you determine which backend is being used by matplotlib?
- matplotlib share x axis but don’t show x axis tick labels for both, just one
- Format a number with commas to separate thousands
- Is the order of a Python dictionary guaranteed over iterations?
- Why and how are Python functions hashable?
- Two’s Complement Binary in Python?
- When to cache a DataFrame?
- Sorting the order of bars in pandas/matplotlib bar plots
- How to send non-English unicode string using HTTP header?
- Upper case first letter of each word in a phrase
- python exception handling
- Single versus double quotes in json loads in Python
- how to direct output into a txt file in python in windows
- Vectorizing `numpy.random.choice` for given 2D array of probabilities along an axis
- Why does a python module act like a singleton?
- Missing parts on Beautiful Soup results
- How can I turn a flat list into a 2D array in python?
- Run process with realtime output to a Tkinter GUI
- Python IMAP search using a subject encoded with utf-8
- fastapi (starlette) RedirectResponse redirect to post instead get method
- hasnext() for Python iterators?
- Loading model with custom loss + keras
- Maximal Length of List to Shuffle with Python random.shuffle?
- Delete an uploaded file after downloading it from Flask
- Creating a Menu in Python [closed]
- Pythonic/efficient way to strip whitespace from every Pandas Data frame cell that has a stringlike object in it
- Algorithm for solving Sudoku
- Pandas: select all dates with specific month and day
- Google Search Web Scraping with Python
- What version of Python should I use if I’m a new to Python?