Soap Question (WSDL)

2005-09-29 Thread Armin
Hey everyone,

I am trying to write a web app. that connects to flickr using SOAP. The
book 'Dive into python' says I need to have a WSDL file to connect,
while the only useful soap related url flickr api
(flickr.com/services/api) provides is the following:

The SOAP Server Endpoint URL is http://www.flickr.com/services/soap/

What am I supposed to do here? Help is very much appreciated at this
point.

Thanks,
Armin

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


Re: Soap Question (WSDL)

2005-10-01 Thread Armin
Thanks for the comment everyone.

I was considering to write my own soap interface to Flickr as apposed
to use the ready to go libraries for Flickr as Fredrik pointed out. I
got to get FlickrClient to work. Nonetheless, I am excited to use soap
services for my needs.

Thanks for your support,
Armin

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


Re: Python, PostgreSQL, What next?

2006-12-02 Thread Armin
 
> I've studied Python and studied PostgreSQL. 
Good.

>What is the absolute next best step to take to merge these two finely 
>together? I've heard of

Just download psycopg2. Python and PostgreSQL are a match made in heavan.

Make your connection, 
do querys, 
get data,
earn profits.

Object-Relational-Mappers are to direct SQL as phone sex is to the real 
thing.

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


py2exe + SQLite problem

2009-01-29 Thread Armin



Hello all,

I have frozen a running application which is using SQLite with py2exe.

When I start the exe file I see in the log file of the exe:

Traceback (most recent call last):
  File "dpconf.py", line 666, in ?
  File "dpconf.py", line 251, in __init__
  File "sqlite\main.pyc", line 255, in execute
_sqlite.DatabaseError: no such table: genslaveopt

The table exist in the database file ... no problem with the plain 
python version.


How can I solve that problem ??

Best Regards

--Armin


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


py2exe + SQLite problem

2009-01-29 Thread Armin



Hello all,

I have frozen a running application which is using SQLite with py2exe.

When I start the exe file I see in the log file of the exe:

Traceback (most recent call last):
  File "dpconf.py", line 666, in ?
  File "dpconf.py", line 251, in __init__
  File "sqlite\main.pyc", line 255, in execute
_sqlite.DatabaseError: no such table: genslaveopt

The table exist in the database file ... no problem with the plain 
python version.


How can I solve that problem ??

Best Regards

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


py2exe + data_files

2009-01-29 Thread Armin


Hello,

is there a way to place individual data files into to the standard 
'dist'  directory and not into a subdirectory of 'dist'


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


distutil problem ??

2009-01-29 Thread Armin


Hello,

I have the following setup script for py2exe:

from distutils.core import setup
import py2exe

setup(windows=['dpconf.py'],
data_files=[ "", ["proj_db","gsd_db","dachs2.xbm"]]
)

When I create the distribution I got the following err msg:

*** copy data files ***
warning: install_data: setup script did not provide a directory for '' 
-- installing right in 'C:\pyDPCONF.2.3-dev\dist'

error: can't copy '': doesn't exist or not a regular file

Looks a little bit inconsistent ?

--Armin

PS: "." makes also problems
--
http://mail.python.org/mailman/listinfo/python-list


Re: py2exe + SQLite problem

2009-01-30 Thread Armin

Gabriel Genellina wrote:

En Thu, 29 Jan 2009 13:05:11 -0200, Armin  escribió:


I have frozen a running application which is using SQLite with py2exe.
When I start the exe file I see in the log file of the exe:
Traceback (most recent call last):
   File "dpconf.py", line 666, in ?
   File "dpconf.py", line 251, in __init__
   File "sqlite\main.pyc", line 255, in execute
_sqlite.DatabaseError: no such table: genslaveopt

The table exist in the database file ... no problem with the plain 
python version.


Did you solve this problem? As you posted 4 related messages and the 
last one might imply a solution to this first one...


Yes, the distutil option 'data_files' failed to copy the database files 
to the dist directory. All dbopen calls have created empty db files ...


--Armin

PS: any comments on the data_files issue ??




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


Re: py2exe + SQLite problem

2009-01-31 Thread Armin

Gabriel Genellina wrote:

En Fri, 30 Jan 2009 09:50:08 -0200, Armin  escribió:




Right at the end: "To install data files directly in the target 
directory, an empty string should be given as the directory."


setup(...,
  data_files=[
   ('', ['list/of/file/names', 
'perhaps/including/source/directory']),

   ]
 )


Yes ... so far the theory :)

As posted before ... set's my script (python 2.3):

from distutils.core import setup
import py2exe

setup(windows=['dpconf.py'],
data_files=[ "", ["proj_db","gsd_db","dachs2.xbm"]]
)

When I create the distribution I got the following err msg:

*** copy data files ***
warning: install_data: setup script did not provide a directory for '' 
-- installing right in 'C:\pyDPCONF.2.3-dev\dist'

error: can't copy '': doesn't exist or not a regular file

Looks a little bit inconsistent ?

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


Re: py2exe + SQLite problem

2009-02-01 Thread Armin


Hello,

Thanks to all ... it's working now !

Google isn't always your friend :) I found in the net a lot but wrong 
examples for specification of "data_files". Now I have the correct one.


Best Regards

--Armin



Gabriel Genellina wrote:

En Sat, 31 Jan 2009 11:51:16 -0200, Armin  escribió:

Gabriel Genellina wrote:

En Fri, 30 Jan 2009 09:50:08 -0200, Armin  escribió:


 Right at the end: "To install data files directly in the target 
directory, an empty string should be given as the directory."

 setup(...,
  data_files=[
   ('', ['list/of/file/names', 
'perhaps/including/source/directory']),

   ]
 )


Yes ... so far the theory :)

As posted before ... set's my script (python 2.3):


You didn't tell us that you were using version 2.3 -- it's important, as 
the current stable releases are 2.6 and 3.0. Anyway, this should work in 
2.3 too.



from distutils.core import setup
import py2exe

setup(windows=['dpconf.py'],
 data_files=[ "", ["proj_db","gsd_db","dachs2.xbm"]]
 )



Comparing my example and yours, you lack a parenthesis level:

setup(windows=['dpconf.py'],
  data_files=[("", ["proj_db","gsd_db","dachs2.xbm"])]
  )


When I create the distribution I got the following err msg:

*** copy data files ***
warning: install_data: setup script did not provide a directory for '' 
-- installing right in 'C:\pyDPCONF.2.3-dev\dist'

error: can't copy '': doesn't exist or not a regular file

Looks a little bit inconsistent ?


O thou of little faith, try again...


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


Re: Lists aggregation

2009-03-16 Thread Armin
On Monday 16 March 2009 15:07:06 mattia wrote:
> I have 2 lists, like:
> l1 = [1,2,3]
> l2 = [4,5]
> now I want to obtain a this new list:
> l = [(1,4),(1,5),(2,4),(2,5),(3,4),(3,5)]
> Then I'll have to transform the values found in the new list.
> Now, some ideas (apart from the double loop to aggregate each element of
> l1 with each element of l2):
> - I wanted to use the zip function, but the new list will not aggregate
> (3,4) and (3,5)
> - Once I've the new list, I'll apply a map function (e.g. the exp of the
> values) to speed up the process
> Some help?
>
> Thanks, Mattia
> --
> http://mail.python.org/mailman/listinfo/python-list

zip wouldn't work here, you can use list comprehensions:

l = [(x, y) for x in l1 for y in l2]

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


Re: array next pointer

2009-03-17 Thread Armin
On Tuesday 17 March 2009 19:04:25 Luis Zarrabeitia wrote:
> On Tuesday 17 March 2009 03:17:02 pm R. David Murray wrote:
> > > > (btw, I love the new sentinel argument for the next function in
> > > > python3!)
> > >
> > > next() doesn't have a sentinel argument. It's iter() which does, and
> > > that's in 2.x also.
> >
> > But it does have a 'default' argument, and you can pass that
> > a sentinel, so it amounts to the same thing ;)
>
> Yep, that's what I meant, I forgot the parameter name.

Could you give an example of next() with a sentinel and describe its use case 
please?  I have a little trouble understanding what you guys mean!

thanks,
-- 
Armin Moradi
--
http://mail.python.org/mailman/listinfo/python-list


Re: How to do this in Python?

