Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-27 Thread Paul Rubin
"Michaâ Janeczek" <[EMAIL PROTECTED]> writes: > I wasn't aware of the runtime issues, these can be things to watch out > for. However, the type of embedding that I imagined would be mostly > pure functions, since Python can deal with IO rather well. It'd also > be applicable in situations where we

Re: problem with sorting

2008-03-27 Thread jwelby
On Mar 28, 5:38 am, [EMAIL PROTECTED] wrote: > >>> dict = {'M':3, 'R':0, 'S':2} > >>> print dict > > {'S': 2, 'R': 0, 'M': 3} > > now if I wanted sorted values in list, i am not able to do this>>> print > dict.values().sort() > > None > > it returns None instead of [0, 2, 3] The sort method works

Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-27 Thread Paul Rubin
malkarouri <[EMAIL PROTECTED]> writes: > FWIW, I find #1 more interesting for me personally. > As a monad-challenged person, I find it much easier to develop > components using pure functional programming in a language like > Haskell and do all my I/O in Python than having it the other way > round.

Re: problem with sorting

2008-03-27 Thread Paddy
On Mar 28, 5:38 am, [EMAIL PROTECTED] wrote: > >>> dict = {'M':3, 'R':0, 'S':2} > >>> print dict > > {'S': 2, 'R': 0, 'M': 3} > > now if I wanted sorted values in list, i am not able to do this>>> print > dict.values().sort() > > None > > it returns None instead of [0, 2, 3] Try: from pprint imp

problem with sorting

2008-03-27 Thread ankitks . mital
>>> dict = {'M':3, 'R':0, 'S':2} >>> print dict {'S': 2, 'R': 0, 'M': 3} now if I wanted sorted values in list, i am not able to do this >>> print dict.values().sort() None it returns None instead of [0, 2, 3] -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting back an Object

2008-03-27 Thread Gary Herron
David Anderson wrote: > Well, I've got a little problem, I have a list that contains objects > from the class C, then I use those objects.__str__ to generate a > ListCtrl, A wxPython widget that makes a list of strings and then you > can handle events when selected, and returns the string selcte

Re: [Twisted-web] [ANN] Twisted 8.0

2008-03-27 Thread Patrick Mullen
It's dangerously close to april fools for this kind of posting! Congrats on the release, it looks mighty impressive. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Twisted-web] [ANN] Twisted 8.0

2008-03-27 Thread Tristan Seligmann
* Christopher Armstrong <[EMAIL PROTECTED]> [2008-03-26 21:26:11 -0400]: > http://twistedmatrix.com/ > > MASSACHUSETTS (DP) -- Version 8.0 of the Twisted networking framework > has been released, Twisted Matrix Laboratories announced Wednesday. I just have to say that I enjoyed reading this rele

Re: Pystemmer 1.0.1 installation problem in Linux

2008-03-27 Thread mungkol
On Mar 28, 6:06 am, Damjan <[EMAIL PROTECTED]> wrote: > mungkol wrote: > > Dear all, > > > I am a newbie to Python community. For my project, I tried to install > > Pystemmer 1.0.1 (http://snowball.tartarus.org/wrappers/ > > PyStemmer-1.0.1.tar.gz) on my linux ubuntu 7.10 machine but > > unsuccessf

Re: Change user on UNIX

2008-03-27 Thread Giampaolo Rodola'
Sorry for replying so late. I'll try to describe what I'm actually trying to implement so that maybe it can help you understand a little better. The application is an asynchronous FTP server implementation. I decided that it would be desirable to change the current implementation so that every tim

Re: how to capture screenshots of the active window in Python

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 20:28:27 -0300, Praveena B <[EMAIL PROTECTED]> escribió: > Can anyone help me out?? Still lacking details... PIL has a ImageGrab module, Windows only. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Getting back an Object

2008-03-27 Thread David Anderson
Well, I've got a little problem, I have a list that contains objects from the class C, then I use those objects.__str__ to generate a ListCtrl, A wxPython widget that makes a list of strings and then you can handle events when selected, and returns the string selcted, how can I access the "parent"

Re: Tkinter menus made easy

2008-03-27 Thread bearophileHUGS
[EMAIL PROTECTED]: > Mine does less. But you tell it less to do it. Some of those fields are optional :-) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: keyboard "interrupt"

