How to Configure Eclipse for Python

How to Configure Eclipse for Python

Rose-Hulman Institute of Technology -
Computer Science & Software Engineering

Python3 must be installed before the complete instillation can be completed. If you don't have Python installed you can install it using these directions

Install the PyDev plug-in for Eclipse


  1. Launch Eclipse
    1. Launch Eclipse. A screen like this should appear, where you can choose which workspace to open. (If not, go to File → Switch Workspace → Other )
    2.         Screenshots read 'Python 3.1', which is the old version. You will be installing Python 3.2.
    3. Browse the csse120 folder which you created when installing Eclipse. Select "Use this as the default and do not ask again".
      1. If you do, Eclipse will automatically use this workspace next time you open Eclipse. If you want to change the workspace later you can always go to File → Switch Workspace... to be sent back to the Workspace Launcher window.
    4. You should now see Eclipse's Welcome screen:
      Click on the arrow on the right to go to the workbench.
      This is where you'll do most of your work in Eclipse.
  2. Download PyDev from within Eclipse
    1. Go to Help → Install New Software
    2.   
    3. Enter http://pydev.org/updates in the Work with:  field.
    4. After several seconds, two options should appear. Select the PyDev for Eclipse option. Do not select the "PyDev Mylyn Integration" flag.

    5.  
    6. Click "Next" and "OK" to continue installing PyDev.
    7. Select "I accept the terms of the license agreement", then click "Finish". The installer will begin to download the plug-in.
    8. Note: When you see the Selection Needed dialog box, you must manually check the box before pressing okay. If you do not, it appears that the installation is continuing, but it is not. You must uninstall PyDev, then reinstall.
    9. A security warning may appear asking whether you trust the software being installed- click "ok", then ensure the correct items are selected and click yes. The instillation process will continue.
    10. When the installation is complete, you will be asked if you want to restart Eclipse. Select "Yes". You may see a Subclipse Usage  dialog, just uncheck the box and continue.
  3. Configure PyDev
    1. Python must be installed to configure PyDev.
    2. Go to Window → Preferences. In the Preferences window, expand PyDev and select Interpreter-Python.
    3. Click "New..." and type Python32 for the Interpreter name. For the Interpreter executable, browse to your copy of Python (C:\Program Files\Python32\python.exe), and press Open.

      Click "OK" and the  Selection Needed Window will appear.
    4. Select all but the PySrc and python32.zip and click OK as many times as necessary to exit the preferences. The default selection should be fine.
    5. The Interpreter is now set up so that the code you write can be interpreted for the computer to run. You are now ready to start running code.

Installing Eclipse Preferences for Python

  1. Download the Eclipse Preferences
    1. Unzip this Preferences for csse120 file, placing its sole unzipped file (EclipsePreference-2011-06.epf)  in any convenient location (your desktop, My Documents folder, etc).
  2. Import the Preferences
    1. Launch Eclipse.
      1. If Eclipse offers to Select a Workspace, browse to C:\EclipseWorkspace\csse120.
      2. If the csse 120 workspace does not appear automatically, choose File → Switch Workspace → Other, and click Next.
    2. Now you are ready to set the preferences for the workspace:
      1. Choose File → Import
      2. In the Import dialog box, select General → Preferences and click Next.
      3. When the Import Preferences dialog opens, select Browse and find the EclipsePreferences-2011-06.epf file that you unzipped and saved above.
      4. Back in the Import Preferences dialog, check Import All, then select Finish.
      5. As before, if the Subclipse Usage dialog makes an appearance, uncheck the box and continue.
      6. Confirm that the installation did not leave behind unintended files by checking if there is:
        1. random .eclipse folder anywhere, possibly in the folder immediately above My Documents.
        2. Any extra users (for example, the installer), in C:\Users
        3. Extra Eclipse workspaces anywhere except for the folders inside C:\EclipseWorkspaces.

