ssh or other python editor

2005-10-04 Thread martijn
H!

I'm using a windows machine.
And a FreeBSD server where I run my python scripts.

I'm working/making my python scripts in a windows OS with putty now.
But I really want the python text colors and tab spacing like the
python windows IDE but the problem is that I can't find a good program.

Thanks

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


Re: ssh or other python editor

2005-10-04 Thread martijn
>So you're using Putty to telenet/ssh into the FreeBSD server, but what
>editor on you using on the FreeBSD server?

I use pico for that.
That Samba isn't available but I can install it.

Or are there other editors for FreeBSD that I can run with putty ?

I'm going googling arround again,
Thanks.

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


Re: ssh or other python editor

2005-10-04 Thread martijn
googling arround give me a full list of python editors and other stuff
http://wiki.python.org/moin/PythonEditors

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


Re: ssh or other python editor

2005-10-04 Thread martijn
- I'm a newbie at freeBSD so I think there is , but I don't know where.
And i'm using putty on a windows OS what don't understand the syntax
coloring.

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


A faster shutil.rmtree or maybe a command.

2005-10-11 Thread martijn
H!

Sometimes I must delete 2 very big directory's.
The directory's have a very large tree with much small file's in it.

So I use shutil.rmtree()
But its to slow.

Is there a faster method ?

I use FreeBsd 5.4.

---
is it maybe faster to walking in the directy en delete each file?

Thanks,
GC-Martijn

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


Re: A faster shutil.rmtree or maybe a command.

2005-10-11 Thread martijn
A little.

I think its yust to big to handle it.
I'm going to ask it in a freebsd forum, maybe they know how to speed
up.

Thanks.

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


newbie question: convert a list to one string

2005-08-25 Thread martijn
H!

I'm searching for the fastest way to convert a list to one big string.

For example:
test = ['test','test2','test3']

print unlist(test)
> test test2 test3 (string)


I know I can make a loop like below but is that the fastest/best option
?

def unlist(test):
output=''
for v in test:
output = output+" "+v
return output


Thanks for helping,
GC-Martijn

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


Re: newbie question: convert a list to one string

2005-08-25 Thread martijn
Thanks that's what i need.

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


fileinput.input - newbie question

2005-09-02 Thread martijn
I'm testing some writing/reading with a file and i'm not sure if it is
possible to print/use the line with fileinput.input inplace=1 (see
below)


import fileinput
thefile = fileinput.input('bla.txt',inplace=1,backup='.bak')
for line in thefile:
if line != "1\n":
print line,

#is it possible to 'use' / print the 'line' on the screen here?

thefile.close()

When its not possible then I use 2 file's filein.txt,fileout.txt

Thanks,
GC-Martijn

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


Re: fileinput.input - newbie question

2005-09-02 Thread martijn
That works fine ;)

Thanks for the fast help.

GC-Martijn

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


check if a webpage is forwarding to a other webpage

2005-09-06 Thread martijn
H!

I'm busy with testing python and now i'm trying to check if a url makes
a forward to a other location with the same content.

So it will be possible to scan unique website's.
I already made these checks:

the html forward:


the header:
Content-Location: othersite.com

the url - check:
if '-':
check if 'sitename.com' has not the same content as site-name.com


the problem:
There are still website's forwarding to a other location with the same
content but they overrule the 3 checks above.

Thanks very Much,
GC-Martijn

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


Re: Removing duplicates from a list

2005-09-14 Thread martijn
I do this:

def unique(keys):
unique = []
for i in keys:
if i not in unique:unique.append(i)
return unique

I don't know what is faster at the moment.

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


Re: Removing duplicates from a list

2005-09-15 Thread martijn
Look at the code below

def unique(s):
return list(set(s))

def unique2(keys):
unique = []
for i in keys:
if i not in unique:unique.append(i)
return unique

tmp = [0,1,2,4,2,2,3,4,1,3,2]
print tmp
print unique(tmp)
print unique2(tmp)
--
[0, 1, 2, 4, 2, 2, 3, 4, 1, 3, 2]
[0, 1, 2, 3, 4]
[0, 1, 2, 4, 3]

As you can see the end result is not the same.
I must get the end result [0, 1, 2, 4, 3] and not [0, 1, 2, 3, 4].
Thats why I use unique2()

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


Re: Removing duplicates from a list

2005-09-15 Thread martijn
Ow thanks , i'm I newbie and I did this test. (don't know if this is
the best way to do a small speed test)

import timeit

def unique2(keys):
unique = []
for i in keys:
if i not in unique:unique.append(i)
return unique

def unique3(s):
e = {}
ret = []
for x in s:
if not e.has_key(x):
e[x] = 1
ret.append(x)
return ret

tmp = [0,1,2,4,2,2,3,4,1,3,2]
s = """\
try:
str.__nonzero__
except AttributeError:
pass
"""
t = timeit.Timer(stmt=s)
print "%.2f usec/pass" % (100 * t.timeit(number=10)/10)
print tmp
print "%.2f usec/pass" % (100 * t.timeit(number=10)/10)
print unique2(tmp)
print "%.2f usec/pass" % (100 * t.timeit(number=10)/10)
print unique3(tmp)
print "%.2f usec/pass" % (100 * t.timeit(number=10)/10)
-
5.80 usec/pass
[0, 1, 2, 4, 2, 2, 3, 4, 1, 3, 2]
7.51 usec/pass
[0, 1, 2, 4, 3]
6.93 usec/pass
[0, 1, 2, 4, 3]
6.45 usec/pass <--- your code unique2(s):

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


Re: Removing duplicates from a list

2005-09-16 Thread martijn
Thanks for all the information.
And now I understand the timeit module ;)

GC-Martijn

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


Python - what is the fastest database ?

2005-02-28 Thread martijn
H!,

I'm testing things with Python with databases.
But I have one big question.

What is the 'fastest' database for the internet in combination with
Python ?

- with +/- 15 GB data.
- fast internet SELECT query's.

Python use bsddb but could he handle 15 GB fast ?

A other question is:
How is it possible that google (super big database) is super fast?
What type database do they use / software ?

Thanks Very Much,
GC-Martijn

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


bsddb for k, v in db.items(): do order the numbers ?

2005-02-28 Thread martijn
WHen I use the code below and printing all the results i get this:
--
0 1 10
11 2 3
4 5 6
7 8 9
--
But I want
--
0 1 2
3 4 5
6 7 8
9 10 11
--

Thanks for helping

import bsddb

def addRow(key,val):
db[key] = key
print key,

db = bsddb.btopen('test3.db','n')

#maar 3 kolomen
for i in range(4):
addRow('%d'%(i*2+0+i),'test%d'%(i*2+0+i))
addRow('%d'%(i*2+1+i),'test%d'%(i*2+1+i))
addRow('%d'%(i*2+2+i),'test%d'%(i*2+2+i))

#-
print 'kolom1','kolom2','kolom3'

p=0
for k, v in db.items():
if p == 0:
p = p+1
print v,
elif p == 1:
p = p+1
print v,
elif p == 2:
p=0
print v,
print

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


Re: bsddb for k, v in db.items(): do order the numbers ?

2005-03-01 Thread martijn
oyea, I must convert it to numbers ;)

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


why is http://pysqlite.org down ?

2005-03-02 Thread martijn
H!

I'm trying things with databases and Python 2.4 for windows2000.
And now I want to try pysqlite.

but http://pysqlite.org/ is down
and http://pysqlite.sourceforge.net/ redirect to pysqlite.org

does someone know if this is the latest version
http://sourceforge.net/projects/pysqlite/ pysqlite 2.0

thanks

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


file.getvalue() with _ or other characters

2005-03-03 Thread martijn
H!

I do this to get a htmlTOtext file

class mvbHTMLParser(htmllib.HTMLParser):

def __init__(self, formatter, verbose=0):
htmllib.HTMLParser.__init__(self,formatter,verbose)
self.imglist = []

def handle_image(self,src,alt,*args):
self.imglist.append(src)


file = StringIO.StringIO()
f = formatter.AbstractFormatter(formatter.DumbWriter(file))
p = mvbHTMLParser(f)
p.feed(html)
p.close()

print file.getvalue()

But then the _ characters are away.
is it possible to keep that character in file.getvalue()

[the p.anchorlist = oke : test_bla.html]

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


Re: file.getvalue() with _ or other characters

2005-03-03 Thread martijn
mmm I'm a newbie with python.

I did this but don't work:

class mvbHTMLParser(htmllib.HTMLParser):

def __init__(self, formatter, verbose=0):
htmllib.HTMLParser.__init__(self,formatter,verbose)
self.imglist = []

def handle_image(self,src,alt,*args):
self.imglist.append(src)

class PreservingStringIO(StringIO.StringIO):
 def close(self):
 pass

file = PreservingStringIO()
f = formatter.AbstractFormatter(formatter.DumbWriter(file))
p = mvbHTMLParser(f)
p.feed(html)
p.close() 

print file.getvalue()


 i will try some things

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


Re: file.getvalue() with _ or other characters

2005-03-04 Thread martijn
srry I needed some sleep.
it works oke.

But if you want to answer a question.

I use this code:
--
import StringIO
import re
import urllib2,htmllib, formatter

class mvbHTMLParser(htmllib.HTMLParser):
def __init__(self, formatter, verbose=0):
htmllib.HTMLParser.__init__(self,formatter,verbose)

def getContent(url):
try:
line = urllib2.urlopen(url)
htmlToText(line.read().lower())
except IOError,(strerror):
print strerror