2009-03-17 Thread Armin
On Tuesday 17 March 2009 19:10:20 Josh Holland wrote:
> On Tue, Mar 17, 2009 at 05:04:36PM -0500, Jim Garrison wrote:
> > What's the canonical Python way of implementing this pseudocode?
> >
> > String buf
> > File   f
> > while ((buf=f.read(1)).length() > 0)
> > {
> > do something
> > }
>
> That looks more like C than pseudocode to me...
> Someone's been spending far too much time on C-like languages, if that's
> what your idea of simply readable code looks like. Thank heavens you
> found Python before it was too late!

I should agree, that looks too much like C. (except there are no ; at the end 
of first two lines).  And I'm sure you will much enjoy your adventure as a 
pythonista (pythanista?) just as I have after migration from C++.

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


Re: Python to Perl transalators

2009-03-17 Thread Armin
On Wednesday 18 March 2009 02:22:57 Chris Rebert wrote:
> 2009/3/17  :
> > Could anyone suggest whether there is any Python to Perl code convertors?
> > I found one on the net viz. Perthon. But it wasn’t really helping out.
>
> 
> Why on earth would you want to? That'd be like translating Shakespeare
> into a bad rap song!
> 
>
> Cheers,
> Chris

lol, actually I would prefer a rap song over Shakespeare, so your analogy 
doesn't work there ;)

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


Re: objectoriented -?- functional

2009-03-18 Thread Armin
On Wednesday 18 March 2009 10:19:41 Peter Otten wrote:
> Walther Neuper wrote:
> > loving Java (oo)
>
> Don't mind, weirder things have happened
>
> http://wiki.muenster.org/index.php/Schwan
>

LOL!!

> > as well as SML (fun) I use to practice both of them
> > separately.
> > Now, with Python I would like to combine 'oo.extend()' with 'functional
> > map':
> >
> > Python 2.4.4 (#2, Oct 22 2008, 19:52:44)
> > [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >
> >  >>> def reverse_(list):
> >
> > ... """list.reverse() returns None; reverse_ returns the reversed
> > list"""
> > ... list.reverse()
> > ... return list
> > ...
> >
> >  >>> ll = [[11, 'a'], [33, 'b']]
> >  >>> l = ll[:]  # make a copy !
> >  >>> l = map(reverse_, l[:])  # make a copy ?
> >  >>> ll.extend(l)
> >  >>> print("ll=", ll)
> >
> > ('ll=', [['a', 11], ['b', 33], ['a', 11], ['b', 33]])
> >
> > But I expected to get ...
> > ('ll=', [[11, 22], [33, 44], [22, 11], [44, 33]])
> > ... how would that elegantly be achieved with Python ?
>
> Sorry, I cannot infer the pattern. How would you do that at all?
>
> Peter
> --
> http://mail.python.org/mailman/listinfo/python-list

If you want to reimplement list.extend() (as I understand?) you will have to 
subclass it and change the behaviour.

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


Re: Python to Perl transalators

2009-03-18 Thread Armin
On Wednesday 18 March 2009 11:01:00 Boris Borcic wrote:
> Armin wrote:
> >> 
> >> Why on earth would you want to? That'd be like translating Shakespeare
> >> into a bad rap song!
> >> 
> >
> > lol, actually I would prefer a rap song over Shakespeare, so your analogy
> > doesn't work there ;)
>
> Why, some people do prefer Perl over Python, so what's wrong with the
> analogy ?
>
> --
> http://mail.python.org/mailman/listinfo/python-list

That would mostly apply to people who haven't coded in Python for one reason 
or another.

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


Re: python equivalent of java technologies

2009-03-18 Thread Armin
On Wednesday 18 March 2009 15:14:30 markolopa wrote:
> Hello,
>
> When comparing python and java with a colleague who is fan of java,
> she challenged me to find in python the equivalent to the following
> technologies. Could you please help telling if we have something
> equivalent in python or not and how they compare to the java
> solutions?
>
> - persistance framework  (~hibernate)
> - transational monitor (distributed transaction), XA compliance
> (message system, DB) (http://en.wikipedia.org/wiki/X/Open_XA)
> - web openess sur le web (web service)
> - RIA and web deployable graphic library
> - scheduling (quartz)
> - secutity (PKI, single sign-on...)
> - reporting (Jasper)
>
> Thanks a lot!
> Marko
> --
> http://mail.python.org/mailman/listinfo/python-list

You could tell her to try Jython.  In that, you can just use the Java 
implementations. :)  Plus, you have things in Jython that Java doesn't :D

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


Re: python equivalent of java technologies

2009-03-19 Thread Armin
On Thursday 19 March 2009 07:45:01 Jeremiah Dodds wrote:
> On Tue, Mar 17, 2009 at 8:32 PM, Armin  wrote:
> > You could tell her to try Jython.  In that, you can just use the Java
> > implementations. :)  Plus, you have things in Jython that Java doesn't :D
> >
> > --
> > Armin Moradi
> > --
> > http://mail.python.org/mailman/listinfo/python-list
>
> Exactly. Her challenges to find stuff have to do with the JVM, not Java the
> language. Python runs on the JVM.

Indeed, afaik, Jython produces Java byte-code.

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


Re: Holy hand grenade!

2009-03-20 Thread Armin
On Friday 20 March 2009 11:54:35 Aahz wrote:
> http://www.telegraph.co.uk/news/newstopics/howaboutthat/5018294/Pub-evacuat
>ed-after-Monty-Python-prop-mistaken-for-grenade.html

LOL!!!

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


Re: what is the python version that NASA using?

2009-03-20 Thread Armin
On Friday 20 March 2009 23:34:18 kyoguan wrote:
> Do you know what is the python version that NASA using?
>
> I want to know how frequently that they would upgrade the python version.
>
> --
> http://mail.python.org/mailman/listinfo/python-list

I don't think they would upgrade it so often.  maybe 2.2?

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


Re: splitting a large dictionary into smaller ones

2009-03-22 Thread Armin
On Monday 23 March 2009 00:01:40 per wrote:
> On Mar 22, 10:51 pm, Paul Rubin <http://phr...@nospam.invalid> wrote:
> > per  writes:
> > > i would like to split the dictionary into smaller ones, containing
> > > only hundreds of thousands of keys, and then try to pickle them.
> >
> > That already sounds like the wrong approach.  You want a database.
>
> fair enough - what native python database would you recommend? i
> prefer not to install anything commercial or anything other than
> python modules
> --
> http://mail.python.org/mailman/listinfo/python-list

sqlite3 module  read more about it in python documentation.

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


postfix type declaration

2009-03-30 Thread Armin
http://www.python.org/dev/peps/pep-3117/

Found it uber-funny!  enjoy!
It would have been cool if they actually accepted this!
-- 
Armin Moradi
--
http://mail.python.org/mailman/listinfo/python-list


Re: python needs leaning stuff from other language

2009-04-02 Thread Armin
On Thursday 02 April 2009 22:40:08 Zac Burns wrote:
> Is it really worth it to not implement list.clear and answer this
> question over and over again?
>
> I see no reason that a list shouldn't have a .clear method.
>
> --
> Zachary Burns
> (407)590-4814
> Aim - Zac256FL
> Production Engineer (Digital Overlord)
> Zindagi Games
>
> On Thu, Apr 2, 2009 at 5:32 PM, Esmail  wrote:
> > Emile van Sebille wrote:
> >> Esmail wrote:
> >>> Diez B. Roggisch wrote:
> >>>> online.serv...@ymail.com schrieb:
> >>>>> python's list needs a thing  list.clear()  like c# arraylist
> >>>>> and
> >>>>
> >>>> some_list[:] = []
> >>>
> >>> I agree that this is nice and clear, but as a relative newbie
> >>> wouldn't
> >>>
> >>> some_list = []
> >>
> >> This is different -- it creates a new list.  Consider:
> >>
> >>  >>> some_list = [1,2,3]
> >>  >>> d = some_list
> >>  >>> d[1]
> >> 2
> >>  >>> some_list[:] = ['a','b','c']
> >>  >>> d[1]
> >> 'b'
> >>  >>> some_list = [1,2,3]
> >>  >>> d[1]
> >> 'b'
> >>
> >> the [:] form allows references into the list to remain valid while the
> >> direct assignment dopes not.
> >
> > Ah .. thanks for clarifying this .. makes sense.
> >
> > Also, thank you Luis for your post.
> >
> > Esmail
> >
> > --
> > http://mail.python.org/mailman/listinfo/python-list
>
> --
> http://mail.python.org/mailman/listinfo/python-list

A .clear() method wouldn't be beneficial:

del mylist[:]

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


Problem displaying jpgs in Tkinter via PIL

2010-05-10 Thread Armin

Hi everyone,

I'm new to Python and have been playing around with it using the 
Enthought Python distribution for Mac OS X 10.6.3 (EPD academic 
license, version 6.1 with python 2.6.4).


It's been great learning the basics, but I've started running into 
problems when I'm trying to use the PIL library with Tkinter. All I'm 
trying to do is display a JPG as a Tkinter label:


# code below:
from Tkinter import *
import Image, ImageTk

def main():
   filename = "images/testimg.jpg"
   imgPIL = Image.open(filename)

   root = Tk()
   imgTK = ImageTk.PhotoImage(imgPIL)
   label = Label(root, image=imgTK)
   label.pack()
   root.mainloop()

main()
# end of code

It all works fine when I'm just using GIF images through Tkinter's 
photoimage object, but as soon as I'm trying to convert an image 
through ImageTk, I get the following error:


ImportError: 
dlopen(/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/site-packages/PIL/_imagingtk.so, 
2): Library not loaded: /sys...@rpath/Tcl Referenced from: 
/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/site-packages/PIL/_imagingtk.so 
Reason: image not found


I have no idea what that means, but I've always assumed the EPD 
includes all the stuff that's needed to make Tkinter work with PIL.

Any advice would be greatly appreciated. Thanks!






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


Re: Problem displaying jpgs in Tkinter via PIL

2010-05-11 Thread Armin
Never mind, I gave up on Tkinter and have switched to wxPython now. 
Getting jpg images to display in a wx frame worked like a charm... (As 
I said, I'm very new to Python, so I didn't really know what my options 
for GUI programming were.)


It seems like the ImageTk module on the Enthought distribution on my 
Mac is broken, but I can't figure out how to fix that. (I wiped my 
python installations and did a re-install, all to no avail.) As long as 
I don't need Tkinter for the GUI I'm envisioning, I don't really care 
however.




