"wormwood_3" <[EMAIL PROTECTED]> wrote
1.1
> 1.1001
> "1.1" is a float type, and apparently it cannot be represented by
> binary floating point numbers accurately.
> I must admit that I do not understand why this is the case.
This isn't just a problem in binary. Consider u
Luke Paireepinart wrote:
> I've always wondered:
> There are numbers in Decimal that can't be represented accurately in
> Binary without infinite precision.
> But it doesn't go the other way. Rational base-2 numbers are rational
> base-10 numbers. I'm supposing this is because base-10 is a hig
At 07:34 PM 8/22/2007, Kent Johnson wrote:
>FWIW here is my fastest solution:
>
>01 from itertools import chain
>02 def compute():
>03 str_=str; int_=int; slice_=slice(None, None, -1)
>04 for x in chain(xrange(1, 101, 10), xrange(2, 101, 10),
>05 xrange(3, 101, 10), xrange(4, 1
Dick Moores wrote:
> At 07:34 PM 8/22/2007, Kent Johnson wrote:
>> FWIW here is my fastest solution:
>>
>> 01 from itertools import chain
>> 02 def compute():
>> 03 str_=str; int_=int; slice_=slice(None, None, -1)
>> 04 for x in chain(xrange(1, 101, 10), xrange(2, 101, 10),
>> 05 x
Folks, I'd like to announce my final Python courses for 2007:
Need to get up-to-speed with Python as quickly as possible? Come join
me, Wesley Chun, author of Prentice-Hall's well-received "Core Python
Programming," for another set of courses this Fall in beautiful
Northern California! This will b
At 08:20 AM 8/23/2007, Kent Johnson wrote:
>Dick Moores wrote:
>>At 07:34 PM 8/22/2007, Kent Johnson wrote:
>>>FWIW here is my fastest solution:
>>>
>>>01 from itertools import chain
>>>02 def compute():
>>>03 str_=str; int_=int; slice_=slice(None, None, -1)
>>>04 for x in chain(xrange(1,
Dick Moores wrote:
>> Two reasons. First, looking up a name that is local to a function is
>> faster than looking up a global name. To find the value of 'str',
>> the interpreter has to look at the module namespace, then the
>> built-in namespace. These are each dictionary lookups. Local values
Hello,
I'm looking for a way to convert Python code into a string.
For example, let say I have this function:
def myFunc():
print 'hello world'
Now in the same module, I'd like to take this function and convert it
into a string:
"""def myFunc():
print 'hello world'\n"""
Thanks
Bern
Greetings,
The following is from:
http://www.hetland.org/coding/
##
Self-Printing One-Liner
If you run this one-liner at a command prompt, it should print out a
copy of itself (write it as one continuous line, without the line
break):
python -c "x='python -c %sx=%s; print x%%(chr
Bernard Lebel wrote:
> Hello,
>
> I'm looking for a way to convert Python code into a string.
>
> For example, let say I have this function:
>
> def myFunc():
> print 'hello world'
>
>
> Now in the same module, I'd like to take this function and convert it
> into a string:
>
> """def myFu
Bernard Lebel wrote:
> Hello,
>
> I'm looking for a way to convert Python code into a string.
>
> For example, let say I have this function:
>
> def myFunc():
> print 'hello world'
>
>
> Now in the same module, I'd like to take this function and convert it
> into a string:
>
> """def myFunc():
"Bernard Lebel" <[EMAIL PROTECTED]> wrote
> I'm looking for a way to convert Python code into a string.
Read the file as text?
You can find the file by checking the __file__ attribute
of a module.
> Now in the same module, I'd like to take this function and convert
> it
> into a string:
If its
Hi Kent,
When try your approach, I get an IOError.
>>> import inspect
>>> def myFunc():
... print 'hello world'
...
>>>
>>> s = inspect.getsource(myFunc)
Traceback (most recent call last):
File "", line 1, in ?
File "C:\Python24\lib\inspect.py", line 552, in getsource
lines, lnum = ge
Hi everybody!
i would like to know how can i capture the system process's status with
python, i need to know if they are sleeping, zombie or runing.
I use Debian lenny, GNU/Linux
thanks
--
Flavio Percoco Premoli, A.K.A. [Flaper87]
http://www.flaper87.com
Usuario Linux registrado #436538
Geek b
Bernard Lebel wrote:
> Hi Kent,
>
> When try your approach, I get an IOError.
>
>
import inspect
def myFunc():
> ... print 'hello world'
> ...
>
s = inspect.getsource(myFunc)
> Traceback (most recent call last):
> File "", line 1, in ?
> File
"Bernard Lebel" <[EMAIL PROTECTED]> wrote
> Why? Because I'm using an API (the Softimage|XSI scripting API)
> where
> I have to create a custom GUI (using that API's GUI toolkit).
>
> I have to attach a logic callback to a number of widgets that can
> change from one execution to the next.
Can y
I'm a bit more of a Linux expert than a Python guru, so I don't know if
there's a facility in python to do that. However, if you look in /proc,
every running process has a directory corresponding to its PID and in
that directory is a pseudo-file called "status" that you can get state
informat
Terry Carroll wrote:
> On Wed, 22 Aug 2007, z machinez wrote:
>
>> Hi All:
>>
>> I have the following tables selected from a database:
>>
>> a1
>>
>> a2
>>
>> each table are of the same column length, same col names. How do I combine
>> or concatenate these tables ? So, I would like to have
>>
>>
"Flaper87" <[EMAIL PROTECTED]> wrote
> i would like to know how can i capture the system process's status
> with
> python, i need to know if they are sleeping, zombie or runing.
The simplest route on Unix may be just to run ps using
the subprocess.Popen object or os.popen. You can then
parse th
Hi,
I have these bunch of html files from which I've stripped presentation with
BeautifulSoup (only kept a content div with the bare content).
I've received a php template for the new site from the company we work with so
I went on taking the same part of my first script that iterates through
I have a seperate library directory both on my work station on
the the remote servers that I write applications for..
I commonly use sys.path.append('/path/to/mylibraries') in my
python code.
That code has to be placed in any standalone script that I write.
I can also place that path in a system
Sebastien wrote:
> I used triple quotes """template code""" to avoid problems, but every file
> touched by the script end up having a problem and not being able the show the
> supposed drop down menu. Now the code the company did for this drop down is
> pretty esoteric:
>
> /*
Tim Johnson wrote:
> I have a seperate library directory both on my work station on
> the the remote servers that I write applications for..
>
> I commonly use sys.path.append('/path/to/mylibraries') in my
> python code.
>
> That code has to be placed in any standalone script that I write.
> I c
hello im checking if a number is in all 5 of the other lists and when
i use the and command it seems to just be checking if it's in a least
one of the others, here is the program it's choppy i needed it for a
quick calculation so it's not pretty but it's not long:
n2=2
n3=3
n4=4
n5=5
n6=6
n
24 matches
Mail list logo