Writing Your First Python Program

  1. Switch to the Python perspective
    1. Go to Window → Open Perspective → Other and choose PyDev, then click OK. If you look at the upper right corner you will see that the perspective has changed from "Java" to "PyDev".
    2. Perspectives are designed to have the most useful tools within reach for whatever task you are doing (for example writing Java code or writing Python code). If you look in the File→ New menu you will see that there are different options with the different perspective.
      PyDev Perspective Java Perspective 
      As you can see, perspectives greatly affect the look of the Eclipse program.
  2. Create a new project
    1. Go to File → New → PyDev Project to start a wizard.
    2. In the next window that appears, enter the name of your project and select "python"  and 3.0"; as the type. Make sure "create default 'src' folder and add it to the pythonpath?" is selected. Click Finish.
    3. If you look at the upper left corner of the workspace (in the Package Explorer view), you should now see your newly created project with a "src" folder inside.
  3. Create a new module
    1. Select the project you just created and go to File → New → PyDev Module. This will launch a new PyDev Module Wizard where you should enter a name for your module and make sure it is in the right location. Leave the Package field blank and select Finish.
    2. Look in the Package Explorer view and you will see an icon of your new file inside the src folder, which Eclipse created when you made the new project before.
      The file should be opened in the open space in the center of the workspace-the Editor view. (If not, right click on the greeting.py icon and select Open.) You will see a tab with the name of your file.
  4. Write and run the program
    1. Here's a program to greet the world. Simply type print('Hello, World!') into the file. You may remove the default doc comment or leave it there; Python ignores it.
    2. Right click on the file and select Save (or press Ctrl+S) to save the file.
    3. Finally, choose the greeting.py icon, and go to Run → Run As → Python Run to run your program.(A quicker alternative is to right-click on the greeting.py icon, and select Run As → Python Run, or press Ctrl+F11.)
    4. Look at the bottom of your screen at the Console view and you will see the message you told the computer to print.
      Congratulations! You have written your first program with Python.