2008-03-27 Thread John Fisher
Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > John Fisher wrote: > > Hi Group, > > Hi John > > > I have been absent a while, mainly because I have been getting better at > > figuring out my own Python problems. But not this one... > > > > I have a timed loop performing certain tasks until a tota

how to capture screenshots of the active window in Python

2008-03-27 Thread Praveena B
Can anyone help me out?? Never miss a thing. Make Yahoo your homepage. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to take snap shot of the of project screen in Python

2008-03-27 Thread Ben Finney
"Praveena Boppudi (c)" <[EMAIL PROTECTED]> writes: > Can anyone help me out? Probably, but your chances improve by starting a *new* thread to discuss your new question, instead of replying to an existing thread. -- \ "Pinky, are you pondering what I'm pondering?" "I think so, | `\

Re: python program deleted

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 19:08:05 -0300, jim-on-linux <[EMAIL PROTECTED]> escribió: > I developed a python program and used py2exe > to create the exe. > > I zip the entire package and email it to my > clients. > > Some clients get the zip file, unzip the > package and everything works fine. > > And

Re: python program deleted

2008-03-27 Thread Steven D'Aprano
On Thu, 27 Mar 2008 18:08:05 -0400, jim-on-linux wrote: > py users, > > I developed a python program and used py2exe to create the exe. > > I zip the entire package and email it to my clients. > > Some clients get the zip file, unzip the package and everything works > fine. > > And some client

Re: Problems wit List Object

2008-03-27 Thread Gary Herron
David Anderson wrote: > Hello all, I have a Class1 that there has a list, and a function that > returns this list, In another class I got an instance of this first > class, and when I make: > > obj1 = Class1() > list = obj1.getList() > > I got this exception: > > traceback (most recent call last)

Problems wit List Object

2008-03-27 Thread David Anderson
Hello all, I have a Class1 that there has a list, and a function that returns this list, In another class I got an instance of this first class, and when I make: obj1 = Class1() list = obj1.getList() I got this exception: traceback (most recent call last): File "xxx", line 184, in onAddErro

Re: csv Parser Question - Handling of Double Quotes

2008-03-27 Thread John Machin
On Mar 28, 8:40 am, [EMAIL PROTECTED] wrote: > On Mar 27, 1:53 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > > > En Thu, 27 Mar 2008 17:37:33 -0300, Aaron Watters > > <[EMAIL PROTECTED]> escribió: > > > >> "this";"is";"a";"test" > > > >> Resulting in an output of: > > > >> ['this', 'is

python program deleted

2008-03-27 Thread jim-on-linux
py users, I developed a python program and used py2exe to create the exe. I zip the entire package and email it to my clients. Some clients get the zip file, unzip the package and everything works fine. And some clients get my email with an icon attached which has the correct filename but

Re: csv Parser Question - Handling of Double Quotes

2008-03-27 Thread John Machin
On Mar 28, 7:37 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > > If you want fame and admiration you could fix > the arguably bug in the csv module and send > the patch to the python bugs mailing list. > However, I just had a perusal of csv.py > good luck :). It is *NOT* a bug in the Python CS

Re: copy file over LAN

2008-03-27 Thread [EMAIL PROTECTED]
On Mar 27, 6:48 pm, Teja <[EMAIL PROTECTED]> wrote: > On Mar 27, 8:34 am, Astan Chee <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > I have afileon another machine on the localnetwork(my machine and > > local machines are on windows) and I want tocopyit locally. Now the > > machine requires authentica

Last Call for Papers for PyCon Italia Due

2008-03-27 Thread Nicola Larosa
Only five days left to propose a paper to PyCon Italia Due , the second Italian Python conference. Also, booking is now open. Here are the next deadlines: Start of Early booking: March 25 End of Call for papers: April 1 Start of Late booking: April 23 End of booking:

Re: Determine size of string in bytes

