Posts

Showing posts with the label How to

SqlAlchemy[SQLite] database connection in Python-Flask

Flask is a Python framework which can be used to build the web application from scratch. Flask is a micro-framework which capable to build websites like Instagram, twitter and anything at programmers will. SqlAlchemy is a package in Python Flask which simplifies database connections. The following simple Application will explain ..... how. This project was built on windows OS and Pycharm IDE The connection string from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['DATABASE_FILE'] = 'app2.db' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + app.config['DATABASE_FILE'] app.config['SECRET_KEY'] = '123456790' db = SQLAlchemy(app) So the db is like the cursor to the database. Read More The complete SQLite Project can be downloaded from GitHub

How to Flask with Python : Making of a Flask website

Flask is the one of the most popular Micro Framework which enables programmers to quickly build web applications. Linkedin, Pinterest are some of the finest examples of this framework. The Framework was initially coded by Armin Ronacher of Pocoo. Let's start with Installation Install Flask First up all you need to install Python on your system if you don't have to get one from www.python.org. You can install Flask from Python Package Index which requires the PIP command and an internet connection. Learn how to get PIP? Install flask using the following command line, the simplest way to install Flask on your system. On Windows go to your command prompt/shell and issue the pip command. D:/> pip install flask It will take some time to finish the procedures. Uninstalling Flask D:/> pip install flask will remove Flask packages from your system Create your first App Flask is Fun Create a file called hello.py from flask import Flask app =...

Install packages with the Python Package Index [PIP]

PyPI - the Python Package Index is the largest Python package repository meant for the Python programming community. It consists of dozens of packages from programmers around the world which minimize the coding tasks. Flask and Django were some of the top Python frameworks in the PyPI. The easiest way to install a Python Package from the repository is pip command, a small Python program. You can install the pip by download and compile the get-pip.py files. Compiling get-pip Go to your command prompt and locate the get-pip.py file and compile with Python interpreter C:/>Python get-pip.py  and will install the Python Package Index command on your computer. Installing packages Let's install Django framework. C:/> pip install Django will install the Django web framework on your system, make sure your internet/Wi-Fi connection turned on. Uninstalling packages You can also use the Python Package Index (pip) to uninstall a package as follows C:/> pip uni...

DISPLAY DIFFERENT LAYOUTS USING FRAGMENT IN A ANDROID STUDIO APP

Image
Android Studio makes App development so easy with supported libraries and classes. Today we are discussing how to show different layout within the main fragment. ( A layout is GUI Windows in Android Studio, where we can place controls and widgets) How ? Basically, this can be done by placing a frame layout inside the main fragment layout and place the different layouts. Create the Drawer Activity App Android Studio Version:  1.3 Android Version: 22 Begin a New Android Project with  Navigation Drawer Activity . Go to Layout folder of the project and access   fragment_main.xml   and add a FrameLayout at the end of the Relative Layout tag, replace the TextView, if exist. < FrameLayout android :id= "@+id/FrameContainer" android :layout_width= "match_parent" android :layout_height= "match_parent" ></ FrameLayout > Note that we assigned an id for the FrameLayout, which can be accessible using the id. You can also customize...

How to get Computer Name using VB6 Code

Accessing system property is pretty easy with VB6 code. This can be useful when programmers need to refer the system name in the code. Steps Declare the GetComputerNameA function which resides in the kernel32 library. Create a function to fetch the Computer Name. Use the function The Kernel functions Declare Function GetComputerNameA Lib "kernel32" (ByVal lpBuffer As String, nSize As Long) As Long Get the computer name Define a new function to do the rest of the task. So you can reuse the code. Public Function GetComputerName() As String Dim sResult As String * 255 GetComputerNameA sResult, 255 GetComputerName = Left$(sResult, InStr(sResult, Chr$(0)) - 1) End Function Calling the function Just invoke the function and place values to a TextBox Text1.Text = GetComputerName