Dear experts please solve this issue [Button:SatRetStat] Title: "Return Status" Key: Alt + S Action: Call: DownloadFile and Display Report [FunctionownloadFile and Display Report] Local Formula:isExeExist: $$IsFileExists:"E:\TallyPrime\Get Return Status in xml.py" 090: IFisExeExist ;100: Exec Command Ex: "C:\Windows\py.exe" 105: Exec Command Ex: "E:\TallyPrime\Get Return Status in xml.py" ;110: Display:Return Filling Stat Report 150: Else 160: Msg Box:ERR:"Supported File Does not exist " 170: ENDIF
I think you can use DLL instead of Python but You can't make dll out of Python So, either make code in c#/c/c++ or maybe you can use Cython to compile Python code as dll Note: I haven't compiled Python into dll but As per my understanding, It'll work
If you are expecting some file from py.exe then You can do it like this For your Python app: 1. In your Python code, ensure that the expected file does not exist and delete it if it does. 2. Complete your task and write the result into the file. For your TDL code: 1. Use a while loop to wait until the Python app generates the file. 2. Once the file exists, you can perform tasks with the file using TDL code. 3. You can use the $$IsFileExists function to check for the existence of the file in the while loop. Example: [function:dotaskafterfileexist] 000:While:NOT ($$IsFileExists:"C:\1.txt") 010:End while ;;;After this line, you can perform tasks with the file 020:Exec Command Ex: "E:\TallyPrime\Get Return Status in xml.py"
BTW DLL is very simple...just think of it like an exe...just that you can't run it directly like exe. Most Probably Above thing will resolve your issue but if it doesn't then you can ping me...will help you
Can we invoke an external application within Tally? (tallysolutions.com) EXEC COMMAND : Python Exe Location : Script Location Ex: EXEC COMMAND : C:\Windows\py.exe : E:\TallyPrime\Get Return Status in xml.py
***I have python script which convert an api json response into a xml file successfully which store in my desctop location. ***now from tally I want to run that py script by using of tdl code. ***while successfully run that py script from tally its create a xml file which contains data of that api json responce and then I show this into tally report
please correct this tdl code to run my py script from tally [Button:SatRetStat] Title: "Return Status" Key: Alt + S Action: Call: DownloadFile and Display Report [FunctionownloadFile and Display Report] Local Formula:isExeExist: $$IsFileExists:"E:\TallyPrime\Get Return Status in xml.py" 090: IFisExeExist ;100: Exec Command Ex: "C:\Windows\py.exe" 105: EXEC COMMAND : C:\Windows\py.exe : E:\TallyPrime\Get Return Status in xml.py 110: Display:Return Filling Stat Report 150: Else 160: Msg Box:ERR:"Supported File Does not exist " 170: ENDIF
I think you should convert your py script into exe and then run exe from tdl... because In user machine python may not be installed which will create issue for you. You can just do a Google search for how to convert python to exe... you'll get it
Hmm, It works fine because you have Python installed but If it wasn't then it will create an issue Anyway, You can use the while loop to check for file and use it
but now the problem is in my py script there is gstin as variable every time I have to change the gstin in my script then run the script how can we pull the party gstin from tally into my script the button [Button:SatRetStat] Title: "Return Status" Key: Alt + S Action: Call: DownloadFile and Display Report this button is in ledger master
this is my py script import requests import json import dicttoxml gstin = '08ABAPM2523R1ZE' url = f"http://sheet.gstincheck.co.in/check-return/my api key/{gstin}" response = requests.get(url) data_dict = json.loads(response.content) xml_data = dicttoxml.dicttoxml(data_dict) with open('data.xml', 'wb') as f: f.write(xml_data)
import sys import requests import json import dicttoxml gstin = sys.argv[1] url = f"http://sheet.gstincheck.co.in/check-return/my api key/{gstin}" response = requests.get(url) data_dict = json.loads(response.content) xml_data = dicttoxml.dicttoxml(data_dict) with open('data.xml', 'wb') as f: f.write(xml_data) You can do it like this
Post conversion of this script into exe, you can pass gstin like this 1. Open CMD 2. "path\to\script.exe" "gstin"
Many many thanks to Himanshu ji and Sai Vineeth ji for your help I have completed the .exe file and it works fine now learning new things is always pleasure thanks himanshu ji again