2008-03-27 Thread breal
On Mar 27, 2:10 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Mar 28, 6:45 am, breal <[EMAIL PROTECTED]> wrote: > > > Forgive me for this question which is most likely stupid... > > The contents of your question are not stupid. The subject however does > invite a stupid answer like: len(the_strin

Re: Determine size of string in bytes

2008-03-27 Thread castironpi
On Mar 27, 4:10 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Mar 28, 6:45 am, breal <[EMAIL PROTECTED]> wrote: > > > Forgive me for this question which is most likely stupid... > > The contents of your question are not stupid. The subject however does > invite a stupid answer like: len(the_strin

Re: csv Parser Question - Handling of Double Quotes

2008-03-27 Thread jwbrown77
On Mar 27, 1:53 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 27 Mar 2008 17:37:33 -0300, Aaron Watters   > <[EMAIL PROTECTED]> escribió: > > > > >> "this";"is";"a";"test" > > >> Resulting in an output of: > > >> ['this', 'is', 'a', 'test'] > > >> However, if I modify the csv to: > >

Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-27 Thread malkarouri
On 26 Mar, 08:46, Paul Rubin wrote: > A few thoughts. The envisioned Python-Haskell bridge would have two > directions: 1) calling Haskell code from Python; 2) calling Python > code from Haskell. The proposal spends more space on #1 but I think > #1 is both more difficu

extension module initialization called twice

2008-03-27 Thread pianomaestro
I have a cython extension module "mux" where the initialization is being called more than once (the initmux c function). I am wondering if my use of multiple threads causes this. Can't multiple threads share the same python module ? The threads are being created from an external C library. I just

Re: Filtering a Python list to uniques

2008-03-27 Thread Furkan Kuru
lstOne = [ 'A', 'B', 'C', 'C' ] dct = {} for item in lstOne: if dct.has_key(item): dct[item] += 1 else: dct[item] = 1 On Thu, Mar 27, 2008 at 10:51 PM, Kelly Greer <[EMAIL PROTECTED]> wrote: > I'm in Python 2.4.4 > > And it works for me in the Python Shell like you just > did. Let

Re: Instrumented web proxy

2008-03-27 Thread Paul Rubin
Andrew McLean <[EMAIL PROTECTED]> writes: > I would like to write a web (http) proxy which I can instrument to > automatically extract information from certain web sites as I browse > them. Specifically, I would want to process URLs that match a > particular regexp. For those URLs I would have code

Re: first interactive app

2008-03-27 Thread Miki
Hello Tim, > that looks nice, simple, and intuitive. thanks for thinking about it. Thanks, glad I could help. > Now to dive into some gui coding! IMO you can pull it off as a web application and then you won't need to worry about cross-platform, upgrades and all that interesting stuff. HTH, -- M

Re: Tips Re Pattern Matching / REGEX

2008-03-27 Thread Miki
Hello, > I have a large text file (1GB or so) with structure similar to the > html example below. > > I have to extract content (text between div and tr tags) from this > file and put it into a spreadsheet or a database - given my limited > python knowledge I was going to try to do this with regex

Re: Determine size of string in bytes

2008-03-27 Thread John Machin
On Mar 28, 6:45 am, breal <[EMAIL PROTECTED]> wrote: > Forgive me for this question which is most likely stupid... The contents of your question are not stupid. The subject however does invite a stupid answer like: len(the_string). Disclaimer: I know nothing about SOAP except that it's usually ca

Re: dynimac code with lambda function creation

2008-03-27 Thread Justin Delegard
It didn't work when I tried to pass the method object, because 'self' wasn't being recognized as a valid symbol.  I've just been breaking my teeth on python OO, so I didn't realize that 'self' needed to be the first argument of every method that used it.  After inserting that, everything worked

Re: Pystemmer 1.0.1 installation problem in Linux

