Duncan Booth wrote:
> Steven Bethard wrote:
>
>> Should users of the make statement be able to determine in which dict
>> object the code is executed? The make statement could look for a
>> ``__make_dict__`` attribute and call it to allow things like::
>>
>> make Element html:
>> ma
[EMAIL PROTECTED] wrote:
> Hi!
>
> what's the standard way for a "for" loop with float increments?
AFAIK there is no, but you should be easily able to write an frange
yourself:
def frange(from, to, step):
while from < to:
yield from
from += step
for x in frange(10.5, 23.4, 0
Thomas Bartkus wrote:
> I, for one, am so glad to have nested functions again ;-)
again ?
Python has always supported nested functions. it's the scoping rules
that have changed; before the change from LGB to LEGB, you had to
explictly import objects from outer scopes.
--
http://mail.pytho
On 14 Apr 2006 06:11:38 -0700,
[EMAIL PROTECTED] wrote:
> what's the standard way for a "for" loop with float increments?
Use a while loop instead:
f = initial_value
while f <= final_value:
process(f)
f = f + increment
Note that there is no general guarantee that f will
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi
> just curious , if i have a code like this?
>
> def a():
> def b():
> print "b"
> def c():
> print "c"
>
> how can i call c() ??
Your function 'a' is it's own little world where functions 'b' and 'c'
exist.
Your code ins
Hi,
I need to decompress zip archive. I wrote a parser of zip file, i obtain
the compressed data, but when i call zlib.decompress(data) on them,
it throws this error:
decbuf = decompressor.decompress(compressed_data)
error: Error -3 while decompressing: unknown compression method
I try to compr
Hi,
I need to decompress zip archive. I wrote a parser of zip file, i obtain
the compressed data, but when i call zlib.decompress(data) on them,
it throws this error:
decbuf = decompressor.decompress(compressed_data)
error: Error -3 while decompressing: unknown compression method
I try to compre
[EMAIL PROTECTED] wrote:
> just curious , if i have a code like this?
>
> def a():
> def b():
> print "b"
> def c():
> print "c"
>
> how can i call c() ??
in the same way as you'd access the variable "c" in this example:
def a():
c = 10
(that is, by calling the function
On 2006-04-14, Arne <[EMAIL PROTECTED]> wrote:
> Yes I have read the documentation. But I am not sure what is
> the SB/SE suboption. Is this a suboption on the remote machine
> or for Python. Maybe you could be so kind and explain it to me
> with a little code example.
SB/SE are used for telnet p
Are you saying you're on Windows?
If so, try:
http://www.activestate.com/Products/ActivePython/
It's a one-click, msi install with everything you need for win32,
including IDE etc.
Only thing to watch for is that sometimes the msi file won't install
from a logical drive other than c:\. So if yo
Kent Johnson wrote:
> According to the docs, %g formatting is "Same as "e" if exponent is
> greater than -4 or less than precision, "f" otherwise." So I would
> expect that for any num, '%g'%num == '%e'%num or '%g'%num == '%f'%num.
> But this is not the case in fact:
>
> Python 2.4.3 (#69, Mar 29
http://www.medievaltours.ro/en/about.php";>http://www.medievaltours.ro/en/about.php";>http://www.medievalart.ro/img/img-cavaler.gif"; border="0"
height="155" width="92">Discover
Medieval Romaniahttp://www.medievalart.ro/img/logo-medieval.gif"; height="139"
width="99">http://www.medievaltours.ro/
Aahz a écrit :
> In article <[EMAIL PROTECTED]>,
> Felipe Almeida Lessa <[EMAIL PROTECTED]> wrote:
>
>>Em Ter, 2006-04-11 Ã s 07:17 -0700, Aahz escreveu:
>>
>>>Can, yes. But should it? The whole point of adding the () option to
>>>classes was to ease the learning process for newbies who don't
>
Hi Harry,
* Harry George <[EMAIL PROTECTED]> wrote:
> Fabian Braennstroem <[EMAIL PROTECTED]> writes:
>
>> Hi,
>>
>> I am pretty new to python and will use it mainly in
>> combination with scientific packages. I am running ubuntu
>> breezy right now and see that some packages are out of date.
>>
Awesome, thanks for the explaination. It was very informative.
--
http://mail.python.org/mailman/listinfo/python-list
Hi!
what's the standard way for a "for" loop with float increments?
Anton
--
http://mail.python.org/mailman/listinfo/python-list
Thx for the help in finding the search page for this mailing list!!
BartlebyScrivener pointed me to the right place.
>From there
http://groups.google.com/group/comp.lang.python
, I found what I needed
I also discovered I can load mysql-python on my mac fairly easily, if I use
Darwin Ports.
http:
If you don't write or otherwise maintain Python Extension Modules
written in C (or C++) or embed Python in your application,
you can stop reading.
Python 2.5 alpha 1 was released April 5, 2006. The second alpha
should be released in a few weeks. There are several changes
which can cause C extens
> That kind of depends on what you mean by syntactic sugar. For instance, I
> wouldn't call any of your examples syntactic sugar.
AFAIK that is exactly what syntactic sugar means. Apart from non-strictness,
all syntax can be expressed by function application. Even
foo.bar()
is nothing but
bar
Kelie wrote:
> Hello,
>
> I'm trying to analyze some autolisp code with python. In the file to
> be analyzed there are many functions. Each function begins with a
> "defun" statement. And before that, there may or may not have comment
> line(s), which begins with ";". My goal is to export each
On 2006-04-14, Sergei Organov <[EMAIL PROTECTED]> wrote:
> Dennis Lee Bieber <[EMAIL PROTECTED]> writes:
>> It always means bind... But if the LHS is a mutable object, AND you
>> have specified a component of that object, it is the component that is
>> being rebound...
>>
>> lst[:] = []
I found an answer :
color = gtk.gdk.Color()
and then use color for fg et bg
--
http://mail.python.org/mailman/listinfo/python-list
On 14 Apr 2006 04:37:54 -0700, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> def a():
> def b():
> print "b"
> def c():
> print "c"
>
> how can i call c() ??
Function c() is not meant to be called from outside function a().
That's what a nested function is for: localizing it's usage a
[EMAIL PROTECTED] wrote:
> hi
> just curious , if i have a code like this?
>
> def a():
> def b():
> print "b"
> def c():
> print "c"
>
> how can i call c() ??
c is a name in the local scope of a(). You can call c from within a,
where the name is in scope, or you can return c or in
Jerry wrote:
> Kind of like AppleScript then?
Same fundamental goal, i.e. language-independent application scripting.
They seem to have a similar sort of approach to decoupling a scripting
language from its host application (Kross::API::ScriptManager vs. the
Open Scripting Architecture API) but a
According to the docs, %g formatting is "Same as "e" if exponent is
greater than -4 or less than precision, "f" otherwise." So I would
expect that for any num, '%g'%num == '%e'%num or '%g'%num == '%f'%num.
But this is not the case in fact:
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 b
Thank you for your reply.
Yes I have read the documentation. But I am not sure what is the SB/SE
suboption. Is this a suboption on the remote machine or for Python.
Maybe you could be so kind and explain it to me with a little code example.
Thany you very much!
Arne
"Dennis Lee Bieber" <[EMAIL
Hi.
No matter how I try, I just can't find this GdkColor class. I'm trying
to convert some data into a pixmap in order to display it. Here is my
code :
import pygtk
pygtk.require('2.0')
import gtk
xbm = """#define dump_width 4
#define dump_height 4
static unsigned char dump_bits[] = { 0xaa, 0x6c,
hi
just curious , if i have a code like this?
def a():
def b():
print "b"
def c():
print "c"
how can i call c() ??
--
http://mail.python.org/mailman/listinfo/python-list
>That kind of depends on what you mean by syntactic sugar.
Mightbe I was misusing the name of syntactic sugar, but I what I
intended to say was "all the possible 'transformations' that can be
made to reduce all the 'advanced' syntax to some sort of minimal core
of the language".
Bas
--
http://m
Hi,
If I try to print a negative integer as a hexadecimal, I get the
following error:
FutureWarning: %u/%o/%x/%X of negative int will return a signed string
in Python 2.4 and up
For example:
>>> print "%X" % -1
__main__:1: FutureWarning: %u/%o/%x/%X of negative int will return a
signed string in
>
> So when you exec 'a = "B"' in globals(), locals() you might think you
> were changing the local namespace. In fact you are changing a copy of
> the local namespace:
>
Well, that explains much, but not all that I want to be explained. Why?
Because now I understand, that by invoking
exec "a =
On Fri, 14 Apr 2006 02:54:11 -0700, Bas wrote:
> Hi group,
>
> just out of curiosity, is there a list of all the syntactic sugar that
> is used in python? If there isn't such a list, could it be put on a
> wiki somewhere? The bit of sugar that I do know have helped me a lot in
> understanding the
Bas:
>just out of curiosity, is there a list of all the syntactic sugar that
>is used in python?
http://docs.python.org/ref/specialnames.html
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
Grzegorz ¦lusarek:
>I sending email using standard python modules smtplib, email,
>coding email in utf but subject of message is not coded properly. In
>subject i use my national characters (polish) and after send i get XX in
>place these characters.
>Here is the code
>
>Message = email.message_
Fredrik Lundh schreef:
> John Machin wrote:
>
>>> $ python2.4 -mtimeit -s "str = 'D c a V e r \" = d w o r d : 0 0 0 0 0 6
>>> 4 0'" 'str.replace(" ", "")'
>> Oi! The OP mentioned "whitespace" ...
>
> yeah. but as is obvious from his examples, he really means "UTF-16", not
> whitespace.
Yes, tha
> Use the exec statement without the in-clause to get the desired effect:
>
> >>> def f():
> ... a = "a"
> ... exec "a = 'B'"
> ... print a
> ...
> >>> f()
> B
>
Well... I *do* realize that. But this is *not* my problem. I have a
function with another nested one. If I used "exec ..."
Hi group,
just out of curiosity, is there a list of all the syntactic sugar that
is used in python? If there isn't such a list, could it be put on a
wiki somewhere? The bit of sugar that I do know have helped me a lot in
understanding the inner workings of python.
To give a few examples (might no
Thomas Girod wrote:
> Hi there.
>
> I have a list containing integer values from 0 to 255. With this list I
> have informations width and height, as width * height = len(my_list)
>
> What I want to do is to convert this array into a pixmap of dimension
> width * height in order to draw it in
Hi all. I sending email using standard python modules smtplib, email,
coding email in utf but subject of message is not coded properly. In
subject i use my national characters (polish) and after send i get XX in
place these characters.
Here is the code
Message = email.message_from_string(pMessa
> def _gn(x):
> return x.upper()
>
> great_name = _gn
>
> class myclass:
> def mymethod(self, great_name=False):
> if great_name:
> return _gn('something')
> else:
> return 'something'
> >>> def great_name(x):
> ... return x.upper()
> ...
> >>
"david brochu jr" wrote:
> still having problemsi have the following in a txt file:
>
> Windows Registry Editor Version 5.00
if this is a regedit export, the data is encoded as UTF-16. treating
that as plain ASCII doesn't really work.
> for line in new_line.readlines():
> line = re.sub('"'
John Machin wrote:
> > $ python2.4 -mtimeit -s "str = 'D c a V e r \" = d w o r d : 0 0 0 0 0 6
> > 4 0'" 'str.replace(" ", "")'
>
> Oi! The OP mentioned "whitespace" ...
yeah. but as is obvious from his examples, he really means "UTF-16", not
whitespace.
--
http://mail.python.org/mailman/l
Hi,
Every time I upgrade python I also have to download all packages and
reinstall them.
http://www.voidspace.org.uk/python/articles/upgrading_python.html
tells me that this is only a problem on windows for some reasons that
have to do with binary distributions, compiling and more.
This leads m
Hello,
I'm trying to analyze some autolisp code with python. In the file to
be analyzed there are many functions. Each function begins with a
"defun" statement. And before that, there may or may not have comment
line(s), which begins with ";". My goal is to export each function
into separate f
Hi,
I try to define a (new-style) class who:
- have a __slots__ defined to be strict attributes,
- return None if the attribute is 'ok' but not set, or raise a 'normal'
error if the attribute isn't in __slots__.
This code runs, but is it the good way?
Thanks.
class test(object):
__slots__ =
"BartlebyScrivener" <[EMAIL PROTECTED]> writes:
> Yes, but for some reason, I get more and better help here with Python
> than on xemacs. Or maybe I've just had bad luck. Something like the
> following just leaves me scratching my head. I'm on Windows XP and
> never compiled anything that I know
Hi there.
I have a list containing integer values from 0 to 255. With this list I
have informations width and height, as width * height = len(my_list)
What I want to do is to convert this array into a pixmap of dimension
width * height in order to draw it inside a pygtk GUI.
Any suggestions abou
Dennis Lee Bieber <[EMAIL PROTECTED]> writes:
> On Fri, 14 Apr 2006 09:17:05 +0400, Sergei Organov <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>>
>> I, as a newcomer, don't have much trouble understanding the binding vs
>> the assignment by themselves. What does somewhat
On 4/14/06, Rajesh Sathyamoorthy <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I wanted to know why it is more efficient to read a file in smaller chunks (
> using file() or open() )? If this is not done, will this lead to errors in
> the data read or just results in slower performance?
>
> Thank You.
It
Hi,Could I have some links? It would be very helpful.Thank You.On 4/14/06, Felipe Almeida Lessa wrote:
Em Sex, 2006-04-14 às 13:45 +0800, Rajesh Sathyamoorthy escreveu:> I wanted to know why it is more efficient to read a file in smaller> chunks ( using file() or open() )?It's more efficient in som
Steven Bethard wrote:
> Should users of the make statement be able to determine in which dict
> object the code is executed? The make statement could look for a
> ``__make_dict__`` attribute and call it to allow things like::
>
> make Element html:
> make Element body:
>
PATTERN RECOGNITION EVENTS THIS SUMMER, 2006
___
4TH INTERNATIONAL SUMMER SCHOOL ON PATTERN RECOGNITION (ISSPR, 2006), 23-28
JULY, UK
WWW.PatternRecognitionSchool.com
The 4th International Summer School on Pattern Recognition will be organised at
the University of Plymouth, UK
hello again,
still having problemsi have the following in a txt file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\software\compete\dca]"UserId"="92005851""PanelId"="mayflower""PanelName"="Consumer Input Toolbar""CaptureType"=dword:0002
"CapTypOvr"=dword:0001"ExePath"="
Nicolas Fleury wrote:
> Steven Bethard wrote:
>> Ok, I finally have a PEP number. Here's the most updated version of
>> the "make" statement PEP. I'll be posting it shortly to python-dev.
>>
>> Thanks again for the previous discussion and suggestions!
>
> I find it very interesting.
>
> My onl
TPJ wrote:
> I have the following code:
>
> ---
> def f():
>
> def g():
> a = 'a' # marked line 1
> exec 'a = "b"' in globals(), locals()
> print "g: a =", a
>
> a = 'A' # marked line 2
> exec 'a = "B"' in globals(), loc
TPJ wrote:
> I have the following code:
>
> ---
> def f():
>
> def g():
> a = 'a' # marked line 1
> exec 'a = "b"' in globals(), locals()
> print "g: a =", a
>
> a = 'A' # marked line 2
> exec 'a = "B"' in globals(), lo
Part-time job Full-time income
美商高科技生化公司加州百大企業來台拓展亞太市場
誠徵兼職人員,每日2~3小時,月入1萬~3萬
http://www.moonnini.com/w/nica/
上面為在家工作系統網站
若對在家工作有興趣者可去索取電子書
--
[1;30;40m夫兵者不祥之器物或惡之故有道者不處君子居則貴左用兵則貴右兵者不祥之器非君子[m
[1;30m之器不得已[37m[30m而用之恬淡為上勝而不美而美之者是樂殺人夫樂殺人者則不可得志於天下
[m[1;30m矣吉事尚左凶事尚右偏將軍居左上將軍居右言以喪禮處之殺人之眾以哀悲泣之戰勝以
101 - 158 of 158 matches
Mail list logo