def htmlToText(html):
file = StringIO.StringIO()
f = formatter.AbstractFormatter(formatter.DumbWriter(file))
p = mvbHTMLParser(f)
p.feed(html)
p.close()

print file.getvalue()

getContent('http://www.zquare.nl/test.html')
--
then the output is:
text_text
a_link[1]

that's oke but how to delete [n]
like this? : del = re.compile(r'[0-9]',).sub

Thanks for the fast helping,
GC-Martijn

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


Re: bsddb for k, v in db.items(): do order the numbers ?

2005-03-07 Thread martijn
uhm i'm trying to make a very simple but large database:

Let's say I want these fields : |name|age|country|

Then I can't do this because I use the same key

db["name"] = 'piet'
db["age"] = '20'
db["country"] = 'nl'
#same keys so it wil overwrite
db["name"] = 'jan'
db["age"] = '40'
db["country"] = 'eng'

But how does other people use bsddb then ?
- with a hidden |int like below ?

db["name|0"] = 'jan'
db["age|1"] = '40'
db["country|2"] = 'eng'

- do a little math to
first is name
sec is age
third is country

db["0"] = 'jan'
db["1"] = '40'
db["2"] = 'eng'

pointer=0
for k, v in db.items():
  if pointer =3:
poiner = 0
#next 3 fields

--
I like bsddb because of the speed and it can handle big files,
but what is the normal way of using it ?

Thanks for helping

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


possible solution for bsddb > get data results on the internet.

2005-03-15 Thread martijn
H!

I have a big bsddb database created with python and that works fast.
I know that I can use the python_apache module to show the data results
online.

//--- python_apache module




//---

but my question is:
Is there a faster/easy way to get the records online using a bsddb
database ?
with php script maybe ?

Or must I use python and apache to get the fastest resonse...

Thanks for helping/info
GC-Martijn

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


newbie - threading

2005-03-29 Thread martijn
H!,

I have made a spider and now I want to use threading so it will be
faster faster and faster :)

But I don't understand threading.
So I try this but I get a error in windows 2000.
---
class connector(threading.Thread):
def __init__(self,url):
self.url = url
threading.Thread.__init__(self)
def run(self):
print self.url #and do the things

.
.
.
while result:

thread = connector('http://'+result[0])
thread.start()
threadlist.append(thread)
time.sleep(1)

for thread in threadlist:
thread.join()

---

The first 5 url's are oke but then I get a windows 2000 error.
What to do ?

GC-Martijn

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


Re: newbie - threading

2005-03-30 Thread martijn
Thanks MyHaz,

Now its oke :) thanks for that example

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


Spider - path conflict [../test.htm,www.nic.nl/index.html]

2005-04-01 Thread martijn
H!

I thought I was ready with my own spider...
But then there was a bug, or in other words a missing part in my code.

I forget that people do this in website html:
http://www.nic.nl/monkey.html";>is oke
error
error

So now i'm trying to fix my spider but it fails and it fails.
I tryed something like this.


import urlparse
import string

def fixPath(urlpath,deep):
path=''
test = urlpath.split('/',deep)
for this in test:
if this<>'' and this.count('.')==0:
path=path+'/'+this
return path

def fixUrl2(src,url):
url = urlparse.urlparse('http://'+url)
src = urlparse.urlparse('http://'+src)

if url[2]:
thepath = fixPath(url[2],url[2].count('/')-(src[2].count('/')))

if src[1] == '..':
if url[1]<>'':
theurl = url[1]+''+thepath+''+src[2].replace('../','')

print theurl

fixUrl2('../monkey2.html','www.nic.nl/test/info/monkey1.html')
fixUrl2('../../monkey2.html','www.nic.nl/test/info/monkey1.html')
fixUrl2('../monkey2.html','www.nic.nl/info/monkey1.html')


info:
fixUrl2('a new link found','in this page')

I hope someone knows a professional working code for this,
Thanks a lot,
GC-Martijn

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


Re: Spider - path conflict [../test.htm,www.nic.nl/index.html]

2005-04-01 Thread martijn
urllib.basejoin() that's what I need :)

 haha what a stupid code did I made.

Thanks
 GC-Martijn

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


Get the entire file in a variable - error

2005-04-14 Thread martijn
H!

I'm using a database and now I want to compress a file and put it into
the database.

So I'm using gzip because php can open the gzip file's.
The only problem is saving the file into the database.

The function below does this:
- gzip the file [oke]
- get all the bytes with tst.getvalue() [error]
I only get the first line.

I have the same problem when I try it with file.open(), .read().

"how to get all the binary data in a variable to put that in a database
LONG field?"

Thank's

def compressFILE(sid,filedata):
tst = StringIO.StringIO()

#tmp
zip = gzip.GzipFile(str(sid)+'.gz','w',5,tst)
zip.write(filedata)

#put every byte in a database
print tst.getvalue()

zip.close()
tst.close()

return

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


Re: Supercomputer and encryption and compression @ rate of 96%

2005-04-14 Thread martijn
And how do you get the data back ?

1+0=0 == 0+0=0
0+1=1 == 1+1=1

let's say you have the end key : 0
then you want to decompress it , but in what ? 0 0 or 1 0

;)

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


Re: Get the entire file in a variable - error

2005-04-14 Thread martijn
I mean it like this.

I must have a variable that includes a file (in this case a .gz file)
for putting that in a database. (never null)

Thanks,

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


only a simple xml reader value

2006-02-08 Thread martijn
H!,

Is it possible to get a value value ?

When I do this:
-
theXML = """
The Fascist Menace
"""
import xml.dom.minidom as dom
doc = dom.parseString(theXML)
print doc.getElementsByTagName('title')[0].toxml()

I get : The Fascist Menace thats oke for me
-

But the xmlfile I must read have other tags:
theXML = """
The Fascist Menace
bla la etc
"""

how to get that values ?
I try things like:
print doc.getElementsByTagName('title:id')[0].toxml() <--error

Thanks,
GC-Martijn

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


Re: only a simple xml reader value

2006-02-08 Thread martijn
I'm newbie with that xml stuff.

The only thing I must read is the response I get from a EPP server.
A response like this:


http://www.eurid.eu/xml/epp/epp-1.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:contact="http://www.eurid.eu/xml/epp/contact-1.0";
xmlns:domain="http://www.eurid.eu/xml/epp/domain-1.0";
xmlns:eurid="http://www.eurid.eu/xml/epp/eurid-1.0";
xmlns:nsgroup="http://www.eurid.eu/xml/epp/nsgroup-1.0";
xsi:schemaLocation="http://www.eurid.eu/xml/epp/epp-1.0 epp-1.0.xsd
http://www.eurid.eu/xml/epp/contact-1.0 contact-1.0.xsd
http://www.eurid.eu/xml/epp/domain-1.0 domain-1.0.xsd
http://www.eurid.eu/xml/epp/eurid-1.0 eurid-1.0.xsd
http://www.eurid.eu/xml/epp/nsgroup-1.0 nsgroup-1.0.xsd">


Command completed successfully; ending session



c-and-a.eu
 c-and-a_1
25651602
2005-11-08T14:51:08.929Z





OK




clientref-12310026
eurid-1589




//
//Command completed successfully; ending session

what is the official/best way to handle/parse such xml response ?

Thats maybe a better question

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


include "apythonscript.py"

2005-05-09 Thread martijn
H!

I'm trying to find a python function to use like this:

-- maincode.py

Include "apythonscript_function.py"

-- end

So I can split the maincode.py file in smalle pieces.
Or yust save the function's in other file and include them once.
I really want to use this because else { the maincode.py will be super
super large. }

Thanks,
GC-Martijn

- if you don't understand what I mean: http://www.php.net/include

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


Re: include "apythonscript.py"

2005-05-09 Thread martijn
Ah damn , that's the way.

And what if you have a very big class and want to include some class
functions ?

class ThisIsAClass:
def __init__(self):

 Here I want to import a class def

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


still get a using a python script in the crontab

2007-09-19 Thread martijn
H!

I have made a program that is checking if a program is running or not.
If the program is not running then it must start the program again.

in the /etc/crontab:
* *   *   *   *   root/usr/sbin/
program_prgchk

in the /usr/sbin/program_prgchk:
/usr/local/bin/python /home/reseller/domeinaanvraag/program_prgchk.py


in the program_prgchk.py:

import string
import os
import commands