On 2010-05-10 14:01:10 -0700, Armin said:

I'm new to Python and have been playing around with it using the 
Enthought Python distribution for Mac OS X 10.6.3 (EPD academic 
license, version 6.1 with python 2.6.4).


It's been great learning the basics, but I've started running into 
problems when I'm trying to use the PIL library with Tkinter. All I'm 
trying to do is display a JPG as a Tkinter label:


It all works fine when I'm just using GIF images through Tkinter's 
photoimage object, but as soon as I'm trying to convert an image 
through ImageTk, I get the following error:


ImportError: 
dlopen(/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/site-packages/PIL/_imagingtk.so, 
2): Library not loaded: /sys...@rpath/Tcl Referenced from: 
/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/site-packages/PIL/_imagingtk.so 
Reason: image not found


I have no idea what that means, but I've always assumed the EPD 
includes all the stuff that's needed to make Tkinter work with PIL.

Any advice would be greatly appreciated. Thanks!



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


mySQLdb

2013-02-02 Thread Armin Karner
Dear Sir or Madam,



I am curious if there is an update of MySQLdb for python versions 3.3 or 
higher. Because I really need this for a diploma thesis. 
I've tried several of them, including various 2.x versions, but it didn't work. 
The system I use is a Microsoft Windows 7 64 bit. 

I really hope you have a solution for me, because it is quite urgent and 
important. 

I am looking forward to a quick answer!

Yours faithfully
Armin Karner-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Re: Progress migrating cffi and pycparser to libclang

2018-01-05 Thread Armin Rigo
Hi Etienne,

On 5 January 2018 at 10:15, Etienne Robillard  wrote:

> Forwarding  this thread to the CFFI developers...
>
If you're asking whether we could add libclang as a dependency to CFFI, the
answer is no, sorry.

I feel that I've already explained exactly this to you several times in
private e-mails, so I'm writing down this fact here on the public
python-cffi mailing list.  Please stop asking the same question.

For reference, here's my answer again.  CFFI is meant to be used in a
certain way.  I know from experience that a few people keep thinking about
it in a different way---sometimes for good reasons: it is tedious to wrap a
very large library even if it is easy to copy-paste-tweak individual
function definitions.  So to automate the process these people usually want
to parse real .h files, using libclang or better pycparser integration or
something else; and that's cool.  As I said there are already third-party
projects that try to do something similar.  Usually it is never completely
general, but more focused on a particular style of .h files coming from a
particular large project.  Maybe you'll run into similar issues and make
something that works in your case but not in others.  Or maybe you'll
manage to make it general enough.  In all cases this won't be included
inside CFFI, but could nevertheless be a successful separate project.
Please think about it as a project *above* CFFI, maybe something you'll
import and use inside a CFFI build script in order to provide content to
ffi.cdef().


A bientôt,

Armin.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Should I move to Amsterdam?

2005-08-24 Thread Armin Steinhoff
Adriaan Renting wrote:
> Well, I'm not sure if Amsterdam is nice, but the Netherlands is o.k., except 
> for the weather.
> I'd like to descripbe it as 49 weeks of autumn, 1 week of spring, 1 week of 
> summer, 1 week of winter.
> Currently my employer only has an opening for a Microwave Antenna designer 
> though, sorry no Python coders.
> http://www.astron.nl/astron/jobs/index.htm
> 
> Seems like a nice column, I'll read it completely some other time.
>  
> 
>>>>"Wade" <[EMAIL PROTECTED]> 08/24/05 2:31 pm >>> 
> 
> http://www.slate.com/id/2124561/entry/2124562/ 
>  
> Nice little series by Seth Stevenson for Americans daydreaming about 
> emigration. Somewhere, anywhere ... maybe Amsterdam? 
>  
> I've never been to the Netherlands myself, but it 
 >sounds very civilized.

What a joke ... Amsterdam is 'civilized' since several hundreds of
years :)

--Armin



>  
> Extra Python connection, besides the obvious one: Is "gezellig" related 
> to the Zen of Python? ( 
> http://wordcraft.infopop.cc/eve/ubb.x/a/tpc/f/6351024471/m/2041067571/r/3901049571
>  
> ) 
>  
> -- Wade Leftwich 
> Ithaca, NY 
>  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GIL release

2005-03-18 Thread Armin Steinhoff
Alastair Basden wrote:
Hi,
Does anyone know whether there is a way for a python thread to release 
the global interpreter lock, and let all other threads have a chance at 
running before re-acquiring it?  Does the thread scheduling follow a 
round-robin method?
The thread itself are scheduled by the OS ... the access to the GIL is 
managed by 'cooperative scheduling'.

--Armin
Thanks,
agb.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Protecting Python source

2004-11-29 Thread Armin Steinhoff
Alan Sheehan wrote:
Hi pythonistas,
I am looking for methods of deploying applications with end users so
that the python code is tamper proof. What are my options ?
I understand I can supply .pyc or .pyo files but they can easily be
reverse engineered I am told.
Is it possible to load the scripts from zip files where the zip files
are password protected ?
Any other ideas ?
Use Pyrex in order to convert the critical parts to C modules ...
Regards
  Armin

Many thanks,
Alan
--
http://mail.python.org/mailman/listinfo/python-list


Psyco 1.3 released

2004-12-03 Thread Armin Rigo
Hi all,

Psyco 1.3 has been released:

 
  http://sourceforge.net/project/showfiles.php?group_id=41036   
 

 
Includes support for Python 2.4 (and of course still supports Python 2.1
to 2.3).  As always it comes with a few bugfixes, including a memory leak
when using the profiler.  Another good news is that the built-in functions
that read the local variables -- locals(), eval(), execfile(), vars(),
dir(), input() -- now work correctly!


A bientot,

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


CTYPE 0.9.2 porting problems

2004-12-06 Thread Armin Steinhoff

Hi all,
I ported ctypes 0.9.2 to QNX6.3 ... 99.9 % is working but only the 
unittest test_functions.py makes some problem. Here is the code:

p = pointer(c_int(99))
result = f(p)
self.failUnlessEqual(result.contents.value, 99) #---> works!!
# We need to keep the pointer alive, otherwise the contents change:
result = f(pointer(c_int(99)))
print result.contents.value
self.failIfEqual(result.contents.value, 99)
Error message:
# python test_functions.py
..99
F.
==
FAIL: test_pointers (__main__.FunctionTestCase)
--
Traceback (most recent call last):
  File "test_functions.py", line 194, in test_pointers
self.failIfEqual(result.contents.value, 99)
  File "/usr/local/lib/python2.3/unittest.py", line 310, in failIfEqual
raise self.failureException, \
AssertionError: 99 == 99
What's the problem here? 99 isn't equal 99 :)
--
Ran 16 tests in 0.053s
FAILED (failures=1)
#

