From cologuns at xs4all.nl Wed Oct 11 14:43:23 2006 From: cologuns at xs4all.nl (Martijn de Munnik) Date: Wed, 11 Oct 2006 14:43:23 +0200 (CEST) Subject: [python-nl] Compile python extension Message-ID: <23338.84.31.232.161.1160570603.squirrel@webmail.xs4all.nl> 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 From ronaldoussoren at mac.com Wed Oct 11 15:14:22 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 11 Oct 2006 15:14:22 +0200 Subject: [python-nl] Compile python extension In-Reply-To: <23338.84.31.232.161.1160570603.squirrel@webmail.xs4all.nl> References: <23338.84.31.232.161.1160570603.squirrel@webmail.xs4all.nl> Message-ID: <5349841.1160572462719.JavaMail.ronaldoussoren@mac.com> On Wednesday, October 11, 2006, at 02:43PM, Martijn de Munnik wrote: >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: This seems to be a bug in distutils, triggered by the %-signs in your CFLAGS. The easiest way to work around this is to change the CFLAGS and CXXFLAGS in your environment, just remove the options containing %-signs. Those seem to be related to optimization and I don't think those will affect the performance of pysqlite very much. A more permanent fix is change /opt/python/lib/python2.4/distutils/spawn.py" line 122, insert "%s" as the first argument of the call to log.info. This might not be the only place that requires changes. Ronald P.S. please file a bug at http://www.sf.net/projects/python to ensure that this will get fixed in a future release of 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 > > >_______________________________________________ >Python-nl mailing list >Python-nl at python.org >http://mail.python.org/mailman/listinfo/python-nl > > From cologuns at xs4all.nl Thu Oct 12 16:46:19 2006 From: cologuns at xs4all.nl (Martijn de Munnik) Date: Thu, 12 Oct 2006 16:46:19 +0200 (CEST) Subject: [python-nl] Compile python on Solaris 64bit Message-ID: <24983.217.195.243.130.1160664379.squirrel@webmail.xs4all.nl> 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 From wichert at wiggy.net Thu Oct 12 16:54:37 2006 From: wichert at wiggy.net (Wichert Akkerman) Date: Thu, 12 Oct 2006 16:54:37 +0200 Subject: [python-nl] Compile python on Solaris 64bit In-Reply-To: <24983.217.195.243.130.1160664379.squirrel@webmail.xs4all.nl> References: <24983.217.195.243.130.1160664379.squirrel@webmail.xs4all.nl> Message-ID: <20061012145437.GI4341@wiggy.net> We praten hier gewoon nederlands :) Previously Martijn de Munnik wrote: > 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?)." Dat is geen fout in python maar in je development omgeving. Schijnbaar probeer je hier 64bit en 32bit dingen te mixen wat inderdaad niet werkt. > so I edited the file and removed the error line and did a configure and > make again after a make distclean. Als je een #error regel moet weghalen dan ben je vrijwel zeker verkeerd bezig: dan werk je aan een symptoom en niet aan het probleem. Wichert. -- Wichert Akkerman It is simple to make things. http://www.wiggy.net/ It is hard to make things simple. From aerts11 at planet.nl Fri Oct 13 01:01:15 2006 From: aerts11 at planet.nl (doppie) Date: Thu, 12 Oct 2006 16:01:15 -0700 (PDT) Subject: [python-nl] kleine dreambox 7025 plugin Message-ID: <6786822.post@talk.nabble.com> Hallo wie kan mij verder helpen, ik heb een kleine plugin gemaakt voor mijn dreambox 7025 met de funktie dat hij tar.bz2 tar.gz en ipk files moet en kan uitpakken. dat heb ik wereken in zoverre dat het werkt met een telnet cript dat door de plugin word aan gestuurd maar ik zou het graag zonder dat telnet script werkend willen hebben maar kom daar niet aan uit hoe dat te doen. nu werkt het zo hier dus wat het doet list.append((_("1. Install *.tar.bz2 addon from /var/tmp"), "installbz2")) - en dit roept het telnet script aan - def Agent(self): returnValue = self["menu"].l.getCurrentSelection()[1] if returnValue is not None: if returnValue is "installbz2": title = "Installing all *.tar.bz2 Addons at /var/tmp" cmd = "%s bzip2 %s" % (script,installpath) self.session.open(Console,_(title),[cmd]) - dit dus - cd / case $1 in "bzip2") echo "-----------------------------------------" echo "Extracting $1/*.tar.bz2" echo "-----------------------------------------" bunzip2 $2/*.tar.bz2 tar -xvf $2/*.tar echo "-----------------------------------------" echo "Restarting enigma2" echo "-----------------------------------------" init 2 rm $2/*.tar init 3 ;; - en dat werkt prima maar ik wil dat ook zonder dat laaste kunnen doen vanuit de plugin wie heeft dus enig idee hoe dat in de plugin te maken. ik kom er niet meer aan uit hoe nu verder alvast bedankt en groetjes doppie -- View this message in context: http://www.nabble.com/kleine-dreambox-7025-plugin-tf2433860.html#a6786822 Sent from the Python - python-nl mailing list archive at Nabble.com. From cologuns at xs4all.nl Thu Oct 12 16:42:40 2006 From: cologuns at xs4all.nl (Martijn de Munnik) Date: Thu, 12 Oct 2006 16:42:40 +0200 Subject: [python-nl] Compile python on Solaris Message-ID: 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 From ronaldoussoren at mac.com Thu Oct 19 11:43:40 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 19 Oct 2006 11:43:40 +0200 Subject: [python-nl] Compile python on Solaris In-Reply-To: References: Message-ID: On Oct 12, 2006, at 4:42 PM, Martijn de Munnik wrote: > Hi, > > I want to compile python on my solaris 10 system (amd 64 bit). Zoals eerder gezegd spreken we hier nederlands. Cross-posting wordt trouwens i.h.a. als onbeleefd gezien, zeker als de twee lijsten een heel ander publiek aanspreken. Probeer het eens met --without-gcc tussen de argumenten voor configure, gezien de foutmeldingen hieronder lijkt het alsof je gcc en sun's compiler door elkaar heen gebruikt. Ronald P.S. Stuur je bewust twee keer hetzelfde mailtje (vorige d.d. 12 oktober) of is hier iets raars aan de hand? > > 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 > _______________________________________________ > Python-nl mailing list > Python-nl at python.org > http://mail.python.org/mailman/listinfo/python-nl -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3562 bytes Desc: not available Url : http://mail.python.org/pipermail/python-nl/attachments/20061019/2da883b7/attachment.bin From jurian at juriansluiman.nl Wed Oct 25 22:05:15 2006 From: jurian at juriansluiman.nl (Jurian Sluiman) Date: Wed, 25 Oct 2006 22:05:15 +0200 Subject: [python-nl] Pexpect spawn intact houden Message-ID: <1161806715.11060.7.camel@karlijn> Beste Python mensen, Sinds afgelopen weekend ben ik begonnen met Python te spelen. Ik bedacht om een gtk interface te ontwerpen voor vpnc, de (commandline) vpnc client voor Linux. Alles werkt al, alleen nu maak ik als connectie een klasse aan, die probeert dit uit te voeren (dit staat binnen een try): self.child = pexpect.spawn("vpnc-connect " + re.escape(profile)) self.child.expect(".* password .*: ") self.child.sendline(password) Het probleem is echter dat het script doorgaat, en er geen connectie achterblijft. Mijn idee was om bij het aanmaken van de instantie 'Connection', er een connectie wordt gemaakt (met bovenstaande code), en bij het verwijderen van het object er een 'vpnc-disconnect' wordt gedaan. Maar dat gaat dus niet lukken. Kan iemand mij hier wat meer inzicht in verschaffen. Het is dus nu gelukt de pexpect module te gebruiken, en het password correct in te voeren (heb ik getest). Alleen wordt het proces direct gekilled na deze code. Ik heb dingen als self.child.close() geprobeerd, maar dat mocht niet baten. Alvast grote dank van deze python leerling, Jurian PS. Klopt het dat python-nl, en volgens mij python zelf ook, geen IRC kanaal heeft? ------------- volgend deel ------------ Een HTML-bijlage is verwijderd... URL: http://mail.python.org/pipermail/python-nl/attachments/20061025/d709794a/attachment.html From mj at zopatista.com Thu Oct 26 01:26:36 2006 From: mj at zopatista.com (Martijn Pieters) Date: Thu, 26 Oct 2006 01:26:36 +0200 Subject: [python-nl] Pexpect spawn intact houden In-Reply-To: <1161806715.11060.7.camel@karlijn> References: <1161806715.11060.7.camel@karlijn> Message-ID: On 25 Oct 2006, at 22:05, Jurian Sluiman wrote: > PS. Klopt het dat python-nl, en volgens mij python zelf ook, geen > IRC kanaal heeft? Er zijn kanalen voor zowel python als python-nl op Freenode.net: #python en #python-nl. -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://mail.python.org/pipermail/python-nl/attachments/20061026/7651a05d/attachment.pgp From eric at infrae.com Thu Oct 26 15:28:57 2006 From: eric at infrae.com (eric casteleijn) Date: Thu, 26 Oct 2006 15:28:57 +0200 Subject: [python-nl] Pexpect spawn intact houden In-Reply-To: References: <1161806715.11060.7.camel@karlijn> Message-ID: <4540B819.4060203@infrae.com> Martijn Pieters wrote: > On 25 Oct 2006, at 22:05, Jurian Sluiman wrote: >> PS. Klopt het dat python-nl, en volgens mij python zelf ook, geen IRC >> kanaal heeft? > > Er zijn kanalen voor zowel python als python-nl op Freenode.net: #python > en #python-nl. Die laatste moet zijn: #pun :) -- - eric casteleijn http://infrae.com From dekeijzer at gmail.com Fri Oct 27 20:18:27 2006 From: dekeijzer at gmail.com (deKeijzer) Date: Fri, 27 Oct 2006 20:18:27 +0200 Subject: [python-nl] 100 decimalen Message-ID: Hallo mede-python gebruikers, ik ben bezig om een script te schrijven dat 100 decimalen van een breuk moet laten zien. Het script werkt op zich wel, maar niet naar behoren. De eerste 14 decimalen zijn precies zoals ze horen, alleen daarna wijkt hij af van wat het eigenlijk zou moeten zijn. (gecontroleerd met ingebouwde PHP functie) Ik weet niet zeker of het nou aan mijn script ligt of dat het komt doordat python hier gewoon niet geschikt voor is, dit is in ieder geval het script: import math def p(boven, onder): pos=0 decimalen = [] for i in range(0,102): decimalen.append(0) while (boven - onder) >= 0: boven -=onder decimalen[pos] +=1 if pos >= 100 or boven == 0: break while (boven - onder) < 0: onder *=0.1 pos +=1 if pos==1: decimalen[pos] = '.' pos +=1 return ''.join(map(str, decimalen)) print p(13,7) Groeten van deKeijzer! ------------- volgend deel ------------ Een HTML-bijlage is verwijderd... URL: http://mail.python.org/pipermail/python-nl/attachments/20061027/aa987bb6/attachment.html From ronaldoussoren at mac.com Fri Oct 27 20:26:11 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 27 Oct 2006 20:26:11 +0200 Subject: [python-nl] 100 decimalen In-Reply-To: References: Message-ID: <95D355C6-C7FA-4362-828B-67571D098B6B@mac.com> On Oct 27, 2006, at 8:18 PM, deKeijzer wrote: > Hallo mede-python gebruikers, > > ik ben bezig om een script te schrijven dat 100 decimalen van een > breuk moet laten zien. Het script werkt op zich wel, maar niet naar > behoren. > De eerste 14 decimalen zijn precies zoals ze horen, alleen daarna > wijkt hij af van wat het eigenlijk zou moeten zijn. (gecontroleerd > met ingebouwde PHP functie) > Ik weet niet zeker of het nou aan mijn script ligt of dat het komt > doordat python hier gewoon niet geschikt voor is, dit is in ieder > geval het script: Het probleem komt doordat je gebruik maak van floating point nummers, die hebben niet voldoende precisie om tot 100 posities achter de komma te rekenen. Een verdere uitleg hiervan staat in de Python FAQ op http://www.python.org/infogami-faq/general/why-are-floating-point- calculations-so-inaccurate/. Als je gebruik maakt van Python 2.4 kan je de decimal module gebruiken, die implementeerd floating point getallen met een zelf op te geven precisie. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3562 bytes Desc: not available Url : http://mail.python.org/pipermail/python-nl/attachments/20061027/56a568e1/attachment.bin