def checkifrunning():
line = string.strip(commands.getoutput("ps x -o pid,command | grep
program_reseller.py | grep -v 'grep'"))
pid = string.split(line,' ')[0]
if pid<>'':pid = int(pid)
return pid

if checkifrunning()=='':
os.system('/usr/sbin/program_reseller')
#os.wait()
#os.waitpid(checkifrunning(),0)

os._exit(0)


If I run the command /usr/sbin/program_prgchk everything works (no
 process)
But when I use it in the crontab I get a  process

Thanks for helping,
GC-Martijn

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


Re: still get a using a python script in the crontab

2007-09-19 Thread martijn
On 19 sep, 16:50, Zentrader <[EMAIL PROTECTED]> wrote:
> > If I run the command /usr/sbin/program_prgchk everything works (no
> >  process)
> > But when I use it in the crontab I get a  process
>
> The crontabs file on my system is stored in /var/spool/cron/
> crontabs/.  It appears you are checking the wrong file.  Try a
> "crontab -e" from the command line and compare it to the contents in
> the /etc/crontab file.

The crontab is working because I can see that he started the
os.system('/usr/sbin/program_reseller') AND a  process (what
I can only kill by killing the '/usr/sbin/program_reseller'

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


Re: Why do Perl programmers make more money than Python programmers

2013-05-07 Thread Martijn Lievaart
On Sun, 05 May 2013 17:07:41 -0400, Roy Smith wrote:

> There *are* programming languages worse than PHP.  Have you ever tried
> britescript?

Have you tried MUMPS? :-)

M4


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


Free seminar on domain-specific modeling

2005-09-19 Thread Martijn Iseger
Domain-specific modeling makes software development 5-10 times faster than 
approaches based on UML or MDA. 
It accelerates development and reduces complexity by automatically generating 
full code from higher-abstraction design models.
Learn from speakers Juha-Pekka Tolvanen, Jack Greenfield, Steven Kelly and 
Krzysztof Czarnecki about DSM and how to implement it.

Time:   Friday, October 21, 2005. 8:00am - 12:00noon. Right after OOPSLA.
Place:  Town & Country Resort & Convention Center, San Diego.

More info and registration: http://www.metacase.com/DSMseminar 


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


Re: Free seminar on domain-specific modeling

2005-09-20 Thread Martijn Iseger

> Martijn Iseger wrote:
> 
>> Domain-specific modeling makes software development 5-10 times faster
>> than approaches based on UML or MDA. It accelerates development and
>> reduces complexity by automatically generating full code from
>> higher-abstraction design models.
>> 
> Wow, look everyone!  A silver bullet!
> 
Before slashing down in ignorance - educate yourself on www.dsmforum.org. 
After that: feel free to comment. I will make you look a lot more intelligent 
Peter Hansen.


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


Re: Free seminar on domain-specific modeling

2005-09-21 Thread Martijn Iseger
> if you don't understand the "silver bullet" reference, you're not
> qualified to use phrases like "makes software development 5-10 times
> faster".

You could reverse that as well: http://www.dsmforum.org 


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


Re: Free seminar on domain-specific modeling

2005-09-21 Thread Martijn Iseger
Hello Steve,

> 1. Any organisation that can talk about "a leap in productivity of
> 400% from Assembler to BASIC" as though nothing occurred in between
> suffers such a total disconnect from computing history that it's hard
> to take other utterances seriously.

I believe the point being made by the organization is that during computing 
history the most successful shifts in productivity were achieved by similar 
shifts in raising the abstraction level on which developers specify solutions. 
According to Capers Jones Software Productivity research Fortran is 4.5 times 
more productive than Assembler. Looking at chronology I'd say it is not 
incorrect 
to refer to the advent of compilers as a leap.

> 2. "The last OOPSLA ... put forward Domain-Specific Modeling as a
> solution. Similar statements have been uttered recently by Bill Gates
> and Grady Booch, among others." The fact that a technique is promoted
> at a conference doesn't mean the book about it came down from a
> mountain carried by a prophet. 

Absolutely. Fact is that both (prophets?) as well as a growing number of 
experts (other prophets?) see this approach as a viable one, hence the 
increased 
interest at a growing number of events.

> 3. "Domain-Specific Modeling is only possible because it narrows down
> the design space or domain" presumably means that component-based
> approaches are more successful when the components are created with
> the problem domain in mind. What a surprise.

Nope, it means that instead of using generic languages (programming or 
modeling) 
to specify solutions on top of your platform/component framework, in many 
cases it makes more sense to use a language that better fits your problem 
domain.
Using components is one way of raising abstraction from the "bottom up" and 
narrowing your design space. Why stop there?
Depending on how the language has been created, a good DSM language is on 
a higher abstraction level than for example C, Java, Python etc. Still, from 
model instances you can generate all the lower level code (which in turn 
interfaces with your component framework). Wouldn't you agree this makes 
development faster and more mature?

> You might also like to look up "flowchart" in your dictionary ;-)
Maybe I will!

Regards,

Martijn


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


Re: Free seminar on domain-specific modeling

2005-09-21 Thread Martijn Iseger
Hello Michael,


> The alternate point is that during computing history, many, many, many
> promises were made for many, many, many, technologies based on the
> same principle of raising the abstraction level. Many, many, many of
> those technologies promised much and failed to deliver on their claims
> when used beyond the people inventing/using those technologies.

True, DSM however is not so much a new method for develping software. It's 
been used since the early 1990ies as far as I know and seen many sccessful 
implementations of it in varying sectors of industry: From mobile phones 
(Nokia uses it to develop the software running in all their phones) to IP 
switching platforms (Lucent), CRM systems, pacemakers, home automation systems, 
J2EE-based B2B portals (insurance industry), car infotainment systems (Audi 
A6), messaging systems (USAF), enterprise apps on smartphones (Nokia series60), 
Tooling industry and many more. Success with DSM depends on several factors 
like a common platform used for developing applications or variants of 
applications 
and the presence of domain-expertise: That leaves out one-time projects.

> One thing is relatively clear - your approach appears to include a
> graphical approach to systems building. Personally I suspect that the
> fact people are able to engage other parts of their brain when
> building these systems beyond linguistic is the real reason you see
> benefits, rather than actually the specific thing that led to the
> visual approach being possible.

It is actually based on the graphical approach. The important thing I see 
here is that specific instances of this approach are defined by a company's 
expert developer instead of by a standards-body or a vendor, this puts the 
expert in the driver-seat so to say, he/she gets the ability to formalize 
(changing) development practices in his/her problem domain for the rest of 
the (less experienced) developers to follow automatically. Instead of adopting 
a one-size-fits-all approach companies/developers get to tailor the approach 
to the specific needs of their unique problem domain. It does not eliminate 
coding but attempts to minimize the need for it and leave it to the people 
who are really good at it.

> (On a sad note it looks like you're reinvented how hardware is
> designed and made, but not made the intuitive leap :-/ )

I suppose you mean software here? It seems I fail to make the "leap" towards 
understanding what you mean with this, feel free to elaborate.

Regards,

Martijn


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


Re: [EVALUATION] - E01: The Java Failure - May Python Helps?

2005-02-07 Thread Martijn Faassen
Alex Martelli wrote:
Fredrik Lundh <[EMAIL PROTECTED]> wrote:

Markus Wankus wrote:

Google his name - he has been banned from Netbeans and Eclipse (and
Hibernate, and others...) for good reason.  Can you imagine how much of
a Troll you need to be to *actually* get "banned" from the newsgroups of
open source projects such as those?
have Pythoneers ever "banned" anyone from a public forum?  it's not like
we haven't seen trolls and crackpots before, you know.

I don't see how banning is technically possible in unmoderated groups.
Shunning, or pelting the troll with abuse whenever he shows up, etc,
etc, sure.  But, banning?
The PSU can do it, by modifying the time stream. This is done by simply 
readjusting the basic parameter of the
--
http://mail.python.org/mailman/listinfo/python-list


Re: ElementTree and XPATH

2004-12-11 Thread Martijn Faassen
Istvan Albert wrote:
[EMAIL PROTECTED] wrote:
it seems to be invalid syntax if I give "/a/b[0]" to the findall()
method. Does anyone know the correct syntax?

I think the proper mindset going in should be that
elementtree does not support xpath but that
there are some handy constructs that resemble
the location steps of xpath.
The lxml Pythonic wrapper of libxml2 which aims (among others) to build 
an elementtree API compatible interface will indeed extend that API and 
offer XPath support. Of course it's all not done yet. :)

http://codespeak.net/mailman/listinfo/lxml-dev
http://codespeak.net/svn/lxml/trunk/
Regards,
Martijn
--
http://mail.python.org/mailman/listinfo/python-list


Re: from vb6 to Python

2004-12-11 Thread Martijn Faassen
Gerhard Häring wrote:
MarcoL wrote:
I am a VB6 programmer and I would like to learn a new high level 
language (instead of restarting from scratch with .NET), wich is 
opensource and cross-platform, in order to develop cross-platform 
business applications
Good for you! And Python is a good choice. :)
I think Python is the most suitable language for the scope.
My question are:
- Which version of python is more suitable for creating cross-platform 
GUI's? I've herard of PyGTK, wxPython, PyQT, tk, Anygui..
It's a matter of taste. I like wxPython best. It would probably be 
different if PyQT was also open-source on win32.
Note that these are not really 'versions of Python'. These are different 
Python bindings or libraries (that you import as modules and packages in 
the normal way) that offer GUI facilities.

For cross-platform GUIs wxPython seems to be popular, though I've never 
used it myself.

[snip snip]

- Is it possible, from Python, to work with sqlite? And with MsAccess?
Yes.
pysqlite (http://pysqlite.org/), and pyado, if by MsAccess you mean 
using the JET engine via ADO.
Python can basically work with virtually any database; there are 
bindings for many. You can also access MsAccess through ODBC, though 
it's been a few years since I did that.

See the database topic guide:
http://www.python.org/topics/database/
And this is a list of database bindings:
http://www.python.org/topics/database/modules.html
Regards,
Martijn
--
http://mail.python.org/mailman/listinfo/python-list


Re: lies about OOP

2004-12-14 Thread Martijn Faassen
[EMAIL PROTECTED] wrote:
A paper finding that OOP can lead to more buggy software is at
http://www.leshatton.org/IEEE_Soft_98a.html
[snip description of paper that compares C++ versus Pascal or C]
What papers have scientific evidence for OOP?
That's of course a good question. I'm sure also that comp.object has 
argued about this a thousand times. I'll just note that one paper is 
just a single data point with specific circumstances. The OO languages 
under investigation might have caused increased or lower failure rates 
for other reasons than their (lack of) object-orientedness, for 
instance. It is of course possible to come up with a lot of other 
explanations for a single data point besides a conclusion that OOP can 
lead to more buggy software. It for instance certainly not surprising to 
me that C++ can lead to more buggy software than some other languages. :)