# XXX But this not! WHY on earth?  >> BUT this IS working!!
arg = byref(v)
result = f(arg)
self.failIfEqual(result.contents, v.value)
I see always a crash of Python if the library call time() is used ... 
but it happens only with this call.

What could be in general the reasons??
Regards
   Armin
--
http://mail.python.org/mailman/listinfo/python-list


Re: Calling a C program from a Python Script

2004-12-09 Thread Armin Steinhoff
Brad Tilley wrote:
Is it possible to write a file open, then read program in C and then 
call the C program from a Python script like this:

for root, files, dirs in os.walk(path)
for f in files:
try:
EXECUTE_C_PROGRAM
If possible, how much faster would this be over a pure Python solution?
I would compile that C program into a shared library (*.so or *.dll ) in 
order to use that shared library with ctypes ... that's the easiest way, 
IMHO :)  ( http://starship.python.net/crew/theller/ctypes )

Regards
 Armin

Thank you,
Brad
--
http://mail.python.org/mailman/listinfo/python-list


Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-10 Thread Armin Rigo
Hi Alex,

On Mon, 9 Jan 2006, Alex Martelli wrote:
> 50%, yes (the other 50% must come from private contributions, that's a
> EU rule for research projects).  It used to be thought that some of the
> EU money could be used to help pay for sprint participants' travel
> expenses, but apparently something has gone wrong on that score
> (probably some EU administrative requirement) -- I didn't ever see any
> of the travel-expense-help money that was promised to me on one
> occasion, so I had to swallow that cost myself.

This is not the whole truth.  We have some procedure now for funding 
travel costs, although it's admittedly very bureaucratic :-(

Anyway, independently of this, there are some people we are happy to see 
come back again and again to PyPy sprints even though we know their budget 
is extremely limited.  We have always arranged things for them to minimize 
the costs.  It's nothing like a "congress" where you have to pay XXX/day 
for having water and cake brought to the tables by the staff at 10am.  I 
can certainly say that attending a PyPy sprint is not expensive at all; 
I'd expect the major problem to be rather to find a week's free time for 
it.

On the bureaucratic side: Alex, we *have* a procedure at this point, and 
we have been trying to contact you several time in the past months -- with 
no success as far as I know, so I'll try via comp.lang.python this time 
:-)  If you still feel like seeing your money back in exchange for some 
papers to fill and sign, please show up...


A bientot,

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


Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-10 Thread Armin Rigo
Hi Alex,

On Mon, 9 Jan 2006, Alex Martelli wrote:
> 50%, yes (the other 50% must come from private contributions, that's a
> EU rule for research projects).  It used to be thought that some of the
> EU money could be used to help pay for sprint participants' travel
> expenses, but apparently something has gone wrong on that score
> (probably some EU administrative requirement) -- I didn't ever see any
> of the travel-expense-help money that was promised to me on one
> occasion, so I had to swallow that cost myself.

This is not the whole truth.  We have some procedure now for funding 
travel costs, although it's admittedly very bureaucratic :-(

Anyway, independently of this, there are some people we are happy to see 
come back again and again to PyPy sprints even though we know their budget 
is extremely limited.  We have always arranged things for them to minimize 
the costs.  It's nothing like a "congress" where you have to pay XXX/day 
for having water and cake brought to the tables by the staff at 10am.  I 
can certainly say that attending a PyPy sprint is not expensive at all; 
I'd expect the major problem to be rather to find a week's free time for 
it.

On the bureaucratic side: Alex, we *have* a procedure at this point, and 
we have been trying to contact you several time in the past months -- with 
no success as far as I know, so I'll try via comp.lang.python this time 
:-)  If you still feel like seeing your money back in exchange for some 
papers to fill and sign, please show up...


A bientot,

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


Re: hide python code !

2006-08-15 Thread Armin Steinhoff
Bayazee wrote:
> hi
> can we hide a python code ?
> if i want to write a commercial software can i hide my source code from
> users access ?
> we can conver it to pyc but this file can decompiled ... so ...!!
> do you have any idea about this ...?

Use Pyrex in order to build C-Modules from the critical parts of your 
software.

> 
> ---
> First Iranian Open Source Community : www.python.ir

Interesting ... but you are not a member of this community. Right?

--Armin


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


Re: Match First Sequence in Regular Expression?

2006-01-28 Thread Armin Steinhoff
Alex Martelli wrote:
> Christoph Conrad <[EMAIL PROTECTED]> wrote:
> 
> 
>>Hello Roger,
>>
>>
>>>since the length of the first sequence of the letter 'a' is 2. Yours
>>>accepts it, right?
>>
>>Yes, i misunderstood your requirements. So it must be modified
>>essentially to that what Tim Chase wrote:
>>
>>m = re.search('^[^a]*a{3}b', 'xyz123aabbaaab')
> 
> 
> ...but that rejects 'aazaaab' which should apparently be accepted.

  ... and that is OK. That was the request:

 >I'm looking for a regular expression that matches the first, and only
 > the first, sequence of the letter 'a', and only if the length of the
 > sequence is exactly 3.

--Armin

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


Re: Python multithreading on cluster system? Embedding python in PVM?

2006-02-19 Thread Armin Steinhoff
abhinav wrote:
> Hi guys.I have read that one cannot perform true multithreading in
> python due to global interpreter lock mechanism.Suppose i have to
> implement a crawler on a say cluster system like clusterknoppix so that
> i can use parallel virtual machine (PVM)for programming in
> multiprocessor environment or say open MPI.Can i integrate python with
> PVM or MPI.Can i embed python into C for programming in multiprocessor
> environment.Is there any way of embedding python in PVM or MPI so that
> i can implement a true cluster based search engine?
> Any help would be very kind.Thanks.
> 


http://pypvm.sourceforge.net

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


Re: editor for Python on Linux

2006-02-19 Thread Armin Steinhoff
Mladen Adamovic wrote:
> Hi!
> 
> I wonder which editor or IDE you can recommend me for writing Python 
> programs. I tried with jEdit but it isn't perfect.
>

Nothing is perfect ... but try SciTE and Eric 
http://www.die-offenbachs.de/detlev/eric3.html

--Armin

http://www.steinhoff-automation.com


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


Re: pyvm -- faster python

2005-05-13 Thread Armin Steinhoff
Stelios Xanthakis wrote:
> Kay Schluehr wrote:
> 
>>
>> Yes. What we are seeking for and this may be the meaning of Armins
>> intentiously provocative statement about the speed of running HLLs is a
>> successor of the C-language and not just another VM interpreter that is
>> written in C and limits all efforts to extend it in a flexible and
>> OO-manner. Python is just the most promising dynamic OO-language to
>> follow this target.
> 
> 
> Bytecode engine is the best method for dynamic code execution
> ("exec", eval, etc).  A low level OOP language would be very suitable
> for a python VM.
> 
> pyvm has that. A big part of it is written in "lightweight C++" [1].

Realy ?  I have downloaded the lwc distribution and checked it out.
It was a surprise that none of the examples are working.
I'm using SuSE 9.0 with  gcc 3.3.1 ...

Is there a working version of lwc ???

Regards

   Armin




> That makes it less portable as the lwc preprocessor is using GNU-C
> extensions.  However, it's the same extensions also used by the linux
> kernel and AFAIK the intel compiler supports them too.
> 
> So probably the bigger "competitor" of pyvm is boost-python.
> And that's one reason the release of the source is stalled until it
> gets better.
> 
> 
> Stelios
> 
> [1] http://students.ceid.upatras.gr/~sxanth/lwc/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pyvm -- faster python

2005-05-13 Thread Armin Steinhoff
Stelios Xanthakis wrote:
> Armin Steinhoff wrote:
> 
>>>
>>> pyvm has that. A big part of it is written in "lightweight C++" [1].
>>
>>
>>
>> Realy ?  I have downloaded the lwc distribution and checked it out.
>> It was a surprise that none of the examples are working.
>> I'm using SuSE 9.0 with  gcc 3.3.1 ...
>>
> 
> :(
> 
>> Is there a working version of lwc ???
>>
> 
> pyvm is written in lwc-2.0 which is not yet released because
> nobody's using it.

As you mentioned it ... lwc-2.0 is used for pyvm. So it is used :)

Do you have an idea when lwc-2.0 will be releast ?

Everyone who are interested in pyvm will need it ...


-- Armin


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


PyXML/expat and the empty elements

2005-05-17 Thread Armin Steinhoff


