deronbrowne / Bookkeeper-Buddy

0 stars 0 forks source link

Boom!!! #10

Open deronbrowne opened 7 years ago

deronbrowne commented 7 years ago

https://github.com/deronbrowne/Bookkeeper-Buddy/blob/1c72b1a8295cfbf573f09f89c598c2ff890628de/Bookkeeper_Buddy.py#L8

@vkee I think this is what I basically did in the User_input_check file :smiley: . I had to repeat it several times for each different section, but the structure is repeated.

vkee commented 7 years ago

Nice! What do you mean repeat it several times for each different section?

deronbrowne commented 7 years ago

That construction works for one set of options. But there are several instances where the user can choose from a set of options. So the construction is repeated for each of those instances.

On Tue, Aug 22, 2017 at 3:56 PM Vincent Kee notifications@github.com wrote:

Nice! What do you mean repeat it several times for each different section?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/deronbrowne/Bookkeeper-Buddy/issues/10#issuecomment-324134237, or mute the thread https://github.com/notifications/unsubscribe-auth/AdB1lPd7hfdotOAGHoRhrE0rxA5SmhEuks5sazJcgaJpZM4O_Cei .

vkee commented 7 years ago

Can't you make a generic enough function that is used by all of them so you only need one?

deronbrowne commented 7 years ago

Hm. I don't think so. I could try to consolidate some of the repeated things, but I'd have to use conditionals instead. So it can either be a large chunk of code with conditionals or it can be separate functions. The separate functions are easier for me to follow.

I'll play around with it a bit and see how I can improve. Do you think there's a better way of doing it?

vkee commented 7 years ago

Conditionals probably are the way to go unless it literally devolves into copy pasting everything in each case (but it should reuse a fair amount?).

deronbrowne commented 7 years ago

I'm getting together something a little more consolidated. I'll let you know once I commit it so you can take a look. Quick question:

Say I have a file 'a' with a function, 'function', defined in it and I run that function in another file 'b'. Will the value that 'function' returns be immediately accessible in 'b', or would I have to access it via "a.function.variable"?

On 23 August 2017 at 10:52, Vincent Kee notifications@github.com wrote:

Conditionals probably are the way to go unless it literally devolves into copy pasting everything in each case (but it should reuse a fair amount?).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/deronbrowne/Bookkeeper-Buddy/issues/10#issuecomment-324360953, or mute the thread https://github.com/notifications/unsubscribe-auth/AdB1lFY0QUThk2cjrA_dwC6hmSrjJhD5ks5sbDyTgaJpZM4O_Cei .

vkee commented 7 years ago

Alright.

Depends how you import it (see https://en.wikibooks.org/wiki/A_Beginner%27s_Python_Tutorial/Importing_Modules).