Python Forum
How to define a global file?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to define a global file?
#5
in some cases i cheat to do logging.  i open() or os.open() a file and os.dup2() its file descriptor to stdout (1).  i am running Linux.  i have no idea if this works in Windows (nor do i care).  then all print() goes to that file, even in called functions and forked processes (which i do a lot of).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
How to define a global file? - by dullboy - Oct-05-2016, 05:10 AM
RE: How to define a global file? - by wavic - Oct-05-2016, 05:14 AM
RE: How to define a global file? - by Larz60+ - Oct-05-2016, 05:16 AM
RE: How to define a global file? - by dullboy - Oct-05-2016, 05:32 AM
RE: How to define a global file? - by Skaperen - Oct-05-2016, 07:54 AM
RE: How to define a global file? - by wavic - Oct-05-2016, 11:42 AM
RE: How to define a global file? - by j.crater - Oct-05-2016, 11:50 AM
RE: How to define a global file? - by wavic - Oct-05-2016, 12:42 PM
RE: How to define a global file? - by j.crater - Oct-05-2016, 12:51 PM
RE: How to define a global file? - by wavic - Oct-05-2016, 01:00 PM
RE: How to define a global file? - by Crimson King - Oct-05-2016, 01:23 PM
RE: How to define a global file? - by dullboy - Oct-05-2016, 02:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Global variable does not seem to be global. Columbo 6 3,803 Jul-15-2019, 11:00 PM
Last Post: Columbo
  define methods in another file bb8 13 6,979 Mar-04-2018, 06:37 AM
Last Post: Python_n00b_06
  [Python Class] save method output to global file/list Vijay 3 5,181 Dec-23-2017, 03:20 AM
Last Post: Vijay

Forum Jump:

User Panel Messages

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