Hi all,

is it possible to get the name of an empty element specified
by  ... the expat parser seems only to recognize
the  form

Regards

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


Re: PyXML/expat and the empty elements

2005-05-17 Thread Armin Steinhoff
Armin Steinhoff wrote:
> 
> 
> Hi all,
> 
> is it possible to get the name of an empty element specified
> by  ... the expat parser seems only to recognize
> the  form
> 
> Regards
> 
>   Armin


Ok ... found the root of the problem. The expat parser is OK :)

Regards

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


Post-EuroPython 2005 PyPy Sprint 1st - 7th July 2005

2005-06-12 Thread Armin Rigo
Post-EuroPython 2005 PyPy Sprint 1st - 7th July 2005 
==

The next PyPy sprint is scheduled right after EuroPython 2005
in Gothenborg, Sweden.  Its main focus is translation to 
lower level backends but there are also other possible topics. 
We'll give newcomer-friendly introductions.  To learn more
about the new PyPy Python-in-Python implementation look here: 

http://codespeak.net/pypy 

On a side note, there are a number of sub projects that may be
interesting for participating in google's summer-of-code event
(deadline June 14th!).  The PyPy group is willing to mentor
projects that have some link with PyPy, so if you are accepted
in such a project, the sprint could also serve as a good
meeting and kick-off point.  Further down you'll find some
examples, but there are certainly more and bigger ones :-)

Goals and topics of the sprint 
--

The main, though not the only, focus of the sprint will be on
the "translation" aspect of PyPy.   The goal here is to
progress towards a completely translated PyPy.  How much will
already have been done before EuroPython is unknown; as a
guess, we will be left with:
 
- completing the "rtyper", the piece of code that assigns low-level
  C-like types to high-level RPython objects (lists, dicts, instances,
  etc.) and low-level control flow graphs to high-level ones;
   
- polish off the GenC and GenLLVM back-ends, responsible for turning
  the low-level C-like flow graphs into real C or LLVM source code.

See http://codespeak.net/pipermail/pypy-dev/2005q2/002136.html for more
information (10th of June status).
 
Non-translation-related topics are welcome too.  Here are some suggestions
from the issue tracker (https://codespeak.net/issue/pypy-dev/):
   
- integrate the parser module, possibly making it RPython
  conformant;
 
- rewrite in Python a C module you are familiar with
  (partial list of missing/incomplete modules: os, math, array,
  regular expressions, binascii...)

- implement Python 2.3's import hook extensions (zip-imports etc.)

- fix Windows-related issues, '%'-formatting rounding errors,
  add missing docstrings on app-level built-in types and functions,
  etc.

- weakrefs (but this requires discussion and planning on pypy-dev
  before the sprint! feel free to start such a discussion, though.)


Location & Accomodation  
 

The sprint will be held in the former Math Center building
near the crossing of Gibraltargatan and Eklandagatan. Entrance
is on the middle of the side facing Gibraltargatan. The doors
to the building are normally locked, so you need the phone number
of somebody inside to get in. Instructions on whom to call will be
posted on the door.

The sprint will be co-located with several other sprints. See the 
`EuroPython Wiki`_, to find out what other sprints will be running.

Nearest, and probably cheapest is to book accomodation at SGS Veckobostäder
through the Europython website. This option will be available until about
20 June.

.. _`EuroPython special accomodation`: 
http://www.europython.org/sections/accomodation/special_accomodation
.. _`EuroPython Wiki`: http://www.europython.org/sections/sprints_and_wiki

Exact times 
---

The public Pypy sprint is held Friday 1st July - Thursday 7 July 2005.
Hours will be from 09:00 until people have had enough. It's a good 
idea to arrive a day before the sprint starts.   

(There is a sprint for people who are familiar with the Pypy codebase
before Europython as well. This will be held at Jacob & Laura's home
on Götabergsgatan 22.)


Network, Food, currency 
 

Sweden is not part of the Euro zone. One SEK (krona in singular, kronor
in plural) is roughly 1/10th of a Euro (9.15 SEK to 1 Euro).

There are some pizzerias, kebab places and the like close to the venue.
Their food is edible and cheap, but not very good. For good food, you need to
go downtown.

You need a wireless network card to access the network. You will be 
issued a login to the Chalmers NOMAD network. This will allow you to 
use access points all over Chalmers.  However, we can likely provide 
a wireless/ethernet bridge.  

Sweden uses the same kind of plugs as Germany. 230V AC.

Registration etc.pp. 
 

Please subscribe to the `PyPy sprint mailing list`_, introduce
yourself and post a note that you want to come.  Feel free
to ask any questions there! 

.. _`PyPy sprint mailing list`: 
http://codespeak.net/mailman/listinfo/pypy-sprint


-- 
Armin Rigo & the PyPy team

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

EuroPython 2006: Call for papers

2006-04-25 Thread Armin Rigo
Hi all,

A shameless plug and reminder for EuroPython 2006 (July 3-5):

* you can submit talk proposals until May 31st.

* there is a refereed papers track; deadline for abstracts: May 5th.
  See the full call for papers below.


A bientot,

Armin Rigo & Carl Friedrich Bolz




   EuroPython 2006
   CERN, Geneva, 3-5 July

   Refereed Track: Call for Paper

 http://www.europython.org


EuroPython is the only conference in the Python world that has a
properly prestigious peer-reviewed forum for presenting technical and
scientific papers. Such papers, with advanced and highly innovative
contents, can equally well stem from academic research or industrial
research. We think this is an important function for EuroPython, so we
are even making some grants available to help people with travel costs.

For this refereed track, we will be happy to consider papers in subject
areas including, but not necessarily limited to, the following:

* Python language and implementations
* Python modules (in the broadest sense)
* Python extensions
* Interoperation between Python and other languages / subsystems
* Scientific applications of Python
* Python in Education
* Benchmarking Python

We are looking for Python-related scientific and technical papers of
advanced, highly innovative content that present the results of original
research (be it of the academic or "industrial research" kind), with
proper attention to "state of the art" and previous relevant
literature/results (whether such relevant previous literature is itself
directly related to Python or not).

We do not intend to let the specific subject area block a paper's
acceptance, as long as the paper satisfies other requirements:
innovative, Python-related, reflecting original research, with proper
attention to previous literature.

Abstracts
=

Please submit abstracts of no more than 200 words to the refereeing
committee. You can send submissions no later than 5 May 2006. We shall
inform you whether your paper has been selected no later than 15 May
2006. For all details regarding the submission of abstracts, please see
the EuroPython website (http://www.europython.org).  Papers

If your abstract is accepted, you must submit your corresponding paper
before 17 June 2006. You should submit the paper as a PDF file, in A4
format, complete, "stand-alone", and readable on any standards-compliant
PDF reader (basically, the paper must include all fonts and figures it
uses, rather than using external pointers to them; by default, most
PDF-preparation programs typically produce such valid "stand-alone" PDF
documents).

Refereeing
==

The refereeing committee, selected by Armin Rigo, will examine all
abstracts and papers. The committee may consult external experts as it
deems fit. Referees may suggest or require certain changes and editing
in submissions, and make acceptance conditional on such changes being
performed. We expect all papers to reflect the abstract as approved and
reserve the right, at our discretion, to reject a paper, despite having
accepted the corresponding abstract, if the paper does not substantially
correspond to the approved abstract.

Presentation


The paper must be presented at EuroPython by one or more of the
authors. Presentation time will be either half an hour or an hour,
including time for questions and answers, depending on each paper's
details, and also on the total number of papers approved for
presentation.

Proceedings
===

We will publish the conference's proceedings in purely electronic
form. By presenting a paper, authors agree to give the EuroPython
conference non-exclusive rights to publish the paper in electronic forms
(including, but not limited to, partial and total publication on web
sites and/or such media as CDROM and DVD-ROM), and warrant that the
papers are not infringing on the rights of any third parties. Authors
retain all other intellectual property rights on their submitted
abstracts and papers excepting only this non-exclusive license.

Subsidised travel
=

We have funds available to subsidise travel costs for some presenters
who would otherwise not be able to attend EuroPython. When submitting
your abstract, please indicate if you would need such a subsidy as a
precondition of being able to come and present your paper. (Yes, this
possibility does exist even if you are coming from outside of
Europe. Papers from people in New Zealand who can only come if their
travel is subsidised, for example, would be just fine with us...).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: having a function called after the constructor/__init__ is done

2009-03-16 Thread Armin Moradi
class MyClass(object):
   def __init__(self, really_init=True):
   self.a = 3
   self.b = 4
   # other initialization
   if really_init: on_load()

   def on_load(self):
   print 'hello!'

class B(MyClass):
def __init__(self):
super(B, self).__init__(False)
self.c = 4
print "B initialized"
   MyClass.on_load()

def on_load(self):
print 'hello!'


Would this work?

(posted it again to include the python-list in To:)

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


PEP 372 -- Adding an ordered directory to collections

2008-06-16 Thread Armin Ronacher
at happens if an existing key is reassigned?

The key is not moved but assigned a new value in place.  This is
consistent with existing implementations and allows subclasses to
change the behavior easily::

class movingcollections.odict):
def __setitem__(self, key, value):
self.pop(key, None)
odict.__setitem__(self, key, value)

What happens if keys appear multiple times in the list passed to the
constructor?

The same as for regular dicts: The latter item overrides the
former.  This has the side-effect that the position of the first
key is used because the key is actually overwritten:

>>> odict([('a', 1), ('b', 2), ('a', 3)])
collections.odict([('a', 3), ('b', 2)])

This behavior is consistent with existing implementations in
Python, the PHP array and the hashmap in Ruby 1.9.

Why is there no ``odict.insert()``?

There are few situations where you really want to insert a key at
an specified index.  To avoid API complication, the proposed
solution for this situation is creating a list of items,
manipulating that and converting it back into an odict:

>>> d = odict([('a', 42), ('b', 23), ('c', 19)])
>>> l = d.items()
>>> l.insert(1, ('x', 0))
>>> odict(l)
collections.odict([('a', 42), ('x', 0), ('b', 23), ('c', 19)])


Example Implementation
==

A poorly performing example implementation of the odict written in
Python is available:

`odict.py <http://dev.pocoo.org/hg/sandbox/raw-file/tip/
odict.py>`_

The version for ``collections`` should be implemented in C and use a
linked list internally.

Other implementations of ordered dicts in various Python projects or
standalone libraries, that inspired the API proposed here, are:

- `odict in Babel`_
- `OrderedDict in Django`_
- `The odict module`_
- `ordereddict`_ (a C implementation of the odict module)
- `StableDict`_
- `Armin Rigo's OrderedDict`_


.. _odict in Babel: 
http://babel.edgewall.org/browser/trunk/babel/util.py?rev=374#L178
.. _OrderedDict in Django:
   
http://code.djangoproject.com/browser/django/trunk/django/utils/datastructures.py?rev=7140#L53
.. _The odict module: http://www.voidspace.org.uk/python/odict.html
.. _ordereddict: http://www.xs4all.nl/~anthon/Python/ordereddict/
.. _StableDict: http://pypi.python.org/pypi/StableDict/0.2
.. _Armin Rigo's OrderedDict: 
http://codespeak.net/svn/user/arigo/hack/pyfuse/OrderedDict.py


Future Directions
=

With the availability of an ordered dict in the standard library,
other libraries may take advantage of that.  For example, ElementTree
could return odicts in the future that retain the attribute ordering
of the source file.


Copyright
=

This document has been placed in the public domain.
--
http://mail.python.org/mailman/listinfo/python-list


Re: PEP 372 -- Adding an ordered directory to collections

2008-06-18 Thread Armin Ronacher
Martin v. Löwis  v.loewis.de> writes:

> 
> > I think I have lost the thread here, sorry. So I explain again what I
> > mean. I think for this data structure it's important to keep all the
> > normal dict operations at the same speed. If you use a C
> > implementation vaguely similar to my pure python recipe you can
> > perform the del in O(1) too, because pairs are joined in (double)
> > linked list. But such data structure is O(n) to find the n-th item
> > inserted into the sequence.
> 
> Right. So byindex(n) would be O(n) then, right? If so, what's the
> purpose of having that method in the first place?
What's the purpose of having list.insert?

> The PEP doesn't give a rationale, but just proposes that the method
> be there. My guess is that it includes it for performance reasons.
> However, I think the PEP (author) is misguided in assuming that
> making byindex() a method of odict, you get better performance than
> directly doing .items()[n] - which, as you say, you won't.
Without byindex the only way to cherry pick an item is either doing
something like

i = od.iteritems()
for idx in xrange(offset):
value = idx.next()
return value

Or

return od.items()[offset]

One creates tons of unnecessary method calls, the other creates a full
blown list object just to throw it away later.  Both less than optimal
solutions that can be implemented in a more efficient way on the C
layer where one only has to iterate over the linked list offset times
and return the item.  And iteration for that linked list is most likely
something like "for (n = 0; n != offset; ++n) iter = iter->next".

Regards,
Armin

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

Re: PEP 372 -- Adding an ordered directory to collections

2008-06-19 Thread Armin Ronacher
Small Status update of the changes incorporated in the PEP:

  - The PEP Title was fixed.  Of course it's a dictionary not a
directory :-)

  - A questions and answers section was added that covers some
