I think this is the best one available to write, run and debug your python code.

So, let's see how to install this...

First of all, Go to this site.


Two versions are available here : Professional and Community Edition


Of course, we are going to use 'Free Community Edition'...

Just download this edition .It will be around 126 mb. The installation is also very simple. Just next-next...
Once everything is done. Just click the PyCharm icon created on your desktop.

Click on the Create project option.You will get a screen like this.



You also have to select an interpreter. I have already selected Python 2.7 interpreter.Click on the '...' box.It will pop up a screen like this.



Once you click on the '+' icon.It will show you all the interpreters available in your system.I have already selected Python 2.7 and in the bottom part, you can also see available packages.Click ok.


Click on File -> New -> Give your file a name( hello in this case).
Write you code and press F5 and you will be able to see an output in the bottom part of editor.

That's it !!





Ok, it sounds interesting and believe me, it is interesting.Ubuntu is my favorite platform to do any kind of technical stuff but there is some problem in my Ubuntu Os.So, performing this trick on windows platform.

Let's see how to do this....

So, first of all  install facebook-sdk to use facebook API..

*One thing I want to mention here , use this facebook-sdk with Python 2.x version not with Python 3.x..

HOW TO INSTALL FACEBOOK-SDK:

Go to Python27->Scripts folder using Command Prompt.


As you can see, it is already installed in my system.

Now, we can steal data from facebook using this module's functions...


Grab complete code here.....

You also have to generate access token to make this code work...

HOW TO GENERATE ACCESS TOKEN:

Go here.

Click on 'Get Access Token' button.

It will pop up a window, select some boxes based on your requirements and click 'Get access token'.


Once this gets generated , Just Copy-Paste it and use it in your code.

OUTPUT OF OUR CODE :


I am interested in Movie category. So, I have used its 'id' to get some more information..


A lot of interesting information here...

release_date : July 25
talking_about_count : 9886
also, an image is here...
https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-frc3/t1.0-9/s720x720/1970458_690026
707710062_1244083687_n.jpg

Let's first look at the SQL's way...

I have created  Info table here and inserted some values into it...


We all know how to UPDATE table values in sql...


So now, MongoDB's way....

I have already covered how to insert and select values in MongoDB in my previous posts...


db.info.update () :

We can pass 4 parameters here....

Criteria : It lets you specify the query that selects the record you want to update.
             { Name : " Praveen " } in our case.
Objnew: It lets you to specify the updated information.
             { Name : " Praveen ", City : " Pune" } in our case.
Upsert: This argument tells MongoDB to update the record if it exists, and create it if it doesn’t.
Multi: This lets you specify whether all matching documents should be updated or just the first one.

© 2015 Techie's House. Designed by Bloggertheme9