Configure PyDev for Productivity

  1. Add line numbers
    1. Add line numbers by right-clicking in the margin at the left side of the code view and click on Show Line Numbers
  2. Change the comment color to one you can read more easily
    1. Go to Window → Preferences. Open PyDev and select Editors (actually click on 'Editors', don't just expand it). In the Appearance Color Options dropdown menu, select Comments. Then change it to a brighter color (perhaps fuchsia?).
  3. Turn on Task view  to show TODO: items and add a CONSIDER: tag
    1. Go to Window → Show View → Tasks.
    2. Window → Preferences → PyDev → Task Tags, and add CONSIDER: to the end of the list.
    3. To get the task tags to show, run the program once, or select Project → Clean
The Difference Between Hubs, Switches and Routers

Learn the difference between a router and switch, a hub and switch, and a router and hub.

Some technicians have a tendency to use the terms routers, hubs and switches interchangeably. One minute they're talking about a switch. Two minutes later they're discussing router settings. Throughout all of this, though, they're still looking at only the one box.  Ever wonder what the difference is among these boxes?  The functions of the three devices are all quite different from one another, even if at times they are all integrated into a single device. Which one do you use when? Let's take a look...

Hub, Switch, and Router Defined

Hub [define]

A common connection point for devices in a network. Hubs are commonly used to connect segments of a LAN. A hub contains multiple ports. When a packet arrives at one port, it is copied to the other ports so that all segments of the LAN can see all packets.

Switch [define]

In networks, a device that filters and forwards packets between LAN segments. Switches operate at the data link layer (layer 2) and sometimes the network layer(layer 3) of the OSI Reference Model and therefore support any packet protocol. LANs that use switches to join segments are called switched LANs or, in the case of Ethernet networks, switched Ethernet LANs.

Router [define]

device that forwards data packets along networks. A router is connected to at least two networks, commonly two LANs or WANs or a LAN and its ISP.s network. Routers are located at gateways, the places where two or more networks connect. Routers use headers and forwarding tables to determine the best path for forwarding the packets, and they use protocols such as ICMP to communicate with each other and configure the best route between any two hosts.

The Differences Between Hubs, Switches, and Routers on the Network

Today most routers have become something of a Swiss Army knife, combining the features and functionality of a router and switch/hub into a single unit. So conversations regarding these devices can be a bit misleading — especially to someone new to computer networking.

The functions of a router, hub and a switch are all quite different from one another, even if at times they are all integrated into a single device. Let's start with the hub and the switch since these two devices have similar roles on the network. Each serves as a central connection for all of your network equipment and handles a data type known as frames. Frames carry your data. When a frame is received, it is amplified and then transmitted on to the port of the destination PC. The big difference between these two devices is in the method in which frames are being delivered.

In a hub, a frame is passed along or "broadcast" to every one of its ports. It doesn't matter that the frame is only destined for one port. The hub has no way of distinguishing which port a frame should be sent to. Passing it along to every port ensures that it will reach its intended destination. This places a lot of traffic on the network and can lead to poor network response times.

Additionally, a 10/100Mbps hub must share its bandwidth with each and every one of its ports. So when only one PC is broadcasting, it will have access to the maximum available bandwidth. If, however, multiple PCs are broadcasting, then that bandwidth will need to be divided among all of those systems, which will degrade performance.

A switch, however, keeps a record of the MAC addresses of all the devices connected to it. With this information, a switch can identify which system is sitting on which port. So when a frame is received, it knows exactly which port to send it to, without significantly increasing network response times. And, unlike a hub, a 10/100Mbps switch will allocate a full 10/100Mbps to each of its ports. So regardless of the number of PCs transmitting, users will always have access to the maximum amount of bandwidth. It's for these reasons why a switch is considered to be a much better choice then a hub.

Routers are completely different devices. Where a hub or switch is concerned with transmitting frames, a router's job, as its name implies, is to route packets to other networks until that packet ultimately reaches its destination. One of the key features of a packet is that it not only contains data, but the destination address of where it's going.

A router is typically connected to at least two networks, commonly two Local Area Networks (LANs) or Wide Area Networks (WAN) or a LAN and its ISP's network . for example, your PC or workgroup and EarthLink. Routers are located at gateways, the places where two or more networks connect. Using headers and forwarding tables, routers determine the best path for forwarding the packets. Router use protocols such as ICMP to communicate with each other and configure the best route between any two hosts.

Today, a wide variety of services are integrated into most broadband routers. A router will typically include a 4 - 8 port Ethernet switch (or hub) and a Network Address Translator (NAT). In addition, they usually include a Dynamic Host Configuration Protocol (DHCP) server, Domain Name Service (DNS) proxy server and a hardware firewall to protect the LAN from malicious intrusion from the Internet.

All routers have a WAN Port that connects to a DSL or cable modem for broadband Internet service and the integrated switch allows users to easily create a LAN. This allows all the PCs on the LAN to have access to the Internet and Windows file and printer sharing services.

Some routers have a single WAN port and a single LAN port and are designed to connect an existing LAN hub or switch to a WAN. Ethernet switches and hubs can be connected to a router with multiple PC ports to expand a LAN. Depending on the capabilities (kinds of available ports) of the router and the switches or hubs, the connection between the router and switches/hubs may require either straight-thru or crossover (null-modem) cables. Some routers even have USB ports, and more commonly, wireless access points built into them.

Some of the more high-end or business class routers will also incorporate a serial port that can be connected to an external dial-up modem, which is useful as a backup in the event that the primary broadband connection goes down, as well as a built in LAN printer server and printer port.

Besides the inherent protection features provided by the NAT, many routers will also have a built-in, configurable, hardware-based firewall. Firewall capabilities can range from the very basic to quite sophisticated devices. Among the capabilities found on leading routers are those that permit configuring TCP/UDP ports for games, chat services, and the like, on the LAN behind the firewall.

So, in short, a hub glues together an Ethernet network segment, a switch can connect multiple Ethernet segments more efficiently and a router can do those functions plus route TCP/IP packets between multiple LANs and/or WANs; and much more of course.
Did You Know...
Routers are also the only one of these three devices that will allow you to share
a single IP address among multiple network clients.
This article was adapted from the PracticallyNetwork.com Troubleshooting Q&A Reference
Key Terms To Understanding Storage Servers:
LAN
A computer network that spans a relatively small area. Most LANs are confined to a single building or group of buildings.
WAN
A computer network that spans a relatively large geographical area. Typically, a WAN consists of two or more local-area networks (LANs).
network
A group of two or more computer systems linked together.
MAC address
Short for Media Access Control address, a hardware address that uniquely identifies each node of a network.
OSI
Short for Open System Interconnection, an ISO standard for worldwide communications that defines a networking framework for implementing protocols in seven layers.
source : http://www.webopedia.com/DidYouKnow/Hardware_Software/2006/router_switch_hub.asp



Facebook Time !!!

I like facebooking very much. Facebook will help us to stay connected with our friends either the
new one or the old one. It's also help us to keep our photo album so we can see it in times. I always
feel glad everytime I saw my photo albums. It reminds me in a fun, happy and other kind of feeling when I saw
my old photos with my friends. Besides that, I like to play Poker so much. I think, many people think that poker is a bad game. Actually, it's not that bad to play.It doesn't need any real money if we want to. And the important one is patient. We have to be patient for wating our cards match. If we aren't patient, we will get bankrupt like many of my friends. So I think it's a good idea to play poker if we believe it's good for us. So I recommend you to play poker just for having fun and practicing to be a patient person, not assume it as a gambling game that will make us being a bad person. Whatever you do, it might have a positive side, so change yourself being a positive thinkers. Good luck!!


Label: 0 komentar | edit post
My First Post

Hi friends... It might be my first post in my blog and I don’t know whether someone will read my blog or not,,ha ha... It will be my first blog because my posts previously made for tasks in School. Last time, I didn't have any idea to be interested for making my own blog that so many people so interested to use it. I just thought that it would be fun to have one.
I am now a college student in Bina Nusantara University. At first, I didn't register as one of Binusian (Binus University student). When I was in the third grade of Senior High school, there were 2 University that gave an information for all of the students which that time was in the third grade. The 2 University were Petra Christian University and Ubaya(University of Surabaya). They asked my high school administration to give them all student's report cards. It was used for giving the third grade student  information about the type of registration for them if they join their university. Luckily, I got scholarships from both of them, So I registered in Petra Christian University to take IT major. I've paid the first payment to complete the registration there. I have heard from so many people  that the IT major in Petra is well known in East Java. So, I've been so sure that I could get what I wanted there.Right after the payment ,  my father remembered that he has relation there as a lecturer. I was so shocked that he said the IT major in Petra wasn’t good enough that time. He suggested my father to register me to Binus University. After the call, my father just realized that last time, he wanted to put me there. He has red an article about Binus in kompas, but he forgot to tell me. Soon, I sent an application to Binus and registered there. It was a great loss for the payment in Petra, because we couldn’t take back the money we’ve transferred there.
The first time I moved to Jakarta, I have a big passion to make it the best time in my life. I I have decided to make an awesome improvement. So I really have a big motivation to make my dreams come through. Maybe it’s good for me to have a friend that will give support each other.  I do expect that soon I got friend who want to improve his/her ability together with me. I hope I can keep my passion onwards.
Starts from now on, I want to post many important things in my life here, so this can be my notes and it will be an important way to improve my English ability.
Hope my wishes comes through :-p :d
My Parent's Biography

I want to tell you about my parents life from the past till now.
My father born in Tulungagung, 25 Maret 1958 and my mother born in Surabaya 5 december 1964. My father went to junior highschool in Tulungagung, but he went to SMAK Santa Maria Malang (Langsep). My mother went to SMAK YPPI Surabaya. My father and mother didn’t go to college. The directly applied for a job. My father helped my granpa’s job at home and my mother applied in a car dealer as a secretary.

My father and my mother were met by my aunt in Surabaya. After that my father took my mother to Tulungagung to do my grandpas’s bussiness. At first it was(100) difficult. But, my father is really a hardworker person. He never gave up to make his bussiness better and better. He went out of town to find customers. He went till Jakarta to find customers. After he got some customers, he sent his product to them. But there were some customers haven’t paid until this year. He is a priest in Cirebon and he ran without paying his debt to my father. The total money is actually big enough. It is a big loss for my father. Without thinking of that loss, my father kept on spirit to get money. He thougt that that loss might not have any effect for his bussiness. If he got depression too much, his bussiness wouldn’t bloom like now.


That’s just a part of my parent’s biography. I think it’s enough for this time

God Bless You Guys

I WILL ALWAYS AGAINST GO GREEN

Nowadays people’s outcry being increased so many as the the technology became so amazing. There are so many needs that they have to fill up. Things that are necessary for us to fill up used so many energy. We can not live without it and a lots of them are electronic things . We can understand that we can not leave electronics behind us. We can not go out of our home without it, such as cellphone.

I am really againts go green activities. Our life is so depended to electronic technologies. We need them to help us doing our activities everyday. Just say that we always need cellphone to call our family or relation to keep in contacting. We will really miss them if we can not contact them within a time. Now, we have a phone called Blackberry, this phone is really a smart phone. Not only for texting and calling, we can use it to promote our merchandise. It is so helpfull for us who have a shop and we want a better marketing. Although it is against going green, we need all of the electronic instruments to help us.

So, our latest technology is very useful for our life. We can not deny that we will use this instruments for the whole of our life. So, we will always against go green and use our electronic instrument whatever we like.