of the questions raised here and on the original thread on
python-devel.

  - Comparison behavor was documented

  - a note on Python 3 support was added (about keys-views)


Regards,
Armin

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


Re: New python.org site

2006-03-12 Thread Armin Ronacher
I don't like the new python.org

But i have I (in my mind) nice idea.

Dedicate python.org to the language developers and python interna. And
create a nice small page on go-python.org dedicated to the users. It
should *only* feature a documentation with a comment box on the bottom
of each side, a download section and links to important python pages as
well as a nice designed moinmoin wiki.

Regards,
Armin

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


Try Python!

2006-03-29 Thread Armin Ronacher
Hiho,

One week ago I came across the nice `Try Ruby!`_ demonstration which
features an ajax based ruby console and a 20 minutes ruby tutorial.
I really liked that application and so I started to port that to
python.
Since I got a bit confused by the very complex javascript code I wrote
a
webconsole from scratch.

The result is a very basic python console which behaves like the CLI
one, except that it can't handle `raw_input` or any other method call
trying to access `sys.stdin`.

At the moment the application is multithreaded and evaluated
expressions
in a dict holding the sessions variables of the client connections.

Because of the behaviour the application breaks down easily and isn't
secure. This happens because I haven't finished it yet. Additionally
sessions don't have a timeout so you have to restart the server if it's
eating to much RAM.

If someone is interested in putting up that application on a public
server I can tell the application to spawn from inside XEN hosts and to
use forking instead of the multithreaded approach currently used.

The application is licensed under the GNU GPL, the sourcecode is
available via svn from::

http://trac.pocoo.org/repos/trypy

Since it requires Paste, PasteDeploy and the current colubrid checkout,
here the installation for copy/pasteing:

- easy_install Paste
- easy_install PasteDeploy
- svn co http://trac.pocoo.org/repos/trypy
- cd trypy
- svn co http://trac.pocoo.org/repos/colubrid/trunk/colubrid
- python trypy.py

The last command starts the application.

And here a screenshot of a running session:
http://trac.pocoo.org/wiki/TryPy

Regards,
Armin

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


Re: Try Python!

2006-03-29 Thread Armin Ronacher
BartlebyScrivener wrote:
> Armin,
>
> Mike Meyer already took a crack at this, and his starts right up just
> by clicking on the link.
>
> http://www.mired.org/home/mwm/try_python/
Hm. Looks not that useful since you can't create any functions and you
can remove the prompt :-)

> Yours looks prettier, but I don't think novices are going to be able to
> figure out how to start it.
They don't have to figure out if someone would install that on a public
host. But therefore the application has to run inside of a jail or a
XEN since python doesn't have a secure sandbox.

Regards,
Armin

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


Re: New Python website, new documentation ?

2006-03-30 Thread Armin Ronacher
I paste my idea (original posted in #pythonpaste a few days ago):

 Chairos: what I really miss is a "go-python.org" page :)
 which would be what?
 showing up python gui application, python wsgi
applications, a python documentation with a comment section, tutorials
and a wiki
 and everything compact
 and python.org for the companies and core developers

Something really basic. Only small tutorials, a documentation with
comments and a list of python applications. With a clean design and
only few links per page. Something like the rubyonrails page for
example.

Regards,
Armin

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


Re: Python's Performance

2005-10-10 Thread Harald Armin Massa
Fredrik,

but still some very valuable people write:

"""
What is Python?

Python is an interpreted, interactive, object-oriented programming
language. It is often compared to Tcl, Perl, Scheme or Java.
"""
taken from
http://www.python.org/doc/Summary.html

maybe someone could update that???

Harald

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


Re: Python vs Ruby

