Cookie name and expiration
Hi, I'm testing the Cookie module's MarshalCookie in mod_python on my localhost environment. Everything looks ok and cookie set, get and update operations work well. But I'm not sure about the cookie name could be set by Cookie module. I mean the name of cookie file saved in the Temporary Internet Files directory of Internet Explorer. Consider that I run the script as http://localhost:8080/myScripts/myScript When I look at the Temporary Internet Files dir, not like other cookies came from normal websites, the cookie file was saved as "myScript/" and the cookie address is shown as http://localhost:8080/myScripts/ I don't know this is normal behaviour of the browser or there is an option to set the name of cookie file. I mentioned the expiration in the subject but maybe it's not related to expiration. For example if I run directly http://localhost:8080/myScripts/myScript2 after a day and look for the temporary internet directory again, I see a second cookie named "myScript2/" and the first cookie (myScript/) still exists there. But the first cookie seems no longer valid for this domain although I set the expire range for 30 days. Do I miss something about cookies concept and behaviour of browsers? Could anyone please clarify? Thanks and regards, Kutlu -- http://mail.python.org/mailman/listinfo/python-list
Re: High-performance Python websites
If you need an example one is in front of you and you are using it now. Google uses python at their thousands of servers. But as you see Google gains this performance from the power of hundreds of thousands servers. The main idea behind the Google search engine was indexing the whole web through hundreds of servers. So you can imagine where Google's power comes from.. Regards On Nov 26, 2:33 am, ShoqulKutlu wrote: > Hi, > > Managing load of high volume of visitors is a common issue for all > kind of web technologies. I mean this is not the python issue. This > issue is mostly about server level designs. You need to supply load > balancing for both web servers and databases to make your web site > able to respond to several concurrent visitors. Of course a good > programmed website is a key performance issue but for your mention I > would also suggest considering how many hardwares, how many > webservers, how many database cluster and which database server should > be used or will be used in the future.. > > Regards, > Kutlu > > On Nov 26, 2:24 am, Nick Mellor wrote: > > > > > Hi all, > > > I'm contemplating setting up a Python-powered website for the tourist > > industry, which will involve a web service, a good deal of XML > > processing, and a Django-powered front-end. If the project works, it > > could get a lot of traffic. I'm sure it can be done, but I'm looking > > to find out more about how existing high-volume Python sites have > > managed their workload. Can anyone give me examples of high-volume > > Python-powered websites, if possible with some idea of their > > architecture? > > > Many thanks, > > > Nick- Hide quoted text - > > - Show quoted text - -- http://mail.python.org/mailman/listinfo/python-list
Re: jython and java application
Welcome a million :) On Nov 26, 5:33 am, KB wrote: > Kutlu, > > I already have a first born, else I would name her after you. > > You are brilliant. That's what it was. Kudos. > > For future ref for fellow boneheads like me, in Eclipse, under Project > properties, Jython Class Path, Add External JAR... > > Thanks a million! -- http://mail.python.org/mailman/listinfo/python-list
Re: Cookie name and expiration
I'd already found my problem, that I had to set the "path" propert of a cookie object something like below: myCookie.path = '/' This is not the cookie content and not documented in the mod_python cookie module documentation. I hope this will help anyone else.. Regards, Kutlu On Nov 26, 1:32 am, ShoqulKutlu wrote: > Hi, > > I'm testing the Cookie module's MarshalCookie in mod_python on my > localhost environment. Everything looks ok and cookie set, get and > update operations work well. But I'm not sure about the cookie name > could be set by Cookie module. I mean the name of cookie file saved in > the Temporary Internet Files directory of Internet Explorer. Consider > that I run the script ashttp://localhost:8080/myScripts/myScript > When I look at the Temporary Internet Files dir, not like other > cookies came from normal websites, the cookie file was saved as > "myScript/" and the cookie address is shown ashttp://localhost:8080/myScripts/ > I don't know this is normal behaviour of the browser or there is an > option to set the name of cookie file. > > I mentioned the expiration in the subject but maybe it's not related > to expiration. For example if I run > directlyhttp://localhost:8080/myScripts/myScript2 > after a day and look for the temporary internet directory again, I see > a second cookie named "myScript2/" and the first cookie (myScript/) > still exists there. But the first cookie seems no longer valid for > this domain although I set the expire range for 30 days. > > Do I miss something about cookies concept and behaviour of browsers? > Could anyone please clarify? > > Thanks and regards,Kutlu -- http://mail.python.org/mailman/listinfo/python-list
Re: High-performance Python websites
Hi, Managing load of high volume of visitors is a common issue for all kind of web technologies. I mean this is not the python issue. This issue is mostly about server level designs. You need to supply load balancing for both web servers and databases to make your web site able to respond to several concurrent visitors. Of course a good programmed website is a key performance issue but for your mention I would also suggest considering how many hardwares, how many webservers, how many database cluster and which database server should be used or will be used in the future.. Regards, Kutlu On Nov 26, 2:24 am, Nick Mellor wrote: > Hi all, > > I'm contemplating setting up a Python-powered website for the tourist > industry, which will involve a web service, a good deal of XML > processing, and a Django-powered front-end. If the project works, it > could get a lot of traffic. I'm sure it can be done, but I'm looking > to find out more about how existing high-volume Python sites have > managed their workload. Can anyone give me examples of high-volume > Python-powered websites, if possible with some idea of their > architecture? > > Many thanks, > > Nick -- http://mail.python.org/mailman/listinfo/python-list
Re: jython and java application
I don't know if it's right place but normally main method requires an args even it is not needed to supply from commandline. Maybe this is a jython runtime error and requires at least an empty argument. You could try to pass and empty string array like ['']. I'm not using jython please use your own notation. Regards, Kutlu On Nov 26, 3:30 am, KB wrote: > Hi there, > > Apologies if this is on the wrong group, this is a jython question. > Please redirect me to the correct group if this is in error. > > I have a java application that takes no arguements. When I run it, it > spits out output, and finishes. > > I am trying to run this java application from jython 2.5.1, JRE6. > > I have made simple "Hello World" java classes be callable from a > simple jython script, yet I am stumbling on the java main construct in > the application. > > print krbtest.SimpleHistoricTutorial().main() obviously gives me an > args error (expected 1, got 0) as the definition in the java > application is: > > public static void main(String[] args) > > The jython code is as follows: > import krbtest > > # was messing with this to pass a java formatted string but to no > avail > > from java.lang import String > > print krbtest.SimpleHistoricTutorial().main() > > # > > Any advice greatly appreciated! Especially with how to call "main()" > with arguments from jython. > > Apologies in advance again if this is the wrong group. -- http://mail.python.org/mailman/listinfo/python-list
Re: jython and java application
Hi, I don't know how do you call the java library from within your jython application it gives java.lang.NoClassDefFoundError This looks like you referenced jar or whatever else from your jython application which also needs a class com/bloomberglp/blpapi/Session in another library file. It might run while running standalone because the dependent libraries exists where it looks for. For your jython application you need to make krbtest referenced to the dependent libraries. It seems you application took a copy of krbtest and other libraries not available to krbtest there. I hope it helps. Regards, Kutlu On Nov 26, 4:49 am, KB wrote: > Hmmm, for some reason my follow up post didn't make it. > > Modified jython script to: > > # Eclipse package name for java application > import krbtest > > import java.lang as lang > from java.lang import String > from jarray import array > > myargs=array([],String) > > krbtest.SimpleHistoricTutorial().main(myargs) > > > Now I get: > > Traceback (most recent call last): > File "test.py", line 15, in > krbtest.SimpleHistoricTutorial().main(myargs) > at krbtest.SimpleHistoricTutorial.run(SimpleHistoricTutorial.java:27) > > at krbtest.SimpleHistoricTutorial.main(SimpleHistoricTutorial.java: > 22) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > > at java.lang.reflect.Method.invoke(Unknown Source) > > java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: com/ > bloomberglp/blpapi/Session > > I would post the java app but its quite large, but the main defn: > > public static void main(String[] args) throws Exception > { > SimpleHistoricTutorial example = new SimpleHistoricTutorial(); > example.run(); > } > > Is pretty vanilla. I have tried making the run() a public method and > call it, all to no avail. > > Note, the Java app works fine standalone, I just need to call it from > jython. > > Again, any help appreciated. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do I correctly download Wikipedia pages?
Hi, Try not to be caught if you send multiple requests :) Have a look at here: http://wolfprojects.altervista.org/changeua.php Regards Kutlu On Nov 26, 5:45 am, Steven D'Aprano wrote: > I'm trying to scrape a Wikipedia page from Python. Following instructions > here: > > http://en.wikipedia.org/wiki/Wikipedia:Database_downloadhttp://en.wikipedia.org/wiki/Special:Export > > I use the URL "http://en.wikipedia.org/wiki/Special:Export/Train"; instead > of just "http://en.wikipedia.org/wiki/Train";. But instead of getting the > page I expect, and can see in my browser, I get an error page: > > >>> import urllib > >>> url = "http://en.wikipedia.org/wiki/Special:Export/Train"; > >>> print urllib.urlopen(url).read() > > ... > Our servers are currently experiencing a technical problem. This is > probably temporary and should be fixed soon > ... > > (Output is obviously truncated for your sanity and mine.) > > Is there a trick to downloading from Wikipedia with urllib? > > -- > Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: High-performance Python websites
Hi Nick, Sorry about my concern on Google. It caused a confusion about Google groups. I didn't mean explicitly where Google uses python, I mentioned just Google uses Python. A Google officer told that they run Python on thousands of their servers at an interview. Due to this claim I wanted to say it for you. Actualy of course it can be done and even it will not be worse than any other frameworks, and I bet can be better than Java and ASP.NET if configured and programmed well. I really encourage you to use mod_python for any project. Mod_python and mod_wsgi made it very powerful at web side. As I said in my previous message a web application's responsiveness is dependent to several issues. A good web framework, server speed, database design etc.. In this case you want to use django, which as I know build for mod_python and can be configured to run on a mod_wsgi web server. Consider that you will have one million members on your site. That traffic simply needs several clustered web servers and clustered databases. This means you supply a load balancing. So concurrent user sessions will be shared on different web servers. You can do your best with such a clustered system with such a powerful language. Really don't worry about that. Regards, Kutlu On Nov 26, 7:21 am, Nick Mellor wrote: > Thanks Kutlu, > > I wasn't aware that Google used Python for running their Google groups > servers. Can you confirm that? The only place > I've seen Google explicitly use Python on their web front end is in > the Google Ads tests. > > I am impressed by the responsiveness of lawrence.com, ljworld.com and > others on the Django home page (http://www.djangoproject.com/) > > They seem to do a great job of loading large, complex pages using > Django (stacked on Python, stacked on bytecode, stacked on C.) > Shows it can be done. > > Nick -- http://mail.python.org/mailman/listinfo/python-list
Re: High-performance Python websites
Hi again, I also want to say something about creating a better web application. If I were you I wouldn't use any web framework like django or other. If you want to create a commercial project and want to manage all modules of the application yourself I suggest you to create your own framework. I don't mean create a Django like framework. Determine your needs, modules, services and build your own modules. Use other independent open source modules for any specific issues. To make a successful project requires your own business logic. And you can do this with your own algorithm. Don't avoid collecting other modules for templating, xml parsing, DB connectivity issues. But build your own framework with these and your own modules.. Regards, Kutlu -- http://mail.python.org/mailman/listinfo/python-list