Mherrmann / fbs-tutorial, fbs app.

Fbs app


Before you can use the installer command on windows, please install NSIS and add its installation directory to your PATH environment variable.

Real forex bonuses


Mherrmann / fbs-tutorial, fbs app.


Mherrmann / fbs-tutorial, fbs app.


Mherrmann / fbs-tutorial, fbs app.

If you have not used pyqt before: it's the library that allowed us in the above examples to use qt (a GUI framework) from python. Fbs's contribution is not to combine python and qt. It's to make it very easy to package and deploy pyqt-based apps to your users' computers. For an introduction to pyqt, see here.


Fbs app


This tutorial shows how you can use fbs to create a simple python GUI and an associated installer:


You can follow this tutorial on windows, mac or linux. Only python 3.5 or 3.6 will work. Other versions will likely give errors.


Create a virtual environment in the current directory:


Activate the virtual environment:


The remainder of the tutorial assumes that the virtual environment is active.


Install the required libraries (most notably, fbs and pyqt5 ):


(if this produces errors, try pip install wheel first.)


You can also use qt for python instead of pyqt. To do this, simply write pyside2 instead of pyqt5 throughout this tutorial. For the above, use pip install pyside2==5.12.0 .


Execute the following command to start a new fbs project:


This asks you a few questions. You can for instance use tutorial as the app name and your name as the author.


The command creates a new folder called src/ in your current directory. This folder contains the minimum configuration for a bare-bones pyqt app.


To run the basic pyqt application from source, execute the following command:


This shows a (admittedly not very exciting) window. Screenshots on windows/mac/ubuntu:


Source code of the sample app


Let's now take a look at the source code of the pyqt app that was generated. It is at src/main/python/main.Py :


The important steps are highlighted as comments. They're the only boilerplate that's required. In the middle of the code, you can see that a window is being created, resized and then shown.


We want to turn the source code of our app into a standalone executable that can be run on your users' computers. In the context of python applications, this process is called "freezing".


Use the following command to turn the app's source code into a standalone executable:


This creates the folder target/tutorial . You can copy this directory to any other computer (with the same OS as yours) and run the app there! Isn't that awesome?


Desktop applications are normally distributed by means of an installer. On windows, this would be an executable called tutorialsetup.Exe . On mac, mountable disk images such as tutorial.Dmg are commonly used. On linux, .Deb files are common on ubuntu, .Rpm on fedora / centos, and .Pkg.Tar.Xz on arch.


Fbs lets you generate each of the above packages via the command:


Depending on your operating system, this may require you to first install some tools. Please read on for OS-specific instructions.


Before you can use the installer command on windows, please install NSIS and add its installation directory to your PATH environment variable.


The installer is created at target/tutorialsetup.Exe . It lets your users pick the installation directory and adds your app to the start menu. It also creates an entry in windows' list of installed programs. Your users can use this to uninstall your app. The following screenshots show these steps in action:


On mac, the installer command generates the file target/tutorial.Dmg . When your users open it, they see the following volume:


To install your app, your users simply drag its icon to the applications folder (also shown in the volume).


On linux, the installer command requires that you have fpm. You can for instance follow these instructions to install it.


Depending on your linux distribution, fbs creates the installer at target/tutorial.Deb , . Pkg.Tar.Xz or . Rpm . Your users can use these files to install your app with their respective package manager.


A more interesting example


We will now create a more powerful example. Here's what it looks like on windows:


When you click on the button in the window, a new quote is fetched from the internet and displayed above.


Before you can run this example, you need to install the python requests library. To do this, type in the following command:


The source code of the new app consists of two files:


Please copy the former over the existing file in src/main/python/ , and the latter into the new directory src/main/resources/base/ . If you are using pyside2 instead of pyqt, you have to replace all occurrences of pyqt5 in main.Py by pyside2 .


Once you have followed these steps, you can do fbs run (or fbs freeze etc.) as before.


The new app uses the following code to fetch quotes from the internet:


You can see that it uses the requests library we just installed above. Feel free to open build-system.Fman.Io/quote in the browser to get a feel for what it returns. Its data comes from a public database.


The app follows the same basic steps as before. It instantiates an application context and ends by calling appctxt.App.Exec_() :


What's different is what happens in between:


The first line uses get_resource(. ) to obtain the path to styles.Qss . This is a QSS file, qt's equivalent to CSS. The next line reads its contents and sets them as the stylesheet of the application context's .App .