2005-10-21 Thread Harald Armin Massa
Casey,


> I have heard, but have not been able to verify that if a program is
> about
> 10,000 lines in C++
> it is about
> 5,000 lines in Java
> and it is about
> 3,000 lines in Python (Ruby to?)

BTW: it is normally only 50 lines in Perl. Not that you could read it,
though

Harald

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


migrate from ZODB 3.3.1 --- to where, and how?

2005-10-25 Thread Harald Armin Massa
Hello,

I am using ZODB "standalone" in version 3.3.1 within some application.

Now I learn that the 3.3.x branch of ZODB is "retired". No problem so
far, everything is running fine.


BUT... "retired" gives me the hint that nothing GREAT will be done to
this branch anymore :)

Now I am questioning myself: to which branch should I migrate? Is 3.5 a
sure bet, or are uneven subversions a bad sign, making retirement
likely?

As much as my diggings showed me, the "special sign" of 3.3 was
import ZODB
from persistent import Persistent
from persistent.list import PersistentList
from persistent.mapping import PersistentMapping

that PersistentList and PersistenMapping reside within
persistent., while in the 3.2 branch they reside somewhere
else in the namespace.

I learned it the hard way that 3.3 filestores not get converted
magically or easy to 3.2 :) ...

So, my questions:
 - where should I migrate to?
 - how is migration done best (especially taking care of "old"
filestores

Harald

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


Re: Announce: PythonD 2.4.2 r 1.0 for DJGPP/DOS/Windows

2005-11-18 Thread Harald Armin Massa
Claudio,

maybe it's because PythonD is running within DOS?

(which, for archaelogical completeness, is an ancient operating system)

Harald

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


Re: Application Plugin Framework

2005-11-22 Thread Harald Armin Massa
Ron,

> I'm attempting to develop a  plugin framework for an application that I'm
> working on.  I wish to develop something in which all plugins exist in a
> directory tree.

The PIL of the effbot is doing exactly this. (Python Image Library). I
know it,  because I had to work around that dynamic for freezing it
with py2exe :)

www.effbot.org, search for PIL

There you can find how this problem was solved by the effbot. Guess
that should be good enough for mortals.

Harald

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


Re: python speed

2005-11-30 Thread Harald Armin Massa
Dr. Armin Rigo has some mathematical proof, that High Level Languages
like esp. Python are able to be faster than low level code like
Fortran, C or assembly.

I am not wise enough to understand that proof.

Maybe I understood those papers totally wrong and he was saying
something totally different.

But whatever, the pypy-team is formed out of some more people of his
calibre and founded by the European Union to provide "butter by the
fish", say, to produce real code that may deliver that promise.

And I could see real development just from watching the BDFL: 3 years
ago PyPy was 2000times slower then CPython, and Guido was joking "and
that number is growing", this year there were not officially negated
romours that sometime maybe PyPy could be the reference implementation
of Python; and also reports that PyPy is only 18 times slower then
CPython.

For the time being, my Python programs just sit and wait for database,
network, user input or the acting of COM-Applications like Excel or
Winword. Sometimes I even have 3 threads, one to wait for user, one for
database and one to wait for Excel - boy, I wait fast!

But on the other hand, I do no real world applications like triple
mersenne first person shooters, only business software like the one
which in earlier time was written in COBOL or carved into cave walls.
Less challenge, higher reward.

Harald

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


Re: python speed

2005-11-30 Thread Harald Armin Massa
>Faster than assembly? LOL... :)

why not? Of course, a simple script like "copy 200 bytes from left to
right" can be handoptimized in assembler and run at optimum speed.
Maybe there is even a special processor command to do that.

I learned that there was one generation of CPUs which had effectively a
command to copy X bytes from left to right; but a specific version of
that CPU did this command slower then a loop in certain situations.
Some newer generations of that CPU and even some competitors CPU had
that command implented correctly, and it was indeed faster than the
loop.

Now: is it rather likely that for a single programm a programmer is
able to get it right for all CPUs?

It even gets more complicated. The human mind is able to consider a
certain amount of things at once, sth. like on-chip-cache or
short-term-memory.

Now with an ever growing complexity of processors, with cache lines,
partyparallelexecution, branchprediction, out of order execution,
multilevelcaching, hypermetathreading ... it may be that the usual
availaible human brain is no longer capable of really knowing what
happens.

My guess is that the average code speed of a Rigopy could indeed be
higher than the average code speed of the average assembler programmer.


Harald

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


Re: reddit.com rewritten in Python

2005-12-05 Thread Harald Armin Massa
Yeah! Another web framework for Python!

Now we can prouldy say: Python: the only language with more web
frameworks than keywords

Harald

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


Re: reddit.com rewritten in Python

2005-12-05 Thread Harald Armin Massa
Yeah! Another web framework for Python!

Now we can proudly say: Python: the only language with more web
frameworks than keywords

Harald

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


Re: Considering moving from Delphi to Python [Some questions]

2005-07-05 Thread Harald Armin Massa
> I want some feedback on folllwing:
> anybody who has experience in writing SOAP servers in Python and data
> entry heavy web applications.
> Any suggestions?
> darkcowherd
>
I have never written SOAP Servers. But I have very very good experience
in creating entry heavy web application using Python and Quixote;
Webserver Medusa.

The current entry forms have at maximum 700 distinct entries, of which
groups can be multiplied via XMLHTTPRequest and DOM-Modifikation
without page reloading.
Speed is great. Because of very slow rendering and various buggies
within IE (beast took longer to render then me to deliver) we switched
to Firefox.

System is performing adequately well and is being constantly extended;
Pythons clear structure makes that easy.

Hope that helps,

Harald

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


Re: How do you program in Python?

2005-07-05 Thread Harald Armin Massa
Peter,

> I do all my work using Scite
Me too!

> So, any time I need to test the changes, I hit four keys (which at this
> point is understandably more like a "chord" that I hit without direct
> awareness of it) and I'm done.  Sounds pretty close to old-style BASIC
> and since I've come that route too (in the distant past), this may not
> be a coincidence.

in addition I have set up scite and paths so that "F5", the scite run
command, invokes python , with output given in the scite
output area (and saving before)
in addition, ctrl+1 does a compile (checking for syntax errors)

and exceptions are printed out in the scite output, colourcoded and
with double-click on them scite opens the appropriate script at the
offending position.

VERY quick.

Harald

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


Re: PEP on path module for standard library

2005-07-22 Thread Harald Armin Massa
> When you try to 'freeze' an application module,
>and Jason's 'path' module is present in any of the directories that are
>looked at by freeze's module finder (your app doesn't have to import
>it), freeze goes into an infinite loop of imports, eventually getting a
>'maximum recursion depth' exception.  This seems to be related to
>freeze getting confused between 'os.path' and Jason's 'path'.

This is a bug in distutils. Thomas Hellers py2exe encounters the same
bug. As much as I remember our conversation, he submitted a patch to
distutils.

In the meanwhile I renamed path.py to jpath.py, usings Jason's first
letter in a motion of honour while circumventing this bug.

Harald

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


Re: PEP on path module for standard library

