Tutorial by Examples

To simply open a URL, use the webbrowser.open() method: import webbrowser webbrowser.open("http://stackoverflow.com") If a browser window is currently open, the method will open a new tab at the specified URL. If no window is open, the method will open the operating system's default b...
The webbrowser module also supports different browsers using the register() and get() methods. The get method is used to create a browser controller using a specific executable's path and the register method is used to attach these executables to preset browser types for future use, commonly when mu...
Detailed instructions on getting activemq set up or installed.
Currently (as of version 2.11.0) there is no built-in functionality to move an already existing worktree. This is listed as an official bug (see https://git-scm.com/docs/git-worktree#_bugs). To get around this limitation it is possible to perform manual operations directly in the .git reference fil...
To include the base64 module in your script, you must import it first: import base64 The base64 encode and decode functions both require a bytes-like object. To get our string into bytes, we must encode it using Python's built in encode function. Most commonly, the UTF-8 encoding is used, howeve...
The base64 module also includes encoding and decoding functions for Base32. These functions are very similar to the Base64 functions: import base64 # Creating a string s = "Hello World!" # Encoding the string into bytes b = s.encode("UTF-8") # Base32 Encode the bytes e = b...
The base64 module also includes encoding and decoding functions for Base16. Base 16 is most commonly referred to as hexadecimal. These functions are very similar to the both the Base64 and Base32 functions: import base64 # Creating a string s = "Hello World!" # Encoding the string into...
Adobe created it's own encoding called ASCII85 which is similar to Base85, but has its differences. This encoding is used frequently in Adobe PDF files. These functions were released in Python version 3.4. Otherwise, the functions base64.a85encode() and base64.a85encode() are similar to the previous...
Just like the Base64, Base32, and Base16 functions, the Base85 encoding and decoding functions are base64.b85encode() and base64.b85decode(): import base64 # Creating a string s = "Hello World!" # Encoding the string into bytes b = s.encode("UTF-8") # Base85 Encode the byte...
The :{ instruction begins multi-line mode and :} ends it. In multi-line mode GHCi will interpret newlines as semicolons, not as the end of an instruction. ghci> :{ ghci| myFoldr f z [] = z ghci| myFoldr f z (y:ys) = f y (myFoldr f z ys) ghci| :} ghci> :t myFoldr myFoldr :: (a -> b -&g...
Understanding the concept To understand content negotiation in Web API, it is important to understand the term Resource. On the web, any information that we can access can be referred as HTTP resource. There is a tremendous amount of material to view on the web which has different content type suc...
public override void DidEnterBackground(UIApplication application) { //to add the background image in place of 'active' image var backgroundImage = new UIImageView(); backgroundImage.Tag = 1234; backgroundImage.Image = UIImage.FromBundle("Background"); background...
The following example is an example of a basic server: # Imports the Flask class from flask import Flask # Creates an app and checks if its the main or imported app = Flask(__name__) # Specifies what URL triggers hello_world() @app.route('/') # The function run on the index route def hello...
With Flask, URL routing is traditionally done using decorators. These decorators can be used for static routing, as well as routing URLs with parameters. For the following example, imagine this Flask script is running the website www.example.com. @app.route("/") def index(): return ...
The two most common HTTP methods are GET and POST. Flask can run different code from the same URL dependent on the HTTP method used. For example, in a web service with accounts, it is most convenient to route the sign in page and the sign in process through the same URL. A GET request, the same that...
Instead of typing our HTML markup into the return statements, we can use the render_template() function: from flask import Flask from flask import render_template app = Flask(__name__) @app.route("/about") def about(): return render_template("about-us.html") if __n...
Similar to Meteor.js, Flask integrates well with front end templating services. Flask uses by default Jinja Templating. Templates allow small snippets of code to be used in the HTML file such as conditionals or loops. When we render a template, any parameters beyond the template file name are pass...
The request object provides information on the request that was made to the route. To utilize this object, it must be imported from the flask module: from flask import request URL Parameters In previous examples request.method and request.form were used, however we can also use the request.args...
The simplest and perhaps best-known method for computing the FFT is the Radix-2 Decimation in Time algorithm. The Radix-2 FFT works by decomposing an N point time domain signal into N time domain signals each composed of a single point. Signal decomposition, or ‘decimation in time’ is achieved by b...
Atom is a hackable text editor created by GitHub and developed on top of the Electron desktop application platform. This means it can be used as a text editor for basic programming up to a full-sized IDE. It is also extremely customisable, it provides thousands of community-made packages (syntax hi...

Page 1090 of 1336