Εμφάνιση αναρτήσεων με ετικέτα Python. Εμφάνιση όλων των αναρτήσεων
Εμφάνιση αναρτήσεων με ετικέτα Python. Εμφάνιση όλων των αναρτήσεων

Τρίτη 27 Νοεμβρίου 2012

Τutorial για την λειτουργία των συναρτήσεων στην Python.


Using a function

Python has lots of pre-made functions, that you can use right now, simply by ‘calling’ them. ‘Calling’ a function involves you giving a function input, and it will return a value (like a variable would) as output. Don’t understand? Here is the general form that calling a function takes:

If-else και While statements στην Python.

Introduction
(Our final lesson before we get into interacting with human input. Can’t wait, can you?)
Just imagine you needed a program to do something 20 times. What would you do? You could copy and paste the code 20 times, and have a virtually unreadable program, not to mention slow and pointless. Or, you could tell the computer to repeat a bit of code between point A and point B, until the time comes that you need it to stop. Such a thing is called a loop.

Πως δουλεύουν οι μαθηματικοί τελεστές στην Python

Math in Python
Now try typing the stuff in bold. You should get the output shown in blue. I’ve given explainations in brackets.

Δευτέρα 26 Νοεμβρίου 2012

Try – catch – finally και return?

Μία από τις απορίες που είχα πριν από λίγες μέρες ήταν τι γίνεται αν έχουμε μία μέθοδο που επιστρέφει τιμή, ο κώδικάς της βρίσκεται σε ένα μπλοκ try – catch – finally, και η εντολή return είναι είτε μέσα στην try είτε μέσα στην catch.
Δηλαδή ο κώδικα είναι κάπως έτσι:

Πως στέλνουμε e-mail στην Python.

Sending e-mail

Although Python makes sending e-mail relatively easy via the smtplib library, Django provides a couple of light wrappers over it. These wrappers are provided to make sending e-mail extra quick, to make it easy to test e-mail sending during development, and to provide support for platforms that can’t use SMTP.

Βίντεο για τη δημιουργία ενός wiki σε Django.


 Εδώ θα βρείτε 3 χρήσιμα βίντεο που θα σας βοηθήσουν στα πρώτα σας βήματα στο κόσμο του django.