2008-03-27 Thread Damjan
mungkol wrote: > Dear all, > > I am a newbie to Python community. For my project, I tried to install > Pystemmer 1.0.1 (http://snowball.tartarus.org/wrappers/ > PyStemmer-1.0.1.tar.gz) on my linux ubuntu 7.10 machine but > unsuccessful. It produced the following error: you need to install the "b

Re: Instrumented web proxy

2008-03-27 Thread Miki
Hello Andrew, > Tiny HTTP Proxy in Python looks promising as it's nominally simple (not > many lines of code) > > http://www.okisoft.co.jp/esc/python/proxy/ > > It does what it's supposed to, but I'm a bit at a loss as where to > intercept the traffic. I suspect it should be quite straightforward,

Tips Re Pattern Matching / REGEX

2008-03-27 Thread egonslokar
Hello Python Community, I have a large text file (1GB or so) with structure similar to the html example below. I have to extract content (text between div and tr tags) from this file and put it into a spreadsheet or a database - given my limited python knowledge I was going to try to do this with

How to take snap shot of the of project screen in Python

2008-03-27 Thread Praveena B
Hi, Can anyone help me out? Thanks, Praveena. Never miss a thing. Make Yahoo your homepage. -- http://mail.python.org/mailman/listinfo/python-list

Re: csv Parser Question - Handling of Double Quotes

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 17:37:33 -0300, Aaron Watters <[EMAIL PROTECTED]> escribió: >> "this";"is";"a";"test" >> >> Resulting in an output of: >> >> ['this', 'is', 'a', 'test'] >> >> However, if I modify the csv to: >> >> "t"h"is";"is";"a";"test" >> >> The output changes to: >> >> ['th"is"', 'is', '

Re: Building a "safe" python?

2008-03-27 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I'm making a game where you'll be able to make your own mods and I | want to be able to write these mods in python. However, python has a | lot of "dangerous" functions (like erase any file on the harddrive | etc) so I want a "safe" py

Re: Determine size of string in bytes

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 16:45:52 -0300, breal <[EMAIL PROTECTED]> escribió: > Forgive me for this question which is most likely stupid... > > How do I determine the number of bytes a string takes up? I have a > soap server that is returning a serialized string. It seems that when > the string goes

Re: Time problem (again)

2008-03-27 Thread Jason Scheirer
On Mar 27, 12:17 pm, "Fabio Durieux Lopes" <[EMAIL PROTECTED]> wrote: >Hi, > >I'm recreating a date-time based on a string and I have a problem > when daylight savings time is set (I'm off by 1). So today I forced > my computer into daylight savings time and debugged it again, but > this ti

Re: csv Parser Question - Handling of Double Quotes

2008-03-27 Thread Aaron Watters
> "this";"is";"a";"test" > > Resulting in an output of: > > ['this', 'is', 'a', 'test'] > > However, if I modify the csv to: > > "t"h"is";"is";"a";"test" > > The output changes to: > > ['th"is"', 'is', 'a', 'test'] I'd be tempted to say that this is a bug, except that I think the definition of "c

Re: Building a "safe" python?

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 16:29:23 -0300, <[EMAIL PROTECTED]> escribió: > I'm making a game where you'll be able to make your own mods and I > want to be able to write these mods in python. However, python has a > lot of "dangerous" functions (like erase any file on the harddrive > etc) so I want a "s

Instrumented web proxy

2008-03-27 Thread Andrew McLean
I would like to write a web (http) proxy which I can instrument to automatically extract information from certain web sites as I browse them. Specifically, I would want to process URLs that match a particular regexp. For those URLs I would have code that parsed the content and logged some of it

Re: Signal problem

2008-03-27 Thread Jeffrey Froman
Fabio Durieux Lopes wrote: > def signalHandler(signum, frame): > terminate = True This creates a new variable named "terminate" inside the signalHandler function's local scope. To adjust the value of a module-level global from inside a function, use the "global" keyword: def signalHandl

Re: Regarding __slots__ and other stuff: A couple of questions

2008-03-27 Thread dave berk
Didn't see your answer, Gabriel. Thanks, now I understand it even better. On 3/27/08, dave berk <[EMAIL PROTECTED]> wrote: > > sorry, forget all I wrote: I should have read this more thoroughly, it > explained it all > > http://www.cafepy.com/article/python_attributes_and_methods/python_attributes

Re: Regarding __slots__ and other stuff: A couple of questions

2008-03-27 Thread dave berk
sorry, forget all I wrote: I should have read this more thoroughly, it explained it all http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.htm Descriptors only wor

Re: Signal problem

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 16:27:16 -0300, Fabio Durieux Lopes <[EMAIL PROTECTED]> escribió: >On daemon.py I have: > > terminate = False > > def signalHandler(signum, frame): >terminate = True > >And my main loop goes like this: > >'while(not daemon.terminate):' > >When the signal t

Re: PyCon Feedback and Volunteers (Re: Pycon disappointment)

2008-03-27 Thread Aahz
In article <[EMAIL PROTECTED]>, fumanchu <[EMAIL PROTECTED]> wrote: >On Mar 16, 5:09 pm, [EMAIL PROTECTED] (Aahz) wrote: >> >> If you did not like the programming this year (aside from the sponsor >> talks) and you did not participate in organizing PyCon or in delivering >> presentations, it is Y

Re: How to take snap shot of the of project screen in Python

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 15:24:05 -0300, Praveena Boppudi (c) <[EMAIL PROTECTED]> escribió: > Can anyone help me out? What is "the project screen"? Do you want your development session using any IDE? Your running program? What platform? OS? Console or graphical application? Why using Python? -- Ga

Re: Pycon disappointment

2008-03-27 Thread Aahz
In article <[EMAIL PROTECTED]>, Barry Hawkins <[EMAIL PROTECTED]> wrote: > >I'll step out and say that some of the non-vendor talks were quite >weak. The most severe was a talk on Stackless where the original >speaker was unable to be here and someone got up and clicked through >the slide deck at

Determine size of string in bytes

2008-03-27 Thread breal
Forgive me for this question which is most likely stupid... How do I determine the number of bytes a string takes up? I have a soap server that is returning a serialized string. It seems that when the string goes over 65978 characters it does not return to the soap client. Instead I get an erro

csv Parser Question - Handling of Double Quotes

2008-03-27 Thread jwbrown77
Hello, I am trying to read a csv file. I have the following functioning code: BEGIN import csv reader = csv.reader(open("test.csv", "rb"), delimiter=';') for row in reader: print row END This code will successfully parse my csv file formatted as such: "this";"is";"a";"t

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Martin Blume
"Istvan Albert" schrieb > > > Is subprocess.Popen completely broken? > > Your lack of faith in Python is somewhat > disturbing ... > I have consistently made the experience that when I was about to ask "is X completely broken", the error was on my side. Martin -- http://mail.python.org/ma

Re: Regarding __slots__ and other stuff: A couple of questions

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 11:27:42 -0300, dave berk <[EMAIL PROTECTED]> escribió: > *first:* > Why doesn't this works? > class C(object): > ... __slots__ = ['foo', 'bar'] > ... class_attr = 'class attribute' > ... c = C() c.foo = 'foo' c.bar = 'bar' c.bar, c.foo > ('bar', 'fo

Building a "safe" python?

2008-03-27 Thread martin . nordstrom87
I'm making a game where you'll be able to make your own mods and I want to be able to write these mods in python. However, python has a lot of "dangerous" functions (like erase any file on the harddrive etc) so I want a "safe" python. I first found RExec but that is disabled in python 2.5 so I was

Re: Plugin framework - Overcomplicating things?

2008-03-27 Thread [EMAIL PROTECTED]
On Mar 27, 4:18 am, André <[EMAIL PROTECTED]> wrote: > On Mar 27, 3:31 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > > > En Thu, 27 Mar 2008 01:50:56 -0300, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> escribió: > > > > All this comes to my question - am I overcomplicating this project? I

Signal problem

2008-03-27 Thread Fabio Durieux Lopes
Hello again! Full of problems today! This one is about signal treatment. I made a daemon and set it to treat 2 signals: SIGALRM and SIGTERM. It goes like this: signal.signal(signal.SIGTERM, daemon.signalHandler) signal.signal(signal.SIGALRM, aFilter.alarmHandler) On daemon.py I

Time problem (again)

2008-03-27 Thread Fabio Durieux Lopes
Hi, I'm recreating a date-time based on a string and I have a problem when daylight savings time is set (I'm off by 1). So today I forced my computer into daylight savings time and debugged it again, but this time I noticed something strange. This is the documentation from python libr