2005-07-22 Thread Harald Armin Massa
>Having path descend from str/unicode is extremely useful since I can
>then pass a path object to any function someone else wrote without
>having to worry about whether they were checking for basestring.
I use path.py from Jason to encapsulate a lot of the windows plattform
specialities of path dealing.
Being able to use path-opjects at every place where I would use str or
unicode is very essential, because I often use Python to tame Excel and
Word. To open files within these programms needs some "plain str" as
"PATH" for the file. (which, of course, can also be down by ways to
"convert" PATH to STRING.

Harald

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


Re: Dabo in 30 seconds?

2005-08-01 Thread Harald Armin Massa
Cliff (who has a love/hate relationship with Twisted) wrote:

> Twisted, for one, can't be used without knowing Python.  In fact,
> without knowing Python quite well.  For that matter, it can't easily be
> used .

Is "using" really a verb that is fitting for working with twisted? As
much as I read and tried to learn, it is not that you use twisted, but
you provide twisted with callbacks so that it uses you?

So it is more something about devotion or digestion then simply "use",
or?

Harald

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


multiple replaces

2005-09-16 Thread Harald Armin Massa
again, and again ... another try of templating

txt="""


whatever

the machine with bing

10% of boo is foo
"""

h1=txt.replace("%","%%")
h2=h1.replace("","%(tree)s")
h3=h2.replace("","%(house)s")

house="something awfull"
tree="something beautifull"
print h3 % locals()


--> the  approach allows it for me, that I can write
real HTML which looks fair. The replacing-chain takes care of % signs
within the file, and also makes a template for string replaces

BUT... it looks terribly inefficient to me. There are 3 strings which
are only there to be garbage collected. I am looking for a speedy way
of
"go through the text, and if you find sth. that is in REPLACEMENT,
replace it with it"

sth. like
rpdict={"":"%(tree)s","":"%(house)s","%","%%"}

for key, value in rpdict.iteritems():
h1=h1.replace(key, value)

but ... without the garbage, in one command.

I guess there are very, very, very wise solution for this problem, but
I do not know of them.

Who knows and tells me?

Harald

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


occupywallst.org is looking for Python programmers

2011-11-12 Thread Harald Armin Massa
just got this from Richard:

Justine  told me they are looking for Python
programmers.  (It involves Django also.)

so, if anyone is interested to help them out, please contact Justine.

Best wishes

Harald

-- 
Harald Armin Massa
no fx, no carrier pigeon
-
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Guido at Google

2005-12-21 Thread Harald Armin Massa
> It seems that our master Guido van Rossum had an offer from google and
> he accepted it!!

Isn't Guido-Sans official title BDFL? *wink*

whatever, if it's true, congratulations and best wishes. Now there is
one *bot and the BDFL at google, we have still 3 bots in the wild, do
we?

Suggesting to name a Rigobot 


Harald

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


Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2005-12-27 Thread Harald Armin Massa
Guido at Google: a message in THE public forum c.l.p.

A confirmation by Martellibot, that Guido is IN FACT sitting 15m
distant from him; and everybody in Python knows where Martellibot has
his desk.

Can it get more official than this?

yeah:
a confirmation by Greg Stein @ Google within slashdot, that Guido is
working at Google.

I am sure that more people in the Python community are reading c.l.p.
and /. than the washington post, the people affected have been
informed.

I guess that's as formal and official as it can get.

And concerning Guido, Python, community and leadership:

Guido is the designer, the creator of Python. He has nearly unlimeted
trust in his design decisions: we all know, that he is THE gifted
language designer. His proclamations are accepted because he has proven
over time that he knows what's best for the language.

Allow me to quote Greg Stein:
"Ha! Guido would quit in a heartbeat if you tried to make him manage
people. That just isn't where he's at. He's absolutely brilliant and
loves to write excellent code. Great. We're gonna let him do just that
:-)"

So, Google with their geek-version of the Playboy-Mansion, free massage
parleurs, free lunch and dinner and best recruitment tactics on the
planet and the known universe will not be able to make Guido manage
people.

Somehow the Python community managed itself through the years... Python
grew healthy and steadily; forked less then usual, inspired other
languages and got faster and faster and faster.

Maybe only mediocre and less ideas need a great leader. Maybe a great
idea can lead for itself?

Harald

--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607

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


Re: Python vs. Lisp -- please explain

2006-02-19 Thread Harald Armin Massa
>>OK, but then we should change ,
>>which starts with "Python is an interpreted, interactive,
>>object-oriented programming language."

I second this motion. Even tried to persuade the site maintainer
before. We should really, really change it. The perceived speed of
Python will at least triple on dropping that "interpreted" - and I am
NOT joking.

Harald

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


Re: How many web framework for python ?

2006-02-19 Thread Harald Armin Massa
Bruno,

>In fact, there are actually too much *good* python web frameworks.

I tended to share that opinion, just because there are more web
frameworks then keywords in Python. But we should stop thinking of this
as a bug; it is a feature.

Because everyone and his girlfriend creates an own web framework for
Python, we have a clear security advantage over other languages. One
"ruby on rails" worm will bring down at least 2000 web 2.0 beta sites.
A worm for a Python web framework will be incompatible with all others.

Harald

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


cx_Oracle and UTF8

2006-02-22 Thread Harald Armin Massa
Hello,

I am looking for a method to convince cx_Oracle and oracle to encode
it's replies in UTF8.

For the moment I have to...

cn=cx_Oracle.connect("user","password", "database")
cs=cn.Cursor()

cs.execute("select column1, column2, column3 from table")

for row in cs.fetchall():
   t=[]
   for i in range(0,len(row)):
  if hasattr(row[i],"encode"):
t.append(row[i].encode("utf8"))
  else:
t.append(row[i])
print t

Guess I am to much accustomed to postgresql which just allows "set
client_encoding='utf8'...

Harald

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


Re: cx_Oracle and UTF8

2006-02-23 Thread Harald Armin Massa
Dietz,

thank you for your answer.

> It's called NLS (national language support),
>and it is like a locale-setting in python/C. I'm too lazy to google right

Sad thing: I allready googled that and had to learn: you CAN definitely
change some parameters, that is sort order and language for error
messages with
alter session set NLSREGION  and set NLSLANGUAGE

The only part about the charset is with NLSLANG, which could be set to
German_Germany.UTF8

BUT ... NLSLANG is no per-session parameter, not setable per alter
session, it needs to get set within the environment to make SQLPLUS
recognize it.  (and, I do of course use python not sqlplus=

In another of the WWW I learned that NLSLANG has to be set on per
connection basis; not on per cursor / session basis; so my primary
suspect is cx_Oracle.Connection ... but those objects to not have a
visible method with any "encoding" in it.

Harald

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


Re: cx_Oracle and UTF8

2006-02-27 Thread Harald Armin Massa
Gerhard,

thanks, that

import os
os.environ["NLS_LANG"] = "German_Germany.UTF8"
import cx_Oracle
con = cx_Oracle.connect("me/[EMAIL PROTECTED]")

really helped. At least now the query returns something encoded
differently. I dared not to believe that there is no "direct encoding
change api" without touching the environment.

Now all that is left is to find out if Oracle indeed has the same
opinion what UTF8 should be like.

Thank you very much,

Harald

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


Re: lines of code per functional point

2006-05-09 Thread Harald Armin Massa
Bryan,

at the end of the paper there is a reference to:

http://page.mi.fu-berlin.de/~prechelt/documents/jccpp_tr.pdf

In chapter 5.6 on page 19 of this publication you can find Figure 10,
Displaying program length in comparison.

I read the graphics (looking at the yellow boxes) that most of the
python programs are quite as small as the smallest 60% of perl
programs; where "small" ist LOC.

All progs in that study should have dealt with the same problem, so
FP(perl)=FP(Python), and you should be correct with LOC/FP(Python) <=
LOC/FP(perl)

Please also see that they were evaluating Python 1.5.2, which missed
some very "density improving features" as there are esp. list
comprehenstions.

Harald

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


Europython 2006 call for proposals

2006-05-18 Thread Harald Armin Massa
Hello,

I am writing this supporting the Python in Business Track.

We are looking for talks proposals concerning the usage of Python in
doing business. So, if you have a story to tell...

Maybe you have written a webcrawler in Python and founded a search
engine? Or you are using Python to organize all those
HTTPS-certificates, selling your company and flying to space, all with
programming Python?

Or are you up to more challenging aspects of daily life, like using
Python to organize the ticket sales for a cinema-chain? Or even to do
Point-Of-Sale stuff with some retailers? Or you have done something
else interesting with Python in your Business?

Please, come to EuroPython 2006 and tell others how you got prosperous
programming in Python! (Just to remind you: Switzerland is one of the
most well known places to take care of your money matters)

Did Python give you inspiration to make Javascript suck less? Did you
write a famous Python book, got hired by a company and live happily
ever after?

Cone to CERN, Switzerland, from 3. to 5. July 2006 - tell your story!

Learn about Web 2.5 and up at the place Web 0.1-1.0 were developed! Be
at the place famous for creating the antimatter to blow up Vatican!
Have food in THE cafeteria with the highest likelyhood to queue
together with a future or past Nobel Prize winner.

Go to www.europython.org - and don't miss the talk submission deadline
on 2006-05-31

[on a special note to Italians who are only allowed to travel to
conferences with the possibility of recruitment: there will be some
highly qualified PyPys at the conference; and just have a look at the
timescale of PyPy founding by the European Union]

Harald

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


Re: Cheese Shop: some history for the new-comers

2006-03-16 Thread Harald Armin Massa
Tim,

> For most people 'developers' would mean people developing *with* python,
> not developing python.

one of the richest people on earth did define what developers are:

http://www.ntk.net/ballmer/mirrors.html

people developing with something. So, unless we get /F or BDFL to do an
even more astonishing dance proclaiming that people developing Python
are developers, not people developing WITH Python, I guess you are
quite right.

Harald

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