[snip]
If OOP is so beneficial for large projects, why are the Linux kernel,
the interpreters for Perl and Python, and most compilers I know written
in C rather than C++?
Because C++ is not an ideal object oriented language? Because a Linux 
kernel has very stringent predictability requirements for what kind of 
machine code is generated that C meets and is much harder to do with 
C++? There are other reasons to choose C, such as portability, obiquity 
and performance.

Some of the same reasons probably apply to Perl and Python, though at a 
lesser degrees. I do not know a lot about Perl's implementation. I do 
know that Guido van Rossum has in fact considered rewriting Python in 
C++ in the past. And right now, there are various projects that are 
using object oriented languages to reimplement Python, including Python 
itself.

Finally, it is certainly possible to program in object oriented style in 
C. It is more cumbersome than in a language that supports it natively, 
but it is certainly possible. Such OO in C patterns occur throughout the 
Linux kernel, which needs a pluggability architecture for its various 
types of drivers. It can also be seen in many aspects of Python's 
implementation. Another example of a C-based system that uses object 
oriented technologies is the GTK+ widget set.

Anyway, this question is using a few data points to make an overly 
generic argument, and the data points themselves do not really support 
the argument so very well either.

Regards,
Martijn
--
http://mail.python.org/mailman/listinfo/python-list


Re: lies about OOP

2004-12-15 Thread Martijn Faassen
Paul McGuire wrote:
"Martijn Faassen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Paul McGuire wrote:
[snip]
I would characterize the 80's as the transitional decade from structured
programming (which really started to hit its stride when Djikstra
published
"Use of GOTO Considered Harmful") to OOP, and that OOP wasn't really
"joyful" until the early-to-mid 90's.
IMMEDIATE NOTICE TO ALL PYTHON SECRET UNDERGROUND MEMBERS.
Classified. Any disclosure to non-PSU members prohibited. Offenders will
be apprehended and removed from the time stream, permanently.
 


Yikes!  (or better, "Jikes!" or even "Yijkes!"?) - my bad.
And he was on faculty at UT right here in Austin, too.
It's a very common mistake I've seen so often that for a while I 
wondered whether his name really *was* Djikstra, but I knew he was Dutch 
and that it couldn't be so. That the PSU picked you for its disclosure 
is just a random coincidence, I'm sure.. :)

Regards,
Martijn
--
http://mail.python.org/mailman/listinfo/python-list


Re: lies about OOP

2004-12-15 Thread Martijn Faassen
Peter Hansen wrote:
Martijn Faassen wrote:
Paul McGuire wrote:
"Martijn Faassen" <[EMAIL PROTECTED]> wrote in message

Yikes!  (or better, "Jikes!" or even "Yijkes!"?) - my bad.
And he was on faculty at UT right here in Austin, too.
It's a very common mistake I've seen so often that for a while I 
wondered whether his name really *was* Djikstra, but I knew he was 
Dutch and that it couldn't be so. That the PSU picked you for its 
disclosure is just a random coincidence, I'm sure.. :)
Well, in any case, thanks for setting the record straight, Martjin.
That of course also happens to me once every while. I can take care of 
myself though -- Dijkstra however needs an advocate for the correct 
spelling of his name in this earthly realm.

Imagine, for instance, what if he wants to egosurf, google for his own 
name and finds nothing because everybody was saying Djikstra all the 
time? That'd be terrible! What, they don't have google in the eternal 
realm? How can it be valhalla without google? Impossible.

Regards,
Martijn
--
http://mail.python.org/mailman/listinfo/python-list


Re: NO REALLY

2004-12-15 Thread Martijn Faassen
Jive wrote:
Isn't there a comp.lang.flame or something?
I've doublechecked, but I didn't see any significant flaming in this 
article (and I'm generally not very tolerant of it). My PSU posting was 
certainly not intended as a flame, in case that was misinterpreted.

What'd I miss?
Regards,
Martijn
--
http://mail.python.org/mailman/listinfo/python-list


Re: lies about OOP

2004-12-16 Thread Martijn Faassen
Peter Hansen wrote:
Martijn Faassen wrote:
Peter Hansen wrote:
Well, in any case, thanks for setting the record straight, Martjin.
That of course also happens to me once every while. I can take care of 
myself though -- Dijkstra however needs an advocate for the correct 
spelling of his name in this earthly realm.

Then there's us Danes, with "sen" instead of "son" (as many people
think it ought to be).  And I can't even claim the wrong form
sounds noticably different, making any defense seem petty.
Obviously -sen is the only real suffix, as it's -sen in Dutch as well, 
as in Faas-sen. :)

(Darn those Norwegians, influencing people's ideas of how a
name like Hansen ought to be spelled, grumble, grumble.
If they'd just invent a cell phone that used Python, as the
Swedish have, they might deserve all that extra attention.)
;-)
That's not the Swedes, it's the Finnish that did that. They typically 
don't like being mistaken for Swedes. :)

Regards,
Martijn
--
http://mail.python.org/mailman/listinfo/python-list


Re: libxml2/xpath

2004-12-16 Thread Martijn Faassen
Maxim Khesin wrote:
I am trying to do some xpath on
http://fluidobjects.com/doc.xhtml
but cannot get past 'point A' (that is, I am totally stuck):

import libxml2
mydoc = libxml2.parseDoc(text)
mydoc.xpathEval('/html')
[]

this returns an empty resultlist, which just seems plain wrong. Can anyone
throw a suggestion to the stupid?
Is the html element in a namespace?
Regards,
Martijn
--
http://mail.python.org/mailman/listinfo/python-list


Re: NO REALLY

2004-12-16 Thread Martijn Faassen
Peter Hansen wrote:
Brian van den Broek wrote:
Peter Hansen said unto the world upon 2004-12-15 17:39:
I could easily see this thread descending into a flame war in,
oh, about another ten posts.  That would be so freaky...

Without a doubt that is the most ignorant and small-minded thought 
that ever has been, and ever could be, committed to words!
 
And you, sir, must be, like, one of those Nazi type people,
like that guy, uh, what was his name? er.. Godwood, Goodwin, something
like that, anyway.  (Hey, Jive, you happy yet?)
Object oriented programming SUX! And Python too!
It's slow and no scientific research exists in its favor! Also it 
doesn't work. Why would I need polymorphism? Lisp had all of this 50 
years ago anyway. But functional programming by the way SUX TOO! So does 
procedural programming! And structured programming SUX, GOTO all the way!

Oh, and Vi SUX, Emacs all the way. Emacs Lisp SUX though. Java is the 
only true object oriented language, so Python is not truly object 
oriented and it's slow anyway. The future will be to .NET. Oh and XML 
sucks! Python developers are above XML! And why doesn't Python have a 
web framework like Ruby on Rails? Python has way too many web 
frameworks, that SUX! And oh by the way, Ruby SUX!

Perl is way superior to Python as it outperforms it and it's more 
readable. Indentation SUX! Depending on it is Barbaric, which is like 
Cobol, which by the way, ROCKS!

The decorator syntax SUX! Why didn't they just use the ternary operator 
syntax for it?? Oh, and Python really went downhill since version 1.5.2!

Python will not be a mature language if it doesn't add UNSIGNED INT, 
SIGNED LONG and FLOAT to the language as basic data types. Oh, and any 
language that doesn't have True Macros SUX.

Guido von Rossam is ITALIAN! And he SUX! I SUX TOO BUT I WILL NEVER 
ADMIT TO IT EVER IN THIS WHOLE DISCUSSION, I will answer ANY argument 
indicating that my arguments are fallacious and my behavior unreasonable 
with the TRUTH, which is that you SUX.

Hah!
Martijn
--
http://mail.python.org/mailman/listinfo/python-list


Re: from vb6 to Python

2004-12-11 Thread Martijn Faassen
Luis M. Gonzalez wrote:
MarcoL wrote:
Hello,
I am a VB6 programmer and I would like to learn a new high level
language (instead of restarting from scratch with .NET...

I'd like to add that by going with Python, you'll also be able to
develop for .NET. Check this out: www.ironpython.com .
Since the development of Ironpython is now being funded by Microsoft,
you'll get the best of both worlds: An already excellent
cross-platform, object oriented language and a fully compliant .NET
language for Windows and Linux (through Mono and DotGnu).
Unfortunately this is currently not near production use, and whether 
Microsoft is funding IronPython development is up in the air:

One IronPython fan noted a disconcerting silence in IronPython development:
http://usefulinc.com/edd/blog/contents/2004/12/09-jvm/read
Of course it'll all resolve itself one way or another eventually, just 
wanted to correct the impression that IronPython is ready to go already.

Regards,
Martijn
--
http://mail.python.org/mailman/listinfo/python-list


Re: from vb6 to Python

2004-12-14 Thread Martijn Faassen
Luis M. Gonzalez wrote:
Martijn Faassen wrote:
Unfortunately this is currently not near production use, and whether
Microsoft is funding IronPython development is up in the air:
 
It's true that he Ironpython's mailing list is a little bit innactive,
but this is just because there's only one person in charge of
Ironpython at this moment (although Microsoft was looking to hire a new
developer to help on this).
A new developer is interesting news and makes it more likely the future 
funding status is assured.

However, the innactivity is due to the fact
that Jim Hugunin, its developer, has begun working for MS just a couple
of months ago, and as he says, there are tons of new CLR features to
learn that are applicable to dynamic languages.
I realize that, and I'm sure that impacts things. That doesn't change 
the fact that IronPython as it stands now isn't done, and there isn't a 
clear idea of what will happen. Talk about "open source doesn't have a 
clear roadmap"; that seems to be true at least if Microsoft is doing the 
open source. ;)

