open urls in browser
Hi All, I am new to python. Before posting i have done some google regarding my question. But i didn't get exact information. So thought of posting it here. I want to open a list of urls in browser that too in same window with out exiting. it should load one by one on same window and also it should log the details simultaneously to another text file. Ex: http://www.google.com - Pass/Fail. If you guys already having this code please share it with me. Thanks a lot in advance. -- http://mail.python.org/mailman/listinfo/python-list
Re: open urls in browser
On Jul 18, 6:21 pm, Chris Angelico wrote: > On Mon, Jul 18, 2011 at 10:05 PM, srikanth wrote: > > Ex:http://www.google.com- Pass/Fail. > > What do you mean by "Pass" or "Fail"? If you send a URL to a web > browser, all you'll find out is whether or not the browser accepted it > - it won't tell you if the page is valid. If you want that, you don't > need a web browser at all - what you want is a simple URL fetcher, > such as urllib/urllib2. > > http://docs.python.org/library/urllib.htmlhttp://docs.python.org/release/3.1.3/library/urllib.request.html > > ChrisA Sorry i don't need that one. by mistake i have written it. -- http://mail.python.org/mailman/listinfo/python-list
Problem with Packages
Hi, I am learning about Python packages and I am getting an ImportError but I can't figure out the reason why. I have three modules and they are stored in a directory hierarchy as: my_apps | |--> mod3.py |--> dir1/dir1_1/mod1.py |--> dir2/dir2_2/mod2.py mod1.py defines a function called add(num1, num2) and mod2.py defines a function called multiply(num1, num2) and mod3.py makes use of the two functions defined in mod1.py and mod2.py and mod3.py's contents is as follows: --- from dir1.dir1_1 import mod1 from dir2.dir2_2 import mod2 def main(): print mod1.add(10, 34) print mod2.multiply(3, 6) if __name__ == "__main__": main() -- And the directory my_apps is included in PYTHONPATH environment variable, what am I doing wrong? I executed this code under PyDev and it's working perfectly but when I run it outside of PyDev, it fails. This is command I used to execute mod3.py: C:\> python C:\my_apps\mod3.py But I get the following error: Traceback (most recent call last): File "c:\my_apps\mod3.py", line 1, in ? from dir1.dir1_1 import mod1 ImportError: No module named dir1.dir1_1 Thanks, Srikanth -- http://mail.python.org/mailman/listinfo/python-list
Re: Problem with Packages
> It appears that you forgot the basic rule: a package is a directory with > an __init__.py file (even if empty). Exactly right. I didn't know that __init__.py is a mandatory one. Thanks for pointing out. > > my_apps > > | > > |--> mod3.py > > |--> dir1/dir1_1/mod1.py > > |--> dir2/dir2_2/mod2.py > > You need 4 of such files here. Thanks again for saying 4, cause I would have definetly put only 2 (inside dir1_1 and dir2_2) > > And the directory my_apps is included in PYTHONPATH environment > > variable, what am I doing wrong? I executed this code under PyDev and > > it's working perfectly but when I run it outside of PyDev, it fails. > > Maybe PyDev plays some tricks with PYTHONPATH or something... > I got the same doubt and I checked PyDev before posting, the PYTHONPATH is exactly the same but I didn't notice or rather overlooked __init__.py file it created automatically when I created packages using the dialogs. > Gabriel Genellina Thanks you Gabriel! -- Srikanth -- http://mail.python.org/mailman/listinfo/python-list
Re: Removing a particular index from a list
Thanks Steve, Cyril and Peter. > > This, or not reading the tutorial. > > http://docs.python.org/tut/node7.html#SECTION00720 > > Peter I read this 2 months ago and I expected it to be a method of list, but I sound like I am making an excuse. Thanks a lot. Regards, Srikanth -- http://mail.python.org/mailman/listinfo/python-list
Removing a particular index from a list
Hi, list.remove(item) removes the first item from the list, but how do I say to remove a particular index from a list without using it's value? Let's say I have 4 items in my list as >>> li = ["sri", "s", "srikanth", "s"] And if I want to remove the last item ("s"), how do I remove it? li.remove(-1) doesn't do it. This is my problem. Thanks, Srikanth -- http://mail.python.org/mailman/listinfo/python-list
Best Free and Open Source Python IDE
Yes, All I need is a good IDE, I can't find something like Eclipse (JDT). Eclipse has a Python IDE plug-in but it's not that great. Please recommend. Thanks, Srikanth -- http://mail.python.org/mailman/listinfo/python-list
Python CGI windows
Dear All, I Have certain clarification in python CGI. I use Python IDLE *1. How do we execute CGI Scripts in Windows? 2. How do i configure the Server?(If i use WAMP,XAMPP) 3. Is mod_python required for python cgi? * Someone Please revert back to me with the solution for the same.I would be at-most thankful -- Thanks & Regards, Srikanth.N -- http://mail.python.org/mailman/listinfo/python-list