Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Exporting Python Output to Notepad
#1
Hi
i am trying create a file in Python 2.6.6. Its working in Python 2.7

fp = open('command_file.txt', 'w')
fp.write(device1 + '#' + intstatus + '\n' + device1 + '#\n')

command_file.txt is not being created when i run in Python 2.6.6 . any idea how to fix it up ?
Quote
#2
I don't see anything obvious wrong, but more information would be helpful. What are device1 and intstatus? Are you getting an error, or is there just no file? If you're getting an error, what is the full text of the error? Are you running it exactly the same in the two versions (that is, could the current working directory be different, so that the relative file path is pointing to an unexpected location?
buran likes this post
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures

Quote
#3
i m not getting any error..but i dont see that file.Running exactly the same code and i am login to root... i tried

10:57:03 # find . -name command_file.txt

no luck....
Quote
#4
Okay, then what exactly are device1 and instatus? If they are the wrong type that could be interfering with the write command.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures

Quote
#5
i was returning the output to list before it was getting written in .txt..fixed that.. thanks
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Exporting list with dictionary to Excel veromi22 0 141 Oct-15-2019, 12:54 AM
Last Post: veromi22
  Exporting to Excel Nirmal 5 334 Aug-08-2019, 12:22 PM
Last Post: Nirmal
  Running python code meant for Notepad++ plugin independently greektranslator 3 438 Jan-28-2019, 06:03 PM
Last Post: maxtimbo
  Exporting Json events to a text file uklipse 3 555 Aug-21-2018, 02:12 PM
Last Post: buran
  Setup Notepad++ for python LavaCreeperKing 6 6,464 Mar-22-2018, 07:27 PM
Last Post: LavaCreeperKing
  Cannot "Run" python on notepad++ interconnected 6 4,565 Dec-11-2016, 10:43 PM
Last Post: Blue Dog
  Path of Notepad++ and Python Vienetas 6 3,445 Oct-13-2016, 07:22 PM
Last Post: sparkz_alot
  Cant Get Powershell to run a python program from notepad++. Newbie help! Pythonerous 4 3,909 Oct-10-2016, 07:16 PM
Last Post: Pythonerous

Forum Jump:


Users browsing this thread: 1 Guest(s)