Python Forum
modifying what a module defines
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
modifying what a module defines
#8
(Aug-26-2019, 06:29 AM)fishhook Wrote:
if option == "1":
    print("\nOkay, you have decided to work WITHOUT THE EUREKAPRINTER.\n\n")
  
if option == "2":
    import eurekaprinter
    print("\nOkay, you have decided to work WITH THE EUREKAPRINTER.\n\n")
    eurekaprinter.print_eureka()
Hi!

I was not sure what you meant with that (hey, I was so sleepy I didn't notice your line 5, where you import the eurekaprinter module), so when I noticed your line 5, I was not sure if it meant, leaving my line 9 (that's where I imported the module) in or out. I tried both ways (with my line 9 in and with my line 9 out) with your line 5, and both works, so I think your code is neater. Thanks!

All the best,

(Aug-26-2019, 07:34 PM)Skaperen Wrote: i ended up using the environment variable technique. it also lets me do it by setting that environment variable as i run the script.

Hi!

That's great! I have no idea about the environment variable technique, but I found your dilemma quite interesting, and I wanted to find out if, with my little knowledge, I could provide some thoughts or maybe a possible solution, even if it is not written with a neat piece of code.

Thanks for bringing in the problem! It was a nice challenge for me!

All the best,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply


Messages In This Thread
modifying what a module defines - by Skaperen - Aug-22-2019, 10:02 PM
RE: modifying what a module defines - by fishhook - Aug-23-2019, 06:39 AM
RE: modifying what a module defines - by Skaperen - Aug-24-2019, 07:26 PM
RE: modifying what a module defines - by fishhook - Aug-26-2019, 06:29 AM
RE: modifying what a module defines - by newbieAuggie2019 - Aug-27-2019, 09:39 AM
RE: modifying what a module defines - by Skaperen - Aug-26-2019, 07:34 PM
RE: modifying what a module defines - by Skaperen - Aug-28-2019, 07:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  input defines variable but it's not defined tozqo 5 7,384 Jun-05-2017, 02:45 AM
Last Post: tozqo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020