Skip to main content
Code Review

Return to Answer

added 3 characters in body
Source Link
Mast
  • 13.8k
  • 12
  • 57
  • 127

Use it aslike this.

Use os.path.join instead of string manipulation to join paths. It is os independent. Also checking for / isn't a good idea. You can use os.sep which again is osOS independent. But it would be a good idea to make sure that filename does not contain / by itself.

In the comments you are saying that full path must be given but in the function you are checking for that. Why? Decide what you want the function to do. It does both? Then you can use this:

I skipped a lot of the code because it is quite big.
Hope this helped.

About me being able to see what's going on by the comments. Not really. You missed what the `main` function is doing

About me being able to see what's going on by the comments. Not really. You missed what the main function is doing.

Use it as this.

Use os.path.join instead of string manipulation to join paths. It is os independent. Also checking for / isn't a good idea. You can use os.sep which again is os independent. But it would be a good idea to make sure that filename does not contain / by itself.

In the comments you are saying that full path must be given but in the function you are checking for that. Why? Decide what you want the function to do. It does both? Then you can use this

I skipped a lot of the code because it is quite big.
Hope this helped.

About me being able to see what's going on by the comments. Not really. You missed what the `main` function is doing

Use it like this.

Use os.path.join instead of string manipulation to join paths. It is os independent. Also checking for / isn't a good idea. You can use os.sep which again is OS independent. But it would be a good idea to make sure that filename does not contain / by itself.

In the comments you are saying that full path must be given but in the function you are checking for that. Why? Decide what you want the function to do. It does both? Then you can use this:

I skipped a lot of the code because it is quite big.

About me being able to see what's going on by the comments. Not really. You missed what the main function is doing.

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

About the strings being messy. Yes, they are. Try to change the things I have mentioned and I'll take a look again. Add your updated code like done in this question this question instead of modifying it.

About the strings being messy. Yes, they are. Try to change the things I have mentioned and I'll take a look again. Add your updated code like done in this question instead of modifying it.

About the strings being messy. Yes, they are. Try to change the things I have mentioned and I'll take a look again. Add your updated code like done in this question instead of modifying it.

added 464 characters in body
Source Link
Aseem Bansal
  • 2.3k
  • 3
  • 22
  • 37

About me being able to see what's going on by the comments. Not really. You missed what the `main` function is doing

About the strings being messy. Yes, they are. Try to change the things I have mentioned and I'll take a look again. Add your updated code like done in this question instead of modifying it.


About me being able to see what's going on by the comments. Not really. You missed what the `main` function is doing

About the strings being messy. Yes, they are. Try to change the things I have mentioned and I'll take a look again. Add your updated code like done in this question instead of modifying it.

Source Link
Aseem Bansal
  • 2.3k
  • 3
  • 22
  • 37
Loading
lang-py

AltStyle によって変換されたページ (->オリジナル) /