Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Python demo

Featured Replies

Hi everybody,i m quite new to fgfs, this great fs !!i saw in the source code a python file (demo.py). I don t know much about python but what s inside the file could interest me for an important project.So i need to run the demo.py but if i try in DOS mode, a command like:c:pathpython.exe path2demo.py,i get an error,so what should i do to run the demo ?thanks a lot:)

Let me start out by saying that I have never tried running python on dos. But, you will need to go out and find/install python. What is distributed with FlightGear is simply a python script.FlightGear has a variety of interfacing capabilities so you can do the same sort of thing from perl, C/C++, java, even visual basic. As long as you can open up a tcp or udp socket connection and read/write, you have almost unlimited ability to monitor and remote control a running FlightGear application.You do need to pass the right options to FlightGear when you run it to enable the various interfacing options you plan to use.If this doesn't help, you probably want to post something more detailed than "I get an error." If there was only one error possible in this world, someone would have already found it and fixed it and life would be perfect. :-)Curt.

okthanks a lot for trying to help me curt.well...it seems that the python script attempts to connect to fg on port 5500 by default. i got a socket error bc Flight gear doesn t want of the connection. i had tried a launch command with:--native=socket,in,30,,5500,udpso i guess i should write something else but what ?2)in fact my project is about controlling the cameras in fg. I did the nasal tutorial for example. What i m able to do is changing between views. But within each view,i can't change parameters like the offset, the eye position of the camera etc.for example, the command setprop("/sim/someview/someposition/",xxx);doesnt seem to work :(are all the camera positions static once they are defined or is there another way that using nasal to write programs that allow changing the parameters of a view ?thks for any help:)

  • 2 weeks later...

>ok>thanks a lot for trying to help me curt.>well...it seems that the python script attempts to connect to>fg on port 5500 by default. i got a socket error bc Flight>gear doesn t want of the connection. i had tried a launch>command with:>--native=socket,in,30,,5500,udp>so i guess i should write something else but what ?I may be totally wrong, but actually the last time I checked DOS, it didn't even provide basic socket functionality, so while running Python under DOS may in fact be possible, running socket-based pythong scripts under DOS would definitely require also socket support, that is some sort of TSR-based driver?Are you sure you are actually referring to DOS and not only a DOS (shell/console) box?>2)>in fact my project is about controlling the cameras in fg. I>did the nasal tutorial for example. What i m able to do is>changing between views. But within each view,i can't change>parameters like the offset, the eye position of the camera>etc.>for example, the command>setprop("/sim/someview/someposition/",xxx);>doesnt seem to work :(>are all the camera positions static once they are defined or>is there another way that using nasal to write programs that>allow changing the parameters of a view ?IIRC, camera views aren't directly used, but rather copied verbatim to the current view property, that is any modifications should be done there.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.