Thomas Korimort wrote:
> Hi!
>
> Does anyone know the precise circumstances when the error
>
> "Fatal Python error: Py_EndInterpreter: thread still has a frame"
>
> does occur. I checked the source code of pythonrun.c, which tells me
> that this error message is thrown in Py_EndInterpreter, when
>
On 2/3/06, John Dean <[EMAIL PROTECTED]> wrote:
> Hi
>
> Could somebody, please tell me where I can find information about embedding
> Python into a C/C++ application. The example in the docs is rather simple. I
> am looking for something a bit more complex and longer
For my opinion: Boost.Python
Hello:
Does Python support a peek like method for its file objects?
I'd like to be able to look at the next byte in a disk file before
deciding whether I should read it with, say, the read() method.
Is it possible to do so in Python?
Your answer would be much appreciated.
Thanks.
Ok, I finally got it working! See below
On 2/4/06, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Sat, 04 Feb 2006 02:18:27 -0500, Gregory Piñero wrote:
> > class Node:
> > def __init__(self):
> > self.arg0=0
> > self.arg1=0
> > self.arg2=0
> > self.arg3=0
>
>
Peter Hansen <[EMAIL PROTECTED]> wrote:
> More precisely, the state of the function is *saved* when a yield
> occurs, so you certainly don't *recreate* it from scratch, but merely
> restore the state, and this should definitely be faster than creating it
> from scratch in the first place.
Right
Shalabh Chaturvedi wrote:
> [EMAIL PROTECTED] wrote:
>
> A class-to-class and method-to-method rewrite will give some but likely
> not the full benefit of moving to Python. A redesign might be necessary
> - making it more 'Pythonic' in the process. In my experience, many cruft
> classes that ex
"Randall Parker" <[EMAIL PROTECTED]> writes:
[...]
> The code I'm writing in Python is a test executive to test embedded C
> code. Then tests get written in Python that the test executive
> processes. No, I'm not going to write yet another layer of tests in
> order to compensate for shortcomings in
Ivan Voras wrote:
> Tuvas wrote:
>>waits for a lul in the computing process. How can I ensure that this
>>does not happen? This thread uses little processing power, so it could
>>be set to a high priority, if there is a way to do this. Thanks!
>
> Python is bad for concurrently executing/computing
Joseph Garvin wrote:
> Wolfgang Keller wrote:
>>If this is actually also true in the general case, and not due to eventual
>>non-representativeness of the test mentioned above, is it simply due to a
>>less-than-optimum implementation of generators in the current Pyython
>>interpreter and thus li
"Randall Parker" <[EMAIL PROTECTED]> writes:
[...]
> Also, a lot of C++'s flaws flow from the fact that it is old and grew
> in lots of increments.
That was a deliberate decision on the part of C++'s designers!-)
I guess the same is true of Python in some respects: it's still
incrementally changi
Brian Blais wrote:
> I have a string input from the user, and want to parse it to a
> number, and would like to know how to do it. I would like to be able
> to accept arithmetic operations, like:
>
> '5+5'
> '(4+3)*2'
> '5e3/10**3'
>
> I thought of using eval, which will work, but could lead to b
Tuvas wrote:
> waits for a lul in the computing process. How can I ensure that this
> does not happen? This thread uses little processing power, so it could
> be set to a high priority, if there is a way to do this. Thanks!
Python is bad for concurrently executing/computing threads, but it
shoul
Ivan Voras wrote:
> Because "bar and aba happen to be parts of extension library" :)
To end this disussion: I meant "doing it in C" as a colloquial
expression, not a technical one. The expression holds true for every
case where a function/class/module/etc is implemented in a lower-level
langua
Fredrik Lundh wrote:
>
> uhuh? so why did you just argue that
>
> if foo.bar():
> bar.aba()
>
> means "doing it in C" if bar and aba happens to be parts of an extension
> library ?
Because "bar and aba happen to be parts of extension library" :)
--
http://mail.python.org/mailman/
Hi,
Since May 2005 there is a port of python (v2.4.1) for Apple iPod.
Porting was an 'easy' job, the only consideration was how you can
write with a
iPod, ipodlinux [1] people did an interface called iPodRead that
allows you
type into iPod scrolling left or right on the wheel. (This affects
[EMAIL PROTECTED] wrote:
> I've got a fairly substantial webapp written in Java (plus Tomcat,
> Hibernate, Struts, JSP, MySQL) that is a bit of a bear to work with. I
> didn't write it. Much of it is only very sparsely documented (if at
> all). No design docs anywhere. It's a large webapp with many
Joseph Garvin wrote:
>
> I am not a CPython or PyPy hacker, but I would guess that it will always
> be slower as a matter of principal. When resuming a generator you have
> to resetup the state the function was in when it was last called, which
> I think should always be more costly than callin
Hi,
Anyone tries to use BeautifulSoup (
http://www.crummy.com/software/BeautifulSoup/ ) in
Jython? I can not run that ,the error that Jython
gives me is: unpack sequence too long.
Sincerely,
Erica
__
赶快注册雅虎超大容量免费邮箱?
http://cn.mail.yahoo.com
--
TPJ wrote:
> I understand your POV and I really appereciate your reply, but I doubt
> that I could simplify my code to make it small *enough* to fit in one
> post and not look too long.
The pont of the exercise of taking non-working code and trying to cut
away parts that aren't part of the probl
Thomas Guettler wrote:
> Hi,
>
> Is there an application like Squirrelmail[1] written in python?
>
> I want to access IMAP folder with a web-browser.
>
> Google shows me some dead projects. Most webmail applications
> seem to be written in PHP. Is there a useable webmailer written
> in python?
>
Peter Hansen wrote:
> Please see this page: http://docs.python.org/ref/strings.html and read
> about escape sequences in strings, and about raw strings.
Thanks Peter. Forgot about that one. In a way, I wish it *would* have
given me trouble, so I could have found it early rather than later.
--
pyluke wrote:
> Scott David Daniels wrote:
>> pyluke wrote:
>>> I... want to find lines with ... "\[" but not instances of "\\["
>>
>> If you are parsing with regular expressions, you are running a marathon.
>> If you are doing regular expressions without raw strings, you are running
>> a marathon
Wolfgang Keller wrote:
>If this is actually also true in the general case, and not due to eventual
>non-representativeness of the test mentioned above, is it simply due to a
>less-than-optimum implementation of generators in the current Pyython
>interpreter and thus likely to change in the futu
John M. Gabriele wrote:
>> But once it is
>> there, Python is a good choice for web apps. Java is slow
>
> Slow? They're both dynamic languages, but Java is statically
> typed (with less work to do at runtime). For long-running processes,
> I'd guess that Java bytecode executes faster than Python
Hi,
Is there an application like Squirrelmail[1] written in python?
I want to access IMAP folder with a web-browser.
Google shows me some dead projects. Most webmail applications
seem to be written in PHP. Is there a useable webmailer written
in python?
Thomas
--
Thomas Guettler, http://www
> 2. Read the module's documentation. Several time. In your case read the
> "negative lookbehind assertion" part "(? you understand how it may be of use to you.
OK. lookbehind would be more useful/suitable here...
--
http://mail.python.org/mailman/listinfo/python-list
Gregory Piñero wrote:
> I want to walk down each tree and get a random subtree at a random
> depth.
Can you quantify that randomness? Should it be uniform at each level?
Thinking about this may be fruitful. I don't yet know whether you need
to see all leaves before you know which subtree
Hello,
in <[EMAIL PROTECTED]>, Magnus Lycka <[EMAIL PROTECTED]> posts the
result of a short test that seems to indicate that resuming a generator takes
more time than calling a function.
If this is actually also true in the general case, and not due to eventual
non-representativeness of the te
> To add to what scott said, two advices:
> 1. Use Kodos, it's a RE debugger and an extremely fine tool to generate
> your regular expressions.
Ok, just found this. Will be helpful.
> 2. Read the module's documentation. Several time. In your case read the
> "negative lookbehind assertion" par
Scott David Daniels wrote:
> pyluke wrote:
>> I'm parsing LaTeX document and want to find lines with equations
>> blocked by "\[" and "\]", but not other instances of "\[" like "a & b
>> & c \\[5pt]"
>> so, in short, I was to match "\[" but not "\\]" I've tried:
>> check_eq = re.compile('(?
Scott David Daniels wrote:
> pyluke wrote:
>> I'm parsing LaTeX document and want to find lines with equations blocked
>> by "\[" and "\]", but not other instances of "\[" like "a & b & c \\[5pt]"
>> so, in short, I was to match "\[" but not "\\]" I've tried:
>> check_eq = re.compile('(?!\%\
pyluke wrote:
> I'm parsing LaTeX document and want to find lines with equations blocked
> by "\[" and "\]", but not other instances of "\[" like "a & b & c \\[5pt]"
> so, in short, I was to match "\[" but not "\\]" I've tried:
> check_eq = re.compile('(?!\%\s*)\[')
> check_eq.search(li
Ernesto <[EMAIL PROTECTED]> wrote:
> NEVERMIND ! Here is the solution...
>
> #
> if (os.path.isdir("C:\\MyNewFolder") == 0):
> os.mkdir("C:\\MyNewFolder")
> # -
M
At first I'd like to thank you for such a long answer.
> (...)
> You need to simplify the code as much as possible, cutting away everything
> you can, to the SMALLEST amount of code that still experiences the problem.
I understand your POV and I really appereciate your reply, but I doubt
that I c
Thanks for the advice guys. See below.
On 2/4/06, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Sat, 04 Feb 2006 02:18:27 -0500, Gregory Piñero wrote:
>
> > class Node:
> > def __init__(self):
> > self.arg0=0
> > self.arg1=0
> > self.arg2=0
> > self.arg3=0
>
Terry Hancock <[EMAIL PROTECTED]> wrote:
> On Thu, 02 Feb 2006 19:27:55 -0600
> DH <[EMAIL PROTECTED]> wrote:
> > But I think most people who don't like the extraneous
> > 'self' in python just consider it a minor inconvenience
> > and don't even notice it after using python for a while.
>
>
Dear all,
I need to create a script which will extract the contents of 2 cells of
an html that contains a specified number of cells.Then I need to put
that contents in another cells of my own html page.How can i do that?Any
samples, tutorials, advice?
--
http://mail.python.org/mailman/listinfo/py
Robot <[EMAIL PROTECTED]> writes:
> Dear all,
> I need to create a script which will extract the contents of 2 cells
> of an html that contains a specified number of cells.Then I need to
> put that contents in another cells of my own html page.How can i do
> that?Any samples, tutorials, advice?
Robot wrote:
> Dear all,
> I need to create a script which will extract the contents of 2 cells of
> an html that contains a specified number of cells.Then I need to put
> that contents in another cells of my own html page.How can i do that?Any
> samples, tutorials, advice?
>
You should take a lo
Quoth [EMAIL PROTECTED]:
...
| The first point is: Python has global functions, as well as methods. If
| f(a) should look up f inside a first, that would shadow any global or
| local f. That's bad, because python is dynamically typed, and you
| sometimes down' know what "a" is. Things like "open(fi
Robot:
>I need to create a script which will extract the contents of 2 cells of
>an html that contains a specified number of cells.Then I need to put
>that contents in another cells of my own html page.How can i do that?
http://www.python.org/doc/lib/module-htmllib.html
--
René Pijlman
--
http:
I'm parsing LaTeX document and want to find lines with equations blocked
by "\[" and "\]", but not other instances of "\[" like "a & b & c \\[5pt]"
so, in short, I was to match "\[" but not "\\]"
to add to this, I also don't want lines that start with comments.
I've tried:
check_eq = re.compil
Blair P. Houghton <[EMAIL PROTECTED]> wrote:
...
> > It is (search for 'staticmethod' and 'classmethod'). But there's not
> > much use for 'static methods' in Python - we usually just use plain
> > functions ('classmethods' are another beast - much more useful than
> > staticmethods)
>
> Does i
Daniel Nogradi <[EMAIL PROTECTED]> wrote:
...
> So after all, what is a 'factory' or 'factory function'?
A brief explanation in Python terms is at
http://www.aleax.it/ep03_pydp.pdf -- "pages" (slides) 37-44 (the rest of
the presentation is about an even more fundamental design pattern,
"templat
> I have a string input from the user, and want to parse it
> to a number, and would like to know how to do it. I
> would like to be able to accept arithmetic operations,
> like:
>
> '5+5'
> '(4+3)*2'
> '5e3/10**3'
>
> I thought of using eval, which will work, but could lead
> to bad security pr
Thank you VERY much!
These other errors are not so serious. I think I'll fix them soon. The
most important thing is that now I'm ready to work on that code again.
Life is beautiful again!
Damn, I knew it is some very stupid mistake. I must learn how to use
that pylint, instead of asking people on
Daniel Nogradi wrote:
[...]
> So after all, what is a 'factory' or 'factory function'?
The name is intended to be indicative: it's a function that makes things
- usually instances of some class.
As has already been pointed out. Image is a module from PIL, so
Image.open() is a function in that m
Brian Blais wrote:
> Hello,
>
> I have a string input from the user, and want to parse it to a number,
> and would like to know how to do it. I would like to be able to accept
> arithmetic operations, like:
>
> '5+5'
> '(4+3)*2'
> '5e3/10**3'
>
> I thought of using eval, which will work, but
On Sat, 04 Feb 2006 06:48:11 -0500, Brian Blais wrote:
> Hello,
>
> I have a string input from the user, and want to parse it to a number, and
> would like
> to know how to do it. I would like to be able to accept arithmetic
> operations, like:
>
> '5+5'
> '(4+3)*2'
> '5e3/10**3'
>
> I thou
Brian Blais schrieb:
> Hello,
>
> I have a string input from the user, and want to parse it to a number,
> and would like to know how to do it. I would like to be able to accept
> arithmetic operations, like:
>
> '5+5'
> '(4+3)*2'
> '5e3/10**3'
>
> I thought of using eval, which will work, bu
Donn Cave wrote:
> Quoth [EMAIL PROTECTED]:
> | > Still see no problem. Of course, it goes without saying that
> | > Python 2.4 doesn't work this way, but given that it's theoretically
> | > possible for f(a) to be resolved similarly to a.f, then I really
> | > do not see what you're seeing here.
On Sat, 04 Feb 2006 04:21:50 -0800, TPJ wrote:
> Help me please, because I really don't get it. I think it's some stupid
> mistake I make, but I just can't find it. I have been thinking about it
> for three days so far and I still haven't found any solution.
>
> My code can be downloaded from her
> AttributeError: 'Obj' object has no attribute
> '_Object__ls_demanded_links'
> --
>
> Perhaps I'll explain what's going on there. First, the objects' manager
> is created, and then also some objects are created. After doing that,
> the object calle
Roy Smith wrote:
> In article <[EMAIL PROTECTED]>,
> Peter Hansen <[EMAIL PROTECTED]> wrote:
>
>>You should
>>either prefix your string with an "r" (just before the opening quotation
>>mark) or escape the backslashes (as in use "C:\\Folder..." instead of
>>just "C:\Folder").
>
> Of the two al
Oops.
http://www.activestate.com/_images/screenshots/ss_Komodo_rails_large.gif
is the debugger screenshot for Ruby (Komodo supports more than one
language). Python's debugger in Komodo looks exactly the same.
--
http://mail.python.org/mailman/listinfo/python-list
n.estner wrote:
> Yes, I 100% agree to that point!
> But the point is, the current situation is not newbie-friendly (I can
> tell, I am a newbie): I declare a method with 3 parameters but when I
> call it I only pass 2 parameters. That's confusing. If I declare a
> member variable, I write: "self.
> as it would be so obviously a good thing to have a graphical (or maybe
> curses-base) browser through the dynamic state of a Python program, it's
> probably there.
>
> Can someone point me to something?
If you mean graphical debuggers, most Python specific IDEs have them.
Few examples ..
Python
> > Actually, this way of creating a class instance is good OO practice in
> > many places: The Image.open() method acts as a factory-function for
> > creating Image objects.
> > You don't know, until you inspect the return value, if the created
> > object is actually an instance of class Image or
Hello,
I have a string input from the user, and want to parse it to a number, and
would like
to know how to do it. I would like to be able to accept arithmetic operations,
like:
'5+5'
'(4+3)*2'
'5e3/10**3'
I thought of using eval, which will work, but could lead to bad security
problems
(n
Help me please, because I really don't get it. I think it's some stupid
mistake I make, but I just can't find it. I have been thinking about it
for three days so far and I still haven't found any solution.
My code can be downloaded from here:
http://www.tprimke.net/konto/PyObject-problem.tar.bz2.
Grant Edwards wrote:
> Definitely. Nobody does single .exe file windows programs
> anymore. A single-file installer is almost as easy.
>
uTorrent, Process Explorer or Media Player Classic are single .exe
windows programs.
Granted, most of them are under-150kb-works-of-arts, but MPC isn't (well
On Sat, 04 Feb 2006 02:18:27 -0500, Gregory Piñero wrote:
> Hi,
>
> Would anyone be able to tell me why my function below is getting stuck
> in infinite recusion?
> Maybe I'm just tired and missing something obvious?
Your code is quite confusing, especially since there is very little
documentati
John M. Gabriele wrote:
> [EMAIL PROTECTED] wrote:
>> But once it is
>> there, Python is a good choice for web apps. Java is slow
>
> Slow? They're both dynamic languages, but Java is statically
> typed (with less work to do at runtime). For long-running processes,
> I'd guess that Java bytecode e
On 2 Feb 2006 09:41:20 -0800, sleepylight <[EMAIL PROTECTED]> wrote:
> Ah! I see now. That makes prefect sense. I guess I was thinking that
> python was simply going to pass a whole command string to the program
> rather than give each argument as individual strings. Seeing this
> makes the doc
Hello,
as it would be so obviously a good thing to have a graphical (or maybe
curses-base) browser through the dynamic state of a Python program, it's
probably there.
Can someone point me to something?
Cheers,
Jens
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern>And several others if you google a bit.
Yes:
http://sourceforge.net/projects/pynetwork/
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Martin Biddiscombe wrote:
> "parameter=12ab"
> "parameter=12ab foo bar"
> "parameter='12ab'"
> "parameter='12ab' biz boz"
> "parameter="12ab""
> "parameter="12ab" junk"
>>> import shlex
>>> def extract(s):
... s = s.split("=")[1]
... s = shlex.split(s)[0]
... return s
...
>>> extract(
>Would anyone be able to tell me why my function below is getting stuck
>in infinite recusion?
>def replace_within_node(node,oldnode,newnode):
>if node is oldnode:
>return newnode
Without looking further, the most likely reason is that the base case is
never true: ie, node is never o
"Jean-Paul Calderone" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm not sure I follow. Surely you're not suggesting that this doesn't
> work:
>
>>>> class X:
>... def foo(self):
>... print 'X.foo', self
>...
>>>> class A(X):
>... pass
69 matches
Mail list logo