Fbs ensures that get_resource(. ) works both when running from source (i.E. During fbs run ) and when running the compiled form of your app. In the former case, the returned path is in src/main/resources . In the latter, it will be in your app's installation directory. Fbs handles the corresponding details transparently.


The next-to-last line instantiates mainwindow . This new class sets up the text field for the quote and the button. When the button is clicked, it changes the contents of the text field using _get_quote() above. You can find the full code in main.Py .


As already mentioned, you can use fbs run to run the new app. But here's what's really cool: you can also do fbs freeze and fbs installer to distribute it to other computers. Fbs includes the requests dependency and the styles.Qss file automatically.


Fbs lets you use python and qt to create desktop applications for windows, mac and linux. It can create installers for your app, and automatically handles the packaging of third-party libraries and data files. These things normally take weeks to figure out. Fbs gives them to you in minutes instead.


Fbs's manual explains the technical foundation of the steps in this tutorial. Read it to find out more about fbs's required directory structure, dependency management, handling of data files, custom build commands, API and more.


If you have not used pyqt before: it's the library that allowed us in the above examples to use qt (a GUI framework) from python. Fbs's contribution is not to combine python and qt. It's to make it very easy to package and deploy pyqt-based apps to your users' computers. For an introduction to pyqt, see here.


Feel free to share the link to this tutorial! If you are not yet on fbs's mailing list and want to be notified as it evolves, sign up here.


About


Tutorial for creating python/qt guis with fbs



Trade forex, cfds, stocks and metals with honest broker


For newbies, risks are 100 times lower


Highest honest leverage on market


Wide payment systems geography


Feel free to choose any account type you like!


For experienced market players making their way to forex heights


Perfectly suits those who are just starting on their way to success on forex


Ideal for those who want to calculate their profit precisely


Designed for those who prefer trading at the fastest speed


For those who want to feel the full power of trading with ECN technologies


To grow your confidence, train your trading skills on a demo account.


Deposit with your local payment systems


Be armed with the latest news


Improvements in the conditions of U.S. Stock trading


FBS copytrade removes the $500 limit for copying PRO traders


FBS 12 years: big time! Big money!


Qualcomm: a strong performer


How well ebay did in 2020?


AUD/USD is dropping after the RBA decision and statement


Will the pound get a boost?


Will the RBA support the AUD?


FBS at social media


Contact us



  • Zopim

  • Wechat

  • Fb-msg

  • Viber

  • Line

  • Telegram

  • Whatsapp


The website is operated by FBS markets inc.; registration no. 119717; FBS markets inc is regulated by IFSC, license IFSC/000102/124; address: 2118, guava street, belize belama phase 1, belize


The service is not provided in the following countries: japan, USA, canada, UK, myanmar, brazil, malaysia, israel and the islamic republic of iran


Payment transactions are managed by НDС technologies ltd.; registration no. HE 370778; address: arch. Makariou III & vyronos, P. Lordos center, block B, office 203


For cooperation, please contact us via support@fbs.Com or +35 7251 23212.


Risk warning: before you start trading, you should completely understand the risks involved with the currency market and trading on margin, and you should be aware of your level of experience.


Any copying, reproduction, republication, as well as on the internet resources of any materials from this website is possible only upon written permission.


Data collection notice


FBS maintains a record of your data to run this website. By pressing the “accept” button, you agree to our privacy policy.



Python and qt:
simplified!


Python and qt are great for writing cross-platform desktop apps.
But packaging, code signing, installers and automatic updates are a pain.
Fbs solves these problems and saves you months of development.


Python qt GUI


Fbs is the fastest way to create a python GUI. It solves common pain points such as packaging and deployment. Based on python and qt, fbs is a lightweight alternative to electron.


Easy packaging


Unlike other solutions, fbs makes packaging easy. Create an installer for your app in seconds and distribute it to your users – on windows, mac and linux!


Open source


Fbs's source code is available on github. You can use it for free in open source projects licensed under the GPL. Commercial licenses are also offered. More information below.


Battle-tested


Applications built with fbs have been installed on tens of thousands of machines. It encapsulates years of experience. This ensures your app runs on your users' computers.


Get started


The best place to get started with fbs is the tutorial. All you need is a text editor and python 3. In 15 minutes, you will create a simple app and an installer. Everybody who takes the tutorial says it's a breeze!


Licensing


You can use fbs for free in open source projects that are licensed under the GPL. If you don't want to open your code up to the public, you can purchase a commercial license for EUR 449 per developer:


