Probably a bit of weird question. I realise decorators shouldn't be
executed until the function they are defined with are called, but is
there anyway for me to find all the decorates declared in a file when
I import it? Or perhaps anyway to find the decorators by loading the
file by other methods
On Fri, 26 Oct 2007 16:29:34 -0700, jimmy.musselwhite wrote:
> On Oct 26, 6:56 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
>> On 10/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>> wrote:
>>
>> > Hello all
>> > It would be great if I could make a number that can go beyond current
>> > size limita
Nicko wrote:
> If you don't like the rounding errors you could try:
>
> def fact(n):
> d = {"p":1L}
> def f(i): d["p"] *= i
> map(f, range(1,n+1))
> return d["p"]
>
> It is left as an exercise to the reader as to why this code will not
> work on Py3K
Serves yo
On Oct 26, 4:54 am, Lennart Benschop <[EMAIL PROTECTED]> wrote:
> Python has had the Decimal data type for some time now. The Decimal data
> type is ideal for financial calculations. Using this data type would be
> more intuitive to computer novices than float as its rounding behaviour
> matches mo
On Oct 26, 7:17 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote:
> Matimus wrote:
> >> - Traling characters at the end of a literal are already used (the L
> >> for long).
>
> > The trailing L is going away in Python 3.0. For your consideration may
> > I suggest a '$' prefix. Though, I'm not sure I
> On Behalf Of Andrew West
> Basically what I'm looking for is a way to, given a python file, look
> through that file and find all the decorators and the associated
> functions, that includes any arguments that the decorator has.
The inspect module has a function called "findsource"
import ins
"Shane Geiger" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
a buggy hack (copying your top post style)
>>> D(123456789.123456789)
Decimal("123456789.123")
Or what there an unwritten :-)?
| D = lambda x: decimal.Decimal(str(x))
|
| >> D(3.2)
| Decimal("3.2")
--
http://mail.
My apologies in advance, I'm new to python
Say, I have a dictionary that looks like this:
record={'BAT': '14.4', 'USD': '24', 'DIF': '45', 'OAT': '16',
'FF': '3.9', 'C3': '343', 'E4': '1157', 'C1': '339',
'E6': '1182', 'RPM': '996', 'C6': '311', 'C5': '300',
'C4': '349',
A long time ago I wrote a redirector to note and display the most frequently
requested modules from the library reference manual's global module index.
When Georg Brandl did his massive rewrite of the Python manuals that broke.
I finally took the time this evening to resurrect that function. The r
"Dan Bishop" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Oct 24, 8:56 pm, "Junior" <[EMAIL PROTECTED]> wrote:
>> I want to open a text file for reading and delineate it by comma. I also
>> want any data
>> surrounded by quotation marks that has a comma in it, not to count th
On Oct 26, 11:29 pm, Frank Stutzman <[EMAIL PROTECTED]>
wrote:
> My apologies in advance, I'm new to python
>
> Say, I have a dictionary that looks like this:
>
> record={'BAT': '14.4', 'USD': '24', 'DIF': '45', 'OAT': '16',
> 'FF': '3.9', 'C3': '343', 'E4': '1157', 'C1': '339',
> '
On Oct 26, 9:29 pm, Frank Stutzman <[EMAIL PROTECTED]> wrote:
> My apologies in advance, I'm new to python
>
> Say, I have a dictionary that looks like this:
>
> record={'BAT': '14.4', 'USD': '24', 'DIF': '45', 'OAT': '16',
> 'FF': '3.9', 'C3': '343', 'E4': '1157', 'C1': '339',
> 'E
Bjoern Schliessmann <[EMAIL PROTECTED]> wrote:
>
>The last app I saw that had problems with whitespace was Worms 2
>(1997). YMMV (and I'm interested in it).
If only. Even the very latest Microsoft WDK (Windows Driver Kit, formerly
known as the DDK) cannot successfully build drivers if the source
On Oct 25, 5:07 pm, Adam Donahue <[EMAIL PROTECTED]> wrote:
> As an exercise I'm attempting to write a metaclass that causes an
> exception to be thrown whenever a user tries to access
> 'attributes' (in the traditional sense) via a direct reference.
Well, now thanks to Bruno and the others you kn
> On Behalf Of Edward Kozlowski
> I think this should do the trick. There's probably something
> more concise than this, but I can't think of it at the moment.
>
> egt = {}
> for key in record:
> if key.startswith('E'):
> egt[key] = record[key]
Not much more concise, but another way
On Fri, 26 Oct 2007 19:29:47 -0400, J. Cliff Dyer wrote:
> Ben Finney wrote:
>> So, the original poster might get further by proposing an '0dNNN.NNN'
>> syntax for 'decimal.Decimal' literals.
> It would rather be remarkably inconsistent and confusing.
>
> Python 3.0a1 (py3k:57844, Aug 31 2007,
I want to transmit an array via socket from a host to another.
How to do it? thank you.
--jeff
_
Largest network of startups. Find new startup opportunities. Click here.
http://thirdpartyoffers.juno.com/TGL2111/fc/Ioyw6iieVGxKk95ANW9UY46Z
Frank Stutzman wrote:
> My apologies in advance, I'm new to python
>
> Say, I have a dictionary that looks like this:
>
> record={'BAT': '14.4', 'USD': '24', 'DIF': '45', 'OAT': '16',
> 'FF': '3.9', 'C3': '343', 'E4': '1157', 'C1': '339',
> 'E6': '1182', 'RPM': '996', 'C6': '311',
>
> This should work -
>
> egt = dict([i for i in d.items() if i[0].startswith('E')])
>
Of course I meant record.items(), not d.items(). Sorry.
Frank
--
http://mail.python.org/mailman/listinfo/python-list
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes:
> assert 0b1 is 0x1
> That this doesn't raise `AssertionError` is an implementation detail.
> It's not guaranteed the two objects are really the same.
I think Ben is getting at 0b1 and 0x1 being the same type, while the
proposed 0d1 is a d
On 26 Ott, 23:33, Stargaming <[EMAIL PROTECTED]> wrote:
> He certainly is -- *you* are misreading *him*. The nit he's picking
is
> the non-terminated string (quotation mark/apostrophe missing).
>
right, now i got it!
beside this, i'm trying to use the reduceXML function proposed by
Larry.. but I
On Oct 27, 3:14 am, Andrew West <[EMAIL PROTECTED]> wrote:
> Probably a bit of weird question. I realise decorators shouldn't be
> executed until the function they are defined with are called, but is
> there anyway for me to find all the decorates declared in a file when
> I import it? Or perhaps
On Oct 27, 8:02 am, Frank Millman <[EMAIL PROTECTED]> wrote:
> > This should work -
>
> > egt = dict([i for i in d.items() if i[0].startswith('E')])
>
> Of course I meant record.items(), not d.items(). Sorry.
>
> Frank
On reflection, although my solution is a bit shorter than some others,
it may n
101 - 123 of 123 matches
Mail list logo