Webstacka's Posts
Nairaland Forum › Webstacka's Profile › Webstacka's Posts
1 2 (of 2 pages)
TrillionBrains:you are Wicked! Mynd44 and Lalasticlala should see this. |
No. Thoze pholice peeples wan go fight fulani herdsmen so zey need to smoke osogbo weed well well... |
That was how one of them, who often sneaks into my house from her aunty's house, came in one day and slipped out N5000 from my wallet on my table. I asked her, threatened, and shouted. She denied ever seeing or taking it... |
That Book, Rich Dad Poor Dad, by Robert Kiyosaki, has always been correct! |
More polos...
|
webstacka:Available. Affordable. |
Still available. Buy your quality polo shirts NOW!
|
Do you want to look good, just like a top notch celebrity? Do you have taste for fashion. Do you need t-shirts and polo shirts that will make you look smart and cute? Anyways, Xmas is around the corner, and its time to change wardrope! GET THESE STOCK POLO SHIRTS, T-SHIRTS AND BOXERS AT AFFORDABLE PRICES NOW! 1 PACK OF POLO SHIRT FOR N1000 OR 2 PACKS FOR N1800. ORDER YOUR POLO SHIRTS NOW! ANYWHERE IN NIGERIA. FOR WHOLESALE/RETAIL: CALL/SMS: +2348179370258 * * Quality is our priority. Why not give us a try * * |
Where is the location? |
I dunno of Delta but in Aba, you need a skill to survive. Teaching skill, tailoring skill, and others are needed in Aba. |
olamil34:No. It doesn't. I've used bottle and its fun. With Object Oriented programming, you can implement MVC style in bottle, and did I forget to mention that bottle is faster than Django? Yes. It is. Bottle helps you to master python not "batteries-included" django. However, the lacking points in bottle are: form generation and validation, database access, and authentication. You still can implement these using WTForms for form validation, Sqlite3 or psycopg2 for raw data access (or the powerful SQLAlchemy or peewee orms), and open-auth for authentication. |
bilard:make sure that Python "Scripts" directory is included in your system environment variables. Then you can use all those commands. Better still, ditch Windows and install Ubuntu. |
Search for opensource repos and contrib. |
Brainfuck |
greatface:just use:
now create a folder called static, under your working directory. Under the static folder, create three more folders: css, js, and img. Put your css files under the css folder, javascript files under the js folder, and image files under the img folder. Run and load your browser. You'll see everything. NOTE: make sure you have python imaging library (pillow) installed on python in order to load images. |
Sync201:For front-end development, yes. |
proxy20:yeah...a lot similar. In fact, bottle is flask without werkzeug. |
Snwokenk:Django is a nice framework, but its not good for teaching beginners web programming. You must have a fair mastery of python to use django. In fact, if you develop an OOD-based web app in bottle, you'll most likely observe that you've developed your own web framework -- and the joy of creating a web framework! |
Let us see how it works. Now open the lesson.py file and type this in your index function:
the above code shows how to solve simple interest in python. Save it. Run and navigate to localhost:8080/ what do you see? You can see how easy it is to embed python codes in html. |
The first you will notice about python is its data types. Python data types are classified into five: 1) integers - negative or positive whole numbers (int) e.g 2, 100, etc. 2) floats - negative or positive decimal points (float) e.g 2.356, -1.846, etc. 3) strings - characters, alphabets and words, enclosed with single or double quotation marks. E.g 'hello', "python bottle", "12*#/", etc. 4) boolean values - true or false statements, denoted by True or False. E.g pay=False, loggedIn=True 5) null values - this is not really a standard data type, but since python is a dynamic language, its data types can change during execution. Thus, a null value is dynamic and its value can change from one data type to another. It is denoted by None. E.g myFruit = None |
Good morning. Like I said before, we are learning python programming using a web application. |
To build android apps, you MUST have a coach. It pays to learn. |
seunny4lif:i said you do not need html to develop android apps in python. You need the kivy framework. |
seunny4lif:No. No html... |
seunny4lif:just keep learning python, you will soon master it. Python can be used to create desktop and web application. Also, android and IOS apps can be created with python. |
seunny4lif:Those python codes run on both windows and unix environment, including linux. |
You may ask questions where you don't understand... |
Creating multiple functions Functions are the building blocks of any programming language. We have already seen a function, that is, the index function wrapped with a decorator. We will later see how python decorators are built. Creating multiple functions is easy in bottle provided they are wrapped with the same decorator. Let us create some:
This demonstrates the power of python functions, decorator and routing functions in separating concerns. If you have not observed already, bottle follows a strict MVC design pattern; which is a good OOD principle. |
Checking time let us use python's datetime library to know the time. This will demonstrate how to use string interpolation in python. But before then, let me introduce a python module that is handful when starting a web browser. It is called the webbrowser module. I'll show how it works in the example below:
|
Now let us do the needful in programming, that is, creating the mandatory hello world app in bottle. First open a text editor and create a python file called lesson.py, and save it in a folder under your C: \ drive, called BottleApp (make sure its created, if not then create it too). Next, edit the lesson.py with the following source code:
Now save it. Open a command prompt or unix shell, navigate to where you saved the file, i.e, cd C: \BottleApp Type the following on the command prompt: python -m lesson Hit enter. Open a web browser and navigate to 127.0.0.1:8080/ You will see your app running... |
No much introduction. I'm a bit free so I decided to do this tutorial before I get busy again. Hope someone learns something from this tutorial. The tutorial is about web programming in python using a micro web framework called bottle. Python bottle is a minimalistic and fast web framework used for developing simple REST services. However, nothing stops you from developing a full-fledged web application with python bottle. One good thing, or maybe a con, of bottle is its single file approach. Bottle is a single python file that requires no external library order than the python standard library. However, this approach makes it a bit difficult to integrate it with other modules, but this can be solved by building your web application with object-orientation in mind from scratch. REQUIREMENTS: 1) Python 3.4 + 2) Bottle web framework (pip install bottle) with internet connection. 3) Web server (optional). Bottle can run with python's standard wsgiref server bundled with python. However, we need a faster web server that will make our development easier. Popular wsgi-based web servers for python are cherrypy, rocket, twisted, tornado, gunicorn, paste, etc. Since we're just using it for development, our best bet would be python paste or cherrypy. I'll use paste (pip install paste) and that's it! 4) text editor. Any good text editor is okay by me, except notepad. Well, I use notepad++ That is all we need for now. Let's get started! |
Ok. |
1 2 (of 2 pages)