If you have questions about licensing fbs, please contact .


When using fbs, there are two other projects whose licensing terms you need to obey: qt and one of its python bindings. Qt can typically be used for free under the terms of the LGPL. On the other hand, the pyqt python binding is only available under the GPL. To comply with its license, you need to open source your application itself under the GPL, or buy a commercial pyqt license. You can avoid this by using pyside2 instead of pyqt, but support for it in fbs is not yet as mature as for pyqt.


Under the hood


Instead of reinventing the wheel, fbs builds on well-tested solutions: pyqt to use qt from python, pyinstaller for packaging, NSIS for windows installers, .Deb files on ubuntu. With fbs, you don't have to spend weeks integrating these technologies. It addresses common tasks such as shipping resource files and accessing them from within your application. Finally, it solves edge cases that only occur on some users' systems and would take time to figure out yourself.


Background


Fbs open sources solutions that were originally implemented for the cross-platform file manager fman. Months of fman's development went into creating installers for the various operating systems, code signing and automatic updates. Fbs gives you the same results in minutes instead of months.



Packaging pyqt5 apps with fbs


Martin Fitzpatrick photo


Distribute cross-platform GUI applications with the fman build system


Fbs is a cross-platform pyqt5 packaging system which supports building desktop applications for windows, mac and linux (ubuntu, fedora and arch). Built on top of pyinstaller it wraps some of the rough edges and defines a standard project structure which allows the build process to be entirely automated. The included resource API is particularly useful, simplifying the handling of external data files, images or third-party libraries — a common pain point when bundling apps.


This tutorial will take you through the steps of creating pyqt5 applications using fbs from scratch, and for converting existing projects over to the system. If you’re targeting multiple platforms with your app, it's definitely worth a look.


If you're impatient, you can grab the moonsweeper installers directly for windows, macos or linux (ubuntu).


Fbs is licensed under the GPL. This means you can use the fbs system for free in packages distributed with the GPL. For commercial (or other non-GPL) packages you must buy a commercial license. See the fbs licensing page for up-to-date information.


Fbs is built on top of pyinstaller. You can also use pyinstaller directly to package applications, see our packaging pyqt5 & pyside2 applications for windows, with pyinstaller tutorial.


Install requirements


Fbs works out of the box with both pyqt pyqt5 and qt for python pyside2 . The only other requirement is pyinstaller which handles the packaging itself. You can install these in a virtual environment (or your applications virtual environment) to keep your environment clean.


Fbs only supports python versions 3.5 and 3.6


Once created, activate the virtual environment by running from the command line —


Finally, install the required libraries. For pyqt5 you would use —


Or for qt for python (pyside2) —


Fbs installs a command line tool fbs into your path which provides access to all fbs management commands. To see the complete list of commands available run fbs .


Now you're ready to start packaging applications with fbs.


Starting an app


If you’re starting a pyqt5 application from scratch, you can use the fbs startproject management command to create a complete, working and packageable application stub in the current folder. This has the benefit of allowing you to test (and continue to test) the packageability of your application as you develop it, rather than leaving it to the end.


The command walks you through a few questions, allowing you to fill in details of your application. These values will be written into your app source and configuration. The bare-bones app will be created under the src/ folder in the current directory.


If you already have your own working pyqt5 app you will need to either a) use the generated app as a guideline for converting yours to the same structure, or b) create a new app using `startproject` and migrate the code over.


Running your new project


You can run this new application using the following fbs command in the same folder you ran startproject from.


If everything is working this should show you a small empty window with your apps' title — exciting eh?


Hello World App on Windows


Hello world app on windows


Hello World App on Mac


Hello world app on mac


Hello World App on Linux


Hello world app on linux


The application structure


The startproject command generates the required folder structure for a fbs pyqt5 application. This includes a src/build which contains the build settings for your package, main/icons which contains the application icons, and src/python for the source.


Your bare-bones pyqt5 application is generated in src/main/python/main.Py and is a complete working example you can use to base your own code on.


If you’ve built pyqt5 applications before you’ll notice that building an application with fbs introduces a new concept — the applicationcontext .


The applicationcontext


When building pyqt5 applications there are typically a number of components or resources that are used throughout your app. These are commonly stored in the qmainwindow or as global vars which can get a bit messy as your application grows. The applicationcontext provides a central location for initialising and storing these components, as well as providing access to some core fbs features.


