On Jul 15, 4:50 pm, alex23 wrote:
> [email protected] wrote:
> > I tried but its not coming.
>
> How much are you prepared to pay for help with this? Or are you just
> asking us to do all the work for you?
Or to be a _little_ less blunt: if you want people here to _assist_
you with _your_
On Tue, Jul 14, 2009 at 11:13 PM, wrote:
>
> Dear all,
>
> Just one more thing i want to ask that suppose i have a file like:---
>
>
> 47 8 ALA H H 7.85 0.02 1
> 48 8 ALA HA H 2.98 0.02 1
> 49 8 ALA HB H 1.05 0.02
On Jul 15, 11:13 am, [email protected] wrote:
> Dear all,
>
> Just one more thing i want to ask that suppose i have a file like:---
>
> 47 8 ALA H H 7.85 0.02 1
> 48 8 ALA HA H 2.98 0.02 1
> 49 8 ALA HB H 1.05
> Douglas Alan (DA) wrote:
>DA> I wrote:
>>> On Jul 14, 8:10 am, Piet van Oostrum wrote:
>>>
>>> > Of course you can take any BST algorithm and replace pointers by indices
>>> > in the array and allocate new elements in the array. But then you need
>>> > array elements to contain the indice
On Jul 15, 5:07 am, "Dr. Phillip M. Feldman"
wrote:
> I appreciate the effort that people have made, but I'm not impressed with any
> of the answers. For one thing, xor should be able to accept an arbitrary
> number of input arguments (not just two), and should return True if and only
> if the nu
On Jul 15, 11:56 am, alex23 wrote:
> On Jul 15, 4:50 pm, alex23 wrote:
>
> > [email protected] wrote:
> > > I tried but its not coming.
>
> > How much are you prepared to pay for help with this? Or are you just
> > asking us to do all the work for you?
>
> Or to be a _little_ less blunt: i
> [email protected] (Aahz) (A) wrote:
>A> In article , Piet van Oostrum
>wrote:
[email protected] (Aahz) (A) wrote:
>>>
>A> In article , Piet van Oostrum
>A> wrote:
>>>
>> And to get c.x = 4 working you also need a __setitem__.
>>>
>A> Nope. You do need __setitem__
On Tue, 2009-07-14 at 23:03 +0530, [email protected] wrote:
> Dear all,
>
> Can anyone tell me that suppose i have a file having content like:
>
> _Atom_name
> _Atom_type
> _Chem_shift_value
> _Chem_shift_value_error
> _Chem_shift_ambiguity_code
> 1 1
2009/7/15 Scott David Daniels :
> Aahz wrote:
>>
>> In article <[email protected]>,
>> Stefan Behnel wrote:
>>>
>>> Deep_Feelings wrote:
So you have chosen programming language "x" so shall you tell us why
you did so , and what negatives or posi
Hi Newsgroup,
I'm new to python and I am familiarizing myself with threads (haven't done any
threading in any
other language before...). I was playing around and discovered some weird
behavior. Here is my code:
import threading
from time import sleep
from random import random
import sys
class
If I have to write an extension module with many objects, how can I
organizing the code?
I think: every object in a separate file, and a last file with the
PyInit_. function. But is unmenageable .
Solutions?
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
Scott David Daniels wrote:
Ethan Furman wrote:
and returns the last object that is "true"
A little suspect this.
_and_ returns the first object that is not "true," or the last object.
or returns the first object that is "true"
Similarly:
_or_ returns the first object that is "true,"
On Jul 14, 6:34 pm, Rick Lawson wrote:
> Appreciate any help on this. I am porting an app from Java to python
> and need generic object pooling with hooks for object initialization /
> cleanup and be able to specify an object timeout.
>
Are you looking for something like a thread pool or a connec
On Jul 15, 5:44 pm, Mark Dickinson wrote:
> On Jul 15, 5:07 am, "Dr. Phillip M. Feldman"
> wrote:
[snip]
> > for arg in args:
> > if bool(arg): result= not result
>
> It's more idiomatic to say "if arg: ..." rather than "if bool
> (arg): ...".
>
Ah yes, but not once conditional tests,
On Tue, 14 Jul 2009 08:53:33 -0700, Carl Banks wrote:
> On Jul 14, 2:14 am, Steven D'Aprano
> wrote:
>> On Tue, 14 Jul 2009 01:30:48 -0700, Carl Banks wrote:
>> > Seriously, do you *ever* take more than 2 seconds to consider whether
>> > you might be missing something obvious before following up
On Wed, Jul 15, 2009 at 1:42 AM, Mohan Parthasarathy wrote:
> So, all four of them above has its use cases in practice i guess.
>
> thanks
> mohan
>
As a hopefully semi-informative aside, I've been writing python code for a
few years now, and I regularly use all four forms of argument passing lis
On Jul 14, 4:48 pm, Ethan Furman wrote:
>
> A whole family of supers. :)
>
You should pick up Lisp. The whole concept of a binary operator
doesn't exist over there. All the things binary operators can do, Lisp
does with 0, 1, 2, or more arguments.
[1]> (+)
0
[2]> (+ 1)
1
[3]> (+ 1 2)
3
[4]> (+
On Tue, 14 Jul 2009 11:25:08 -0700, Dr. Phillip M. Feldman wrote:
> Current Boolean operators are 'and', 'or', and 'not'. It would be nice
> to have an 'xor' operator as well.
I've often wished there was too, for the sake of completeness and
aesthetics, I'd love to be able to write:
a xor b
i
On Jul 15, 12:08 am, Christian Heimes wrote:
> Chris Rebert wrote:
> > Using the xor bitwise operator is also an option:
> > bool(x) ^ bool(y)
>
> I prefer something like:
>
> bool(a) + bool(b) == 1
>
> It works even for multiple tests (super xor):
>
> if bool(a) + bool(b) + bool(c) + bool(d
On Wed, 2009-07-15 at 02:02 -0700, Jonathan Gardner wrote:
> On Jul 14, 4:48 pm, Ethan Furman wrote:
> >
> > A whole family of supers. :)
> >
> All the things binary operators can do, Lisp
> does with 0, 1, 2, or more arguments.
+1
n-ary operators are great, but binary operators are just synt
tuxagb:
> If I have to write an extension module with many objects, how can I
> organizing the code?
> I think: every object in a separate file, and a last file with the
> PyInit_. function. But is unmenageable .
>
> Solutions?
What do you think about using Cython?
Bye,
bearophile
--
htt
Steven D'Aprano wrote:
On Tue, 14 Jul 2009 11:25:08 -0700, Dr. Phillip M. Feldman wrote:
Current Boolean operators are 'and', 'or', and 'not'. It would be nice
to have an 'xor' operator as well.
I've often wished there was too, for the sake of completeness and
aesthetics, I'd love to be abl
Hi,
I have a lot of old Dbase files (.dbf) and I'll like to convert these
to SQLite databases as automatically as possible.
Does anybody know a tool/Python script to do so?
I know, I could use dbfpy and create the SQLite table and import all
data. But is there something easier?
Many thanks for
On Jul 14, 2:21 pm, John Machin wrote:
> On Jul 14, 7:22 pm, hartley wrote:> > > I'm very new at
> wrapping Python/C, and I have run into some problems.
>
> [snip]
>
>
>
> > > > pValue = PyObject_CallObject(pFunc,NULL);
>
> > > > pValue is now a PyList - i've even verified this with:
>
>
On 14 juil, 19:33, [email protected] wrote:
> Dear all,
>
> Can anyone tell me that suppose i have a file having content like:
>
> _Atom_name
> _Atom_type
> _Chem_shift_value
> _Chem_shift_value_error
> _Chem_shift_ambiguity_code
> 1 1 PHE H H
Howdy all,
A common idiom I use is::
def frobnicate(warble):
foo = complex_computation()
bar = long.access.path.leading.to.useful.value
baz = (lengthy + expression * with_several_parts)
spangulate("%(warble)s: %(foo)s%(bar)s [%(baz)d]" % vars())
This allows th
On Wed, 15 Jul 2009 11:53:28 +0200, Helmut Jarausch
wrote:
> Hi,
>
> I have a lot of old Dbase files (.dbf) and I'll like to convert these
> to SQLite databases as automatically as possible.
> Does anybody know a tool/Python script to do so?
>
> I know, I could use dbfpy and create the SQLite ta
> Andreas Grommek (AG) wrote:
>AG> Hi Newsgroup,
>AG> I'm new to python and I am familiarizing myself with threads
>AG> (haven't done any threading in any other language before...). I was
>AG> playing around and discovered some weird behavior. Here is my code:
When you start programming with
Hi,
On Wed, Jul 15, 2009 at 08:08:13PM +1000, Ben Finney wrote:
> def frobnicate(warble):
> foo = complex_computation()
> bar = long.access.path.leading.to.useful.value
> baz = (lengthy + expression * with_several_parts)
> spangulate("%(warble)s: %(foo)s%(bar)s
Sure, Aho-Corasick is fast for fixed strings; but without real
numbers / a concrete goal
> > Matt, how many words are you looking for, in how long a string ?
a simple solution is good enough, satisficing. Matt asked "how to
make that function look nicer?"
but "nice" has many dimensions -- bicycle
2009/7/15 Jeremiah Dodds :
> As a hopefully semi-informative aside, I've been writing python code for a
> few years now, and I regularly use all four forms of argument passing listed
> above.
Curiously, I never use the all-named style in Python, whereas it's my
normal style in Ada. I shall now en
Hi all,
I need to extend and not replace the __getitem__ method of a dict class.
Here is sample the code:
>>> class myDict(dict):
... def __getitem__(self, y):
... print("Doing something")
... dict.__getitem__(self, y)
...
>>> a=myDict()
>>> a["value"] = 1
>>> print a["value"
Nicolas Chauvat writes:
> On Wed, Jul 15, 2009 at 08:08:13PM +1000, Ben Finney wrote:
> > That is, pylint is not aware that the names used by accessing the values
> > from the dictionary returned by ‘vars()’.
> > ...
>
> You are not the only one:
> http://lists.logilab.org/pipermail/python-proje
On Wed, Jul 15, 2009 at 12:39:48PM +0200, Nicolas Chauvat wrote:
> Here is the ticket:
> https://www.logilab.net/elo/ticket/9634
Apologies: http://www.logilab.org/ticket/9634
--
Nicolas Chauvat
logilab.fr - services en informatique scientifique et gestion de connaissances
--
http://mail.pyth
fdb wrote:
> Hi all,
>
> I need to extend and not replace the __getitem__ method of a dict class.
>
> Here is sample the code:
>
class myDict(dict):
> def __getitem__(self, y):
> print("Doing something")
> dict.__getitem__(self, y)
>
a=myDict()
>
pdpi wrote:
> On Jul 15, 12:08 am, Christian Heimes wrote:
>> Chris Rebert wrote:
>>> Using the xor bitwise operator is also an option:
>>> bool(x) ^ bool(y)
>> I prefer something like:
>>
>> bool(a) + bool(b) == 1
>>
>> It works even for multiple tests (super xor):
>>
>> if bool(a) + bool(b
Yes, that is what I was looking for.
Greets!!
--
View this message in context:
http://www.nabble.com/how-to-set-timeout-while-colling-a-soap-method--tp24461403p24496577.html
Sent from the Python - python-list mailing list archive at Nabble.com.
--
http://mail.python.org/mailman/listinfo/pyth
On Jul 15, 4:53 am, Jonathan Gardner
wrote:
> On Jul 14, 6:34 pm, Rick Lawson wrote:
>
> > Appreciate any help on this. I am porting an app from Java to python
> > and need generic object pooling with hooks for object initialization /
> > cleanup and be able to specify an object timeout.
>
> Are
Only this! I'm going crazy!
Than you!
Code:
class myDict(dict):
def __getitem__(self, y):
print("Doing something")
return dict.__getitem__(self, y)
a=myDict()
a["value"] = 1
print a["value"]
Christian Heimes ha scritto:
> How about returning the value? :]
--
FabioBD
-
I'm looking for objective oriented and pythonic way to solve my problem.
I'm using IDLE's TreeWidget, by inheriting TreeItem and overriding some of
it's methods. My tree structure is defined inside treedata, which is
xml.dom.minidom object. MenuTreeFrame is responsible for displaying the
widget
On Jul 15, 7:54 pm, hartley wrote:
> On Jul 14, 2:21 pm, John Machin wrote:
> > On Jul 14, 7:22 pm, hartley wrote:> > > I'm very new
> > at wrapping Python/C, and I have run into some problems.
[snip]
/* the first telling */
> > > > statement C_embedding.buff = the_pylist ?
>
> > > > BTW C-em
Rick Lawson wrote:
> On Jul 15, 4:53 am, Jonathan Gardner
> wrote:
>> On Jul 14, 6:34 pm, Rick Lawson wrote:
>>
>> > Appreciate any help on this. I am porting an app from Java to python
>> > and need generic object pooling with hooks for object initialization /
>> > cleanup and be able to specif
On Wed, Jul 15, 2009 at 11:54 AM, Tim Rowe wrote:
>
> Curiously, I never use the all-named style in Python, whereas it's my
> normal style in Ada. I shall now enter a period of self-refelection to
> try to work out why I am so inconsistent :-)
>
>
>
I use it for functions that only (or mostly) ha
In article , Piet van Oostrum wrote:
>> [email protected] (Aahz) (A) wrote:
>
>>A> In article , Piet van Oostrum
>>wrote:
> [email protected] (Aahz) (A) wrote:
>>A> In article , Piet van Oostrum
>>A> wrote:
>>> And to get c.x = 4 working you also need a __se
On Jul 15, 12:37 pm, Christian Heimes wrote:
> pdpi wrote:
> > On Jul 15, 12:08 am, Christian Heimes wrote:
> >> Chris Rebert wrote:
> >>> Using the xor bitwise operator is also an option:
> >>> bool(x) ^ bool(y)
> >> I prefer something like:
>
> >> bool(a) + bool(b) == 1
>
> >> It works even
Diez B. Roggisch wrote:
> Rick Lawson wrote:
>
>> On Jul 15, 4:53 am, Jonathan Gardner
>> wrote:
>>> On Jul 14, 6:34 pm, Rick Lawson wrote:
>>>
>>> > Appreciate any help on this. I am porting an app from Java to python
>>> > and need generic object pooling with hooks for object initialization /
"Steven D'Aprano" wrote:
>Unfortunately, outside of boolean algebra and simulating electrical
>circuits, I can't think of any use-cases for an xor operator. Do you have
>any?
A bitwise xor is a poor man's comparator - if the result is binary zero,
the operands were equal, no matter what they
Dear conference!
I have test Why python based script for HeeksCNC post-processing does not
work... And I've got unbelievable behavior When importing module module
manually it works, but same opertaion from script does not
work as seen
/opt/HeeksCAD8/HeeksCNC> python
Python 2.6 (r26:66714, Fe
Steven D'Aprano wrote:
On Tue, 14 Jul 2009 11:25:08 -0700, Dr. Phillip M. Feldman wrote:
Current Boolean operators are 'and', 'or', and 'not'. It would be nice
to have an 'xor' operator as well.
I've often wished there was too, for the sake of completeness and
aesthetics, I'd love to be abl
Nicolas> Here is the ticket:
Nicolas> https://www.logilab.net/elo/ticket/9634
Is it possible to get read-only access to the tracker? It's prompting me
for a login which I don't have.
Thx,
--
Skip Montanaro - [email protected] - http://www.smontanaro.net/
when i wake up with a heart r
> Piet van Oostrum (PvO) wrote:
>PvO> def run(self):
>PvO> with lock:
All the 'with lock:' lines should have been 'with self.lock:' but as
lock is also a global variable, it did work. Of course you can decide to
use only the global variable and get rid of the self.lock altogether
On Wed, Jul 15, 2009 at 09:22:11AM -0500, [email protected] wrote:
>
> Nicolas> Here is the ticket:
> Nicolas> https://www.logilab.net/elo/ticket/9634
>
> Is it possible to get read-only access to the tracker? It's prompting me
> for a login which I don't have.
>
> Thx,
that should be htt
"MRAB" wrote in message
news:[email protected]...
> Steven D'Aprano wrote:
>> On Tue, 14 Jul 2009 11:25:08 -0700, Dr. Phillip M. Feldman wrote:
>>
>>> Current Boolean operators are 'and', 'or', and 'not'. It would be nice
>>> to have an 'xor' operator as well.
>
On Wed, Jul 15, 2009 at 8:12 AM, Peter Fodrek wrote:
>
> Would anyone be helpful for me to get more information about this problem
> because pydb does not show anything usable for me,please?
What is the directory structure for the HeeksCNC module? Although I'm
no expert, I suspect it looks someth
John Nagle wrote:
walterbyrd wrote:
I believe Guido himself has said that all indentions should be four
spaces - no tabs.
Since backward compatibility is being thrown away anyway, why not
enforce the four space rule?
At least that way, when I get python code from somebody else, I would
know wh
Nobody wrote:
On Fri, 10 Jul 2009 09:23:54 +, garabik-news-2005-05 wrote:
I would like to learn a way of changing the colour of a particular
part of the output text. I've tried the following
On Unix operating systems this would be done through the curses interface:
http://docs
Christian Heimes wrote:
Chris Rebert wrote:
Using the xor bitwise operator is also an option:
bool(x) ^ bool(y)
I prefer something like:
bool(a) + bool(b) == 1
It works even for multiple tests (super xor):
if bool(a) + bool(b) + bool(c) + bool(d) != 1:
raise ValueError("
On Jul 13, 6:26 am, seldan24 wrote:
> Hello,
>
> I'm fairly new at Python so hopefully this question won't be too
> awful. I am writing some code that will FTP to a host, and want to
> catch any exception that may occur, take that and print it out
> (eventually put it into a log file and perform
JM> By the way why would you prevent us from using tabs for indenting ?
JM> If I'm not wrong, from a semantic point of view, that's what tabs
JM> are for: indenting. Spaces are meant to separate tokens, aren't they
JM> ? I love my tabs, don't take them away from me !
I don't thin
On 2009-07-15 10:15, Jean-Michel Pichavant wrote:
Christian Heimes wrote:
Chris Rebert wrote:
Using the xor bitwise operator is also an option:
bool(x) ^ bool(y)
I prefer something like:
bool(a) + bool(b) == 1
It works even for multiple tests (super xor):
if bool(a) + bool(b) + bool(c) + b
Peter Fodrek wrote:
> Dear conference!
>
> I have test Why python based script for HeeksCNC post-processing does not
> work... And I've got unbelievable behavior When importing module module
> manually it works, but same opertaion from script does not
> work as seen
>
> /opt/HeeksCAD8/HeeksCN
QOTW: "Everyone gets so caught up in programming via languages that you get,
well, people trying to teach 'Computer Programming' as if it were only
necessary to grok a language, rather than grokking /symbol manipulation/
itself." - Simon Forman
http://groups.google.com/group/comp.lang.python/m
Helmut Jarausch wrote:
Hi,
I have a lot of old Dbase files (.dbf) and I'll like to convert these
to SQLite databases as automatically as possible.
Does anybody know a tool/Python script to do so?
I know, I could use dbfpy and create the SQLite table and import all
data. But is there something e
On Jul 15, 8:39 pm, David Lyon wrote:
> On Wed, 15 Jul 2009 11:53:28 +0200, Helmut Jarausch
>
> wrote:
> > Hi,
>
> > I have a lot of old Dbase files (.dbf) and I'll like to convert these
> > to SQLite databases as automatically as possible.
> > Does anybody know a tool/Python script to do so?
>
>
Hello,
I have a shell script, that I'm attempting to convert to Python. It
FTP's files down from an AS/400 machine. That part is working fine.
Once the files arrive, the script converts them from EBCDIC to ASCII
and then formats their line width based on a pre-determined size.
For example, if I
On Tue, 14 Jul 2009 20:10:32 +0100, wrote:
Can i become more precise like instead of printing all lines for PHE and
ASP is it possible that for PHE python will print only those lines which
will have information about H and HA and for ASP it will print those
lines
which will have information
John Machin wrote:
If dbfpy can't handle any new-fangled stuff you may have in your
files, drop me a line ... I have a soon-to-be released DBF module that
should be able to read the "new" stuff up to dBase7 and VFP9,
including memo files, conversion from whatever to Unicode if
needed, ...
Cheer
seldan24 wrote:
what can I use as the equivalent for the Unix 'fold' command?
def fold(s,len):
while s:
print s[:len]
s=s[len:]
s="A very long string indeed. Really that long? Indeed."
fold(s,10)
Output:
A very lon
g string i
ndeed. Rea
lly that l
ong? Indee
d.
Greeting
Hi DaveA,
Thank for your responses even though my problem has been solved based on
Miles' suggestion. I am writing programs by using the SimPy library,
which is a discrete-event simulator library. Below is my actual code segment
class RAID(Process):
def ReqServ(self):
while(now()In
Jean-Michel Pichavant writes:
> While everyone's trying to tell the OP how to workaround the missing
> xor operator, nobody answered the question "why is there no [boolean]
> xor operator ?".
Probably because there isn't one in C. The bitwise XOR operator, on the
other hand, exists in both C an
On Jul 15, 12:47 pm, Michiel Overtoom wrote:
> seldan24 wrote:
> > what can I use as the equivalent for the Unix 'fold' command?
>
> def fold(s,len):
> while s:
> print s[:len]
> s=s[len:]
>
> s="A very long string indeed. Really that long? Indeed."
> fold(s,10)
>
> Output:
seldan24 wrote:
On Jul 15, 12:47 pm, Michiel Overtoom wrote:
seldan24 wrote:
what can I use as the equivalent for the Unix 'fold' command?
def fold(s,len):
while s:
print s[:len]
s=s[len:]
s="A very long string indeed. Really that long? Indeed."
fold(s,10)
Output:
A
Hrvoje Niksic writes:
> > While everyone's trying to tell the OP how to workaround the missing
> > xor operator, nobody answered the question "why is there no [boolean]
> > xor operator ?".
>
> Probably because there isn't one in C. The bitwise XOR operator, on the
> other hand, exists in both C
On Wed, 15 Jul 2009 13:37:22 +0200, Christian Heimes
wrote:
>pdpi wrote:
>> On Jul 15, 12:08 am, Christian Heimes wrote:
>>> Chris Rebert wrote:
Using the xor bitwise operator is also an option:
bool(x) ^ bool(y)
>>> I prefer something like:
>>>
>>> bool(a) + bool(b) == 1
>>>
>>> I
Hrvoje Niksic wrote:
[snip]
Note that in Python A or B is in fact not equivalent to not(not A and
not B).
>>> l = [(True, True), (True, False), (False, True), (False, False)]
>>> for p in l:
... p[0] or p[1]
...
True
True
True
False
>>> for p in l:
... not(not p[0] and not p[1])
...
T
On 7/15/2009 10:23 AM MRAB said...
On Jul 15, 12:47 pm, Michiel Overtoom wrote:
seldan24 wrote:
what can I use as the equivalent for the Unix 'fold' command?
def fold(s,len):
while s:
print s[:len]
s=s[len:]
You might still need to tweak the above code as regards ho
On 7/15/2009 10:43 AM Jean-Michel Pichavant said...
Hrvoje Niksic wrote:
[snip]
Note that in Python A or B is in fact not equivalent to not(not A and
not B).
>>> l = [(True, True), (True, False), (False, True), (False, False)]
>>> for p in l:
... p[0] or p[1]
...
True
True
True
False
On Jul 15, 2009, at 1:43 PM, Jean-Michel Pichavant wrote:
Hrvoje Niksic wrote:
[snip]
Note that in Python A or B is in fact not equivalent to not(not A and
not B).
>>> l = [(True, True), (True, False), (False, True), (False, False)]
>>> for p in l:
... p[0] or p[1]
[snip]
Did I make twic
Hi all,
I came accross a strange behaviour in python today. Here is a simple
example to describe my situation:
MY_GLOBAL = ''
def a():
print 'global is: ', MY_GLOBAL
def b():
try:
MY_GLOBAL += 'bla'
except Exception, e:
print 'b: ', e
def c():
try:
globa
On Jul 15, 2009, at 1:55 PM, Emile van Sebille wrote:
On 7/15/2009 10:43 AM Jean-Michel Pichavant said...
Hrvoje Niksic wrote:
[snip]
Note that in Python A or B is in fact not equivalent to not(not A
and
not B).
Did I make twice the same obvious error ?
No -- but in the not(not... example
On 7/15/2009 10:55 AM Rodrigue said...
I came accross a strange behaviour in python today. Here is a simple
example to describe my situation:
MY_GLOBAL = ''
def e_raise():
if not MY_GLOBAL:
MY_GLOBAL = 'bla'
Traceback (most recent call last):
File "glo.py", line 49, in
Tim Golden wrote:
I was pondering on this yesterday, and the only case I've
come across in my code -- and it's reasonably common --
is checking that one and only one of two params has been
passed. I have code which wants, say, an id or a name
but doesn't want both. It's hardly difficult to write
On Jul 15, 2009, at 1:55 PM, Rodrigue wrote:
Basically, I was very surprised to discover that e() raises an
exception, but even more that e_raise() points to
if not MY_GLOBAL Is the problem not really when I assign?
My assumption is that some reordering is happening behind the scenes
that creat
I did initially ask for an infix xor operator, but eventually gave up on
this. I like the first of your two one-line solutions below; this is clean
and easy to understand. Thanks! I'd still like to be able to write an
expression like '(a and b) xor (c and d) xor (e and f)', but it looks as
thou
On Jul 14, 2009, at 5:06 PM, David Bolen wrote:
Are you sure? It seems to restrict them in the same block, but not in
the entire file. At least I was able to use both space and tab
indented blocks in the same file with Python 3.0 and 3.1.
It seems to me that, within an indented block, Python
On Tue, 14 Jul 2009 11:47:41 -0700 (PDT), Mark Dickinson
wrote:
>On Jul 14, 7:25 pm, "Dr. Phillip M. Feldman"
>wrote:
>> Current Boolean operators are 'and', 'or', and 'not'. It would be nice to
>> have an 'xor' operator as well.
>
>Hmm. I don't think 'nice' is sufficient. You'd need to make
On Jul 9, 7:28 pm, Miles Kaufmann wrote:
> On Jul 9, 2009, at 9:20 AM, Lie Ryan wrote:
>
> > Michael Mossey wrote:
> >> I want to understand better what the "secret" is to responding to a
> >> ctrl-C in any shape or form.
>
> > Are you asking: "when would the python interpreter process
> > Keyboar
Dear all,
Sorry that I am disturbing you all again and again but this is the way I
am trying to solve my problem:---
>>> import re
>>> exp = re.compile("CA")
>>> infile = open("file1.txt")
>>> for line in infile:
... values = re.split("\s+", line)
... if exp.search(line):
...prin
On 2009-07-15 13:29, Wayne Brehaut wrote:
On Tue, 14 Jul 2009 11:47:41 -0700 (PDT), Mark Dickinson
wrote:
On Jul 14, 7:25 pm, "Dr. Phillip M. Feldman"
wrote:
Current Boolean operators are 'and', 'or', and 'not'. It would be nice to
have an 'xor' operator as well.
Hmm. I don't think 'nice'
On Jul 15, 7:29 pm, Wayne Brehaut wrote:
> On Tue, 14 Jul 2009 11:47:41 -0700 (PDT), Mark Dickinson
> wrote:
> >I'd also guess that 'xor' would be much less used than 'and' or 'or',
> >but maybe that's just a reflection of the sort of code that I tend to
> >write.
>
> You're right about that!. I
On Jul 14, 2:25 pm, "Dr. Phillip M. Feldman"
wrote:
> Current Boolean operators are 'and', 'or', and 'not'. It would be nice to
> have an 'xor' operator as well.
My $0.02 on this discussion: There would be nothing gained by having
non-bitwise XOR operator. You can't short-circuit XOR, because y
Miles Kaufmann wrote:
On Jul 15, 2009, at 1:43 PM, Jean-Michel Pichavant wrote:
Hrvoje Niksic wrote:
[snip]
Note that in Python A or B is in fact not equivalent to not(not A and
not B).
>>> l = [(True, True), (True, False), (False, True), (False, False)]
>>> for p in l:
... p[0] or p[1]
On 2009-07-15, [email protected] wrote:
> Sorry that I am disturbing you all again and again but this is the way I
> am trying to solve my problem:---
We could probably be a lot more helpful if you would keep these
postings all in a single thread so that people who didn't read
the first p
On Thu, 2009-07-16 at 00:16 +0530, [email protected] wrote:
> Dear all,
>
> Sorry that I am disturbing you all again and again but this is the way I
> am trying to solve my problem:---
>
> >>> import re
> >>> exp = re.compile("CA")
> >>> infile = open("file1.txt")
> >>> for line in infile:
Mag Gam wrote:
> At my university we are trying to compile python with --enable-shared
Is there a reason why you need to compile the CPython interpreter yourself?
> however when I do a make many things fail. Is it a good idea to
> compile python with shared libraries?
Perfectly fine, Linux dist
On Wed, 15 Jul 2009 11:51:44 -0700 (PDT), Mark Dickinson
wrote:
>On Jul 15, 7:29 pm, Wayne Brehaut wrote:
>> On Tue, 14 Jul 2009 11:47:41 -0700 (PDT), Mark Dickinson
>> wrote:
>> >I'd also guess that 'xor' would be much less used than 'and' or 'or',
>> >but maybe that's just a reflection of th
I'm using multiprocessing to spawn several subprocesses, each of which
uses a very large data structure (making it impractical to pass it via
pipes / pickling). I need to allocate this structure once when the
process is created and have it remain in memory for the duration of
the process. The way t
On Jun 26, 6:47 am, Mag Gam wrote:
> Thankyou everyone for the responses! I took some of your suggestions
> and my loading sped up by 25%
what a useless post...
--
http://mail.python.org/mailman/listinfo/python-list
Jean-Michel Pichavant writes:
> Hrvoje Niksic wrote:
> [snip]
>> Note that in Python A or B is in fact not equivalent to not(not A and
>> not B).
>>
l = [(True, True), (True, False), (False, True), (False, False)]
for p in l:
> ... p[0] or p[1]
[...]
Try with a different data se
mheavner schrieb:
I'm using multiprocessing to spawn several subprocesses, each of which
uses a very large data structure (making it impractical to pass it via
pipes / pickling). I need to allocate this structure once when the
process is created and have it remain in memory for the duration of
th
1 - 100 of 149 matches
Mail list logo