<div dir="ltr"><div><br></div>Hi<div class="gmail_extra"><br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">
<div><div class="gmail_quote">
<div><div><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div dir="ltr">On 5 February 2013 09:38, Aaron Misquith <span dir="ltr"><<a href="mailto:aaronmisquith@gmail.com" target="_blank">aaronmisquith@gmail.com</a>></span> wrote:<br>

<div><div class="gmail_extra"><div class="gmail_quote"><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I have attached a python program with this mail which peforms following operations:<br>


1.Logs in to facebook.<br>

2.Asks the user for access tokens.<br>3.Gets the friend list of the user.<br>4.outputs the friend list as pdf.<br>
<br>My Problems regarding the above program are:<br>1.I want to display the names of my friends(in output) one in each line in the intermediate .doc file that i have created. <br>              example output: {'data': [{'name': 'Roy Fernandes'}, {'name': 'Aniruddh Beigh'},<br>





                                       I want it to be displayed as : Roy Fernandes<br>                                                                                 Aniruddh Beigh<br><br>2.Is there a way to automate getting access tokens for the user that is logging in? If not how to get access tokens for each user while logging in?<br>





<br>3.How to dislpay text with clickable links.<br>   Eg: Something thing like alert box, wherein if you click the link you go to the page.<br><br>4. Finally my lecturer has asked me to create a gui for the facebook login program using tkinter library module. I don't know how to create one (the lecturer has not thought this topic in class so i'm just clueless here). So if someone can do it and explain me the steps it will be very helpfull.</blockquote>




<div><br></div></div></div><div>The way this tutoring mailing list (and in general, any programming mailing list or support forum) works is that you do the legwork first, then come with the actual problems you're having.  You don't just ask for people to write your solutions for you.  <br>




<br></div><div>Also, your questions together with a partial solution by (apparently) someone else makes me wonder whether this is homework.  Can you please clarify?  Obviously, apart from the above comment on this not being a solution service, we cannot provide direct solutions to homework assignments.<br>




<br></div><div>All that said, to address your questions somewhat:<br></div><div>1.) The program is directly printing the returned Python dict object (e.g. nik) which is why you're getting the curly-braced representation of it.  To print/output it differently, take some more control over the printing process.  E.g. print the attributes of the nik object manually and use newline characters (\n) where required.  If you don't understand this answer then you're lacking some basic Python skills/understanding and I'd recommend learning some basic Python first, perhaps by working through Alan Gauld's tutorial: <a href="http://www.alan-g.me.uk/tutor/index.htm" target="_blank">http://www.alan-g.me.uk/tutor/index.htm</a>  <br>




Then try your hand at this problem again yourself, and *then* post back with specific problems you're having. <br></div><div><br></div><div>2.) Probably, but I don't offhand know how.  This is not really a Python tutoring question and may be a question for appropriate for a Facebook API programming forum.<br>




<br></div><div>3.) There's lots of TkInter materials on the web that will get you started.  Here's a decent tutorial: <a href="http://www.tkdocs.com/tutorial/index.html" target="_blank">http://www.tkdocs.com/tutorial/index.html</a><span><font color="#888888"><br>




</font></span>
</div></div></div></div></div></blockquote></div></div><br></div></div></div><div>First of all i would like to confirm that this was my assignment and i 
have completed it and shown to my lecturer. I'll also confirm that the 
class facebook was available in stackoverflow( Not completely, I had to 
make some changes to suit my requirements).But the rest is all mine 
especially exporting the output as pdf. None of the forums were helpful 
regarding this. </div></div></div></blockquote><div><br></div><div>Making simple PDF's is almost trivial with Python.  The following example is from <a href="http://is.gd/ol6bhn">http://is.gd/ol6bhn</a> (a ReportLab tutorial that was turned up with the google search "python reportlab example"):<br>
<br><pre class=""><span style="color:rgb(255,119,0);font-weight:bold">from</span> reportlab.<span style="color:black">pdfgen</span> <span style="color:rgb(255,119,0);font-weight:bold">import</span> canvas
 
c = canvas.<span style="color:black">Canvas</span><span style="color:black">(</span><span style="color:rgb(72,61,139)">"hello.pdf"</span><span style="color:black">)</span>
c.<span style="color:black">drawString</span><span style="color:black">(</span><span style="color:rgb(255,69,0)">100</span>,<span style="color:rgb(255,69,0)">750</span>,<span style="color:rgb(72,61,139)">"Welcome to Reportlab!"</span><span style="color:black">)</span>
c.<span style="color:black">save</span><span style="color:black">(</span><span style="color:black">)<br></span></pre> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div><div>
Everywhere people have mentioned about pypdf and 
reportlab toolkit , but none of them worked for me (i have also posted 
the solution on stackoverflow yesterday). </div></div></div></blockquote><div><br></div><div>What did you try and what problems or errors did you run into? What did you want to happen instead?<br></div><br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div><div>The problem 
that i encounter in creating GUI is I already have a class <b>facebook</b>; How am i supposed to integrate it to class "<b>Application</b>"(required to create GUI with tkinter)  which i have to integrate it with (the small bookish knowledge i possess in the topic).<br>
</div></div></div></blockquote><div><br></div><div>Put your Facebook class in it's own module.  Then import that module from your GUI application module (or from whatever module needs to use it) and create an instance of the Facebook class where you need it.  <br>
</div><div><br></div><div>Seriously, work through a Python programming tutorial, and then a TkInter one.   You wouldn't be asking these questions if you had a proper grounding in programming concepts in general and Python.  However it's not feasible to address that piecemeal style via a mailing list exchange here.  <br>
</div><div> </div>Walter<br></div></div><div class="gmail_extra"><br></div></div>