Re: And the reverse? Does os also import os.path?

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 14:22:11 -0300, Bruno Desthuilliers <[EMAIL PROTECTED]> escribió: > Wilbert Berendsen a écrit : >> If i do >> > import os > os.path.abspath("bla") >> '/home/wilbert/bla' >> >> it seems that just import os also makes available al os.path functions. >> >> But is that al

Re: Py2exe embed my modules to libary.zip

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 14:34:02 -0300, Larry Bates <[EMAIL PROTECTED]> escribió: > Create your py2exe distribution without a zipfile and all the modules > will just be put into the installation directory. Use Inno Setup to > make a proper installer for your application. I second that. It's the ea

How to take snap shot of the of project screen in Python

2008-03-27 Thread Praveena Boppudi (c)
Hi, Can anyone help me out? Thanks, Praveena. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Istvan Albert
On Mar 27, 10:53 am, Skip Montanaro <[EMAIL PROTECTED]> wrote: > Is subprocess.Popen completely broken? Your lack of faith in Python is somewhat disturbing ... -- http://mail.python.org/mailman/listinfo/python-list

Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-27 Thread Michał Janeczek
On Thu, Mar 27, 2008 at 7:23 PM, Joshua Kugler <[EMAIL PROTECTED]> wrote: > You might want to take a look at this: > > http://www.artfulcode.net/articles/extending-python-almost-anything/ > > That might get you started at least on the calling Haskell part. Yes, ctypes is on my related works/pro