You should also give credit to Jim: he's the man who developed Jython,
which is a complete inplementation of Python written in Java.
He also created Numeric and co-authored Aspect, another programming
language.
I know who Jim is, and he deserves plenty of credit. I'm just passing 
along the concerns of a major IronPython fan, who doesn't know what's up 
himself and wants to fork the code. That's at the very least not a sign 
of good community management. :)

So I'm sure that Ironpython will be a reality soon, and a very good
one...
I was pointing out that IronPython is *not* a reality right now, which 
is the impression that was being given to a newbie before. I wanted to 
counter an impression that might cause newbies to struggle with 
IronPython only to find out it's not ready yet. Whether IronPython will 
be mature soon is open for debate.

Regards,
Martijn
--
http://mail.python.org/mailman/listinfo/python-list


Re: lies about OOP

2004-12-14 Thread Martijn Faassen
Paul McGuire wrote:
[snip]
I would characterize the 80's as the transitional decade from structured
programming (which really started to hit its stride when Djikstra published
"Use of GOTO Considered Harmful") to OOP, and that OOP wasn't really
"joyful" until the early-to-mid 90's.
IMMEDIATE NOTICE TO ALL PYTHON SECRET UNDERGROUND MEMBERS.
Classified. Any disclosure to non-PSU members prohibited. Offenders will 
be apprehended and removed from the time stream, permanently.

Words in human languages typically consist of a combination of vowels 
and consonants, at least up until the start of the posthumanist 
revolution in 3714, when the Morning Light Confederation's ships reached 
the ablethik-seganichek world of Kaupang again (on Hellenberg consensus 
time streams with catalog marker AB-7). Alphabetic scripts are a typical 
way to represent them. Even in the posthuman phase on Kaupang they were 
widely appreciated as a quaint representation.

The language English, an indo-european tongue of the west-germanic 
persuasion (expressiveness rating 7, comprehensiveness rating 12, fits 
in the moderate Y group of the Lespan pan-species language 
classification system), is widely in use throughout a surprisingly long 
period on many time streams. This language does not have overly long 
consonant combinations.

The language Dutch, though closely related to the language English has a 
slightly different sound to glyph mapping system. Dutch is, of course, 
the true language of the Python Secret Underground and the official 
native language of Python users. In the language Dutch, a certain vowel 
sound is expressed as a combination of the glyphs 'i' and 'j'. The glyph 
'j' however is exclusively used for consonants in the English language, 
unlike in Dutch, where 'j' serves a dual role.

Human brains used to the English language cannot cope with glyph 
representations that express consonants in too long a sequence, without 
any space left for vowels. A combination like 'jkstr' in the English 
language is inevitably considered to be a spelling error, and corrective 
procedures automatically attempt to correct the spelling of such a word 
to a more acceptable combination.

This happens frequently to the name 'Dijkstra', a name that originated 
in the Dutch natural language. The English eye cannot accept such a 
ridiculous combination of consonants (j k s t *and* r?), and desperately 
 tries to resolve the situation. As a result, the glyphs 'i' and 'j' 
are frequently reversed.

This is extremely unfortunate, as Djikstra is well known to be a primary 
moniker for the leader of the Insulationist faction within the Gheban 
coalition. The Insulationist faction is, of course, a prominent member 
the alliance that produced the Alien Whitespace Eating Nanovirus. 
Djikstra is therefore an enemy of the Python programming language. All 
that we stand for. All our hopes. All our dreams will come to naught if 
Djikstra gets his way.

The moniker Djikstra is to be avoided in public utterances. PSU members 
can give themselves away and draw unwanted attention from the 
Insulationist overlord at this critical junction. What's worse, 
innocents might be caught up in this cosmic web of intrigue. While most 
innocents can of course be safely ignored, any innocent of temporal 
tension rating 17 and above (revised scale) should not be exposed to 
undue danger, as they may be essential for our time stream manipulations.

It is therefore important to avoid the utterance of Djikstra's name at 
all costs!

ADDENDUM FOR PSU MEMBERS OF CLASSES NE-100 AND HIGHER
The relation between Djikstra and Dijkstra's name is of course not a 
coincidence. As was already evidenced in the famous "Considered Harmful" 
article, the great philosopher Dijkstra was on to a monumental cosmic 
secret: that reality is bound by a term rewriti
--
http://mail.python.org/mailman/listinfo/python-list


informal #python2.8 channel on freenode

2014-01-06 Thread Martijn Faassen

Fellow Pythoneers,

I've started an informal channel "#python2.8" on freenode. It's to 
discuss the potential for a Python 2.8 version -- to see whether there 
is interest in it, what it could contain, how it could facilitate 
porting to Python 3, who would work on it, etc. If you are interested in 
constructive discussion about a Python 2.8, please join.


I realize that if there is actual code created, and if it's not under 
the umbrella of the PSF, it couldn't be called "Python 2.8" due to 
trademark reasons. But that's premature - let's have some discussions 
first to see whether anything can happen.


Hope to see you there for some discussion!

Regards,

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


Re: the Gravity of Python 2

2014-01-07 Thread Martijn Faassen

On 01/07/2014 01:19 AM, Chris Angelico wrote:


Can we get a run-down of everything that actually must be broken in
2.7 -> 3.3, that can't be backported via __future__, so we can start
cherry-picking which bits to break in 2.8? The biggest one is going to
be Unicode strings, for a large number of people (the print statement
and division operators can be __future__'d, lots of other stuff got
backported into 2.7). I'd be prepared to bet money that that one will
NOT be broken in 2.8, meaning that it achieves nothing on that score.
So how much easier will the migration actually be?


That's a good question. I envision support for per-module upgrades, 
though I'm not 100% sure that it would work. This way a large project 
can incrementally start porting modules to the Python 3 unicode behavior.


The 'future' module (python-future.org) effectively backports the Python 
3 str and bytes into Python 2.7. The question is then what happens when 
they interact with Python 2 str and unicode.


I'm speculating about the behavior of the 'future' module here, but 
here's what I could imagine.


First the Python 3 behavior:

py3str + py3str = py3str

py3bytes + py3bytes = py3bytes

py3str + py3bytes = error

Then the behavior of when Python 3 str/bytes are mixed with Python 2 str 
and unicode:


py3str + py2unicode = py2unicode

py3str + py2str = py2unicode

py3bytes + py2str = py2str

Plus the regular old Python 2 behavior.

I'm quite sure I could be getting something wrong; it's only a few days 
since I saw 'future' and started thinking along these lines.


Regards,

Martijn

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


Re: the Gravity of Python 2

2014-01-07 Thread Martijn Faassen

Hi there,

I just tried this out with the future module to see what it actually 
does, and I got this:


On 01/07/2014 01:54 PM, Martijn Faassen wrote:


First the Python 3 behavior:

py3str + py3str = py3str


Yup, of course.


py3bytes + py3bytes = py3bytes


Again of course.


py3str + py3bytes = error


Yup, that's an error.


Then the behavior of when Python 3 str/bytes are mixed with Python 2 str
and unicode:

py3str + py2unicode = py2unicode


This didn't work as I expected; I'd have expected py2unicode for 
compatibility reasons, as py3str cannot be combined with py2str (but in 
fact it *can*, odd).



py3str + py2str = py2unicode


This in fact returns py3str, which I didn't expect either.


py3bytes + py2str = py2str


And this gets me py3bytes.

I'll get in touch with the author of the 'future' module to try to 
understand why his reasoning is different from mine, i.e. where I'm wrong.


Regards,

Martijn


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


Re: the Gravity of Python 2

2014-01-07 Thread Martijn Faassen

Hi,

I've posted a documentation issue to the 'future' module which includes 
a further evolution of my thinking. As I expected, the author of the 
'future' module has thought this through more than I had:


https://github.com/PythonCharmers/python-future/issues/27

To get back to a hypothetical Python 2.8, it could implement this kind 
of behavior, and I think it would help support incremental upgrades. As 
long as you're using Py 3 bytes and str in your code, you'll be aware of 
errors and be forced to think about it. Other Python code in the system 
can remain unchanged, and to the magic of ducktyping will continue to 
work. You can then tackle things incrementally.


Regards,

Martijn

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


Re: the Gravity of Python 2

2014-01-08 Thread Martijn Faassen

Hi there,

On 01/07/2014 06:00 PM, Chris Angelico wrote:

I'm still not sure how Python 2.8 needs to differ from 2.7. Maybe the
touted upgrade path is simply a Python 2.7 installer plus a few handy
libraries/modules that will now be preinstalled? These modules look
great (I can't say, as I don't have a huge Py2 codebase to judge based
on), and they presumably work on the existing Pythons.


Well, in the original article I argue that it may be risky for the 
Python community to leave the large 2.7 projects behind because they 
tend to be the ones that pay us in the end.


I also argue that for those projects to move anywhere, they need a 
clear, blessed, official, as simple as possible, incremental upgrade 
path. That's why I argue for a Python 2.8.


Pointing out the 'future' module is existence proof that further 
incremental steps could be taken on top of what Python 2.7 already does.


