Re: Python IDE

2005-07-19 Thread JZ
Dnia Tue, 19 Jul 2005 13:26:38 +0200, Mage napisał(a):

> I had no luck with the code completion, 

It works. Just type sys. and wait a while. But you have to set up pydev
first. Check PyDev->Builder->Use Builders and PyDev->CodeCompletion->...

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What is your favorite Python web framework?

2005-07-18 Thread JZ
Dnia Mon, 18 Jul 2005 09:06:21 -0400, Peter Hansen napisał(a):

>> I think Django is more mature than Subway or CherryPy and can quickly
>> become the black horse in area of pythonic frameworks.
> 
> I'm not familiar with this expression.  What do you mean by "black horse"?

I meant "dark horse". Sorry for confusion. :)

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What is your favorite Python web framework?

2005-07-18 Thread JZ
Dnia Mon, 18 Jul 2005 09:26:10 -0300, Admin napisał(a):

> On Mon, 18 Jul 2005 08:45:22 -0300, JZ <[EMAIL PROTECTED]> wrote:
> 
>> Much more stable and much faster is e.g. Mygty (http://myghty.org) It is
>> about 2x faster then CherryPy. Also faster than CherryPy is Webware and
>> SkunkWeb. I did not check how fast is Django... It is fresh framework for
>> open source community.
> 
> Mmmh... I really don't know which one is better :(

Django has similar aproach to Rails or Subway. Myghty is similar to
Perl::Mason. I think those two are the most matured and powerfull. (I do
not mean Zope and Plone which is specific to its own category)

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What is your favorite Python web framework?

2005-07-18 Thread JZ
Dnia 18 Jul 2005 04:24:12 -0700, paron napisał(a):

>>I favor speed of development, intensive OO development, performance under
>>heavy load, short learning curve, good documentation and community.
> 
> I settled on CherryPy:
> 
> Performance under load -- can't say one way or the other. I do know
> it's lightweight -- 40kb download, I recall.

I do not know how new CherryPy 2.1 (which now can use wsgi) is fast and
stable but earler versions were quite unstable under heavy loads. Its
paradigm "creating web site like standalone appl" (inherited from Cherry1)
is not good suited to more complicated internet applications.

Much more stable and much faster is e.g. Mygty (http://myghty.org) It is
about 2x faster then CherryPy. Also faster than CherryPy is Webware and
SkunkWeb. I did not check how fast is Django... It is fresh framework for
open source community.

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What is your favorite Python web framework?

2005-07-18 Thread JZ
Dnia 18 Jul 2005 00:52:40 -0700, laurent napisał(a):

> I follow somes projects that have a pythonic way to make web site.
> there's thats projects :
>http://www.cherrypy.org/
> and
>http://subway.python-hosting.com/
> subway aim to be like ruby on rails frameworks , simple and fast
> developpment. It uses cherrypy and other project like :
>  * http://www.cheetahtemplate.org/
>  * http://www.formencode.org/
>  * http://www.sqlobject.org/

I think Django is more mature than Subway or CherryPy and can quickly
become the black horse in area of pythonic frameworks.

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Django - Rails killer comes...

2005-07-18 Thread JZ
Dnia Mon, 18 Jul 2005 00:52:44 -0700, flab ba napisał(a):

> To me, this seems like it places itself in competition with Zope, not
> Rails.

No. Zope is an application server, much more powerfull and complicated,
with its own object database and total object approach to all elements of
the system. Django is similiar to Rails or Subway rather than to Zope.

> If I'm wrong, could somebody explain why this is a "Rails Killer?"

Maybe Django is not strictly Rails killer (because if someone prefers Ruby
to Python, he choose Ruby - and vice-versa) But Django is good alternative
to Rails for those who prefer Python. Both use similiar approach, both was
created in the same time, both use ORM, MVC etc.

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Django - Rails killer comes...

2005-07-15 Thread JZ
http://www.djangoproject.com/

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Perl s/ To Python?

2005-06-10 Thread JZ
Dnia Fri, 10 Jun 2005 14:57:21 +0100, John Abel napisał(a):

> $testVar =~ s#/mail/.*$##g
> 
> The only way I can think of doing it, is:
> 
> mailPos = testVar.find( "mail" )
> remainder =  testVar[ :mailPos ]
> 
> Any ideas would be appreciated.  I'm iterating over a lot of entries, 
> and running these lines for each entry.

import re
testVar = re.compile(r'/mail/.*$').sub('', testVar) 

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


[Plone] DTML instead of ZPT for PHPParse

2005-05-03 Thread JZ
Who knows how to add to Plone the following content using DTML instead of
ZPT template?

http://www.w3.org/1999/xhtml"; xml:lang="en-US"
  lang="en-US" i18n:domain="plone"
  metal:use-macro="here/main_template/macros/master">
  


HERE IS MY DYNAMIC PHP: 


  


I need to use DTML instead of ZPT because PHPParse product cannot work with
ZPT. :( 

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list



PHPParser pod Zope

2005-05-03 Thread JZ
Probuje zainstalowac modul php pod zope i tam napisali dziwna rzecz ze
potrzebuje "PHP CGI program" a nie PHP CLI. Kompilacja php 5.0.4 pod
linuksem daje mi w wyniku mod_php + 5 plikow binarnych: pear, php,
php-config, phpextdist, phpsize. Zas lektura skryptu do zope jest nizbyt
jasna. Napisali:

#Path to the PHP-CGI-Interpreter.
#Modify it to where your PHP CGI program is located.PHP CLI does not work.
# ^^^
if sys.platform == 'win32':
PHPath = "c:\\php\\php.exe"
from win32pipe import popen2
else:
ENVPath = "env"
PHPath = "/usr/local/lib/php5/bin/php"
from os import popen2

Przeciez odpowiednikiem php.exe jest wlasnie linuksowy php jako cli. Nic
nie rozumiem. Reczne odpalenie /usr/local/lib/php5/bin/php -v wyswietla mi
oczywiscie ze to jest CLI. O co im chodzi z tym php cgi? Czyzby o skrypt
odpalany w .../cgi-bin/? Ale wtedy dlaczego pod win32 to jest binarny
interpreter a tu nie? Jak na zlosc nie podali zadnego przykladu. :(

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python or PHP?

2005-04-26 Thread JZ
PHP can do the same. For ADOdb (excelent database wrapper)it can be as
the following:

$conn->Execute('UPDATED foo SET bar=? WHERE id=?', array("foo'bar",
123));

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: os.open() i flaga lock

2005-04-12 Thread JZ
Dnia Tue, 12 Apr 2005 15:14:25 +0200, JZ napisał(a):

> Szukam jakiegoś odpowiednika fcntl na win32. W manualu napisali że
> os.open() z odpowiednią flagą jest bardziej uniwersalne od fcntl. Niestety
> zero informacji na temat tej flagi oraz brak jakiegokolwiek przykładu... :(

Sorry, I wanted to send to another group. because I cannot remove the post,
I provide simple translation:

I am looking for function similar ro fcnt but for win32. I've found brief
info in manual about os.open() which should work with specific flag value.
But I cannot find any info abotu that flag and no examples at all. :(

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


os.open() i flaga lock

2005-04-12 Thread JZ
Szukam jakiegoś odpowiednika fcntl na win32. W manualu napisali że
os.open() z odpowiednią flagą jest bardziej uniwersalne od fcntl. Niestety
zero informacji na temat tej flagi oraz brak jakiegokolwiek przykładu... :(

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Best editor?

2005-04-07 Thread JZ
Dnia 5 Apr 2005 11:22:59 -0700, ChinStrap napisał(a):

> Opinions on what the best is?

Eclipse + plugins: pydev (http://pydev.sourceforge.net/updates/) and
subclipse(http://subclipse.tigris.org/update/). It is free, stable,
contains integrated (visual) debugger, code completion, refactoring, PyLint
for deep analise of python code, and fine work with SVN.

For win32 lighter solution is PythownWin
(http://activestate.com/Products/ActivePython/). It's very stable, fast and
has very good debugger.

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python IDE like NetBeans/Delphi IDE

2005-04-05 Thread JZ
Dnia Tue, 05 Apr 2005 14:07:14 +0200, [EMAIL PROTECTED] napisał(a):

> Hi !
> 
> I search for an IDE that working in Windows, and knows these functions:
> 
> A.) Automatic name searching/showing/extending on classes with 
> keypressing (like Netbeans, or Delphi Ctrl+Space).
> B.) Debugging: breakpoints, step on lines (code), watch variables.
> 
> Or A and B both.
> 
> Please help me.

Check those:
Eclipse + pydev plugin (free, stable, good integration with SVN plugin,
pylint, debugger, refactoring)
PythonWin (free, stable, fast, good debugger)
WingIDE (commercial, slower than PythonWin but has many features)

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


IronPython, Boo and ASP.NET (web service)

2005-01-19 Thread JZ
Is there any way for preparing a simple web service (ASP.NET) using
IronPython or Boo (http://boo.codehaus.org/)? I cannot find any example. C#
uses [WebMethod] attribute for marking remote methods. I do not know how
IronPython or Boo deals with it.

-- 
JZ ICQ:6712522
http://zabiello.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The best way to do web apps with Python?

2005-01-08 Thread JZ
Dnia Sat, 8 Jan 2005 21:11:49 +0800, worzel napisał(a):

> What is the best way to web developemnt with Python? 

Hmm. :) I prefer http://cherrypy.org + http://cheetahtemplate.org/. Very
easy to learn and develop, yet powerfull.

> Is there anything close to PHP style in-page script 
> placement that can create and use other Python objects? 

Check http://spyce.sourceforge.net 
or http://nick.borko.org/pse

--
JZ ICQ: 6712522
http://zabiello.om
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Probleme mit der Installation der openSource Bittorrent.... python vs JAVA

2004-12-30 Thread JZ
Dnia 30 Dec 2004 07:24:45 -0800, xunling napisał(a):

> ich hätte da mal eine Frage zum Azureus bttrn client.

This is not German newsgroup! Write English or none.

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Compiled bytecode

2004-12-29 Thread JZ
Dnia 29 Dec 2004 23:57:14 GMT, LutherRevisited napisał(a):

> I haven't noticed any difference in the performance of text *.py 
> or a bytecompiled file.

Importing modules works faster.

--
JZ ICQ:6712522
http://zabiello.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Plone behind Apache problem...

2004-12-29 Thread JZ
I would like to exclude some files from Plone control within the same
virtual host. The problem is, I cannot use mod_rerwite because Plone needs
mod_proxy for working correctly. So the following rule does not work for
*.php files at all:

RewriteEngine on
RewriteRule \.php - [L]
ProxyPass /
http://host.com:8080/VirtualHostBase/http/host.com:80/mysite/VirtualHostRoot/
ProxyPassReverse /
http://host.com:8080/VirtualHostBase/http/host.com:80/mysite/VirtualHostRoot/

But when I use mod_rewrite instead mod_proxy, I cannot use Plone! It means
not everything works correctly (I cannot add any folder, or document etc.
without raising exception) I think it is because Plone needs
ProxyPassReverse rule for full working. So the following rules work for
*.php, but do not work for Plone:

RewriteEngine on
RewriteRule \.php - [L]
RewriteRule ^(.*)
http://host.com:8080/VirtualHostBase/http/host.com:80/mysite/VirtualHostRoot/$1
[P,L]

I know, I can add ProxyPass rule for excluding specific folder from Plone
but it is not the case. I want to exclude files with specific extensions,
not specific folders. Who knows how to solve that dillemma?

--
JZ ICQ:6712522
http://zabiello.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PHP vs. Python (speed-wise comparison)

2004-12-27 Thread JZ
Dnia Tue, 28 Dec 2004 02:54:13 +0800, Jon Perez napisał(a):

> If you're talking about usage as a server side scripting
> language, then PHP will likely give better page serving
> throughput for the same hardware configuration versus
> even something that is mod_python based (but I believe
> the speed diff would be well under 100%).

I have different experience. When I moved from PHP to Webware
and I compared its performance with (similar scale) php appplications, 
my webware was almost 6 times faster! Application servers are always 
faster because they use compiled scripts stored in memory. They do not need
to load files from filesystem nor parse them. PHP is faster only for
trivial, useless benchmarks like "Hello world". For bigger code Python is
faster than PHP.

> The real problem with Python is not speed but _availability_.

You have rigth here.

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PHP vs. Python

2004-12-23 Thread JZ
Dnia Wed, 22 Dec 2004 20:57:07 -0500, Robert Kern napisał(a):

> I think he means, "scale to larger programs," not "scale to more 
> processors."

Yes. I will try to be more specific. There is several reasons why Python
scales better than PHP. 

(1) Python uses namespaces, PHP - not. The bigger programm the bigger
probability of conflict among names in PHP.

(2) Not only PHP lacks namespaces. It has one big inconsistent mess with
its function naming! Inconsistent prefixes, order of parameters. Mess. It
is difficult to memorize it. Python programming need less interupting for
reading manual.

(3) Python uses modules, PHP - not. Python can download single or some
classes from many big modules (eg. from module1 import class1, var1, fun1).
PHP is primitive in its copy-paste *all* included files! So Python uses
less memory than PHP and do not need to parse so many lines.

(4) Python automatic compile every imported modules into bytecode, PHP has
to parse all those mess. Without accelerators PHP is much slower for bigger
applications. This is the reason why PEAR is so slow. This is the reason
why ezPublish is so slow. The bigger code (more included files), the slower
PHP works. 

(5) Python compile its modules automatic and do not need to parse them for
every browser request like PHP do.

(6) Pythonic application server (eg. Webware) do not need to load and parse
any files from filesystem at all! It loads them once, compile it and store
compiled scripts in memory. PHP has to load files from filesystem, parse
them and execute. From my own experience: when I moved from PHP to Webware
and I compared its performance with (similar scale) php appplications, my
webware was almost 6 times faster!

(7) Python has much better free IDE editors with graphic debugger inside.
PythonWin, Boa, SPE, Eric3 etc. It is much easier debug in Python than i
PHP for larger programmes.

(8) And last but not least. Python is truly object oriented, general
purpose language. PHP is not general purpose language. PHP4 has very poor
OO. (PHP5 has better, but has also some useless new features like private
variables. They have sense for static compiled languages like C++ or Java ,
not for dynamic ones.) Python also uses sofisticated exception handling,
uses namespaces, has module import, has better unicode support, has more
consistent api etc. 
One more example from my experience. I always have problem with converting
string among iso-8859-2, cp1250, mac-ce and utf-8. PHP utf8 functions are
poor, implements useless (for me) iso-8859-1 only. iconv library for PHP is
even worse, when it cannot convert some characters it deletes the following
characters! PHP has no such like: unicode(txt, 'cp1250').encode('cp1250',
'xmlcharrefreplace'). When some characters exists only in cp1250 but not in
iso-8859-2 that function convert them into xml entity &#number; Cute!

--
JZ ICQ:6712522
http://zabiello.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PHP vs. Python

2004-12-22 Thread JZ
Dnia 22 Dec 2004 14:03:36 -0800, [EMAIL PROTECTED] napisał(a):

> Anyone know which is faster?  I'm a PHP programmer but considering
> getting into Python ... 

Python application servers (Webware, Skunkweb) can work much faster than
php. But it is true only for non-trivial code. Benchmark for "Hello world"
is a nonsense of course. 

But pure speed is not the all. Python can scale better, has cleaner and
consistent syntax, better standard libraries and is a common language
rather than specific script language for web only.

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: regular expression: perl ==> python

2004-12-22 Thread JZ
Dnia Wed, 22 Dec 2004 16:55:55 +0100, Fredrik Lundh napisał(a):

> the "_" symbol has no special meaning when you run a Python program, 

That's right. So the final code will be:

import re
line = "The food is under the bar in the barn."
found = re.search('foo(.*)bar',line)
if found:  print 'got %s\n' % found.group(1)

-- 
JZ ICQ:6712522
http://zabiello.com  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: regular expression: perl ==> python

2004-12-22 Thread JZ
Dnia Wed, 22 Dec 2004 10:27:39 +0100, Fredrik Lundh napisał(a):

>> import re
>> line = "The food is under the bar in the barn."
>> if re.search(r'foo(.*)bar',line):
>>   print 'got %s\n' % _.group(1)
> 
> Traceback (most recent call last):
>   File "jz.py", line 4, in ?
> print 'got %s\n' % _.group(1)
> NameError: name '_' is not defined

I forgot to add: I am using Python 2.3.4/Win32 (from ActiveState.com). The
code works in my interpreter.

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: regular expression: perl ==> python

2004-12-22 Thread JZ
Dnia 21 Dec 2004 21:12:09 -0800, [EMAIL PROTECTED] napisał(a):

> 1) In perl:
> $line = "The food is under the bar in the barn.";
> if ( $line =~ /foo(.*)bar/ ) { print "got <$1>\n"; }
> 
> in python, I don't know how I can do this?
> How does one capture the $1? (I know it is \1 but it is still not clear
> how I can simply print it.
> thanks

import re
line = "The food is under the bar in the barn."
if re.search(r'foo(.*)bar',line):
  print 'got %s\n' % _.group(1)

--
JZ ICQ:6712522
http://zabiello.om  
-- 
http://mail.python.org/mailman/listinfo/python-list