The applicationcontext object also creates and holds a reference to a global qapplication object — available under applicationcontext.App . Every qt application must have one (and only one) qapplication to hold the event loop and core settings. Without fbs you would usually define this at the base of your script, and call .Exec() to start the event loop.


Without fbs this would look something like this —


The equivalent with fbs would be —


If you want to create your own custom `qapplication` initialisation you can overwrite the `.App` property on your `applicationcontext` subclass using `cached_property` (see below).


This basic example is clear to follow. However, once you start adding custom styles and translations to your application the initialisation can grow quite a bit. To keep things nicely structured fbs recommends creating a .Run method on your applicationcontext .


This method should handle the setup of your application, such as creating and showing a window, finally starting up the event loop on the .App object. This final step is performed by calling self.App.Exec_() at the end of the method.


As your initialisation gets more complicated you can break out subsections into separate methods for clarity, for example —


On execution the `.Run()` method will be called and your event loop started. Execution continues in this event loop until the application is exited, at which point your `.Run()` method will return (with the appropriate exit code).


Building a real application


The bare-bones application doesn’t do very much, so below we’ll look at something more complete — the moonsweeper application from my 15 minute apps. The updated source code is available to download below.


Only the changes required to convert moonsweeper over to fbs are covered here. If you want to see how_ moonsweeper_ itself works, see the original app article. The custom application icons were created using icon art by freepik.


The project follows the same basic structure as for the stub application we created above.


The src/build/settings/base.Json stores the basic details about the application, including the entry point to run the app with fbs run or once packaged.


The script entry point is at the base of src/main/python/main.Py . This creates the appcontext object and calls the .Run() method to start up the app.


The applicationcontext defines a .Run() method to handle initialisation. In this case that consists of creating and showing the main window, then starting up the event loop.


The cached_property decorator


The .Run() method accesses self.Main_window . You’ll notice that this method is wrapped in an fbs @cached_property decorator. This decorator turns the method into a property (like the python @property decorator) and caches the return value.


The first time the property is accessed the method is executed and the return value cached. On subsequent calls, the cached value is returned directly without executing anything. This also has the side-effect of postponing creation of these objects until they are needed.


You can use @cached_property to define each application component (a window, a toolbar, a database connection or other resources). However, you don’t have to use the @cached_property — you could alternatively declare all properties in your applicationcontext.__init__ block as shown below.


Accessing resources with .Get_resource


Applications usually require additional data files beyond the source code — for example files icons, images, styles (qt’s .Qss files) or documentation. You may also want to bundle platform-specific libraries or binaries. To simplify this fbs defines a folder structure and access method which work seamlessly across development and distributed versions.


The top level folder resources/ should contain a folder base plus any combination of the other folders shown below. The base folder contains files common to all platforms, while the platform-specific folders can be used for any files specific to a given OS.


Getting files into the right place to load from a distributed app across all platforms is usually one of the faffiest bits of distributing pyqt applications. It’s really handy that fbs handles this for you.


To simplify the loading of resources from your resources/ folder in your applications fbs provides the applicationcontext.Get_resource() method. This method takes the name of a file which can be found somewhere in the resources/ folder and returns the absolute path to that file. You can use this returned absolute path to open the file as normal.


In our moonsweeper application above, we have a bomb image file available at src/main/resources/base/images/bug.Jpg . By calling ctx.Get_resource('images/bug.Png') we get the absolute path to that image file on the filesystem, allowing us to open the file within our app.


If the file does not exist `filenotfounderror` will be raised instead.


The handy thing about this method is that it transparently handles the platform folders under src/main/resources giving OS-specific files precedence. For example, if the same file was also present under src/main/resources/mac/images/bug.Jpg and we called ctx.Get_resource('images/bug.Jpg') we would get the mac version of the file.


Additionally get_resource works both when running from source and when running a frozen or installed version of your application. If your resources/ load correctly locally you can be confident they will load correctly in your distributed applications.


Using the applicationcontext from app


As shown above, our applicationcontext object has cached properties to load and return the resources. To allow us to access these from our qmainwindow we can pass the context in and store a reference to it in our window __init__ .


Now that we have access to the context via self.Ctx we can use it this in any place we want to reference these external resources.


The first time we access self.Ctx.Img_bomb the file will be loaded, the qimage created and returned. On subsequent calls, we’ll get the image from the cache.


Those are all the changes needed to get the moonsweeper app packageable with fbs. If you open up the source folder you should be able to start it up as before.


