4
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by woooee
0

Hi, I'm basically a programming hobbiest and new to this forum so I may be wrong, but that being said I don't think you have provided enough information here. Unless of course you are wanting someone to point you in the right direction, or actually code something for you. I'm guessing if you are a newbie the first thing to do would be to first learn a bit about the language. Then ask yourself a few questions, such as. What does python offer that could preform this task I want to automate? One thing I can be sure of is you want to manipulate the string http://www.domaincom/search/iplocati...191.1X.1XX.1XX. I know that python can handle this task no problem. Read up on strings in any beginner tutorial and you should find a solution to this part. The next question would probably be how am I going to pass this information to python, or do i want python to access this information on its own. Depending on the answer to that question, you may be looking at a very simple code, to a much more sophisticated code. Anyway from my exeprience this is the type of process you go through for just about any program you intend to make. And I think you will be better equipt to ask questions if you first go through that process.

0

More info, plz.

State clearly what you are trying to to. Are you going to try and use python to parse the results (via html scrape)? Because that would likely mean regular expressions and that would be tough.

0

Thanks for replies. Yes I started with python as it seems to be the easiest one for a newbie, especially with a linguistics background:) In deed what I want is to search IP addresses location. I have a log which keeps IP of the visitors of my blog. After that, maybe I modify the code and use it for linguistic purposes, from google for example. In deed I searched it on the net but was lost in google:) Such tasks are related to cgi? Or where should I start? Thanks.
Best

0

Here's where you should always start:

What is your input to the script? This should be something tangible, a trigger, a file, some sort of a parameter you are going to pass.

What will your script do, and ultimately output?

Then, we can probably help you out with some code.

0

I have a log which keeps IP of the visitors of my blog

Start with file open and readlines to get the file into memory. Then decide how you are going to identify an IP address. If it is the only thing on the line that has digits, or is always in the same string such as "IP Address 123.34.789" then it is easy to filter out. Here is a simple example that you should be able to use to start with http://pythonstarter.blogspot.com/search/label/python%20readlines http://pythonstarter.blogspot.com/2009/04/python-readline-example-for-newbie.html This is a link to (mostly) online books and tutorials http://linkmingle.com/list/List-of-Free-Online-Python-Books-freebooksandarticles

0

Start with file open and readlines to get the file into memory. Then decide how you are going to identify an IP address. If it is the only thing on the line that has digits, or is always in the same string such as "IP Address 123.34.789" then it is easy to filter out. Here is a simple example that you should be able to use to start with http://pythonstarter.blogspot.com/search/label/python%20readlines http://pythonstarter.blogspot.com/2009/04/python-readline-example-for-newbie.html This is a link to (mostly) online books and tutorials http://linkmingle.com/list/List-of-Free-Online-Python-Books-freebooksandarticles

thanks all.

0

Post any code you're having problems with. I as said earlier, it is fairly straight forward, so don't waste too much time reinventing the wheel.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.