In [2]:
from wordpress_xmlrpc import Client, WordPressPost
from wordpress_xmlrpc.methods.posts import GetPosts, NewPost

wp = Client('http://blog.brobeur.com/xmlrpc.php', 'jess', 'qwerty123')
wp.call(GetPosts())


post = WordPressPost()
post.title = ('At the internet cafe')
post.content = ('I am sitting at the internet cafe')
post.post_status = ('publish')
wp.call(NewPost(post))


Out[2]:
'156'

In [31]:
from wordpress_xmlrpc.methods import posts


myposts = wp.call(posts.GetPosts())

In [32]:
for d in myposts:
    print d


goodmorning!
goodmorning!
At the internet cafe
Google Nexus
Google Nexus
Google Nexus
At the internet cafe
The water is
Cloud Atlas
cloud atlas

In [33]:
def post(titl, content):
    post = WordPressPost()
    post.title =(titl)
    post.content = (content)
    post.post_status = ('publish')
    wp.call(NewPost(post))
    return 'd'
    
def returnpost():
    myposts

In [34]:
post('goodmorning!', 'it is a nice day!')


Out[34]:
'd'

In [35]:
print('hello world!')


hello world!

In [3]:
print 1 * 20


20

In [4]:
myNumber = 41

In [5]:
print myNumber * myNumber


1681

In [24]:
def allnumb(n):
    return 34 * n

In [31]:
print allnumb(7)


238

In [26]:
n = 4

In [34]:
for number in range(50):
    print number


0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

In [27]:
print allnumb()


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-27-bc6ad70f174a> in <module>()
----> 1 print allnumb()

TypeError: allnumb() takes exactly 1 argument (0 given)

In [32]:
import random

In [33]:
random.randint(1,5)


Out[33]:
3

In [ ]: