This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I am new to python tool.
I have written a simple python code in python tool and try to run the workflow but its not generate the .txt output file.
Could you please help me on this.
f = open("D:\Python\demofile2.txt", "x")f.write("Now the file has more content!")f.close()
#open and read the file after the appending:f = open("D:\Python\demofile2.txt", "r")print(f.read())
Please note above code is executed if i saved it in .py file like test.py and executed using command prompt
D:\Python> python test.py ----- (Its generated the output successfully)
Could you please help me why the same is not working if i use the Alteryx Python tool.
Thank you in advance,
Below code ran successfully for me. Slight modification - replaced single back slash with double backslash. make sure, you remove demofile2.txt from D:\Python\ folder.
f = open("D:\\Python\\demofile2.txt", "x")f.write("Now the file has more content!")f.close()
#open and read the file after the appending:f = open("D:\\Python\\demofile2.txt", "r")print(f.read())
Let me know if this helps...
Thank you for your quick response. As you suggested i made the changes in code (double blackslash) and re-run the workflow.
But still the output is not generated. Also i have removed "demofile2.txt" file from folder before run the workflow.
Also for information i am using Alteryx 2019.1.6 version.
is there any error message you are getting? Could you please share the workflow?
Thank you for replying.
I cant share the workflow.
But here I am sharing the images with you.
I hope it will helpful.
Also I don't get any error message.
Workflow running successfully but not generate the output.
Thank you again
Try the attached. It worked for me.
I didn't know what you had in the Text Input tool, so I just added a dummy field
Thank you for your reply.
Yes in text input i have added only dummy value/filed for incoming connection only.
I dont know why the python tool not executing the simple code.
I tried your attached workflow as well but i am facing same issue. (File is not generating)