# Python Script node for Notepad.exe. Possible?

**URL:** <https://forum.dynamobim.com/t/python-script-node-for-notepad-exe-possible/4578>\
**Category:** Developers\
**Created:** [June 18, 2016, 12:01am UTC](https://forum.dynamobim.com/t/python-script-node-for-notepad-exe-possible/4578 "2016-06-18T00:01:15Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![Ron\_Allen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ron_allen/32/124849_2.png) [@Ron\_Allen](https://forum.dynamobim.com/u/Ron_Allen)\
**Post date:** [July 7, 2017, 9:39pm UTC](https://forum.dynamobim.com/t/python-script-node-for-notepad-exe-possible/4578/14 "2017-07-07T21:39:56Z")

</div>

Node to take specific lists formatting and convert them into strings and write to a text file; then open the text file asynchronously to allow the script to continue.

[py.INFORM.py](http://py.INFORM.py)

```
import clr
clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import TaskDialog ##Import task dialog

##from datetime import datetime ##Formatting date time strings for files
import time ##Time as in NOW or tiem string format functions
import sys ##Validate thie is here and avaiable#########
sys.path.append(r'C:\Program Files (x86)\IronPython 2.7\Lib')

import subprocess ##Launching asynchronus processess like notepad
import os ##Operating system - CASE SENSITIVE

msg=IN[0] ##DAta in 0

##msgbox=TaskDialog ##Task Dialog

astr="" ##STR for formatting
for i in msg: ##BIG MESSAGE LIST
	sstr="" ##SUB STRING
	for j in i:
		for k in j:
			sstr=sstr + str(k) + "\t" ##ADD TAB SEPARATORS
		sstr=sstr + "\n" ##ADD CARRIAGE RETURN to substring
	astr=astr + sstr + "\n" ##ADD substring to main and spacer carriage return
##Set file name using date-time in C:\TEMP####
fn="C:\\temp\\DynamoError-" + time.strftime("%Y-%m-%dt%H%M%Z") + ".txt"
f= open (fn, "w+") ##Open file wor Write
f.write(astr) ##Write out ASTR

subprocess.Popen('notepad {}'.format(fn))	##Open the file in Notepad Asynchronously
##msgbox.Show("Message", astr ) ##Will show message dialog in revit - WARNING - Synchronus- script will have to wait.

OUT=astr ##Pass formatted string out
```

---

_[View the full topic](https://forum.dynamobim.com/t/python-script-node-for-notepad-exe-possible/4578)._
