how can I run custom extension files in python script? - python

I have a file with extension (.logs) which has the data without xml format. I also have a tool say abc.exe (added to PATH) which takes the .logs file as input and generates a new file with properly formatted XML. So, I'm trying to run the same tool using python, MY.py is reading the input file rather running it using abc.exe. How can I make the file run using abc.exe using pythons scripting?

If you want to lunch your program (let's say, abc.exe), just use this code:
import subprocess
subprocess.Popen(["abc.exe", "arg1","arg2"])

Related

using pyinstaller with a script that reads and writes from and into a JSON file

I want to use pyinstaller to make a standalone package with a python script that reads a configuration JSON file, then writes into it. the config.json file is in the same directory as my script and I need it to use an API.
How can I do this? and are there any other modules that would allow me to package it?

Python Pytest files to convert single executable file and executed via batch file

I have 10 pytest files and the demand is to convert these to a single executable file, The project contains properties file in which data is present.I need the data for pytest as in the console I was running via python -m pytest but in pyinstaller it is asking for a single .py file to be converted. I tried but came into no solution. Please help me its important. Even though I convert to a single executable the exe file never runs.
In Java I used to create a jar file and it can be processed via .bat file and it reads data from properties file and it works
If in python something like that we can achieve will be welcomed

How to convert py script to an exe file for other non-python users and pass a csv as an argument?

I have a python script that takes a csv file and a week number as arguments. How do I share my code to other non-python users through an exe file that allows them to upload the csv and input the number? The python script is very simple; it just cleans and organizes the data but I'll be sharing this to other people.
What pyinstaller do is to pack your python script as well as all its environment to work on (including the scripts it imports and the imported imports and the whole python executable files) to a single exe, As long as you are using '-F' option meaning a single exe file. The exe file behaves the same way the original python script does.
if you uses
python XXX.py args,
then now you should be using XXX.exe args instead.

How to do multi OS level access of a file using pathlib module?

So here I am writing a python program that read a text file and print its content. So I want to make a system that I write a txt file using a python script in window and then read it using another python script in linux. I will transfer the text file using google cloud. How can I use pathlib module to handle the path of the file in either of the OS.

How to share AutoKey and TextExpander snippet files : json vs. xml

I'm using AutoKey on Ubuntu (12.04) and it works fine. Now I want to use a shared DropBox file, containing all snippets, however this is a TextExpander file because my colleges use MACs and have another app like AutoKey, called TextExpander.
Their .textexpander file seem to be XML, while my AutoKey uses JSON files.
Can I use a shared .textexpander XML-file with my AutoKey program?
Is it possible to redirect / convert the .textexpander snippets file (on DropBox) to an autokey.json file, eg. with a Python script and if then how?
Note: I'm not a linux novice, so I can create / adjust some python scripts and access the file system.

Categories