If that’s working, you’re ready to move onto freezing and building in the installer.


Freezing the app


Freezing is the process of turning a python application into a standalone executable that can run on another user’s computer. Use the following command to turn the app's source code into a standalone executable:


The resulting executable depends on the platform you freeze on — the executable will only work on the OS you built it on (e.G. An executable built on windows will run on another windows computer, but not on a mac).



  • Windows will create an .Exe executable in the folder target/

  • Macos X will create an .App application bundle in target/.App

  • Linux will create an executable in the folder target/



On windows you may need to install the windows 10 SDK, although fbs will prompt you if this is the case.


Creating the installer


While you can share the executable files with users, desktop applications are normally distributed with installers which handle the process of putting the executable (and any other files) in the correct place. See the following sections for platform-specific notes before creating


You must freeze your app first then create the installer.


Windows installer


The windows installer allows your users to pick the installation directory for the executable and adds your app to the user’s start menu. The app is also added to installed programs, allowing it to be uninstalled by your users.


Before you create installers on windows you will need to install NSIS and ensure its installation directory is in your PATH . You can then build an installer using —


The windows installer will be created at target/setup.Exe .


Moonsweeper Windows NSIS installer


Moonsweeper windows NSIS installer


Mac installer


There are no additional steps to create a macos installer. Just run the fbs command —


Moonsweeper Mac Disk Image


Moonsweeper mac disk image


Linux installer


To build installers on linux you need to install the ruby tool effing package management! — use the installation guide to get it set up. Once that is in place you can use the standard command to create the linux package file.


The resulting package will be created under the target/ folder. Depending on your platform the package file will be named .Deb , .Pkg.Tar.Xz or .Rpm . Your users can install this file with their package manager.


Enjoyed this?
You might enjoy my books.


Create GUI applications is my hands-on guide to making desktop apps with python.


Stop searching for how to create GUI applications with python — it's all here.


I've been teaching pyqt for 8 years, helping thousands of developers just like you to bring their apps to life. Let's make your project a success!



Download FBS forex broker — forex trading app with demo for PC


Preview


App specs


Versions history


Description


With this must-have app for each trader, you can track your statistics, manage several accounts per one session, deposit and withdraw funds via various payment systems, and securely keep personal and market-related data.


With the help of the FBS personal area, you can access various statistical data and have it at your finger-tips at all times. With this information at hand, you will be able to see the big picture, that is to say, minimize the strategies that tend to have negative dynamics and scale up profitable tactics. Once you learn to analyze your forex trading efficiency, the results of the daily deals will be more predictable and, thus, less risky and potentially more profitable. You will react to the market signals promptly and with an advanced insight.
FBS offers increased productivity, intuitive interface, and fast performance so that you can manage your accounts efficiently, wisely, and fast. You can go places and yet always stay on top of the changing forex market.


Use FBS as a personal money manager. We like making complicated notions and data storage easy for you. Step into innovation with the following features:


Registration and verification
- register in just several clicks
- log in to be accessible anywhere and anytime
- have your accounts verified by uploading the required documents right from your device


Accounts
- create both demo and real accounts so that they satisfy your trading ambitions
- open and close all your accounts for metatrader4
- activate the swap-free option
- see a list of archived accounts and restore them, if needed


Finances
- select the desired payment method
- deposit and withdraw via bank cards, wire transfers, neteller, or skrill
- make internal transfers between accounts
- see the history of your past transactions
- analyze your transactions on different accounts via the dashboard


Profile
- modify personal data
- check the verification documents and status
- upgrade to the professional category to get an increased leverage


With FBS, you will have mobile access to the most crucial info that will help in your daily currency trading. Download the application to get most out of trading and progress as a trader on the constantly volatile financial market.


5 reasons to choose the FBS personal area for proficient account management:
- multilingual customer support available 24/7 via a chat
- user-friendly interface that simplifies your trading routine
- customizable dashboard with a list of active accounts
- fast and straightforward management of your finances per trading account
- all the personal settings grouped in the profile section


Create a personal area to your liking: modify, analyze, and see how your trading experience improves daily. It’s a win today and profit tomorrow!


FBS – your reliable broker
FBS is an acknowledged, international broker and the official trading partner of FC barcelona.
We are present in 190 countries for more than 10 years now, proving to be secure, innovative, and client-friendly. FBS offers increased leverage for professional clients, multilingual support, overwhelming [on-site analytics] and education, free weekly webinars to support and train the skills of our traders all over the world.
FBS (tradestone ltd.) operates under cysec - license number 331/17.



