>>>>> Gabriel Genellina (GG) escribió:
>GG> Hola
>GG> La notebook de Ariel esta en el placard, atrás de Walter.
¿Quién es Walter y dónde esta? :=(
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
htt
TPError (like a 404 File not
found) it will be caught by the "except URLError", but it will not have
a reason attribute, and then you get an exception in the except clause
and the thread will crash.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
ast line, stdout should come out empty because the
output of more doesn't come back to the parent process, but goes to the
original stdout of the calling script.
Also I would use the following:
viewer = ['more', '-EMR']
proc = subprocess.Popen(viewer, stdin=subproce
)
>AJ>for thread in THREADS:
>AJ>thread.run()
You should use thread.start(), not thread.run(). When you use run(), it
will be sequential execution, as you experience. With start() you get
concurrency
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17
>>>>> gganesh (g) wrote:
>g> Hi friends,
>g> I suppose sendmail() can send mails one by one ,how to send mails
>g> concurrently ,
>g> It would be very grateful,if someone could point out a solution.
There is a discussion about this in the thread `Threaded
As I said above you should do the SMTP connection setup, including the
login, here, and store the connection either in self.s or in a local
variable s in the method. As you don't use the s in another method, I
think a local variable is better.
>g> print "Emailed for site %s&quo
#x27; message' when i run 'python -
>s> v'? I don't think I see that many
>s> install message on linux.
I don't see 'install' messages in the included text.
>s> Here is the full message. Thanks for any help.
[deleted]
--
Piet van Oostrum
UR
D_CONST 3 (1)
28 ROT_TWO
29 STORE_FAST 1 (brian)
32 STORE_FAST 2 (test)
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
>L> arguments? How can I do it?
cls.__init__.im_func.__code__.co_argcount
This will include self, so it will be 1 in First and 2 in Second.
However this is very dirty trickery and should not be recommended. It
may also change in future versions and other implementations of Python.
I thin
>>>>> Chris Rebert (CR) wrote:
>CR> On Wed, May 6, 2009 at 5:24 AM, Piet van Oostrum wrote:
>>>>>>>> Lacrima (L) wrote:
>L> But what if I have to instantiate any class with 3 or 4 required
>L> arguments? How can I do it?
>>>
derstand, but if you are trying to build a C extension
>>> for an existing Python 2.5 installation, using Distutils from that
>>> installation should take care of everything for you. Is there a
>>> setup.py file by any chance? Are you using a standard python
&g
a function that creates a new
instance on every call.
But as Martin P. Hellwig has noted, it wouldn't give you sessions anyway.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
is no advantage in
having two of them instead of one. And the name session is misleading.
Please note also that XMLRPC isn't object-oriented. There is just the
server; in the protocol there are no objects other than the server.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
>>>>> Piet van Oostrum (PvO) wrote:
>>>>> Jelle Smet (JS) wrote:
>PvO> One more thing:
>JS> I start python interactively:
>>>>> import xmlrpclib
>>>>> session1=xmlrpclib.ServerProxy('http://localhost:8000')
econd, the mail server probably doesn't like it that
you make such a large number of connections simultaneously. If the mail
server doesn't protest, probably its systems administrator will.
Moreover there is probably no benefit in having 1000 connections open to
the same mail server because long before there will be another
bottleneck such as your network connection or the CPU load of either
your computer or the mail server, unless you are on a very scalable
infrastructure.
A better solution will be to use a Thread Pool with a limited number of
simultaneous threads (my guess is that 10-20 or so would be good
enough).
And as I said to my students yesterday: You shouldn't program
multithreaded applications unless you have studied this subject
thoroughly. Of course I don't know how this applies to you.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
ing should be chosen when
the string goes to the output channel, i.e. outside of the object.
Unfortunately this is one of the leftovers from Python's pre-unicode
heritage. Hopefully in Python3 this will work without problems. Anyway,
in Python 3 the string type is unicode, so at least __repr__ can return
unicode.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
>>>>> "anuraguni...@yahoo.com" (ac) a écrit:
>ac> also not sure why (python 2.5)
>ac> print a # works
>ac> print unicode(a) # works
>ac> print [a] # works
>ac> print unicode([a]) # doesn't works
Which code do you use now?
And what doe
ctually virtual memory size of the process) when
your announcement came along. Fortunately I had not yet started writing
the code :=)
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
r 4 sites have to wait
>gs> for the thread to release the lock?
No. Where does it set a lock? There is only a short lock period in the queue
when an item is put in the queue or got from the queue. And of course we
have the GIL, but this is released as soon as a long during operation is
started - in this case when the Internet communication is done.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
It does not depend on the source code's
encoding (supposing that the encoding declaration in the source is
correct). repr returns unicode(self).encode("utf-8"), so it is utf-8
encoded even when the source code had a different encoding. The u"©au"
string is not dependent on the source encoding.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
e)
t.start()
threads.append(t)
...
for t in threads:
t.join()
Or just don't make them daemonic.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
.ServerProxy(URL_PORT)
print(SESSION.show_random())
print(SESSION.show_random())
SESSION.shutdown_service()
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
>>>>> "anuraguni...@yahoo.com" (ac) wrote:
>ac> and yes replace string by u'\N{COPYRIGHT SIGN}au'
>ac> as mentioned earlier non-ascii char may not come correct posted here.
That shouldn't be a problem for any decent new agent when there is a
d modules are listed on http://docs.python.org/library/.
>SM> import xml.dom.minidom as minidom
These days ElementTree is considered the most pythonic way.
http://docs.python.org/library/xml.etree.elementtree.html
There is also a reimplementation of the ElementTree API based on libxml2
and
;t do**.
There are now two namespaces: one for __main__ and one for x. These are
distinct and have no relationship.
The reason that the first number is 119 and the second is 117 is that
while importing x the variables a and b are not created.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
>>>>> Peter Otten <__pete...@web.de> (PO) wrote:
>PO> Piet van Oostrum wrote:
>>>
>>> This is perfectly normal.
>PO> I'm not 100% sure of that.
Why not?
>PO> Just in case you didn't notice: I'm not the OP. The above p
>LD> I tried using Emacs via SSH from a Mac once. Made me run screaming for the
>LD> nearest Windows box
The standard Windows box doesn't even have SSH AFAIK.
I edit remote files on my local Emacs on Mac OS X with tramp,
certainly when they are on a SSH-accessible machine.
Works like
o a
>g> tree?. And what is the best way to represent a tree in Python?.
http://networkx.lanl.gov/ has all kinds of Dijkstra's algorithms.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
not have seen it, but Fortran and Algol 60 belong to that
category.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
hich might well fit your requirements.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
27;s firewall blocks SOAP calls?
maybe you should ask your network manager.
I used this example in my last lectures and it worked also today:
from SOAPpy import SOAPProxy
url = "http://xurrency.com/servidor_soap.php";
namespace = "http://xurrency.com/api.wsdl";
server = SOAP
elded
>EG> results ranging from suggestions it has been fixed (not for me) to
>EG> recommendations that the user rebuild python against a newer version
>EG> of libtk (which I have no idea how to do).
>EG> I would greatly appreciate any assistance the communit
e is a matter of taste. You can do some timing
experiments yourself to see if there are significant differences, but I
wouldn't expect so.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
not isinstance(stop, int):
stop = self.index(stop)
return list.__getitem__(self, slice(start,stop))
return list.__getitem__(self, indx)
week = KeyList(['sun','mon','tue','wed','thu','fri','sat'
IPE
pid = os.fork()
if pid == 0: # child code
p1 = Popen(["sleep", "10"], stdout=PIPE)
p2 = Popen(["mail", "-s", "test", "dans"], stdin=p1.stdout)
os._exit(0)
You could use: os._exit(os.waitpid(p2.pid, 0)[1]) but as you don't wait
for the child the actual exit status code is useless.
On Windows there is no fork(), therefore you would have to spawn a
separate Python program that only does the body of the if.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
w do you
think that anybody will be able to divine what is happening?
http://catb.org/esr/faqs/smart-questions.html
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
without correction.I think it didn't enter the method or
>a> any method above the gui.
>a> Please if you have any information,inform me
You don't call correct() or textcorrect() anywhere in your GUI code.
I think instead of self.res= words(self.string) you should call one of
these.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
o give it a self
parameter. The same applies to the other methods, so in textcorrect you
have to call self.correct(i) and give correct a self parameter. etc.
Or you make them all static methods and use Ex3.textcorrect().
I don't think putting all the methods in a class is a good ide
, a raw string cannot have a backslash as
>JG> its last character.
Cannot have an odd number of backslashes as its last characters.
>>> print r'test \\'
test \\
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
>>>>> Esmail (E) wrote:
>E> LittleGrasshopper wrote:
>>>
>>> So what do you guys use, and why? Hopefully we can keep this civil.
>E> I use Emacs, just because I have been using this editor for
>E> all sorts of things in the last 20+ years.
M
te as much
in the child as you can, for example by
del wx; del sys.modules['wx'] etc, delete all variables that you don't
need, and hope the garbage collector will clean up enough. But it will
make you application quite complicated. From the python level you can't
get rid of loa
or quotes ?
Use the MatchFirst (|)
I have also split it up to make it more readable
kw = Word(alphas + "+_-.").setResultsName("keyword")
eq = Suppress(Literal ("="))
value = dblQuotedString | Optional(Word(printables))
pattern = Group(kw + eq + value)
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
y to stop the
>WZ> HTTP server gracefully?
In don't think it is useful to put the HTTP server in its own process as
the Manager process has hardly anything to do. But if you do you can
make it wait by doing the join of the worker processes at the end,
instead of inside the stop().
as
>JKK> usual. I never get any feedback. Just C-x o to the interpreter and
>JKK> print out the variable you just defined. It should be there.
What kind of feedback do you expect?
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
s that you wanted to solve.
Maybe you are dyslectic or something similar, in which case I apologize.
But anyway, I think you should learn to express yourself more clearly.
There are also courses for that.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
ces use the same value
'lala' but some need 'lele' or sometime later in the life of the instance
the value will be changed to 'lele'
class Bletch:
var = 'lala'
def update(self):
self.var = 'lele'
In this case it is a matter of taste w
that PyXML is no longer maintained.
>TA> Is there a DTD parser that is being maintained? Or does it not really
>TA> matter that PyXML is no longer maintained, given that it's not like the DTD
>TA> spec has changed very much?
http://codespeak.net/lxml/validation.html#dtd
-
the curses screen with addstr. But a curses screen has a
limited length, whereas your ls -l output may be larger so then you must
implement some form of scrolling.
>l> import curses, os
>l> screen = curses.initscr()
>l> os.system("ls -l")
>l> curses.endwin()
--
>>>>> norseman (n) wrote:
>n> Piet van Oostrum wrote:
>>>>>>>> norseman (n) wrote:
>>>
>n> I have tried both and Popen2.popen2().
>n> os.popen runs both way, contrary to docs.
>>>
>>> What do you mean `os.p
ease candidate
http://sourceforge.net/project/showfiles.php?group_id=22307&package_id=34790&release_id=672239
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
t;PLEASE HIT RETURN FOR NEXT SCREEN OR q TO
STOP")
screen.refresh()
key = screen.getkey()
if key.lower() == 'q':
break
else: # end of listing reached
screen.addstr(height-1, 0, "** END OF LISTING ** HIT RETURN")
screen.re
eys in the `bucket' that belongs to the hash value. The average
complexity of looking up a key is O(1).
See http://wiki.python.org/moin/DictionaryKeys
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
>>>>> Arnaud Delobelle (AD) wrote:
>AD> Piet van Oostrum writes:
>>>>>>>> Aaron Brady (AB) wrote:
>>>
>AB> I am writing a mapping object, and I want to ask about the details of
>AB> __hash__ and __eq__. IIUC if I understan
in my Python mode such that the
## working on region in file /tmp/python-26084kfr.py...
message will be replaced by the actual code executed, if that code is
not too big (size configurable). And that looks nicer.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
ssues. But I'll read the paper to figure out what
>L> the problem is, thanks.
Here is exactly the problem. Merging the two MRO's as you state would
give C3, C2, C1, object, i.e. C2 before C1.
But your class definition:
class C3(C1, C2):
says that C1 should be before C2. Conflict!!
Change it to class C3(C2, C1):
You see it has nothing to do with the metaclasses. The following code
gives the same error:
class C1(object):
pass
class C2(C1):
pass
class C3(C1, C2):
pass
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
>>>>> Piet van Oostrum (I) wrote:
>I> But your class definition:
>I> class C3(C1, C2):
>I> says that C1 should be before C2. Conflict!!
>I> Change it to class C3(C2, C1):
Of course the C1 is then superfluous.
I wonder why you want this. What is the pro
here a way from the Linux shell or a bash script to terminate
>GB> just one specific Python script ?
So just kill it.
--
Piet van Oostrum <[EMAIL PROTECTED]>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ript in bash (or any other process for that
matter) in the background you can get the process id (pid) with $!
(immediately after starting the process). Later on you can use this to kill
the process:
python myscript myargs &
savepid=$!
later: kill $savepid
That is much better than trying t
he location that the
instruction referenced and then jumped to the address following that
location. To implement a recursive procedure you started the code of the
procedure with saving the return address to a stack.
--
Piet van Oostrum <[EMAIL PROTECTED]>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
it for PyGTK.
But AFAIK GTK doesn't have a native implementation on the Mac, only X11. At
least not in a stable version.
--
Piet van Oostrum <[EMAIL PROTECTED]>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
http://starship.python.net/~davem/cgifaq/faqw.cgi?req=show&file=faq02.011.htp
or google for python cgi session for more.
But why write it yourself if someone else has already done the work?
--
Piet van Oostrum <[EMAIL PROTECTED]>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
tandard
>F> CPython as an executable, using tools like py2exe, won't be covered.
>F> Right ?
As I understand it, distributing Python is also covered. For a commercial
vendor $1.25 is peanuts, but for the PSA it is a significant amount (think
about all the Mac OSX copies if Apple
)
tally([line[0] in vowels for line in f])
>SRH> # counts is a dict; counts.keys() == [False, True]
No guarantee about the order. It could be [True, False].
>SRH> count_nonvowels, count_vowels = counts.values()
So you must use counts[False] and counts[True].
--
Piet van Oostrum <[E
>>>>> Grant Edwards (GE) wrote:
>GE> On 2009-09-25, Piet van Oostrum wrote:
>>>>>>>> exar...@twistedmatrix.com (e) wrote:
>>>
>e> I specifically left out all "yield" statements in my version, since that's
>e&g
ecked Python 3.1.)
He's not using Python3, see the print statement and the file function.
But even with the appropriate changes the behaviour will be the same in
3.1 as in 2.x.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
= [X(x) for x in xrange(0, n)]
>l> t = Y(5)
>l> How can I easily print "t" and all its nested attributes? (Something like
>l> PHP's print_r())
I don't know what print_r does, but in your example above
print [x.L for x in t.M] would work.
Probably
onn.request("POST", "/programming/bots/test.php", "ted=fred", headers)
>t> r1 = conn.getresponse()
>t> print r1.status, r1.reason
>t> data1 = r1.read()
>t> print data1
>t> conn.close()
>t> print "new ok"
>t> The PHP script is
>t> print"hello ";
>t> print $_POST["ted"];
>t> Ted post
--
Piet van Oostrum
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
--
http://mail.python.org/mailman/listinfo/python-list
haracters won't be representable in latin-1.
The reason it worked is that these characters were translated into two-
or more-bytes sequences and replace did work with these. But it's
dangerous, as they are then no longer the unicode characters they were
intended to be.
--
Piet van Oostrum
a place. Usually utf-8 is a safe bet but in some cases can
be overkill. And then in you Python input/output (read/write) you may
have to use a different encoding if the programs that you have to
communicate with expect something different.
--
Piet van Oostrum
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
--
http://mail.python.org/mailman/listinfo/python-list
nd the issue and how to get over?
How did you post the data? If you post binary data you should indicate
this with a proper mime type, like application/octet-stream. Otherwise
it might be interpreted as text which it isn't.
--
Piet van Oostrum
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
--
http://mail.python.org/mailman/listinfo/python-list
be since 1969-12-31, or since
1970-1-1 but then starting with 1 instead of 0.
And your 59 is wrong if the others are deemed to be correct.
Depending on what you want you have to add 1 to the following solution
import datetime
startdate = datetime.date(1970, 1, 1)
enddate = datetime.date(197
>>>>> greg (g) wrote:
>g> MRAB wrote:
>>> And when someone says "January 30", do they really mean the day before
>>> the last day of the month?
>g> No, no, that's January -2, a *completely* different thing!
But for someone e
x27;creator_badge_index': '1',
'token': '92dcd92a8bc16f73f330d118ae1ed891',
'do-grant': '1',
'grant-userid' : 'Guest_xLolKittyx',
}
params = urllib.parse.urlencode(paramdict)
url = 'http://www.imvu.com/catalog/web_manage_badges.php'
form = urllib.request.OpenerDirector.open(url, params)
--
Piet van Oostrum
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
--
http://mail.python.org/mailman/listinfo/python-list
>z> ...
>z> Any ideas?
CGI scripts return stuff by printing it, or more generally writing to
stdout.
So print message should do. The rest is not a Python question but a
Javascript question.
--
Piet van Oostrum
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
--
http://mail.python.org/mailman/listinfo/python-list
ewline, or is it
a backslash followed by 'n'? In the first case then every filename is on
a separate line. So then you are mixing two concepts of line.
Anyhow you would make your life easier by getting rid of the \n's.
If all your filenames are numeric with the extension mp3 then the
following gives you a list of the filenames from a line:
In [31]: re.findall('[0-9]+\.mp3', line)
Out[31]: ['100.mp3', '10008.mp3', '10005.mp3', '10001.mp3', '10006.mp3']
--
Piet van Oostrum
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
--
http://mail.python.org/mailman/listinfo/python-list
use I solve my problem in another way :-)
>D> locals().has_key(myname)
>D> globals().has_key(myname)
1. This excludes builtins. The OP says: `no matter where is it', so that
suggests also builins.
2. The more modern invocation would be "myname in locals()" or "mynam
x27;t wait for them. You can only wait for the shell that starts the
rsync, but that will be finished almost immediately.
>>> import subprocess
>>> p = subprocess.Popen('sleep 1000 &', shell=True)
>>> p.wait()
0
>>>
The wait() returns imm
ogram
newlog.write(root)
newlog.flush()
--
Piet van Oostrum
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
Nu Fair Trade woonwaar op http://www.zylja.com
--
http://mail.python.org/mailman/listinfo/python-list
="win32".
You can check that subprocess is working, e.g. with
subprocess.call('dir', shell=True)
--
Piet van Oostrum
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
Nu Fair Trade woonwaar op http://www.zylja.com
--
http://mail.python.org/mailman/listinfo/python-list
nelson writes:
> Hi all,
> I have this function, defined in a string and ecetuted through ad
> exec call
>
> def cell1(d):
>
> x=d.get('x')
> print x
>
> import y
> return y.add(y.add(self.adf0(x),self.adf0(x)),self.adf0(x))
>
Wha
Carlo writes:
> On 2010-12-01, Peter Otten <__pete...@web.de> wrote:
>>>>> import re
>>>>> re.compile("([a-z])([A-Z])").sub(r"\1 \2", "camelCase")
>> 'camel Case'
>
> Very simple if you know it. Thank you!
ep everything in byte strings your problem may
disappear. In Python 3 you have to do this explicitely as the default is
unicode.
--
Piet van Oostrum
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
Nu Fair Trade woonartikelen op http://www.zylja.com
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano writes:
> You don't need the space between strings and the attribute access:
> "1".zfill(2) is fine. You only need it for numbers, due to the ambiguity
> between the decimal point and dotted attribute access.
Personally I prefer parentheses: (1).c
For non-SQL you could look into Kyoto Cabinet, which is Berkeley DB-like. Or
ZODB which is a Python Object databes.
--
Piet van Oostrum
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
Nu Fair Trade woonartikelen op http://www.zylja.com
--
http://mail.python.org/mailman/listinfo
return object.__new__(cls, n)
But you have to be aware that the initializers are not called in this way.
--
Piet van Oostrum
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
Nu Fair Trade woonartikelen op http://www.zylja.com
--
http://mail.python.org/mailman/listinfo/python-list
1.0, 2.0, 3.0])
>TN> 0.1
>TN> which looks like a left fold to me.
Yes, see the Haskell result:
Prelude> foldl (/) 1.0 [1.0, 2.0, 3.0]
0.1
Prelude> foldr (/) 1.0 [1.0, 2.0, 3.0]
1.5
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142B
n a way that retains scalability and avoids deadlock
and data races.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
>>>>> Seamus MacRae (SM) wrote:
>SM> Piet van Oostrum wrote:
>>> By the way, there is a series of articles about concurrency on ACM Queue
>>> which may be interesting for those participating in or just following
>>> this discussion:
>
o a staticmethod would be
preferable:
class Funcoes:
@staticmethod
def CifradorDeCesar(self, mensagem, chave, funcao):
But as been mentioned in this thread before, there might be no reason to
use the class anyway.
The next thing you will run into is that you call CifradorDeCesar with
an
>>>>> "Enrico" <4...@755189.45> (E) wrote:
>E> "Piet van Oostrum" ha scritto nel messaggio
>E> news:m2ljo1ajnx@cs.uu.nl...
>>> The method doesn't need the class at all, so a staticmethod would be
>>> preferable:
can perfectly work, and I
>h> think it is definitely to report this as a bug to Python.org as you
>h> say.
Filecmp does a binary compare, not a text compare. So it starts by
comparing the sizes of the files and if they are different the files
must be different. If equal it compares the bytes by reading large
blocks. Comparing text files would be quite different especially when
ignoring line separators. Maybe comparing text files should be added as
a new feature.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
just wanted to know whether two files
were equal, not what the differences would be. In that case difflib is
overkill.
On the other hand `equal' has many meanings. Ignoring line endings is
one option, ignoring trailing whitespace could be another one. Yet
another one could be normalizing t
NR> not help.
The exact time of the destruction of objects is an implementation detail
and should not be relied upon.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
n None and Nothing,
except for the type system.
Java, on the other hand does have static typing but does not have
disjoint sums. So they have not much choice but to put null in every
class-based type.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
these the most idiomatically pythonic forms? Or am I missing
>k> something better?
Do it yourself:
class MyList(list):
def __getitem__(self, indx):
if isinstance (indx, tuple):
return [self[i] for i in indx]
else:
return list.__getitem__(self
>>>>> John Yeung (JY) wrote:
>JY> I've never heard a mathematician use the term "bottom". It certainly
>JY> could be that I just haven't talked to the right types of
>JY> mathematicians.
"Bottom" is a term from lattice theory, wh
eger in not entered,in that case how are they different?
>>> z=eval(raw_input())
3+4
>>> z
7
>>> z=int(raw_input())
3+4
Traceback (most recent call last):
File "", line 1, in
ValueError: invalid literal for int() with base 10: '3+4'
r. Therefore it should use client-side scripting (which probably
means Javascript or flash (shudder!)) Including that in a PSP web page isn't
so much different from its inclusion in any other framework. You must
just choose one of the existing editors.
--
Piet van Oostrum
URL: http://pietvanoostrum.
Reading your question again I think I have probably misunderstood it.
You want to an editor to edit Python Server Pages?
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
program? In that case you
shouldn't call ./sort as it is in argv[0], but just sort (assuming '.'
is not in your PATH) or the full path, like /usr/bin/sort.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list
401 - 500 of 717 matches
Mail list logo