On Mon, 08 Sep 2008 07:34:55 +1000, James Mills wrote:
This is the strangest post I've seen
since I've joined this list (only
recently). What the ?
Yeah, castironpi sometimes doesn't make much sense. Maybe because it's a
bot!? :-)
Ciao,
Marc 'BlackJack' Rintsch
--
http
extras. ;-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
used
on Windows under the hood is called `CreateProcess()` not
`CreatePipe()`.
How does Windows implement popen()? [I think they call it _popen()
though...]
Doesn't matter because the `Popen()` implementation doesn't use `popen()`.
Ciao,
Marc 'BlackJack' Rintsch
--
http
On Wed, 03 Sep 2008 03:09:18 -0400, Derek Martin wrote:
On Wed, Sep 03, 2008 at 06:40:10AM +, Marc 'BlackJack' Rintsch
wrote:
On Tue, 02 Sep 2008 19:54:12 -0400, Derek Martin wrote:
And if they model an action there must be some way to activate the
action
That's a reasonable
://opengroup.org/onlinepubs/007908775/xsh/popen.html
So it's a name of a *function* and it's a little bit unsuitable for a
*class*. As Jeremy wrote: the instances represent *processes* not
popens, whatever that may be.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python
`spam.egg` but just the local binding!
Could some one provide me a sample code of module intialization? And how
can I ensure that module initialization is done only once?
Module initialization is only done once, there's nothing to ensure.
Ciao,
Marc 'BlackJack' Rintsch
--
http
On Tue, 02 Sep 2008 06:24:21 -0700, qxyuestc wrote:
showed above: the result from sum1() and sum2() is the same. So, what is
the difference between f(a) and f(*a)
f(a) - f([1, 2, 3])
f(*a) - f(1, 2, 3)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python
On Tue, 02 Sep 2008 09:28:42 -0400, Derek Martin wrote:
On Tue, Sep 02, 2008 at 12:27:49PM +, Marc 'BlackJack' Rintsch
wrote:
The Python class is a generalization of the standard Posix function
of (almost) the same name:
http://opengroup.org/onlinepubs/007908775/xsh/popen.html
So
)
pairs = imap(extract_numbers, clean_lines)
print '\n'.join(b for a, b in pairs if a + b == 42)
if __name__ == '__main__':
main()
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 02 Sep 2008 11:39:09 -0400, Derek Martin wrote:
On Tue, Sep 02, 2008 at 01:57:26PM +, Marc 'BlackJack' Rintsch
wrote:
I would argue that they don't represent processes at all; the object
is a set of files which connect the standard I/O streams of a
subprocess to its parent
of an image in a matrix.
But I can't find the appropriate operations.
Work through the tutorial in the Python documentation and read some
introduction to Numpy.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
called process but none called
popen.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
this? The most pythonic?
The most pythonic might be not checking at all but simply *call* the
object and deal with possible failures.
What's your use case?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
give some
problems.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 01 Sep 2008 14:25:01 -0400, Terry Reedy wrote:
Marc 'BlackJack' Rintsch wrote:
On Mon, 01 Sep 2008 02:27:54 -0400, Terry Reedy wrote:
Most likely because Python figured out that the terminal expects cp437.
What does `sys.stdout.encoding` say?
The interpreter in the command prompt
of the entries in the directory.
path: path of directory to list
The list is in arbitrary order. It does not include the special
entries '.' and '..' even if they are present in the directory.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo
. Please stop numbering names
and use *meaningful* names instead!
Could you describe them problem better, with sample inputs and expected
outputs. There must be a better way that that unreadable mess above.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python
just one module or
factoring out something into a third module that is imported by both old
modules.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
source code and specific questions.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
as there is a reference to them. You deleted the
name `p` and thus one reference to the list with the three characters but
there's still the reference from the list bound to `q` to that three
character list.
What did you expect for an updated q anyway?
Ciao,
Marc 'BlackJack' Rintsch
--
http
sort of singletons in Python.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
.
Names for the components result in much easier to understand source code,
so I would prefer to use `ctypes` or `construct` to create such a record.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
:
@property
def gridsize(self):
return 0.8
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 25 Aug 2008 14:49:14 -0700, castironpi wrote:
I'm interested in the speed benefit, so you don't have to reconstruct
the entire 'record' just to read/write one 'field'. How in ctypes?
Only the field accessed is converted.
Ciao,
Marc 'BlackJack' Rintsch
--
http
On Sun, 24 Aug 2008 07:28:53 -0700, twyk wrote:
So is it good style to omit the BOM in UTF-8 for Python 3.0?
I'd say yes because it is unnecessary with UTF-8 and it messes up the she-
bang line of scripts.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python
the ``def`` statement is executed:
http://docs.python.org/ref/function.html#l2h-634
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
as the callable returns a
true value and then it stops dropping. First value is 0 and
``2 0 5`` is `False` so nothing is dropped.
What have you expected?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
in maillist discussions.
There's the glossary in the documentation:
http://docs.python.org/tut/node18.html
Look under 'duck-typing', 'EAFP', and 'LBYL'.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
1, in module
NameError: name 'file' is not defined
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
', '')
In [50]: cgi.parse_qs(urlparse.urlparse(url)[4])
Out[50]: {'age': ['28'], 'userID': ['398']}
But maybe you should read about the `cgi` module and how to use it.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 20 Aug 2008 18:46:42 -0400, Derek Martin wrote:
How so? What could be easier than rm -rf directory?
C:\rm -rf directory
Illegal command: rm.
Hm. ;-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
'
print 'stmt2'
label .next
print 'stmt3'
print 'stmt4'
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
the Python package index: pypi.python.org
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
for a, b in zip('painter', 'paintor') if a == b)
Out[41]: 6
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
namespace. When you call `goo()` it binds the name `foo` *within
the module* to a new list. This has of course no influence on the name
in the IPython namespace which is still bound to the list object that was
bound to `test.foo` before.
Ciao,
Marc 'BlackJack' Rintsch
--
http
', '1.000.456.344')
Out[13]: '1000456344'
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
a database instead of a dictionary?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
managed2 7020 8021
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
several.
But I *do* know that taking the python zen literally is fruitless.
I think it should be taken more literally than the wrong reduction to
there should be only one way. People tend to forget obvious and
preferably all the time.
Ciao,
Marc 'BlackJack' Rintsch
--
http
virtual?
And what's etc.?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
and the calling program can't influence the called programs buffering
except if it pretends to be a terminal, which pexpect does.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 23 Jul 2008 14:10:22 +0200, mk wrote:
Marc 'BlackJack' Rintsch wrote:
I can't even remember when I deleted something from a list in the past.
Still, doesn't that strike you as.. workaround?
No, I find it actually safer; I don't have to care where modifications of
the list might
On Wed, 23 Jul 2008 09:42:29 -0700, castironpi wrote:
On Jul 23, 9:11 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
On Wed, 23 Jul 2008 14:10:22 +0200, mk wrote:
Marc 'BlackJack' Rintsch wrote:
I can't even remember when I deleted something from a list in the past.
Still, doesn't
(days_of_week)]
For iterables in general: `itertools.cycle()`
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
. You really should take
that detour via 2.6. There should be some of the changes from 3.0 in 2.6
that don't mess with backwards compatibility, and a script that tries to
automate the conversion from 2.6 to 3.0. This spares a lot of work when
porting to 3.0.
Ciao,
Marc 'BlackJack' Rintsch
) == id(a):
... print k
...
hello = 123
a(hello)
hello
## pretty cool.
Or ugly hack. Beauty lies in the eye of the beer holder…
It's totally useless but I wanted to do it for logging purposes.
Don't use such things in production code, please.
Ciao,
Marc 'BlackJack
needs a bit of work.
Are you saying Python is not good for writing A.I., or the A.I. isn't
good at writing Python?
Are you saying python is not as smart as you.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 20 Jul 2008 18:39:52 +0100, Perl_Wizard wrote:
Nobody any sensible answers. Too complicated I suppose!
I've often been asked that, i'd be able to buy me a mars bar!
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 19 Jul 2008 10:27:28 +0100, perl_wizard wrote:
Why is Perl so much better than python?
You are so much better than python?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
-yourself-clearly/
What's called `MethodChain` there seems to be function composition in
functional languages. Maybe `functools` could grow a `compose()` function.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
, and some other
CP/M systems. I never heard any of them called a 'PC'. My
recollection is that 'PC' was a term that IBM coined.
The C64 that still sits on my desk has a label on it saying “commodore 64
- personal computer”.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman
On Sat, 19 Jul 2008 13:57:33 -0700, bearophileHUGS wrote:
Marc 'BlackJack' Rintsch:
What's called `MethodChain` there seems to be function composition in
functional languages. Maybe `functools` could grow a `compose()` function.
To me it looks like a quite more refined thing, it's
On Sat, 19 Jul 2008 13:13:40 -0700, nicolas.pourcelot wrote:
On 18 juil, 17:52, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
On Fri, 18 Jul 2008 07:39:38 -0700, nicolas.pourcelot wrote:
So, I use something like this in 'sheet.objects.__setattr__(self,
name, value)':
if type(value
to rely on such implementation details, your program is
broken.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
. In words, not in
not very clear code with numbered names. That's a silly idea and makes
understanding the code very hard. Please use meaningful names!
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
above in one line, but this seems clearer. ;-)
I know it's a matter of taste but I think the one liner is still clear
(enough)::
values = dict(s.split('=') for s in line.split() if '=' in s)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
of the extra
redirection of an objects `__dict__`?
Oh and the `type()` test smells like you are implementing polymorphism
in a way that should be replaced by OOP techniques.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
forget about reliable
automatic clean up. Do it yourself with an explicit call to a `close()`
method or something like that.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
deciding for you that the last printed line before program exit
should end in a newline. Use `sys.write()` instead of ``print``.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
can't make sure
nothing slips between the cracks with it.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
words, is item a temporary reference to myList[itemIndex] or
is it actually that reference that myList has stored?
The latter. Names are always bound to objects, you can't bind a name to
another name or reference in Python.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman
with a `__del__()` implementation are
not collected! Why are you using `__del__()` anyway? Are you aware of
the promises that are *not* made! It's not guaranteed when the method
is called nor if it is called at all!
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo
of the shell you are using.
Including ways to protect the characters, so they reach the called program
in arguments.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
and
stability. It's not uncommon in open source projects to have very usable
software with a version number below 1.0.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
documentation.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
of a pointer to a struct that represents the
object.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
generating a list with all
results, and the advantage of a low memory footprint is lost.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
access the GUI from multiple threads.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
://', 'https://'))
I would prefer a name like `remove_prefix()` instead of a variant with
`strip` and abbreviations in it.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
bits?
Perhaps something like:
struct.pack('!h(2:1:4:9)',2,0,1,100)
Take a look at Construct_ instead of `struct`.
.. _Construct: http://construct.wikispaces.com/
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
of your choice. That's why UTF-8 might have been a good
idea.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
?)
How come, that you think so?
The '#' is usually the prompt of root accounts while ordinary users get a '$'.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
raised by `PhotoImage` if a non compatible file
was selected!?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
this:
bla = [A(*args) for args in ((), (1,), (1, 2))]
map(str, bla)
['A(0,1)', 'A(1,1)', 'A(1,2)']
Looks like you want default values for the arguments of `A.__init__()`.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 01 Jul 2008 23:25:53 -0700, bsagert wrote:
This simple script writes html color codes that can be viewed in a
browser. I used short form hex codes (fff or 000, etc) and my list
has only six hex numbers otherwise the results get rather large. I
invite criticism as to whether my code
be raised by `urllib2`.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
in the
`Toplevel` instance.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
as any
other file into a string, then sends it across to a network where it
is saved as perusual into a file, […]
Are you sure you read and save the file in binary mode, especially on
windows!?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
call last)
/home/bj/ipython console in module()
type 'exceptions.TypeError': 'int' object is not iterable
See, both ways need something iterable.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
code? Would be my first guess.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
is repeated. For example r'\foo\\bar/baz//spam.py' or:
In [140]: os.path.split('foo//bar')
Out[140]: ('foo', 'bar')
In [141]: 'foo//bar'.split(os.sep)
Out[141]: ['foo', '', 'bar']
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 07 Jun 2008 02:15:07 -0700, s0suk3 wrote:
On Jun 7, 3:15 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
On Fri, 06 Jun 2008 23:57:03 -0700, s0suk3 wrote:
You can just split the path on `os.sep', which contains the path
separator of the platform on which Python is running
, 2, 3, 3]))
print list(gen)
Useless use of a generator expression. This:
gen = itertools.izip(itertools.count(8), [0, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3])
print list(gen)
has the same effect without the intermediate generator that does nothing
but passing the items.
Ciao,
Marc 'BlackJack
would've expected something with more magic, like Perl. :-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 05 Jun 2008 08:21:41 +, Antoon Pardon wrote:
On 2008-06-04, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
On Wed, 04 Jun 2008 09:34:58 +, Antoon Pardon wrote:
On 2008-06-04, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
it makes sense to me to also test if they work
On Wed, 04 Jun 2008 15:55:38 +1000, Ben Finney wrote:
Marc 'BlackJack' Rintsch [EMAIL PROTECTED] writes:
On Wed, 04 Jun 2008 13:50:42 +1000, Ben Finney wrote:
It seems you [alex23] have a different idea of what unit testing
is for from me.
For me it's about finding bugs where
()` to read the 256 byte records one at a time and string
slicing to extract the data.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 04 Jun 2008 09:34:58 +, Antoon Pardon wrote:
On 2008-06-04, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
it makes sense to me to also test if they work as documented.
If they affect the behaviour of some public component, that's where
the documentation should be.
As I
()` with it
• remember second id number
• garbage collect second empty list
• compare both numbers
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
to the
everybody, there *are* functions that rely on them working correctly.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
will be actually FLOATs, not INTs. How can
i do this ? Any help welcome. Regards,
Look at string methods, `join()` for example, and string formatting with
the ``%`` operator.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
? ;-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 01 Jun 2008 10:40:09 -0500, Sam Denton wrote:
Code generators seem to be popular in Python.
I don't think so.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
flow harder to understand, the code more difficult to test, and
usually couples functions more tightly then they should.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
201 - 300 of 1496 matches
Mail list logo