On Mar 26, 9:16 pm, Paul Rubin http://[EMAIL PROTECTED] wrote:
Sean Davis [EMAIL PROTECTED] writes:
OR, NOT, etc.). Any suggestions on how to (1) set up the bit string
and (2) operate on 1 or more of them? Java has a BitSet class that
keeps this kind of thing pretty clean and high-level,
En Thu, 27 Mar 2008 00:34:20 -0300, Astan Chee [EMAIL PROTECTED] escribió:
I have a file on another machine on the local network (my machine and
local machines are on windows) and I want to copy it locally. Now the
machine requires authentication and when I try to do a
import shutil
Well, the solution seems to be something like (windows only)
import os
import os.path
import shutil
import sys
import win32wnet
def wnet_connect(host, username, password):
unc = ''.join(['', host])
try:
win32wnet.WNetAddConnection2(0, None, unc, None, username, password)
Hi, I'm fairly new to Python and to this list. I have a problem that
is driving me insane, sorry if it seems simple to everyone, I've been
fighting with it for a while. :))
I want to take a variable length string and use it as a base for
counting, eg. given the string 'abc' the sequence would
On Wed, Mar 26, 2008 at 07:11:15PM -0700, Noah Spurrier wrote:
def set_nonblock(fd):
flags = fcntl.fcntl(fd, fcntl.F_GETFL)
fcntl.fcntl(fd, fcntl.F_SETFL, flags | os.O_NONBLOCK)
Then in the function, after calling popen:
set_nonblock(io.fromchild.fileno())
On Mar 27, 1:15 am, Grimsqueaker [EMAIL PROTECTED] wrote:
Hi, I'm fairly new to Python and to this list. I have a problem that
is driving me insane, sorry if it seems simple to everyone, I've been
fighting with it for a while. :))
I want to take a variable length string and use it as a base
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
can understand the use of something like the trac component system if
I had multiple components and plugins that handled different areas of
On Mar 26, 1:37 pm, Michael Ströder [EMAIL PROTECTED] wrote:
HI!
I had a look on how Doc/ is organized with Python 2.6. There are files with
suffix .rst. Hmm...
I'm maintaing existing docs for python-ldap which I might have to convert to
the new concept in the long run. What's the
That seems to give me the items in the list back in an iterator. Am I
using it incorrectly?
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 27, 2:33 am, Grimsqueaker [EMAIL PROTECTED] wrote:
That seems to give me the items in the list back in an iterator. Am I
using it incorrectly?
Use list( it ).
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 26 Mar 2008 19:45:34 +0100, Heiko Wundram wrote:
Am Mittwoch, 26. März 2008 19:04:44 schrieb David Anderson:
HOw can we use express pointers as in C or python?
There's no such thing as a pointer in Python, so you can't express
them either. Was this what you were trying to ask?
But
Hi,
I wrote a python script to list files in a directory but somehow did it
wrongly by importing os.path instead of os. To my astonishment, it works
just as charm:
#!/usr/bin/python
import os.path
for file in os.listdir('/root/'):
print file
I was wondering why? os.path doesn't contain
Grimsqueaker schrieb:
That seems to give me the items in the list back in an iterator. Am I
using it incorrectly?
No. Just put a list() around it.
Diez
--
http://mail.python.org/mailman/listinfo/python-list
Ron Eggler schrieb:
Hi,
I would like to get the time of the most recent human activity like a cursor
movement or a key hit.
Does anyone know how I can get this back to start some action after there
has been no activity for X minutes/seconds?
Try hooking yourself into the OS
On Mar 27, 6:41 pm, Jerry Fleming [EMAIL PROTECTED] wrote:
Hi,
I wrote a python script to list files in a directory but somehow did it
wrongly by importing os.path instead of os. To my astonishment, it works
just as charm:
#!/usr/bin/python
import os.path
for file in os.listdir('/root/'):
On Mar 26, 9:55 pm, [EMAIL PROTECTED] wrote:
I want to go in to construction. However, 'I' means 'newsgroup' and
'want to go' means 'is'.
If you had an army of two-micron spiders, could we build something?
Use case is an American skyscraper.
They have powerful tricks. Clearly they can
On Wed, 26 Mar 2008 00:27:17 -0700, Arnaud Delobelle wrote:
I'm hardly surprised. The naivety of those who insist that the best
way to understand how new.function and new.code work is to look at the
C source code for object is amusing.
Since 'those who insist...' are just one person, me,
On Wed, 26 Mar 2008 00:55:22 -0700, Arnaud Delobelle wrote:
[snip]
Except it only *appears* to work. What happens if were store the
instances in a list and then execute them all in one go?
Ah yes, nicely spotted. Another solution would be to use a proper factory
function:
def
Hello,
I am using Partial Function Application in a class and I've come up with
a problem, when the method is called it tries to pass self to the
curried/partial function, but this should be the first argument in
reality, but since the function is curried, then the self gets passed as
the
Gabriel Rossetti schrieb:
Hello,
I am using Partial Function Application in a class and I've come up with
a problem, when the method is called it tries to pass self to the
curried/partial function, but this should be the first argument in
reality, but since the function is curried, then
Gabriel Rossetti wrote:
Hello,
I am using Partial Function Application in a class and I've come up with
a problem, when the method is called it tries to pass self to the
curried/partial function, but this should be the first argument in
reality, but since the function is curried, then
Diez B. Roggisch wrote:
Gabriel Rossetti schrieb:
Hello,
I am using Partial Function Application in a class and I've come up with
a problem, when the method is called it tries to pass self to the
curried/partial function, but this should be the first argument in
reality, but since
On Thu, 27 Mar 2008 00:33:21 -0700, Grimsqueaker wrote:
That seems to give me the items in the list back in an iterator. Am I
using it incorrectly?
Given an iterator, you use it like this:
for item in iterator:
print item # or do something else
If you're sure that the iterator is
On 26 Mar, 23:08, Thomas Heller [EMAIL PROTECTED] wrote:
Knut schrieb:
The script can't resolve the server name. Try to do it by hand using
nslookup or even ping (you may want to add a few print statements inside
the script to see the exact host name it is trying to connect to, in case
OK, got that. If I use:
for x in string_cartesian_product('abc'):
print x
I get:
a
b
c
What am I not understanding?
Thank you
--
http://mail.python.org/mailman/listinfo/python-list
Python Programming on Win32 wrote:
The problem is running smtplib in a py2exe compiled exe file. When it
tries to establish a socket to the mail server it fails.
Just wondering someone has encountered this before, and if someone
might be able to point me in the right direction.
Unhandled
On 26 ožu, 20:11, Gabriel Genellina [EMAIL PROTECTED] wrote:
En Wed, 26 Mar 2008 15:38:16 -0300, Tzury Bar Yochay
[EMAIL PROTECTED] escribió:
and then when my application execute code how can I set path to
d3dx module to library.zip/d3dx.py.
I'm not sure is this properly set question.
Grimsqueaker wrote:
That seems to give me the items in the list back in an iterator. Am I
using it incorrectly?
With Dan's functions in cartesian.py you can do the following:
from cartesian import *
def count(digits):
... args = []
... while 1:
... args.append(digits)
En Thu, 27 Mar 2008 05:40:30 -0300, Gabriel Rossetti
[EMAIL PROTECTED] escribió:
if(atomic):
# Lock the service dict and register the service, then unlock it
self.__mutex.lock(reg, service)
self.__mutex.unlock()
I see that you've already solved your original
Gabriel Rossetti a écrit :
Gabriel Rossetti wrote:
Hello,
I am using Partial Function Application in a class and I've come up
with a problem, when the method is called it tries to pass self to
the curried/partial function, but this should be the first argument in
reality, but since the
Gabriel Rossetti wrote:
Gabriel Rossetti wrote:
Hello,
I am using Partial Function Application in a class and I've come up with
a problem, when the method is called it tries to pass self to the
curried/partial function, but this should be the first argument in
reality, but since the
Tim Henderson a écrit :
Hello
I am writing an application that has a mysql back end and I have this
idea to simplify my life when accessing the database. The idea is to
wrap the all the functions dealing with a particular row in a
particular in a particular table inside a class. So if you
En Thu, 27 Mar 2008 06:00:26 -0300, [EMAIL PROTECTED] escribió:
I was add this into my application code:
import sys
import os
my_dir=os.getcwd()
sys.path.append(my_dir)
sys.path.append(my_dir+\\libary.zip)
sys.path.append(my_dir+\\libary.zip\\py2exe) # PY2EXE is folder
f=open(path.txt,w)
barronmo wrote:
I'm trying to get the difference in dates using the time module rather
than datetime because I need to use strptime() to convert a date and
then find out how many weeks and days until that date. I'm a beginner
so any help would be appreciated. Here is the code:
Use strptime
Thomas Dybdahl Ahle a écrit :
On Wed, 2008-03-26 at 23:04 +0100, Michał Bentkowski wrote:
Why does python create a reference here, not just copy the variable?
Python, like most other oo languages, will always make references for =,
unless you work on native types (numbers and strings).
Bruno Desthuilliers wrote:
Gabriel Rossetti a écrit :
Hello,
I am using Partial Function Application in a class and I've come up
with a problem, when the method is called it tries to pass self to
the curried/partial function, but this should be the first argument
in reality, but since
Hello again.
I apologize for not replying earlier but I have been swamped in work
lately. I appreciate your replies. Eventually I chose using curses for
right-hand edge of the window as it seemed to be the most suitable
solution.
Thank you.
ndlarsen
--
2008/3/27, Alex9968 [EMAIL PROTECTED]:
Guilherme Polo wrote:
2008/3/26, Alex9968 [EMAIL PROTECTED]:
Hi all,
I use Tkinter's Pack widget geometry manager (I really prefer it over
using visual GUI designers), so my question is which other GUI toolkits
have similar
barronmo wrote:
I'm trying to get the difference in dates using the time module rather
than datetime because I need to use strptime() to convert a date and
then find out how many weeks and days until that date.
datetime.datetime.strptime was introduced in Python 2.5; what version
are you
On Mar 26, 1:36 pm, Gabriel Genellina [EMAIL PROTECTED]
wrote:
En Wed, 26 Mar 2008 15:04:44 -0300, David Anderson [EMAIL PROTECTED]
escribió:
HOw can we use express pointers as in C or python?
Traceback (most recent call last):
File stdin, line 1, in module
File parser.py, line
Guilherme Polo wrote:
2008/3/27, Alex9968 [EMAIL PROTECTED]:
Guilherme Polo wrote:
2008/3/26, Alex9968 [EMAIL PROTECTED]:
Hi all,
I use Tkinter's Pack widget geometry manager (I really prefer it over
using visual GUI designers), so my question is which other GUI toolkits
Gabriel Rossetti a écrit :
Bruno Desthuilliers wrote:
Gabriel Rossetti a écrit :
(snip)
registerServiceAtomic = partial(__registerService, True)
registerServiceNonAtomic = partial(__registerService, False)
I should pass self when applying partial, but then I can't do that
since self is
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
can understand the use of something like the trac component system if
I
On Mar 25, 7:36 pm, Miki [EMAIL PROTECTED] wrote:
On Mar 24, 8:17 am, [EMAIL PROTECTED] wrote:
I'm looking for a cool trick using generators. Know any exercises I
can work?
Simple one the comes to mind is flattening a list:
list(flatten([1, [[2], 3], [[[4))
[1, 2, 3, 4]
I don't
lialie wrote:
[... snip slightly confused indication that reading back a
binary item using GetChunk appears to double its length ...]
Well I don't know why this should be happening, but I do at
least have a few suggestions:
1) Try using ADODB.Stream instead of GetChunk etc.
2) Try using the
On Mar 27, 4:01 am, Peter Otten [EMAIL PROTECTED] wrote:
Grimsqueaker wrote:
That seems to give me the items in the list back in an iterator. Am I
using it incorrectly?
With Dan's functions in cartesian.py you can do the following:
from cartesian import *
def count(digits):
...
2008/3/27, Alex9968 [EMAIL PROTECTED]:
Guilherme Polo wrote:
2008/3/27, Alex9968 [EMAIL PROTECTED]:
Guilherme Polo wrote:
2008/3/26, Alex9968 [EMAIL PROTECTED]:
Hi all,
I use Tkinter's Pack widget geometry manager (I really prefer it over
using visual GUI
On Mar 27, 6:05 am, Bruno Desthuilliers bruno.
[EMAIL PROTECTED] wrote:
Gabriel Rossetti a écrit :
Bruno Desthuilliers wrote:
Gabriel Rossetti a écrit :
(snip)
registerServiceAtomic = partial(__registerService, True)
registerServiceNonAtomic = partial(__registerService, False)
On Mar 27, 6:19 am, [EMAIL PROTECTED] wrote:
On Mar 25, 7:36 pm, Miki [EMAIL PROTECTED] wrote:
On Mar 24, 8:17 am, [EMAIL PROTECTED] wrote:
I'm looking for a cool trick using generators. Know any exercises I
can work?
Simple one the comes to mind is flattening a list:
Hi,
it seems that Psyco's author will not port it for the upcoming Python
3000 release :(
So, for us who use it we will continue to use CPython 2.5.x version
for some time to come. Is there an alternative to Psyco so i can have
a look at ?
Thanks in advance.
--
Guilherme Polo wrote:
2008/3/27, Alex9968 [EMAIL PROTECTED]:
Guilherme Polo wrote:
2008/3/27, Alex9968 [EMAIL PROTECTED]:
Guilherme Polo wrote:
2008/3/26, Alex9968 [EMAIL PROTECTED]:
Hi all,
I use Tkinter's Pack widget geometry manager (I really prefer it
Guilherme Polo wrote:
2008/3/27, Alex9968 [EMAIL PROTECTED]:
Guilherme Polo wrote:
2008/3/27, Alex9968 [EMAIL PROTECTED]:
Guilherme Polo wrote:
2008/3/26, Alex9968 [EMAIL PROTECTED]:
Hi all,
I use Tkinter's Pack widget geometry manager (I really prefer it
I had no problem with using standard gettext way of doing i18n on
Windows with PyGTK an Glade, apart some quirks with LANG environment
variable. Basically, the code that works looks like this:
import gettext, locale
locale.setlocale(locale.LC_ALL, '')
if os.name == 'nt':
Hi everyone
I've never used the module 'pickle' so far, thus I've got some questions about
how to use it:
Lets say I have instances of class A and class B:
a = A()
b = B()
Is it possible to pickle both of these instances to the same pkl-file or will
that have any bad impact for unpickle
king kikapu [EMAIL PROTECTED] writes:
it seems that Psyco's author will not port it for the upcoming Python
3000 release :(
I think the idea is it will be part of PyPy and you should use that.
--
http://mail.python.org/mailman/listinfo/python-list
On 27 Μαρ, 14:35, Paul Rubin http://[EMAIL PROTECTED] wrote:
king kikapu [EMAIL PROTECTED] writes:
it seems that Psyco's author will not port it for the upcoming Python
3000 release :(
I think the idea is it will be part of PyPy and you should use that.
I know that his efforts are on PyPy
On Thu, 27 Mar 2008 12:28:25 +, Dominique.Holzwarth wrote:
Lets say I have instances of class A and class B:
a = A()
b = B()
Is it possible to pickle both of these instances to the same pkl-file or
will that have any bad impact for unpickle (i.e. the instance are
'mixed' or
On 27 ožu, 10:44, Gabriel Genellina [EMAIL PROTECTED] wrote:
En Thu, 27 Mar 2008 06:00:26 -0300, [EMAIL PROTECTED] escribió:
I was add this into my application code:
import sys
import os
my_dir=os.getcwd()
sys.path.append(my_dir)
sys.path.append(my_dir+\\libary.zip)
king kikapu wrote:
On 27 Μαρ, 14:35, Paul Rubin http://[EMAIL PROTECTED] wrote:
king kikapu [EMAIL PROTECTED] writes:
it seems that Psyco's author will not port it for the upcoming Python
3000 release :(
I think the idea is it will be part of PyPy and you should use that.
I know that
On 27 Μαρ, 15:56, Diez B. Roggisch [EMAIL PROTECTED] wrote:
king kikapu wrote:
On 27 Μαρ, 14:35, Paul Rubin http://[EMAIL PROTECTED] wrote:
king kikapu [EMAIL PROTECTED] writes:
it seems that Psyco's author will not port it for the upcoming Python
3000 release :(
I think the idea is
Ok, i know this. The one that i do not know, is if, let'say, in 2
years it will be ready for seriously development, PyPy will aim to
replace CPython entirely ?? We are talking about an whole new
distribution ?
Most certainly not. It's the goal of each language to finally become
self-hosted,
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?
Thanks,
Wilbert
--
http://www.wilbertberendsen.nl/
You must be the change you wish to see in the world.
-- Mahatma Gandhi
--
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 kind of
useless in that OS. Do you
I'm new to Python. I'm trying to understand the type/class/object(instance)
model. I have read here:
http://www.cafepy.com/article/python_types_and_objects/python_types_and_objects.html
and here:
http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html
as well
As for psyco, are there any alternatives to use now ?
Nope, but I heard through the grapevine that while it won't be supported for
all times to come, a new version is in the making.
Aha!! It seems you have better sources than me! :)
But ultimately, the author says that the approach is
On Thu, 27 Mar 2008 15:19:11 +0100, Diez B. Roggisch [EMAIL PROTECTED]
wrote:
Ok, i know this. The one that i do not know, is if, let'say, in 2
years it will be ready for seriously development, PyPy will aim to
replace CPython entirely ?? We are talking about an whole new
distribution ?
Most
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 stdin, line 1, in module
File /home/titan/skipm/local/lib/python2.5/subprocess.py, line 594, in
__init__
errread,
king kikapu wrote:
As for psyco, are there any alternatives to use now ?
But ultimately, the author says that the approach is flawed, so at *some*
point it will be discontinued. But that could be said about nearly
everything, couldn't it?
It is a pity because this module *does* really solve
Writing Tkinter menu code used to be rather tedious, uninspiring work.
I figured that I could delegate the job to a program:
http://www.martinrinehart.com/articles/menus.py
Run it. Then look at the source (bottom of file). There's a bit more
doc in the doc comment at the top.
Peer review is
2008/3/27, Skip Montanaro [EMAIL PROTECTED]:
I am trying to replace os.system calls with subprocess.Popen. This simple
example fails miserably:
proc = subprocess.Popen (ls /tmp)
proc = subprocess.Popen (ls /tmp, shell=True)
or
proc = subprocess.Popen ([ls, /tmp])
should work.
2008/3/27, [EMAIL PROTECTED] [EMAIL PROTECTED]:
Writing Tkinter menu code used to be rather tedious, uninspiring work.
I figured that I could delegate the job to a program:
I didn't look at it yet, but just in case you weren't aware there is a
gui designer tool for tkinter called GUI Designer
If it's about some problems, then maybe Cython is an alternative.
http://cython.org
Stefan
Hmmm...thanks but i think Pyrex-like solution is not the ideal one.
Coming from C# and having 8 years of expertise on it, i have gain a
very positive thinking about jit compilers and i think that psyco
Is there a way of translating from the Text widget's width/height (in
characters) to pixels so you can open an appropriately sized window?
--
http://mail.python.org/mailman/listinfo/python-list
Skip Montanaro wrote:
I am trying to replace os.system calls with subprocess.Popen. This simple
example fails miserably:
proc = subprocess.Popen (ls /tmp)
Popen expects a list of program arguments. When passed a single string
instead of a list, as in your example, it assumes that the
On Thu, Mar 27, 2008 at 10:53 AM, Skip Montanaro [EMAIL PROTECTED] 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 stdin, line 1, in module
File
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 ([/usr/bin/ls /tmp])
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
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
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 kind of
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 shell=False, which means that Popen
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
Jerry Hill malaclypse2 at 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
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 stdin, line 1, in module
File
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
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 still fails:
proc =
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 missed
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 described by
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 improve
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/
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
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(nums)
My dynamic code failed at this site http://playwide1.extra.hu/, need
some help thank you.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
Miki [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hello Tim,
snip
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)
-- 300-450 250
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 in
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
[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]
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.
--
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. It
1 - 100 of 217 matches
Mail list logo