First test of a windows .exe file.

First test of a windows .exe file.
This commit is contained in:
gooneybird47 2021-05-08 22:55:51 +01:00
parent 97ef58701a
commit 26e19a8108
5 changed files with 14 additions and 57 deletions

View File

@ -15,6 +15,8 @@ Traffic_Creator.py can be run either through an IDE or directly from the directo
In windows you can open the terminal from the directory the files are in by clicking in the address bar and typing cmd then enter.
**See bottom of this text for a Windows Executable.**
The program should be self explanatory if you have delt with traffic files before but if not I suggest reading up about them on the Wiki first. -
[Wiki.flightgear](http://wiki.flightgear.org/AI_Traffic) (link also in program).
@ -28,6 +30,15 @@ When finished save the file with the name of your choice, all being well it can
This is not an xml editor, it can not edit traffic files, I created it to quickly write test or local files so it's not really a program for writing or editing airline schedules.
### Windows Executable
First test of a windows .exe file.
In the "windows_64" folder is a zip file (Traffic_Creator.zip) extract the contents of the zip into a folder that has *write access* and run the "Traffic_Creator.exe" file.
**This has been tested on several windows 10 computers with no problems but I believe it only runs on 64 bit machines.**
### Disclaimer
This is my first Python program so any errors and bugs are entirely down to me. ;)

View File

@ -2,9 +2,7 @@ import tkinter as tk
from tkinter import ttk
from tkinter import filedialog
from tkinter import messagebox
# from tkinter.filedialog import askopenfile
import webbrowser
# import os
import sys
tg = ['<?xml version="1.0"?>', '<trafficlist>', '</trafficlist>', ' <aircraft>', ' </aircraft>',
@ -26,7 +24,7 @@ open("traffic_test.xml", "w").close()
root = tk.Tk()
root.geometry('1000x768')
root.title('AI Traffic File Creator For FlightGear')
root.title('AI Traffic File Creator For FlightGear - Author Brett Harrison (gooneybird)')
# Redirect Print To File
@ -52,13 +50,6 @@ root.protocol("WM_DELETE_WINDOW", on_closing)
def close_output():
sys.stdout.close()
# ("traffic_test.xml").close
# if sys.platform == 'linux2':
# subprocess.call(["xdg-open", 'traffic_test.xml'])
# else:
# os.startfile('traffic_test.xml')
with open("traffic_test.xml", 'r+') as finp:
outp = finp.read()
out_all = '<?xml version="1.0"?>\n' + '<trafficlist>\n' + outp + '</trafficlist>'

Binary file not shown.

View File

@ -1,45 +0,0 @@
<!-- -->
<aircraft>
<model>Aircraft/</model>
<livery></livery>
<airline></airline>
<home-port></home-port>
<required-aircraft></required-aircraft>
<actype></actype>
<offset>0</offset>
<radius></radius>
<flighttype>ga</flighttype>
<performance-class>light_aircraft</performance-class>
<registration></registration>
<heavy>false</heavy>
</aircraft>
<flight>
<callsign></callsign>
<required-aircraft></required-aircraft>
<fltrules>IFR</fltrules>
<departure>
<port></port>
<time></time>
</departure>
<cruise-alt></cruise-alt>
<arrival>
<port></port>
<time></time>
</arrival>
<repeat></repeat>
</flight>
<flight>
<callsign></callsign>
<required-aircraft></required-aircraft>
<fltrules>IFR</fltrules>
<departure>
<port></port>
<time></time>
</departure>
<cruise-alt></cruise-alt>
<arrival>
<port></port>
<time></time>
</arrival>
<repeat></repeat>
</flight>

Binary file not shown.