I´ll try to mix it with my code (xml.etree).
Thanks ;)
-Mensaje original-
De: python-list-bounces+dvicente=full-on-net@python.org
[mailto:python-list-bounces+dvicente=full-on-net@python.org] En nombre
de Josh English
Enviado el: martes, 08 de febrero de 2011 0:46
Para: python-lis
Nanderson writes:
> loop would be infinite. I get what is happening in the function, and I
> understand why this would work, but for some reason it's confusing me
> as to how it is exiting the loop after a certain number of times. Help
> is appreciated, thanks.
It works because 0 tests false an
On Feb 8, 10:29 pm, Michael Hrivnak wrote:
> Your function only works if n is an integer. Example:
>
> >>> num_digits(234)
> 3
> >>> num_digits(23.4)
>
> 325
>
> When doing integer division, python will throw away the remainder and
> return an int. Using your example of n==44, 44/10 == 4 and 4/1
Your function only works if n is an integer. Example:
>>> num_digits(234)
3
>>> num_digits(23.4)
325
When doing integer division, python will throw away the remainder and
return an int. Using your example of n==44, 44/10 == 4 and 4/10 == 0
Before each iteration of the while loop, the given exp
def num_digits(n):
count = 0
while n:
count = count + 1
n = n / 10
return count
This is a function that basically says how many digits are in a
number. For example,
>>>print num_digits(44)
2
>>>print num_digits(7654)
4
This function counts the number of decimal digits
On Fri, 04 Feb 2011 15:48:55 +, John O'Hagan wrote:
> But I'm still a little curious as to why even unsuccessfully attempting to
> reassign stdout seems to stop the pipe buffer from filling up.
It doesn't. If the server continues to run, then it's ignoring/handling
both SIGPIPE and the EPIPE
I don't know about your IDE, I am using the default IDLE just because it
is handy. But I have made the switch from mod_python. It was a good
idea, but mod_wsgi is a better idea. And as you know, mod_python is no
longer supported.
I am running Apache with mod_wsgi in a windows 7 environment
I think that will help people like me who just depend on gmail, and I know
there are various ways to do filtering in gmail, but just addition of the
tag in [ ] will help avoiding those.. I kindly second that...
On Tue, Feb 8, 2011 at 6:12 PM, Rhodri James wrote:
> On Wed, 09 Feb 2011 01:59:46 -00
On 09/02/2011 01:59, Yang Zhang wrote:
I reduced a problem I was seeing in my application down into the
following test case. In this code, a parent process concurrently
spawns 2 (you can spawn more) subprocesses that read a big message
from the parent over stdin, sleep for 5 seconds, and write so
On Tue, Feb 8, 2011 at 5:41 PM, Roy Smith wrote:
> In article ,
> "Williamson, Ross X. (Guest)"
> wrote:
>
>> Dear All,
>>
>> I'm trying to implement a server/client system where the server is written in
>> python and the client has to be written in c/c++. I can happily send simple
>> text thr
On Wed, 09 Feb 2011 01:59:46 -, David Robinow
wrote:
On Tue, Feb 8, 2011 at 5:03 PM, Rhodri James
wrote:
On Tue, 08 Feb 2011 12:18:50 -, wrote:
On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote:
Either your mail client already knows how to filter messages
appropriately d
On Tue, Feb 8, 2011 at 5:03 PM, Rhodri James
wrote:
> On Tue, 08 Feb 2011 12:18:50 -, wrote:
>> On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote:
>>> Either your mail client already knows how to filter messages
>>> appropriately depending on which mailing list they came from; or, yo
I reduced a problem I was seeing in my application down into the
following test case. In this code, a parent process concurrently
spawns 2 (you can spawn more) subprocesses that read a big message
from the parent over stdin, sleep for 5 seconds, and write something
back. However, there's unexpected
In article ,
"Williamson, Ross X. (Guest)"
wrote:
> Dear All,
>
> I'm trying to implement a server/client system where the server is written in
> python and the client has to be written in c/c++. I can happily send simple
> text through the socket. Ideally I would like make say a struct (u
Dear All,
I'm trying to implement a server/client system where the server is written in
python and the client has to be written in c/c++. I can happily send simple
text through the socket. Ideally I would like make say a struct (using python
struct library) - and then read that in using C. Is
On Feb 8, 7:12 pm, Paul Rubin wrote:
> But the refcount scheme is just an implementation hack
> that gets rationalized way too much. I hope PyPy abandons it.
Done. :)
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
sturlamolden writes:
> comes with a cost. The interpreter will sometimes pause to collect
> garbage. The memory use will be larger as well, as garbage remain
> uncollected for a while and is not immediately reclaimed. Many rely on
> CPython because the interpreter does not pause and a Python proce
On Tue, 08 Feb 2011 14:30:53 -0800, Xah Lee wrote:
> On Feb 8, 9:32 am, Icarus Sparry wrote:
[snip]
>> The 'modern' way to do this is
>> find . -maxdepth 2 -name '*.html' -exec grep whatever {} +
>>
>> The key thing which makes this 'modern' is the '+' at the end of the
>> command, rather than '\
On 8 Feb, 10:39, Vishal wrote:
> Is it possible that the Python process, creates copies of the
> interpreter for each thread that is launched, and some how the thread
> is bound to its own interpreter ?
In .NET lingo this is called an 'AppDomain'. This is also how tcl
works -- one interpreter p
I'm still using mod_python to deploy my framework for production (CentOS
running Python 2.5.5, Apache 2.2.3, mod_python 3.3.1). I'm acutely aware
of how elderly mod_python is, and I've had some frustrations using Wing
to debug inside it -- at least its possible, which is not true for any
other
Are you using your qooxlisp thingy?
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 8, 9:32 am, Icarus Sparry wrote:
> On Tue, 08 Feb 2011 13:51:54 +0100, Petter Gustad wrote:
> > Xah Lee writes:
>
> >> problem with find xargs is that they spawn grep for each file, which
> >> becomes too slow to be usable.
>
> > find . -maxdepth 2 -name '*.html -print0 | xargs -0 grep wha
2011/2/8, Paul Rubin :
> noydb writes:
>> I am looking for ways to go about capturing the frequency of unique
>> values in one field in a dbf table which contains ~50k records. The
>> values are numbers with atleast 5 digits to the right of the decimal,
>> but I want the frequency of values to on
On 2011-02-08, przemol...@poczta.fm wrote:
> I have just subscribed to this python-list@ and this is my N list.
> Usually many mailing lists use square brackets to identify its name
> when you have e-mails from different forums.
> Would you consider adding [] to this list also ?
Please don't.
On Tue, 08 Feb 2011 12:18:50 -, wrote:
On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote:
przemol...@poczta.fm writes:
> I have just subscribed to this python-list@ and this is my N list.
> Usually many mailing lists use square brackets to identify its name
> when you have e-mail
przemol...@poczta.fm writes:
> On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote:
> > Either way, please don't ask for the subject lines to be munged.
>
> Any technical reason why not ?
No technical reason to my knowledge; but then, I haven't looked for one.
The reason of “don't mess wit
noydb writes:
> I am looking for ways to go about capturing the frequency of unique
> values in one field in a dbf table which contains ~50k records. The
> values are numbers with atleast 5 digits to the right of the decimal,
> but I want the frequency of values to only 2 decimal places. I do
>
On Feb 8, 11:49 am, John Nagle wrote:
> The real reason for the GIL, though, is to support dynamic
> code modification in multi-thread progrems. It's the ability
> to replace a function while it's being executed in another thread
> that's hard to do without a global lock. If it were just a d
On 2/8/2011 1:39 AM, Vishal wrote:
Hello,
This might sound crazy..and dont know if its even possible, but...
Is it possible that the Python process, creates copies of the
interpreter for each thread that is launched, and some how the thread
is bound to its own interpreter ?
This will increase
On Tue, 2011-02-08 at 11:52 -0500, Roy Smith wrote:
> In article ,
> Robert Kern wrote:
> > Unlike a UNIX fork, CreateProcess() does not have the same copy-on-write
> > semantics for initializing the memory of the new process. If you want to
> > pass
> > data to the children, the data must be
You could try a collections.defaultdict object with an integer as the startup
value:
counts = collections.defaultdict(int)
for thing in long_list:
counts[get_last_two_digits(thing)] += 1
This assumes get_last_two_digits is the function that provides the key you want
to count by. I'm not sure
I am looking for ways to go about capturing the frequency of unique
values in one field in a dbf table which contains ~50k records. The
values are numbers with atleast 5 digits to the right of the decimal,
but I want the frequency of values to only 2 decimal places. I do
have a method to do this
On 2/8/2011 8:38 AM, Peter Otten wrote:
import socket
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
If you do not like typing 'socket' so many times:
import socket as so # or pick own abbreviation
sock = so.socket(so.AF_UNIX, sot.SOCK_STREAM)
Have you worked through the tutorial
On 2/8/2011 7:18 AM, przemol...@poczta.fm wrote:
On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote:
Either way, please don't ask for the subject lines to be munged.
Any technical reason why not ?
For one reason, python-list exchanges messages with both
comp.lang.python and gmane.
Icarus Sparry writes:
> The 'modern' way to do this is
> find . -maxdepth 2 -name '*.html' -exec grep whatever {} +
Agree, I've noticed that recent version of find have the + option. I
remember in the old days the exec method was considered bad since it
would fork grep for each process, so I've
On Tue, 08 Feb 2011 13:51:54 +0100, Petter Gustad wrote:
> Xah Lee writes:
>
>> problem with find xargs is that they spawn grep for each file, which
>> becomes too slow to be usable.
>
> find . -maxdepth 2 -name '*.html -print0 | xargs -0 grep whatever
>
> will call grep with a list of filenam
Roy Smith, 08.02.2011 17:52:
Robert Kern wrote:
Unlike a UNIX fork, CreateProcess() does not have the same copy-on-write
semantics for initializing the memory of the new process. If you want to pass
data to the children, the data must be pickled and sent across the process
boundary. He's not sa
Rickard Lindberg, 08.02.2011 16:57:
Hi,
Here is a bash script to reproduce my error:
#!/bin/sh
cat> å.timeline<
0.13.0devb38ace0a572b+
2011-02-01 00:00:00
2011-02-03 08:46:00
asdsd
In article ,
Robert Kern wrote:
> Unlike a UNIX fork, CreateProcess() does not have the same copy-on-write
> semantics for initializing the memory of the new process. If you want to pass
> data to the children, the data must be pickled and sent across the process
> boundary. He's not saying t
przemol...@poczta.fm wrote:
On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote:
Would you consider adding [] to this list also ?
>>>
No thank you.
>>
Any technical reason why not ?
Nope. Just don't care for it. For those of us who have our e-mails
automatically sorted into fold
On Tue, Feb 8, 2011 at 7:57 AM, Rickard Lindberg wrote:
> Hi,
>
> Here is a bash script to reproduce my error:
Including the error message and traceback is still helpful, for future
reference.
> #!/bin/sh
>
> cat > å.timeline <
> EOF
>
> python < # encoding: utf-8
> from xml.sa
On 2/8/11 10:11 AM, Brian Curtin wrote:
On Tue, Feb 8, 2011 at 06:34, Vishal mailto:vsapr...@gmail.com>> wrote:
Also, multiprocessing has issues on Windows (most probably because of
the way CreateProcess() functions...)
Such as?
Unlike a UNIX fork, CreateProcess() does not have the sa
On Tue, Feb 8, 2011 at 06:34, Vishal wrote:
> Also, multiprocessing has issues on Windows (most probably because of
> the way CreateProcess() functions...)
Such as?
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Here is a bash script to reproduce my error:
#!/bin/sh
cat > å.timeline <
0.13.0devb38ace0a572b+
2011-02-01 00:00:00
2011-02-03 08:46:00
asdsd
2011-01-24 16:38:11
On 2011-02-08, Chris Rebert wrote:
> On Tue, Feb 8, 2011 at 5:26 AM, gracemia gracemia wrote:
>> ??File "prueba.py", line 4, in
>> ?? ??sock = socket(AF_UNIX, SOCK_STREAM)
>> NameError: name 'AF_UNIX' is not defined
>>
>> code:
>>
>> import socket
>> sock = socket(AF_UNIX, SOCK_STREAM)
>
> You n
Come on down to the Frog & Toad for wild and crazy debates over
parentheses on their own line and bring your resume -- the SunLisp
core is from an up and coming Ft Lauderdale firm that is still looking
for local Lisp (or Scheme or Clojure or...) talent.
The pub: http://www.thefrogandtoadpub.com/
On 8 feb, 14:40, Chris Rebert wrote:
> On Tue, Feb 8, 2011 at 5:26 AM, gracemia gracemia wrote:
> > File "prueba.py", line 4, in
> > sock = socket(AF_UNIX, SOCK_STREAM)
> > NameError: name 'AF_UNIX' is not defined
>
> > code:
>
> > import socket
> > sock = socket(AF_UNIX, SOCK_STREAM)
>
> Yo
gracemia gracemia wrote:
> File "prueba.py", line 4, in
> sock = socket(AF_UNIX, SOCK_STREAM)
> NameError: name 'AF_UNIX' is not defined
>
> code:
>
> import socket
> sock = socket(AF_UNIX, SOCK_STREAM)
You need to qualify the variable names with the module name:
import socket
sock = soc
The second PyCon Australia will be held in Sydney on the weekend of the 20th
and 21st of August at the Sydney Masonic Center.
The first PyCon Australia was held in June 2010 and attracted over 200 Python
programming enthusiasts. The second event is expected to
host over 250 attendees.
The weekend
The 12th Python Game Programming Challenge (PyWeek) is coming. It'll
run from the 3rd to the 10th of April.
The PyWeek challenge:
- Invites entrants to write a game in one week from scratch either as
an individual or in a team,
- Is intended to be challenging and fun,
- Will hopefully increase th
On Tue, Feb 8, 2011 at 5:26 AM, gracemia gracemia wrote:
> File "prueba.py", line 4, in
> sock = socket(AF_UNIX, SOCK_STREAM)
> NameError: name 'AF_UNIX' is not defined
>
> code:
>
> import socket
> sock = socket(AF_UNIX, SOCK_STREAM)
You need to qualify all those names. Normal `import` does
On Tue, Feb 8, 2011 at 8:27 AM, gracemia gracemia wrote:
> This is the simple code:
>
>
> import socket
>
> sock = socket(AF_UNIX, SOCK_STREAM)
> --
>
> Thank you
I think you're having a bit of trouble with Python's
this is the simple code:
--
import socket
# Create an unbound and not-connected socket.
sock = socket(AF_UNIX, SOCK_STREAM)
---
Thank you !
Submitted via EggHeadCafe
SharePoint Tip / Thought of the
This is the simple code:
import socket
sock = socket(AF_UNIX, SOCK_STREAM)
--
Thank you
Submitted via EggHeadCafe
SQL Server CLR Stored Procedures for External Access
http://www.eggheadcafe.com/tutorials/aspnet/08
File "prueba.py", line 4, in
sock = socket(AF_UNIX, SOCK_STREAM)
NameError: name 'AF_UNIX' is not defined
code:
import socket
sock = socket(AF_UNIX, SOCK_STREAM)
Thank you !
Submitted via EggHeadCafe
Statistics, Probability, Lotteries and Dumb Programmers
http://www.eggheadcafe.com/tuto
Xah Lee writes:
> problem with find xargs is that they spawn grep for each file, which
> becomes too slow to be usable.
find . -maxdepth 2 -name '*.html -print0 | xargs -0 grep whatever
will call grep with a list of filenames given by find, only a single
grep process will run.
//Petter
--
.s
On Feb 8, 7:34 am, Vishal wrote:
> On Feb 8, 3:05 pm, Adam Tauno Williams wrote:
>
> > On Tue, 2011-02-08 at 01:39 -0800, Vishal wrote:
> > > Is it possible that the Python process, creates copies of the
> > > interpreter for each thread that is launched, and some how the thread
> > > is bound to
On Feb 8, 7:30 am, gracemia wrote:
> Hello !
>
> I'm trying to develop with AF_UNIX socket type in python (2.5) but
> python says that AF_UNIX is not supported
> How can I do for work with AF_UNIX sockets?
>
> Thank you
Where and when does Python say this to you?
http://docs.python.org/library/s
On Feb 8, 3:05 pm, Adam Tauno Williams wrote:
> On Tue, 2011-02-08 at 01:39 -0800, Vishal wrote:
> > Is it possible that the Python process, creates copies of the
> > interpreter for each thread that is launched, and some how the thread
> > is bound to its own interpreter ?
> > and it "may" also a
Hi
Since upgrading to Python 2.7, I've run into the problem that when I
launch shell scripts (.e.g, *.bat) via subprocess.Popen (with False
for the 'shell' option, mind you), the arguments get interpreted by
the shell. For instance, the '|' character, no longer gets passed
verbatim to the script.
Hello !
I'm trying to develop with AF_UNIX socket type in python (2.5) but
python says that AF_UNIX is not supported
How can I do for work with AF_UNIX sockets?
Thank you
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote:
> przemol...@poczta.fm writes:
>
> > I have just subscribed to this python-list@ and this is my N list.
> > Usually many mailing lists use square brackets to identify its name
> > when you have e-mails from different forums.
> > Would you
Charles Fox (Sheffield) wrote:
> Hi guys, I'm new to this group and have a question about debugging.
> I'm stepping through my code (using emacs pdbtrack and python-mode.el)
> and would like to isnpect objects as I go. So I've defined a little
> object print function,
>
> def p(obj):
> print
przemol...@poczta.fm wrote:
> I have just subscribed to this python-list@ and this is my N list.
> Usually many mailing lists use square brackets to identify its name
> when you have e-mails from different forums.
> Would you consider adding [] to this list also ?
A better approach is to configur
Hi guys, I'm new to this group and have a question about debugging.
I'm stepping through my code (using emacs pdbtrack and python-mode.el)
and would like to isnpect objects as I go. So I've defined a little
object print function,
def p(obj):
print obj
print obj.__class__
d=dir(obj)
przemol...@poczta.fm writes:
> I have just subscribed to this python-list@ and this is my N list.
> Usually many mailing lists use square brackets to identify its name
> when you have e-mails from different forums.
> Would you consider adding [] to this list also ?
No thank you.
Either your mail
Hello,
I have just subscribed to this python-list@ and this is my N list.
Usually many mailing lists use square brackets to identify its name
when you have e-mails from different forums.
Would you consider adding [] to this list also ?
Please compare both version below:
5350 Feb 07 Richard Ho
Westley Martínez wrote:
On Fri, 2011-02-04 at 13:08 -0800, Wanderer wrote:
I want to give the option of changing attributes in a method or using
the current values of the attributes as the default.
class MyClass():
""" my Class
"""
def __init__(self):
""" initialize
On Tue, 2011-02-08 at 01:39 -0800, Vishal wrote:
> Is it possible that the Python process, creates copies of the
> interpreter for each thread that is launched, and some how the thread
> is bound to its own interpreter ?
> and it "may" also allow the two threads to run in parallel, assuming
> the
Hello,
This might sound crazy..and dont know if its even possible, but...
Is it possible that the Python process, creates copies of the
interpreter for each thread that is launched, and some how the thread
is bound to its own interpreter ?
This will increase the python process size...for sure, h
Michele Petrazzo wrote:
> Hi all,
> I'm playing with python internals and I'm discovering a strange behavior
> of isinstance. Considering the following test case:
>
> test/bar.py
> test/b.py
> test/a/__init__.py
> test/a/foo.py
>
> -- __init__.py -> empty
>
> --- foo.py:
> class foo: pass
> c =
Hi all,
I'm playing with python internals and I'm discovering a strange behavior
of isinstance. Considering the following test case:
test/bar.py
test/b.py
test/a/__init__.py
test/a/foo.py
-- __init__.py -> empty
--- foo.py:
class foo: pass
c = foo
--- b.py
def ret():
d = {}
#s = "import sy
72 matches
Mail list logo