Python and qt:
simplified!


Python and qt are great for writing cross-platform desktop apps.
But packaging, code signing, installers and automatic updates are a pain.
Fbs solves these problems and saves you months of development.


Python qt GUI


Fbs is the fastest way to create a python GUI. It solves common pain points such as packaging and deployment. Based on python and qt, fbs is a lightweight alternative to electron.


Easy packaging


Unlike other solutions, fbs makes packaging easy. Create an installer for your app in seconds and distribute it to your users – on windows, mac and linux!


Open source


Fbs's source code is available on github. You can use it for free in open source projects licensed under the GPL. Commercial licenses are also offered. More information below.


Battle-tested


Applications built with fbs have been installed on tens of thousands of machines. It encapsulates years of experience. This ensures your app runs on your users' computers.


Get started


The best place to get started with fbs is the tutorial. All you need is a text editor and python 3. In 15 minutes, you will create a simple app and an installer. Everybody who takes the tutorial says it's a breeze!


Licensing


You can use fbs for free in open source projects that are licensed under the GPL. If you don't want to open your code up to the public, you can purchase a commercial license for EUR 449 per developer:


If you have questions about licensing fbs, please contact .


When using fbs, there are two other projects whose licensing terms you need to obey: qt and one of its python bindings. Qt can typically be used for free under the terms of the LGPL. On the other hand, the pyqt python binding is only available under the GPL. To comply with its license, you need to open source your application itself under the GPL, or buy a commercial pyqt license. You can avoid this by using pyside2 instead of pyqt, but support for it in fbs is not yet as mature as for pyqt.


Under the hood


Instead of reinventing the wheel, fbs builds on well-tested solutions: pyqt to use qt from python, pyinstaller for packaging, NSIS for windows installers, .Deb files on ubuntu. With fbs, you don't have to spend weeks integrating these technologies. It addresses common tasks such as shipping resource files and accessing them from within your application. Finally, it solves edge cases that only occur on some users' systems and would take time to figure out yourself.


Background


Fbs open sources solutions that were originally implemented for the cross-platform file manager fman. Months of fman's development went into creating installers for the various operating systems, code signing and automatic updates. Fbs gives you the same results in minutes instead of months.



Fbs app


This tutorial shows how you can use fbs to create a simple python GUI and an associated installer:


You can follow this tutorial on windows, mac or linux. Only python 3.5 or 3.6 will work. Other versions will likely give errors.


Create a virtual environment in the current directory:


Activate the virtual environment:


The remainder of the tutorial assumes that the virtual environment is active.


Install the required libraries (most notably, fbs and pyqt5 ):


(if this produces errors, try pip install wheel first.)


You can also use qt for python instead of pyqt. To do this, simply write pyside2 instead of pyqt5 throughout this tutorial. For the above, use pip install pyside2==5.12.0 .


Execute the following command to start a new fbs project:


This asks you a few questions. You can for instance use tutorial as the app name and your name as the author.


The command creates a new folder called src/ in your current directory. This folder contains the minimum configuration for a bare-bones pyqt app.


To run the basic pyqt application from source, execute the following command:


This shows a (admittedly not very exciting) window. Screenshots on windows/mac/ubuntu:


Source code of the sample app


Let's now take a look at the source code of the pyqt app that was generated. It is at src/main/python/main.Py :


The important steps are highlighted as comments. They're the only boilerplate that's required. In the middle of the code, you can see that a window is being created, resized and then shown.


We want to turn the source code of our app into a standalone executable that can be run on your users' computers. In the context of python applications, this process is called "freezing".


Use the following command to turn the app's source code into a standalone executable:


This creates the folder target/tutorial . You can copy this directory to any other computer (with the same OS as yours) and run the app there! Isn't that awesome?


Desktop applications are normally distributed by means of an installer. On windows, this would be an executable called tutorialsetup.Exe . On mac, mountable disk images such as tutorial.Dmg are commonly used. On linux, .Deb files are common on ubuntu, .Rpm on fedora / centos, and .Pkg.Tar.Xz on arch.


Fbs lets you generate each of the above packages via the command:


Depending on your operating system, this may require you to first install some tools. Please read on for OS-specific instructions.


Before you can use the installer command on windows, please install NSIS and add its installation directory to your PATH environment variable.