Re: Tkinter menus made easy

2008-03-27 Thread MartinRinehart
[EMAIL PROTECTED] wrote: > menudef = """ > File > New,callNew,Ctrl-N > New Window, callNewWindow, Ctrl-Shift-N > __ > Open, lambda e=0:para(1), Ctrl-O Nice design. I looked at it for a few seconds and didn't even think about pressing F1. Mine does

Re: Tkinter menus made easy

2008-03-27 Thread MartinRinehart
Guilherme Polo wrote: > there is a > gui designer tool for tkinter called GUI Designer (what a bad name), > which used to be called SpecTcl, where you can design the menus and it > then converts to python code. I tried it. after about 10 minutes I was as far as "help not found." Is anyone out t

Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-27 Thread Joshua Kugler
Micha? Janeczek wrote: > Hi, > > I am a student interested in participating in this year's SoC. > At http://tsk.ch.uj.edu.pl/~janeczek/socapp.html (and also below > in this email) you can find a draft of my project proposal. > > I'd like to ask you to comment on it, especially the deliverables >

Re: Pystemmer 1.0.1 installation problem in Linux

2008-03-27 Thread Jason Scheirer
On Mar 27, 8:40 am, mungkol <[EMAIL PROTECTED]> wrote: > Dear all, > > I am a newbie to Python community. For my project, I tried to install > Pystemmer 1.0.1 (http://snowball.tartarus.org/wrappers/ > PyStemmer-1.0.1.tar.gz) on my linux ubuntu 7.10 machine but > unsuccessful. It produced the follow

ctypes and gmp

2008-03-27 Thread Miki
Hello All, Playing around with ctypes, I'm try to use gmp (gmpy is excellent but I want to learn ctypes). I'm running: #!/usr/bin/env python from ctypes import * class mpz(Structure): _fields_ = [ ("_mp_alloc", c_int), ("_mp_size", c_int), ("_mp_d", POINTER(c_uint))

Re: Pystemmer 1.0.1 installation problem in Linux

2008-03-27 Thread Miki
Hello Supheakmungkol, > I am a newbie to Python community. For my project, I tried to install > Pystemmer 1.0.1 (http://snowball.tartarus.org/wrappers/ > PyStemmer-1.0.1.tar.gz) on my linux ubuntu 7.10 machine but > unsuccessful. It produced the following error: > > running install > running build

Set sys.stdout.encoding to utf8 in emacs/python-mode?

2008-03-27 Thread damonwischik
I use emacs 22 and python-mode. Emacs can display utf8 characters (e.g. when I open a utf8-encoded file with Chinese, those characters show up fine), and I'd like to see utf8-encoded output from my python session. >From googling, I've found references to * locale.getdefaultlocale(), which is ('en_

Re: Py2exe embed my modules to libary.zip

2008-03-27 Thread Larry Bates
Create your py2exe distribution without a zipfile and all the modules will just be put into the installation directory. Use Inno Setup to make a proper installer for your application. -Larry On Thu, 2008-03-27 at 06:44 -0700, [EMAIL PROTECTED] wrote: > On 27 ožu, 10:44, "Gabriel Genellina" <[EMA

Re: "Soup Strainer" for ElementSoup?

2008-03-27 Thread Stefan Behnel
erikcw wrote: > I'm parsing real-world HTML with BeautifulSoup and XML with > cElementTree. > > I'm guessing that the only benefit to using ElementSoup is that I'll > have one less API to keep track of, right? If your "real-world" HTML is still somewhat close to HTML, lxml.html might be an option

Re: And the reverse? Does os also import os.path?

2008-03-27 Thread Bruno Desthuilliers
Wilbert Berendsen a écrit : > If i do > import os os.path.abspath("bla") > '/home/wilbert/bla' > > it seems that just import os also makes available al os.path functions. > > But is that always true? Nope. Not all packages expose their sub-packages. -- http://mail.python.org/mailman

Re: singleton decorator

2008-03-27 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hallo, > playing with the decorators from PEP 318 I found the elegant singleton > decorator. > > def singleton(cls): > instances = {} > def getinstance(): > if cls not in instances: > instances[cls] = cls() > return instances[cls] >

singleton decorator

2008-03-27 Thread r . grimm
Hallo, playing with the decorators from PEP 318 I found the elegant singleton decorator. def singleton(cls): instances = {} def getinstance(): if cls not in instances: instances[cls] = cls() return instances[cls] return getinstance @singleton class A: pass

Re: dynimac code with lambda function creation

2008-03-27 Thread Bruno Desthuilliers
Justin Delegard a écrit : > So I am trying to pass an object's method call I assume you mean "to pass an object's method", since I don't get what passing "an object's method call" could mean. > to a function that > requires a function pointer. s/pointer/object/ There's nothing like a pointer

Re: first interactive app

2008-03-27 Thread Tim Arnold
"Miki" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello Tim, >> >> Any ideas on a simple interface for this? >> > How about something like: > > Chapter 1 (001-200 200) > Chapter 2 (200-300 100) > -- 001-300 300 > Chapter 3 (300-450 150) > Chapter 4 (450-500 50) >

Re: dynimac code with lambda function creation

2008-03-27 Thread Laszlo Nagy
Justin Delegard wrote: > So I am trying to pass an object's method call to a function that > requires a function pointer. I figured an easy way to do it would be to > create a lambda function that calls the correct method, but this is > proving more difficult than I imagined. > > Here is the fu

Re: Psyco alternative

2008-03-27 Thread king kikapu
> One reason attention is going to PyPy instead of Psyco... > > Jean-Paul I had a look at PyPy, it, indeed, have a very long way to go so we can consider it an alternative. -- http://mail.python.org/mailman/listinfo/python-list

Dynamic code problem

2008-03-27 Thread perlefenc
My dynamic code failed at this site http://playwide1.extra.hu/, need some help thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Psyco alternative

2008-03-27 Thread Jean-Paul Calderone
On Thu, 27 Mar 2008 08:59:33 -0700 (PDT), [EMAIL PROTECTED] wrote: >Diez B. Roggisch: >> the author says that the approach is flawed, so at *some* >> point it will be discontinued. > >Can't Psyco be improved, so it can compile things like: > >nums = (i for i in xrange(20) if i % 2) >print sum(n

dynimac code with lambda function creation

2008-03-27 Thread Justin Delegard
So I am trying to pass an object's method call to a function that requires a function pointer. I figured an easy way to do it would be to create a lambda function that calls the correct method, but this is proving more difficult than I imagined. Here is the function I'm using: def objectMetho

Re: Psyco alternative

2008-03-27 Thread bearophileHUGS
Diez B. Roggisch: > the author says that the approach is flawed, so at *some* > point it will be discontinued. Can't Psyco be improved, so it can compile things like: nums = (i for i in xrange(20) if i % 2) print sum(nums) I think the current Psyco runs slower than Python with generators/ it

Re: Tkinter menus made easy

2008-03-27 Thread bearophileHUGS
On Mar 27, 3:54 pm, [EMAIL PROTECTED] wrote: > Writing Tkinter menu code used to be rather tedious, uninspiring work. > I figured that I could delegate the job to a program: I did develop a proggy that takes the following as input, it's part of my "agui" project, you can use it as an idea to impro

Re: Line segments, overlap, and bits

2008-03-27 Thread Istvan Albert
On Mar 26, 5:28 pm, Sean Davis <[EMAIL PROTECTED]> wrote: > I am working with genomic data. Basically, it consists of many tuples > of (start,end) on a line. I would like to convert these tuples of > (start,end) to a string of bits where a bit is 1 if it is covered by > any of the regions describ

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread skip
>> Why should I need to set shell=True? I'm not globbing anything. The >> second case still fails: Jerry> RTFM Thank you. I had. The bits about the type of the args parameter don't mention the shell parameter or that there was any difference between using strings or lists. I mis

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Gary Herron
Skip Montanaro wrote: >>> >>> proc = subprocess.Popen ("ls /tmp") >>> >> proc = subprocess.Popen ("ls /tmp", shell=True) >> >> or >> >> proc = subprocess.Popen (["ls", "/tmp"]) >> >> should work. >> > > Why should I need to set shell=True? I'm not globbing anything. The > second case

Pystemmer 1.0.1 installation problem in Linux

2008-03-27 Thread mungkol
Dear all, I am a newbie to Python community. For my project, I tried to install Pystemmer 1.0.1 (http://snowball.tartarus.org/wrappers/ PyStemmer-1.0.1.tar.gz) on my linux ubuntu 7.10 machine but unsuccessful. It produced the following error: running install running build running build_ext buildi

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Lee Capps
On Mar 27, 2008, at 10:53 AM, Skip Montanaro wrote: > I am trying to replace os.system calls with subprocess.Popen. This > simple > example fails miserably: > proc = subprocess.Popen ("ls /tmp") > Traceback (most recent call last): > File "", line 1, in > File "/home/titan/skipm/loca

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Skip Montanaro
Jerry Hill gmail.com> writes: > It's looking for an executable named "ls /tmp" Since it can't find > one, it raises an exception. > > If you just want to replace an os.system call, you need to pass > shell=True to Popen, like this: > proc = subprocess.Popen("ls /tmp", shell=True) > > That will

Re: Checking processes running under Windows

2008-03-27 Thread Shane Geiger
One way: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303339 Another way: wmi # List all running processes # http://tgolden.sc.sabren.com/python/wmi_cookbook.html#running_processes import wmi c = wmi.WMI () for process in c.Win32_Process (): print process.ProcessId, process.Name

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Guilherme Polo
2008/3/27, Skip Montanaro <[EMAIL PROTECTED]>: > > > >>> proc = subprocess.Popen ("ls /tmp") > > > > proc = subprocess.Popen ("ls /tmp", shell=True) > > > > or > > > > proc = subprocess.Popen (["ls", "/tmp"]) > > > > should work. > > > Why should I need to set shell=True? The default is s

Re: Checking processes running under Windows

2008-03-27 Thread Tim Golden
João Rodrigues wrote: > Hello all! I'm trying to write a script that needs to check which processes > are running under Windows (XP Pro, Home, whatever). The method I'm using is: > process_list = os.popen('TASKLIST').read() > > However, XP Home doesn't have the tasklist.exe tool so, this is

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Jerry Hill
> Why should I need to set shell=True? I'm not globbing anything. The > second case still fails: RTFM -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe socket.gaierror (10093)

2008-03-27 Thread Knut
This is frustrating. I was working on writing a sample for my problem. I start with dissecting my code which still gives the same error. Then I start thinking that it might be my setup file doing the damage. And i start it from scratch. Everything suddenly works. Fine! i think, i will have to sta

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Skip Montanaro
> > >>> proc = subprocess.Popen ("ls /tmp") > > proc = subprocess.Popen ("ls /tmp", shell=True) > > or > > proc = subprocess.Popen (["ls", "/tmp"]) > > should work. Why should I need to set shell=True? I'm not globbing anything. The second case still fails: >>> proc = subprocess.Popen (["/

  1   2   >