I may be that these points are wrong or should be weighed differently. 
It's possible that:


* the risk of losing existing big 2.x projects is low, they'll port 
anyway, the money will keep flowing into our community, they won't look 
at other languages, etc.


* these big 2.x projects are going to all find the 'future' module 
themselves and use it as incremental upgrade path, so there's no need 
for a new blessed Python 2.x.


* the approach of the 'future' module turns out to be fatally flawed 
and/or doesn't really help with incremental upgrades after all.


But that's how I reason about it, and how I weigh things. I think the 
current strategy is risky.


Regards,

Martijn

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


Re: the Gravity of Python 2

2014-01-08 Thread Martijn Faassen

On 01/08/2014 01:46 PM, Chris Angelico wrote:

On Wed, Jan 8, 2014 at 11:36 PM, Martijn Faassen  wrote:

Well, in the original article I argue that it may be risky for the Python
community to leave the large 2.7 projects behind because they tend to be the
ones that pay us in the end.

I also argue that for those projects to move anywhere, they need a clear,
blessed, official, as simple as possible, incremental upgrade path. That's
why I argue for a Python 2.8.

Pointing out the 'future' module is existence proof that further incremental
steps could be taken on top of what Python 2.7 already does.


Yep, but suppose it were simply that the future module is blessed as
the official, simple, incremental upgrade path. That doesn't violate
PEP 404, it allows the future module to continue to be expanded
without worrying about the PSF's schedules (more stuff might be added
to it in response to Python 3.5, but this is all in the hands of
future's maintainer), and it should be relatively simple to produce an
installer that goes and grabs it.


That would be better than nothing, but would break the: "upgrade path 
should be totally obvious" guideline. Also the core developers are 
generally not in the habit of blessing external projects except by 
taking them into the stdlib, so that'd be a first.



As Mark Rosewater is fond of saying, restrictions breed creativity.
Can the porting community take the PEP 404 restriction and be creative
within it? I suspect it'll go a long way.


How many actively maintained applications on Python 2.7 are being 
ported? Do we know? If not many, is this a problem? As problems also 
breed creativity.


Regards,

Martijn

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


Re: the Gravity of Python 2

2014-01-08 Thread Martijn Faassen

Hey,

I'm pointing out possible improvements that Python 2.8 could offer that 
would help incremental porting efforts of applications. I'm pointing 
about that helping application developers move forward incrementally may 
be a worthwhile consideration. Like, there's money there.


You can point out that 2.6 and 2.7 were already such releases, and I 
will then point out that many people *have* upgraded their applications 
to these releases. Is there now going to be a giant leap forward to 
Python 3 by these projects, or is the jump still too far? Opinions differ.


On 01/08/2014 02:01 PM, Steven D'Aprano wrote:

Adding 2.8 doesn't help. It just gives people another excuse to delay
migrating. Then, in another two or three years, they'll demand 2.9, and put
it off again. Then they'll insist that 15 years wasn't long enough to
migrate their code, and demand 2.10.


I can play this kind of rhetorical game too, including demands and such 
fun. Who is demanding who does what?


It's not really a surprise that people expect there to be a compatible 
release of a programming language. We'll have to see whether the demand 
for it is strong enough to tear out community apart, or whether all will 
be right in the end.



What's not fine though is people holding the rest of us back with their
negativity and FUD that Python 3 is a mistake.


That's not what I believe I've been doing. Though if people do this, is 
the Python community really so fragile it can't deal with a little bit 
of pushback?


What's not fine is that people who think all is well tell the people who 
disagree to shut up. Maybe we should introduce the concept of "check 
your Python 3 privilege".


Regards,

Martijn

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


Re: the Gravity of Python 2

2014-01-08 Thread Martijn Faassen

Hey,

On 01/08/2014 03:30 PM, Mark Lawrence wrote:


But to be serious why not stick with 2.x if there's no compelling reason
to move?  Whatever happened to "if it ain't broke, don't fix it"?


That's fine for static applications that don't have to change.

Successful applications tend to grow new features over the years. It's 
not fun to do so if new capabilities are growing out of reach in Python 
3 land.


It's possible if enough features exist in Python 3 land bosses of 
successful applications will fund a port, with all the risks of 
introducing bugs that this entails. But a smoother upgrade path would 
help those applications more. And as I pointed out before, these 
applications are where a lot of money and development resources are 
coming from in our community.


Of course it's possible my assessment of the importance of these 
applications, their development resources, and the bump a Python 3 port 
presents for them, is off.


Regards,

Martijn


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


pickle error by multiprocessing

2015-02-14 Thread Martijn Millecamp
hey
for a schoolproject we had to build a robot and control this robot with a gui 
to follow a pathWe use multiprocessingand in our group 2 people can run the 
codebut if i run the code, i got a pickle errorI have a windows 7 and use 
python 2.7 just like the othersWe asked our prof, but he doesn't know what I 
can do :sI have already reinstalled python and all the packages Can i do 
something else?

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


closing stdin, stdout and stderr

2005-12-26 Thread Martijn Brouwer
I am writing a unix daemon in python, so I want to close stdin, stdout
and stderr.
My first attempt was to the standard file descriptors using their
close() methods. After closing stdout, I could not print anymore, so
this seemed to work. However, later I noticed that they were not really
closed. When I close them using os.close(), it did work.
What is the difference between these two methods and what is the reason
behind it? It took me a day to find out why I could not log out after
starting the daemon.

Martijn



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


Re: closing stdin, stdout and stderr

2005-12-26 Thread Martijn Brouwer
On Mon, 2005-12-26 at 23:13 +, Robin Becker wrote:
> Martijn Brouwer wrote:
> > I am writing a unix daemon in python, so I want to close stdin, stdout
> > and stderr.
> > My first attempt was to the standard file descriptors using their
> > close() methods. After closing stdout, I could not print anymore, so
> > this seemed to work. However, later I noticed that they were not really
> > closed. When I close them using os.close(), it did work.
> > What is the difference between these two methods and what is the reason
> > behind it? It took me a day to find out why I could not log out after
> > starting the daemon.
> > 
> > Martijn
> > 
> > 
> > 
> I've had excellent results with variants of the cookbook entry at
> 
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731
> 

I read this one, which was the reason that I tried os.close instead of
sys.stdXXX.close(). But I would like to know why it does not close a
file discriptor is I call its close method().


Martijn

-- 
Martijn Brouwer <[EMAIL PROTECTED]>

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


Re: closing stdin, stdout and stderr

2005-12-26 Thread Martijn Brouwer
On Mon, 2005-12-26 at 23:15 +, Robin Becker wrote:
> Robin Becker wrote:
> > Martijn Brouwer wrote:
> > 
> >> I am writing a unix daemon in python, so I want to close stdin, stdout
> >> and stderr.
> >> My first attempt was to the standard file descriptors using their
> >> close() methods. After closing stdout, I could not print anymore, so
> >> this seemed to work. However, later I noticed that they were not really
> >> closed. When I close them using os.close(), it did work.
> >> What is the difference between these two methods and what is the reason
> >> behind it? It took me a day to find out why I could not log out after
> >> starting the daemon.
> >>
> >> Martijn
> >>
> >>
> >>
> > I've had excellent results with variants of the cookbook entry at
> > 
> > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731
> > 
> but perhaps you're using a non unix OS, which will make that recipe wrong.

Well, I am writing a unix daemon ;)

Martijn


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


Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-04 Thread Martijn Pieters
Dan Christensen wrote:
Any hints for level 13?  I know how to make a call, but don't know "who"
to call.
I haven't figured this one out yet either. Rather frustrating really.
All the hints I've been given so far is to rmember the solution for
level 12.
Banging-my-head-against-it-didn't-help-either-ly yours,
Martijn Pieters


signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-04 Thread Martijn Pieters
Michael Spencer wrote:
Same here.  BTW I was unable to open one of the objects created in level 12.  It
didn't stop me guessing the answer based on the others, but now I wonder whether
I might need the missing piece for level 13.  Anyone else encounter this?
Nope, that piece is just a truncated version that opens fine otherwise
in Firefox which then gives you the piece that you correctly guessed at;
no hints there.
Martijn Pieters


signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-04 Thread Martijn Pieters
Roel Schroeven wrote:
You don't really need the remember the solution; it's more the process
that led you to find the solution.
Yup, I do remember the process, and it hasn't been any help so far.. no
adjustable URLs leading to interesting files, no 'dealable' images, no nada.
Martijn Pieters


signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-04 Thread Martijn Pieters
Martijn Pieters wrote:
I haven't figured this one out yet either. Rather frustrating really.
All the hints I've been given so far is to remember the solution for
level 12.
A, that was devious! I found it finally, how evil that was! I really
fell for it too, until I paid more attention to that error message. Got
it finally. *woot*
Martijn Pieters


signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-04 Thread Martijn Pieters
Roel Schroeven wrote:
Unless Martijn Pieters here and mjpieters in the Python Challenge forum
are two differen persons, you've found it in the meantime, haven't you?
Yup, I found it. How evil and devious. I found the hint without
Googling, BTW, but can see how Google would have led you to the
solution. I for one, will never again believe the claim there is no more
evils..
Martijn Pieters


signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-05 Thread Martijn Pieters
[SNIP me whining then cheering about level 13]
Dan Bishop wrote:
You mean there's a hint in that XML-RPC fault?
No, there is a hint in level 12. Remember how you could manipulate the
URL of the image of level 12 to get to the data file for that level. Now
continue that manipulation and don't believe the suggestion about no
more evils. *Then* pay close attention to what you find. If you get a
'Not Found' you either didn't pay attention in the previous step and
have passed over the hint, or you searched in the wrong direction.
Martijn Pieters


signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: If you use PayPal you might consider an alternative

2005-05-05 Thread Martijn Pieters
Tim Roberts wrote:
That web zite iz juzt too cutezy.  I could never truzt it, even if I hadn't
learned about it through a newzgroup zpam.
And a quick Google shows you to be very right:
http://www.greenzapscam.com/
http://wwsn-forums.com/forum/index.php?showtopic=3496%3Ehttp://wwsn-forums.com/forum/index.php?showtopic=3496
Martijn Pieters


signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-05 Thread Martijn Pieters
Michael Spencer wrote:
Dan Bishop wrote:
> You mean there's a hint in that XML-RPC fault?
No - the hint is associated with another error message
Assuming a web browser (firefox in my case) is being used. ;) I got no
error message when I retrieved that URL with urllib and examined the
result..
Martijn Pieters


signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-05 Thread Martijn Pieters
willitfw wrote:
any help on level 4 would be appreciated.  i've looked at the hints,
but isn't obvious
It isn't meant to be too obvious.. If you're expecting obvious
solutions, you won't like the rest of the challenge. ;)
What have you tried? Have you studied the source of the page, tried the
link, seen what you get back from that link and then adjusted the URL
according to what you got back? From there on out, just follow the
chain, the linked list.
Martijn Pieters


signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree Namespace Prefixes

2005-06-17 Thread Martijn Faassen
Jarek Zgoda wrote:
[snip]
>> It's a shame the default ns behavior in Elementtree is in such a poort 
>> staten. I'm surprised no one's forked Elementtree solely to fix this 
>> issue.
> 
> There is at least one ElementTree API implementation that retains 
> prefixes, lxml.ETree. Go google for it.

Just to make it explicitly clear, lxml is not a fork of ElementTree 
fork, but a reimplementation of the API on top of libxml2.

ElementTree indeed retains prefixes, and since version 0.7 released 
earlier this way, it's also possible to get some control over generation 
of prefixes during element construction.

You can find it here:

http://codespeak.net/lxml

Regards,

Martijn

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


Re: The Modernization of Emacs: exists already

2007-07-23 Thread Martijn Lievaart
On Wed, 18 Jul 2007 06:17:00 -0700, Xah Lee wrote:

> About a month ago, i posted a message about modernization of emacs. I
> enlisted several items that i think emacs should adapt.

And you are posting this to compl.lang.perl because.??

F'up set.

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


if statement, with function inside it: if (t = Test()) == True:

2009-04-24 Thread GC-Martijn
Hello,

I'm trying to do a if statement with a function inside it.
I want to use that variable inside that if loop , without defining it.

def Test():
return 'Vla'

I searching something like this:

if (t = Test()) == 'Vla':
print t # Vla

or

if (t = Test()):
print t # Vla

