Skip to main content
added 106 characters in body
Source Link

A few observations:

  1. This is a very unfriendly way to select a file. Your user can't use even use traditional command line interface conveniences like DIR or navigating folder by folder: they need to know the complete filepath and enter it with no errors.

    You will save users (and yourself!) a lot of hassle by using something like tkinter.filedialog instead.

    This is 100% an easy win. You can quickly write (or google and adapt) a short snippet of code which will be endlessly useful.

  2. The user has no way to graceful way to quit out of the loop. This is probably unproblematic in your intended use case but it isn't a clean design.

  3. I don't understand why the print_menu_prompt() function is stored in a different file.

    The message contained in the function looks very specific to this use case. I can't imagine that you will call the function anywhere else in your code. Which begs the question: why is it in a different file? If you want to edit the message then it is helpful to be able to see the function which initiates it, and if you want to edit the function which initiates it then it will be helpful to see the error message. Separating one action into two different files feels like you're going out of your way to make maintenance annoying.

    I can see why you've broken it out into a separate function. Maybe it could be a sub-function? In this case I don't think you even need to do that: the prose is short enough that putting it into the while loop would have been fine.

No criticism intended: these are preferences and it takes time to explore what works and what doesn't.

A few observations:

  1. This is a very unfriendly way to select a file. Your user can't use even use traditional command line interface conveniences like DIR or navigating folder by folder: they need to know the complete filepath and enter it with no errors.

    You will save users (and yourself!) a lot of hassle by using something like tkinter.filedialog instead.

    This is 100% an easy win. You can quickly write (or google and adapt) a short snippet of code which will be endlessly useful.

  2. The user has no way to graceful way to quit out of the loop. This is probably unproblematic in your intended use case but it isn't a clean design.

  3. I don't understand why the print_menu_prompt() function is stored in a different file.

    The message contained in the function looks very specific to this use case. I can't imagine that you will call the function anywhere else in your code. Which begs the question: why is it in a different file? If you want to edit the message then it is helpful to be able to see the function which initiates it, and if you want to edit the function which initiates it then it will be helpful to see the error message. Separating one action into two different files feels like you're going out of your way to make maintenance annoying.

    I can see why you've broken it out into a separate function. Maybe it could be a sub-function? In this case I don't think you even need to do that: the prose is short enough that putting it into the while loop would have been fine.

A few observations:

  1. This is a very unfriendly way to select a file. Your user can't use even use traditional command line interface conveniences like DIR or navigating folder by folder: they need to know the complete filepath and enter it with no errors.

    You will save users (and yourself!) a lot of hassle by using something like tkinter.filedialog instead.

    This is 100% an easy win. You can quickly write (or google and adapt) a short snippet of code which will be endlessly useful.

  2. The user has no way to graceful way to quit out of the loop. This is probably unproblematic in your intended use case but it isn't a clean design.

  3. I don't understand why the print_menu_prompt() function is stored in a different file.

    The message contained in the function looks very specific to this use case. I can't imagine that you will call the function anywhere else in your code. Which begs the question: why is it in a different file? If you want to edit the message then it is helpful to be able to see the function which initiates it, and if you want to edit the function which initiates it then it will be helpful to see the error message. Separating one action into two different files feels like you're going out of your way to make maintenance annoying.

    I can see why you've broken it out into a separate function. Maybe it could be a sub-function? In this case I don't think you even need to do that: the prose is short enough that putting it into the while loop would have been fine.

No criticism intended: these are preferences and it takes time to explore what works and what doesn't.

Source Link

A few observations:

  1. This is a very unfriendly way to select a file. Your user can't use even use traditional command line interface conveniences like DIR or navigating folder by folder: they need to know the complete filepath and enter it with no errors.

    You will save users (and yourself!) a lot of hassle by using something like tkinter.filedialog instead.

    This is 100% an easy win. You can quickly write (or google and adapt) a short snippet of code which will be endlessly useful.

  2. The user has no way to graceful way to quit out of the loop. This is probably unproblematic in your intended use case but it isn't a clean design.

  3. I don't understand why the print_menu_prompt() function is stored in a different file.

    The message contained in the function looks very specific to this use case. I can't imagine that you will call the function anywhere else in your code. Which begs the question: why is it in a different file? If you want to edit the message then it is helpful to be able to see the function which initiates it, and if you want to edit the function which initiates it then it will be helpful to see the error message. Separating one action into two different files feels like you're going out of your way to make maintenance annoying.

    I can see why you've broken it out into a separate function. Maybe it could be a sub-function? In this case I don't think you even need to do that: the prose is short enough that putting it into the while loop would have been fine.