The installer is created at target/tutorialsetup.Exe . It lets your users pick the installation directory and adds your app to the start menu. It also creates an entry in windows' list of installed programs. Your users can use this to uninstall your app. The following screenshots show these steps in action:


On mac, the installer command generates the file target/tutorial.Dmg . When your users open it, they see the following volume:


To install your app, your users simply drag its icon to the applications folder (also shown in the volume).


On linux, the installer command requires that you have fpm. You can for instance follow these instructions to install it.


Depending on your linux distribution, fbs creates the installer at target/tutorial.Deb , . Pkg.Tar.Xz or . Rpm . Your users can use these files to install your app with their respective package manager.


A more interesting example


We will now create a more powerful example. Here's what it looks like on windows:


When you click on the button in the window, a new quote is fetched from the internet and displayed above.


Before you can run this example, you need to install the python requests library. To do this, type in the following command:


The source code of the new app consists of two files:


Please copy the former over the existing file in src/main/python/ , and the latter into the new directory src/main/resources/base/ . If you are using pyside2 instead of pyqt, you have to replace all occurrences of pyqt5 in main.Py by pyside2 .


Once you have followed these steps, you can do fbs run (or fbs freeze etc.) as before.


The new app uses the following code to fetch quotes from the internet:


You can see that it uses the requests library we just installed above. Feel free to open build-system.Fman.Io/quote in the browser to get a feel for what it returns. Its data comes from a public database.


The app follows the same basic steps as before. It instantiates an application context and ends by calling appctxt.App.Exec_() :


What's different is what happens in between:


The first line uses get_resource(. ) to obtain the path to styles.Qss . This is a QSS file, qt's equivalent to CSS. The next line reads its contents and sets them as the stylesheet of the application context's .App .


Fbs ensures that get_resource(. ) works both when running from source (i.E. During fbs run ) and when running the compiled form of your app. In the former case, the returned path is in src/main/resources . In the latter, it will be in your app's installation directory. Fbs handles the corresponding details transparently.


The next-to-last line instantiates mainwindow . This new class sets up the text field for the quote and the button. When the button is clicked, it changes the contents of the text field using _get_quote() above. You can find the full code in main.Py .


As already mentioned, you can use fbs run to run the new app. But here's what's really cool: you can also do fbs freeze and fbs installer to distribute it to other computers. Fbs includes the requests dependency and the styles.Qss file automatically.


Fbs lets you use python and qt to create desktop applications for windows, mac and linux. It can create installers for your app, and automatically handles the packaging of third-party libraries and data files. These things normally take weeks to figure out. Fbs gives them to you in minutes instead.


Fbs's manual explains the technical foundation of the steps in this tutorial. Read it to find out more about fbs's required directory structure, dependency management, handling of data files, custom build commands, API and more.


If you have not used pyqt before: it's the library that allowed us in the above examples to use qt (a GUI framework) from python. Fbs's contribution is not to combine python and qt. It's to make it very easy to package and deploy pyqt-based apps to your users' computers. For an introduction to pyqt, see here.


Feel free to share the link to this tutorial! If you are not yet on fbs's mailing list and want to be notified as it evolves, sign up here.


About


Tutorial for creating python/qt guis with fbs



FBS trader


Une seule application, des possibilités illimitées


Optimisez votre réactivité et votre efficacité avec une plateforme de trading puissante


Découvrez FBS trader, une application de plate-forme de trading tout-en-un qui vous permet d'accéder aux instruments de trading les plus recherchés au monde, et ce, à partir de votre poche. Bénéficiez de toutes les fonctionnalités nécessaires avec une application à la fois légère et puissante et accédez à vos trades 24h/24 et 7j /7 à partir de n'importe quel appareil ios ou android.


Caractéristiques


Meilleurs instruments de trading


Plus de 50 paires de devises et métaux à trader sur le pouceet dans les meilleures conditions


Statistiques en temps réel


Suivez les taux de change en temps réel à l'aide de graphiques et ne manquez jamais le bon moment


Gestion simple


Une interface intelligente vous permet de modifier vos paramètres d'ordre et de compte en quelques clics


Pourquoi FBS trader ?


FBS trader est aussi puissant que metatrader, mais beaucoup plus simple


Accédez aux marchés du monde entier - à tout moment, n'importe où


Dépôts et retraits instantanés via plus de 100 systèmes de paiement


Une équipe d'assistance professionnelle répondant à vos questions 24h/24 et 7j/7


Il y a encore plus !


Obtenez des informations détaillées sur les ordres :


