from requests import post
foo = post('http://httpbin.org/post', data = {'key':'value'})
Will perform a simple HTTP POST operation. Posted data can be inmost formats, however key value pairs are most prevalent.
Headers
Headers can be viewed:
print(foo.headers)
An example response:
{'Cont...
// src/AppBundle/Controller/HelloWorldController.php
namespace AppBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
class HelloWorldController
{
public function helloWorldAction()
{
return new Response(
'<html><body>Hello World!<...
This example assume that a solution with an application named MyApp already exists.
Add a new project to the solution:
In the Setup project, add a new reference to MyApp from the Projects tab:
In the Product.wxs file, valorize the Manufacturer attribute of the Product node with Hell...
An Array Data Structure is used to store similar objects (or data
values) in a contiguous block of memory. Array Data Structure has
fixed size, which determines the number of data values that can be
stored in it.
Array : The C++ Way
In C++ Programming Language, we can declare a static arr...
#= Regardless of architecture we're using just the following
!define REGSVR `$SYSDIR\regsvr32.exe` #= define where RegSrv32 is
!define DLL `$AppDirectory\App\MyLegalProgram\myLegit.dll` #= define the file to register
##=
#= Command line usage is the same for both variants of RegSrv32 as foll...
This example illustrates how to create a simple sine curve using Matplotlib
# Plotting tutorials in Python
# Launching a simple plot
import numpy as np
import matplotlib.pyplot as plt
# angle varying between 0 and 2*pi
x = np.linspace(0, 2.0*np.pi, 101)
y = np.sin(x) ...
In this example, we take a sine curve plot and add more features to it; namely the title, axis labels, title, axis ticks, grid and legend.
# Plotting tutorials in Python
# Enhancing a plot
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 2.0*np.pi, 101)
y = np.sin(x)
...
In this example, a sine curve and a cosine curve are plotted in the same figure by superimposing the plots on top of each other.
# Plotting tutorials in Python
# Adding Multiple plots by superimposition
# Good for plots sharing similar x, y limits
# Using single plot command and legend
import...
Let's demonstrate the power of PLY with a simple example: this program will take an arithmetic expression as a string input, and attempt to solve it.
Open up your favourite editor and copy the following code:
from ply import lex
import ply.yacc as yacc
tokens = (
'PLUS',
'MINUS',
...
Gui, +AlwaysOnTop +Disabled -SysMenu +Owner ; +Owner avoids a taskbar button.
Gui, Add, Text,, Some text to display.
Gui, Show, NoActivate, Title of Window ; NoActivate avoids deactivating the currently active window.
from flask_wtf import FlaskForm
from wtforms import StringField, IntegerField
from wtforms.validators import DataRequired
class MyForm(FlaskForm):
name = StringField('name', validators=[DataRequired()])
age = InterField('age', validators=[DataRequired()])
To render the template you...
A typical example of the implementation of a Looper thread given by the official documentation uses Looper.prepare() and Looper.loop() and associates a Handler with the loop between these calls.
class LooperThread extends Thread {
public Handler mHandler;
public void run() {
Lo...
\documentclass{beamer}
\mode<presentation>
\usetheme{AnnArbor}
\usecolortheme{seahorse}
\title[Short topic]{Awesome long topic}
\author[Name]{Full name}
\institute[Institute short form]{Full name of institute}
\date{\today}
\begin{document}
\maketitle
\end{document}