--
The long way
t = Test()
if (t == 'Vla':
print t # must contain Vla


Greetings,
GCMartijn
--
http://mail.python.org/mailman/listinfo/python-list


Re: if statement, with function inside it: if (t = Test()) == True:

2009-04-24 Thread GC-Martijn
On 24 apr, 12:11, Steven D'Aprano  wrote:
> On Fri, 24 Apr 2009 03:00:26 -0700, GC-Martijn wrote:
> > Hello,
>
> > I'm trying to do a if statement with a function inside it. I want to use
> > that variable inside that if loop , without defining it.
>
> > def Test():
> >     return 'Vla'
>
> > I searching something like this:
>
> > if (t = Test()) == 'Vla':
> >     print t # Vla
>
> > or
>
> > if (t = Test()):
> >     print t # Vla
>
> Fortunately, there is no way of doing that with Python. This is one
> source of hard-to-debug bugs that Python doesn't have.
>
> > -- The long way
> > t = Test()
> > if (t == 'Vla':
> >     print t # must contain Vla
>
> What's wrong with that?
>
> --
> Steven- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

Nothing is wrong with it , but it cost more lines (= more scrolling)
When possible I want to keep my code small.
--
http://mail.python.org/mailman/listinfo/python-list


Re: if statement, with function inside it: if (t = Test()) == True:

2009-04-24 Thread GC-Martijn
On 24 apr, 12:15, Chris Rebert  wrote:
> On Fri, Apr 24, 2009 at 3:00 AM, GC-Martijn  wrote:
> > Hello,
>
> > I'm trying to do a if statement with a function inside it.
> > I want to use that variable inside that if loop , without defining it.
>
> > def Test():
> >    return 'Vla'
>
> > I searching something like this:
>
> > if (t = Test()) == 'Vla':
> >    print t # Vla
>
> > or
>
> > if (t = Test()):
> >    print t # Vla
>
> > --
> > The long way
> > t = Test()
> > if (t == 'Vla':
> >    print t # must contain Vla
>
> Disregarding some ugly hacks, Python does not permit assignment in
> expressions, so what you're asking for is not possible.
> For the goods of readability, prevention of errors, and simplicity,
> Python forces you to do it the "long way" (the Right Way(tm) if you
> ask most Python partisans).
>
> If you could explain your situation and the context of your question
> in greater detail, someone might be able to suggest an alternate
> structure for your code which obviates your desire for such a
> construct.
>
> Cheers,
> Chris
> --
> I have a blog:http://blog.rebertia.com- Tekst uit oorspronkelijk bericht niet 
> weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

Oke, thanks.
I will use the (correct) long way.
--
http://mail.python.org/mailman/listinfo/python-list


Re: The Importance of Terminology's Quality

2008-08-16 Thread Martijn Lievaart
On Thu, 14 Aug 2008 18:33:30 -0400, John W Kennedy wrote:

> Actually, I was thinking of the 1401. But both the 1620 and the 1401
> (without the optional Advanced Programming Feature) share the basic
> omission of any instruction that could do call-and-return without
> hard-coding an adcon with the address of the point to be returned to.
> (The Advanced Programming Feature added a 1401 instruction, Store
> B-address Register, that, executed as the first instruction of a
> subroutine, could store the return-to address.)

Rgh

Don't. Bring. Back. Those. Nightmares. Please.

The 1401 was a decent enough processor for many industrial tasks -- at 
that time -- but for general programming it was sheer horror.

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


Re: The Importance of Terminology's Quality

2008-08-17 Thread Martijn Lievaart
On Sat, 16 Aug 2008 21:46:18 -0400, John W Kennedy wrote:

>> The 1401 was a decent enough processor for many industrial tasks -- at
>> that time -- but for general programming it was sheer horror.
> 
> But the easiest machine language /ever/.

True, very true.

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


Re: a 100-line indentation-based preprocessor for HTML

2009-11-28 Thread Martijn Arts
It´s quite clear to me: Not. I've taken a look at the "Timebar", and in the
last
two months there has been no change at all.

On Sat, Nov 28, 2009 at 7:32 AM, Steve Howell  wrote:

> On Nov 27, 9:56 pm, "David Williams"  wrote:
> > You might want to take a look at this:
> >
> > http://www.ghrml.org/
> >
>
> Yep, it's not clear how actively they are maintaining that.  The fact
> that it seems to target Genshi only might be limiting their audience,
> which is unfortunate.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: os.remove() permission problem

2009-11-30 Thread Martijn Arts
On Mon, Nov 30, 2009 at 8:21 PM, Victor Subervi wrote:

> Hi;
> I get the following error when I try
> os.remove(file)
>
> *OSError*: [Errno 13] Permission denied: 'particulars.py'
>   args = (13, 'Permission denied')
>   errno = 13
>   filename = 'particulars.py'
>   strerror = 'Permission denied'
>
> Here are the permissions:
>
> -rwxr-xr-x  1 root root   455 Nov 28 05:58 particulars.py
>

Try chmodding the file to 755.


> When I go into the python interpreter and execute that statement, it
> succeeds. What have I missed?
> TIA,
> Victor
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What type of info do you capture about a user's environment for debugging?

2009-12-14 Thread Martijn Arts
On Mon, Dec 14, 2009 at 10:11 PM, Philip Semanchuk wrote:

>
> On Dec 14, 2009, at 3:39 PM, [email protected] wrote:
>
>  We're preparing to release a commercial software product based on
>> Python. When a customer reports problems with our software, we
>> would like to capture as much information about their environment
>> as possible while being respectful of privacy concerns. The info
>> we capture will be displayed to the user for review and optional
>> submission to our support team.
>> Here's what we've come up with so far:
>> - platform module info
>> - locale module info
>> - os.environ (selected info)
>> - sys.argv (application path and command line arguements)
>> Free disk space and write status for the following paths:
>> - application folder
>> - startup folder (which may be different than application folder)
>> - temp path
>> - user path ("My Documents", "Home")
>> Information captured via our browser interface
>> - display resolution
>> - browser version
>> Anyone have any additional suggestions or feedback?
>>
>
> Python version? =)
>
> I think he'll use py2exe or something like that to "compile" the python
files into an exe.

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


Re: pyZui - anyone know about this?

2009-12-15 Thread Martijn Arts
You could do some really awesome stuff with that! I love the webpage example
where you zoom in on the exclamation mark and there's a new page.

Just imagine the possibilities!

On Tue, Dec 15, 2009 at 9:28 AM, Donn  wrote:

> On Tuesday 15 December 2009 04:29:39 David Roberts wrote:
> > Yes, the toolkit used is PyQt.
> \me makes note to start learning PyQt asap.
>
> > and employs pyramidal tiling for efficiency
> \me ... time to hit Wikipedia :)
>
> > (I haven't used any Qt/KDE voodoo in this regard).
> Imho, your code should *become* that voodoo -- from what I saw in that vid
> it's unique and has such promise.
>
> > QtWebKit, and PDF with the pdftoppm utility.
> Ah, thanks.
>
> > The project is opensource (GPLv2), but just hasn't been published
> > yet :) . I'll try to make a release over the next few days, and I'll
> > post a link here when I do.
> Can't wait.
>
> David, thanks for replying here on the list. Well done on your pyZui and I
> hope it catches fire in people's imaginations. I think that fire may
> explain why
> my socks are missing! :D
>
> \d
> --
> \/\/ave: [email protected]
> home: http://otherwise.relics.co.za/
> 2D vector animation : https://savannah.nongnu.org/projects/things/
> Font manager : https://savannah.nongnu.org/projects/fontypython/
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Ctypes and Structures

2009-10-25 Thread Martijn Arts
I'm working with ctypes on a bridge (?) from WiiUse; a new and improved
PyWiiUse, but I'm having a problem:

When connecting to the wiimotes with the init function it gives me back
an array with pointers. Every pointer points to a WiiMote structure, this
all
goes well.
Now when trying to poll the wiimotes (check for events like button presses)
it should edit the WiiMote structures where's button presses using
bit-flags,
but it doesn't.

Here's a bit of code:
wiimotes = pywiiuse.init(1) # connect to the wiimotes
(...)
pywiiuse.rumble(wiimotes[0], 1) # little example of how it works

init function:
def init(nwiimotes):
c_array = wiimote_p * nwiimotes
wiiusedll.wiiuse_init.restype = c_array
return wiiusedll.wiiuse_init(c_int(nwiimotes))

Now I'm going to poll it:

while True:
if pywiiuse.poll(wiimotes, 1):
i = 0
while i < 1:
print 'EVENT:'
print pywiiuse.is_pressed(wiimotes[0], pywiiuse.button['Right'])
i += 1

pywiiuse.button['Right']is 0x0200

This is the is_pressed function:
def is_pressed(dev, button):
return (dev.contents.btns & button) == button

To be honest: I have no idea what is_pressed actually does, but it should
return True
or False?

After testing around a bit I found out that dev.contents.btns always equals
420.

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


Re: Pyfora, a place for python

2009-11-01 Thread Martijn Arts
I think it's a really good idea :) My accountname is "TotempaaltJ"

On Sun, Nov 1, 2009 at 8:48 AM, Paul Rubin wrote:

> Saketh  writes:
> > I am proud to announce the release of Pyfora (http://pyfora.org), an
> > online community of Python enthusiasts to supplement comp.lang.python
> > and #python.
>
> And the reason to want to further fragment Python discussion is
> exactly what?
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Pokemon gamestyle in Python

2009-11-15 Thread Martijn Arts
First; sorry, the title might be somewhat unclear about what I mean.

Then; I know PyGame and I've worked with it, but I want to make a
Pokemon/Legend of Zelda style game with a moving guy on a map.
So what I'm asking is; is there anything better than PyGame for this
gamestyle?
-- 
http://mail.python.org/mailman/listinfo/python-list


CTypes problem.

2009-11-17 Thread Martijn Arts
 I wanted to use PyWiiUse, but, well, it sucks

Then I thought; it can't be THAT hard, can it? So I began porting WiiUse to
Python using ctypes, but apparently, I did something wrong.

poll() gives back an event, *but* (there's always a but) the event doesn't
register. Or... Well... See for yourself, I think it has something to do
with Pointers, but I have no idea, really ;)

So, here's the code:
Code :-P 
-- 
http://mail.python.org/mailman/listinfo/python-list


Compile python extension

2006-10-11 Thread Martijn de Munnik
Hi,

I'm trying to build/install pysqlite on a Solaris 10 platform. I've got
Sun Studio 11 on a AMD 64 platform and got this error. I'm a python newbie
and just want to install trac. I've got ActiveState python:

ActivePython 2.4.3 Build 11 (ActiveState Software Inc.) based on
Python 2.4.3 (#1, Apr  3 2006, 18:07:58) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.

And sqlite build with the following options ./configure
--prefix=/opt/64/sqlite --enable-threadsafe --disable-tcl

my environment looks like this:
CC=cc
CFLAGS=-xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil
-xlibmopt -xtarget=opteron -xarch=amd64 -xregs=no%frameptr
CXX=CC
CXXFLAGS=-xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all
-xlibmil -xlibmopt -xtarget=opteron -xarch=amd64 -xregs=no%frameptr
LDFLAGS=-xtarget=opteron -xarch=amd64

and setyp.cfg looks like this
[build_ext]
define=
include_dirs=/opt/sqlite/include
library_dirs=/opt/sqlite/lib
libraries=sqlite3

/opt/sqlite is a symlink to /opt/64/sqlite

and finally the build command:

% python setup.py build
running build
running build_py
running build_ext
building 'pysqlite2._sqlite' extension
Traceback (most recent call last):
  File "setup.py", line 159, in ?
main()
  File "setup.py", line 156, in main
setup(**get_setup_args())
  File "/opt/python/lib/python2.4/distutils/core.py", line 149, in setup
dist.run_commands()
  File "/opt/python/lib/python2.4/distutils/dist.py", line 946, in
run_commands
self.run_command(cmd)
  File "/opt/python/lib/python2.4/distutils/dist.py", line 966, in
run_command
cmd_obj.run()
  File "/opt/python/lib/python2.4/distutils/command/build.py", line 112,
in run
self.run_command(cmd_name)
  File "/opt/python/lib/python2.4/distutils/cmd.py", line 333, in run_command
self.distribution.run_command(command)
  File "/opt/python/lib/python2.4/distutils/dist.py", line 966, in
run_command
cmd_obj.run()
  File "/opt/python/lib/python2.4/distutils/command/build_ext.py", line
279, in run
self.build_extensions()
  File "/opt/python/lib/python2.4/distutils/command/build_ext.py", line
405, in build_extensions
self.build_extension(ext)
  File "/opt/python/lib/python2.4/distutils/command/build_ext.py", line
470, in build_extension
depends=ext.depends)
  File "/opt/python/lib/python2.4/distutils/ccompiler.py", line 699, in
compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/opt/python/lib/python2.4/distutils/unixccompiler.py", line 112,
in _compile
self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
  File "/opt/python/lib/python2.4/distutils/ccompiler.py", line 1040, in
spawn
spawn (cmd, dry_run=self.dry_run)
  File "/opt/python/lib/python2.4/distutils/spawn.py", line 37, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/opt/python/lib/python2.4/distutils/spawn.py", line 122, in
_spawn_posix
log.info(string.join(cmd, ' '))
  File "/opt/python/lib/python2.4/distutils/log.py", line 33, in info
self._log(INFO, msg, args)
  File "/opt/python/lib/python2.4/distutils/log.py", line 23, in _log
print msg % args
TypeError: not enough arguments for format string


I've got the same issues with mysql and postgresql extensions, any ideas???

BTW anybody succesfully compiled python on Solaris using Sun Studio?

thanks,

Martijn


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


Compile python on Solaris 64bit

2006-10-12 Thread Martijn de Munnik
Hi,

I want to compile python on my solaris 10 system (amd 64 bit).

I did the following:

./configure --prefix=/opt/64/python
make

which resulted in this error:
"Include/pyport.h", line 730: #error: "LONG_BIT definition appears wrong
for platform (bad gcc/glibc config?)."

so I edited the file and removed the error line and did a configure and
make again after a make distclean.

after a new make I get this error complaining about 32 and 64 bit.

ld: fatal: file Parser/acceler.o: wrong ELF class: ELFCLASS32

when I look to the cc statements none of my CFLAGS are passed while these
are in my environment;

CC=cc
CFLAGS=-xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil
-xlibmopt -xtarget=opteron -xarch=amd64 -xregs=no%frameptr
CXX=CC
CXXFLAGS=-xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all
-xlibmil -xlibmopt -xtarget=opteron -xarch=amd64 -xregs=no%frameptr
LDFLAGS=-xtarget=opteron -xarch=amd64


anybody succesfully compiled python on solaris?

thanks,
martijn

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


Compile python on Solaris

2006-10-18 Thread Martijn de Munnik
Hi,

I want to compile python on my solaris 10 system (amd 64 bit).

I did the following:

./configure --prefix=/opt/64/python
make

which resulted in this error:
"Include/pyport.h", line 730: #error: "LONG_BIT definition appears  
wrong for platform (bad gcc/glibc config?)."

so I edited the file and removed the error line and did a configure  
and make again after a make distclean.

after a new make I get this error complaining about 32 and 64 bit.

ld: fatal: file Parser/acceler.o: wrong ELF class: ELFCLASS32

when I look to the cc statements none of my CFLAGS are passed while  
these are in my environment;

CC=cc
CFLAGS=-xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all - 
xlibmil -xlibmopt -xtarget=opteron -xarch=amd64 -xregs=no%frameptr
CXX=CC
CXXFLAGS=-xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all - 
xlibmil -xlibmopt -xtarget=opteron -xarch=amd64 -xregs=no%frameptr
LDFLAGS=-xtarget=opteron -xarch=amd64


anybody succesfully compiled python on solaris?

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