Prix de l'offre/demande en vigueur


Informations sur les take profit et les stop loss


Téléchargez FBS trader gratuitement


Et surveillez vos trades où que vous soyez


System requirements


Operating system: android 4.4+ / ios 10+


FBS sur les médias sociaux


Nous contacter



  • Zopim

  • Wechat

  • Fb-msg

  • Viber

  • Line

  • Telegram

  • Whatsapp


Le site web est exploité par FBS markets inc. ; numéro d'enregistrement 119717; FBS markets inc est réglementé par l'IFSC, licence IFSC/000102/124; adresse : 2118, guava street, belize belama phase 1, belize


Le service n'est pas fourni dans les pays suivants : japon, états-unis, canada, royaume-uni, myanmar, brésil, malaisie, israël et république islamique d'iran


Les transactions de paiement sont gérées par НDС technologies ltd. ; numéro d'enregistrement HE 370778; adresse : arch. Makariou III & vyronos, P. Lordos center, block B, office 203


Pour toute coopération, veuillez nous contacter via support@fbs.Com ou au +35 7251 23212.


Avertissement sur les risques : avant de commencer à trader, vous devez comprendre parfaitement les risques encourus sur le marché des devises ainsi qu'avec le trading sur marge, et vous devez être conscient de votre niveau d'expérience.


Toute copie, reproduction, republication des ressources disponibles sur internet et de tout matériel provenant de ce site web ne sont possibles qu'avec une autorisation écrite.


Avis de collecte de données


FBS conserve un enregistrement de vos données afin d'exécuter ce site web. En appuyant sur le bouton "accepter", vous acceptez notre politique de confidentialité.



Download FBS forex broker — forex trading app with demo for PC


Preview


App specs


Versions history


Description


With this must-have app for each trader, you can track your statistics, manage several accounts per one session, deposit and withdraw funds via various payment systems, and securely keep personal and market-related data.


With the help of the FBS personal area, you can access various statistical data and have it at your finger-tips at all times. With this information at hand, you will be able to see the big picture, that is to say, minimize the strategies that tend to have negative dynamics and scale up profitable tactics. Once you learn to analyze your forex trading efficiency, the results of the daily deals will be more predictable and, thus, less risky and potentially more profitable. You will react to the market signals promptly and with an advanced insight.
FBS offers increased productivity, intuitive interface, and fast performance so that you can manage your accounts efficiently, wisely, and fast. You can go places and yet always stay on top of the changing forex market.


Use FBS as a personal money manager. We like making complicated notions and data storage easy for you. Step into innovation with the following features:


Registration and verification
- register in just several clicks
- log in to be accessible anywhere and anytime
- have your accounts verified by uploading the required documents right from your device


Accounts
- create both demo and real accounts so that they satisfy your trading ambitions
- open and close all your accounts for metatrader4
- activate the swap-free option
- see a list of archived accounts and restore them, if needed


Finances
- select the desired payment method
- deposit and withdraw via bank cards, wire transfers, neteller, or skrill
- make internal transfers between accounts
- see the history of your past transactions
- analyze your transactions on different accounts via the dashboard


Profile
- modify personal data
- check the verification documents and status
- upgrade to the professional category to get an increased leverage


With FBS, you will have mobile access to the most crucial info that will help in your daily currency trading. Download the application to get most out of trading and progress as a trader on the constantly volatile financial market.


5 reasons to choose the FBS personal area for proficient account management:
- multilingual customer support available 24/7 via a chat
- user-friendly interface that simplifies your trading routine
- customizable dashboard with a list of active accounts
- fast and straightforward management of your finances per trading account
- all the personal settings grouped in the profile section


Create a personal area to your liking: modify, analyze, and see how your trading experience improves daily. It’s a win today and profit tomorrow!


FBS – your reliable broker
FBS is an acknowledged, international broker and the official trading partner of FC barcelona.
We are present in 190 countries for more than 10 years now, proving to be secure, innovative, and client-friendly. FBS offers increased leverage for professional clients, multilingual support, overwhelming [on-site analytics] and education, free weekly webinars to support and train the skills of our traders all over the world.
FBS (tradestone ltd.) operates under cysec - license number 331/17.





So, let's see, what was the most valuable thing of this article: tutorial for creating python/qt guis with fbs. Contribute to mherrmann/fbs-tutorial development by creating an account on github. At fbs app

Contents of the article




No comments:

Post a Comment

Note: Only a member of this blog may post a comment.