In message <7fr16650meigqgmj8rh0n3a66q9r4j4...@4ax.com>, Tim Roberts wrote:
> The .NET Common Language Runtime is a vast and very useful class library,
> including two complete GUI systems.
Used only by corporate code-cutter drones.
Go on, name one creative thing which was ever done in Dotnet.
-
Christian Heimes, 10.08.2010 01:39:
Am 10.08.2010 01:20, schrieb Aahz:
The docs say, "Parses an XML section into an element tree incrementally".
Sure sounds like it retains the entire parsed tree in RAM. Not good.
Again, how do you parse an XML file larger than your available memory
using somet
tinn...@isbd.co.uk wrote:
>
>I'm using the python mailbox class in a script that processes incoming
>mail and delivers it to various mbox format mailboxes. It appears
>that, although I am calling the lock method on the destination before
>writing to the mbox and calling unlock afterwards the locki
Lawrence D'Oliveiro wrote:
>
>Frankly I never understood the point of IronPython and IronRuby. They seemed
>like a desperate attempt to keep Dotnet relevant in the modern world of
>dynamic languages. Looks like it was a failure. Yawn.
I'm not sure that's really fair. The .NET Common Language Run
On 10-Aug-2010, at 11:04 AM, Benjamin Kaplan wrote:
> On Mon, Aug 9, 2010 at 10:17 PM, Grady Knotts wrote:
>> In earlier versions of Python I can do:
>>print 'A',
>>print 'B'
>> to print everything on the same line: 'A B'
>>
>> But I don't know how to do this with Python3
>> I'v
On 10-Aug-2010, at 10:57 AM, Xia, Zhen wrote:
> On Tue, 10 Aug 2010 10:02:49 +0530
> Navkirat Singh wrote:
>
>> Hi guys,
>>
>> I am having this strange problem. I have programmed a very basic
>> multiprocessing webserver using low level sockets. Each time the server
>> receives a request it
On Mon, Aug 9, 2010 at 10:17 PM, Grady Knotts wrote:
> In earlier versions of Python I can do:
> print 'A',
> print 'B'
> to print everything on the same line: 'A B'
>
> But I don't know how to do this with Python3
> I've been trying things like:
> print('A',)
> print('
On Tue, 10 Aug 2010 10:02:49 +0530
Navkirat Singh wrote:
> Hi guys,
>
> I am having this strange problem. I have programmed a very basic
> multiprocessing webserver using low level sockets. Each time the server
> receives a request it spawns a new process to handle the request. Now when
> thr
In earlier versions of Python I can do:
print 'A',
print 'B'
to print everything on the same line: 'A B'
But I don't know how to do this with Python3
I've been trying things like:
print('A',)
print('B')
and it prints two different lines.
So, do I get two different
On 10 Αύγ, 01:43, MRAB wrote:
> Íßêïò wrote:
> > D:\>convert.py
> > File "D:\convert.py", line 34
> > SyntaxError: Non-ASCII character '\xce' in file D:\convert.py on line
> > 34, but no
> > encoding declared; seehttp://www.python.org/peps/pep-0263.htmlfor
> > details
>
> > D:\>
>
> > What does
On Mon, Aug 9, 2010 at 9:53 PM, wrote:
> As a learning exercise in Tkinter I htought about making a very simple
> and basic file manager for my own use. I tried searching google for
> any sample project and could not find anything. Not exactly sure how
> to start I tought I could ask here?
>
> I
On 08/09/2010 11:32 PM, Navkirat Singh wrote:
I am having this strange problem. I have programmed a very basic
multiprocessing webserver using low level sockets. Each time the server
receives a request it spawns a new process to handle the request. Now when
through a web browser I type http://
As a learning exercise in Tkinter I htought about making a very simple
and basic file manager for my own use. I tried searching google for
any sample project and could not find anything. Not exactly sure how
to start I tought I could ask here?
I thought about making two listboxes one to list fol
In article <9f21f146-a43a-4108-962b-4dfa14e43...@gmail.com>,
Navkirat Singh wrote:
> I am having this strange problem. I have programmed a very basic
> multiprocessing webserver using low level sockets. Each time the server
> receives a request it spawns a new process to handle the request. Now
Hi guys,
I am having this strange problem. I have programmed a very basic
multiprocessing webserver using low level sockets. Each time the server
receives a request it spawns a new process to handle the request. Now when
through a web browser I type http://localhost:8001/ it automatically creat
On Mon, 09 Aug 2010 09:11:37 -0700, daryn wrote:
> I'm just playing around with the iter function and I realize that I can
> use the iterator returned by it long after the original object has any
> name bound to it.
Yes, the same as everything else in Python. Iterators aren't unique here.
>>> a
Alex Barna wrote:
> So what happens to this field (Windows GUI automation) ?
Either someone cares enough to do something about it, or everyone just
defaults to using AutoIT-like tools.
Which Python implementation are you planning on contributing to?
--
http://mail.python.org/mailman/listinfo/py
I want to use python to do some automatical operation on windows.
the following is the code, which try to open a file with unicode
characters in its filename in msword
but I can't get it work correctly. Can anybody help me?
if that is the shortcoming of WScript, is there any other way to do so
in
Rene Veerman wrote:
hi.
for 2 open source components of mine that are used in debugging, i
would like to capture the output generated by print for any variable.
i'm new to python, so please excuse my noobishness.
i don't know if objects can be json-ed as easy as lists and hash
tables are by pri
On Mon, Aug 9, 2010 at 7:18 PM, Rene Veerman wrote:
> hi.
>
> for 2 open source components of mine that are used in debugging, i
> would like to capture the output generated by print for any variable.
> i'm new to python, so please excuse my noobishness.
>
> i don't know if objects can be json-ed
hi.
for 2 open source components of mine that are used in debugging, i
would like to capture the output generated by print for any variable.
i'm new to python, so please excuse my noobishness.
i don't know if objects can be json-ed as easy as lists and hash
tables are by print.
and i couldn't fin
On 8/9/10 4:43 PM, Stefan Schwarzer wrote:
Hi Robert,
On 2010-08-09 22:23, Robert Kern wrote:
On 2010-08-09 06:42 , Stefan Schwarzer wrote:
Unfortunatey, when I enter
In [2]: %paste
at the prompt it gives me (before I pasted anything)
In [2]: %paste
-
On 9 Aug, 10:21, Steven D'Aprano wrote:
> And that it's quite finicky about blank lines between methods and inside
> functions. Makes it hard to paste code directly into the interpreter.
The combination of editor, debugger and interpreter is what I miss
most from Matlab. In Matlab we can have a
"Steven W. Orr" wrote:
> I'm ok in python but I haven't done too much with web pages. I have a web page
> that is hand written in html that has about 1000 entries in a table and I want
> to convert the table [into html]
Is the data coming from somewhere like a file or db? If so, I'd just
use some
On 08/09/2010 05:02 PM, Paul Rubin wrote:
Gary Herron writes:
This is a Python newsgroup, not an image processing news group.
If you are asking for an algorithm to modify an image
I saw it as a question of how to do something using PIL. Seems ok to me.
A quote from the OP:
"saeed.gnu" writes:
> "x is y" means "id(y) == id(y)"
> "x is not y" means "id(x) != id(x)"
> "x is not None" means "id(x) != id(None)"
No, the meanings are different. The behaviour might, or might not, be
the same. The operators are different *because* the meanings are
dif
Hi Carey,
-- Forwarded message --
From: Carey Tilden
To: python-list@python.org
Date: Mon, 9 Aug 2010 11:27:40 -0700
Subject: Re: Need mentor
On Sun, Aug 8, 2010 at 11:31 PM, Ranjith Kumar
wrote:
> I have described the theme of my project here,
>>It appears all you did was descr
Vedran wrote:
@plot_decorator(fig_params1)
def plt():
pylab.plot(..first graph data...)
pylab.plot(..second graph data..)
plt()
You could do something like
def call(f):
f()
@call
@plot_decorator(fig_params1)
def plt():
pylab.plot(..first graph data...)
Hi Terry,
> -- Forwarded message --
> From: Terry Reedy
> To: python-list@python.org
> Date: Mon, 09 Aug 2010 13:15:24 -0400
> Subject: Re: Need mentor
> On 8/9/2010 2:31 AM, Ranjith Kumar wrote:
>
>> I have described the theme of my project here,
>>
>
> Is this a class assignment
Gary Herron writes:
> This is a Python newsgroup, not an image processing news group.
> If you are asking for an algorithm to modify an image
I saw it as a question of how to do something using PIL. Seems ok to me.
--
http://mail.python.org/mailman/listinfo/python-list
On 08/09/2010 04:27 PM, Anahita Yazdi wrote:
Hi,
I was just wondering how would I be able to get some extra help
regarding editing an image's histogram using python's module? I have
modified a histogram of an image however I dont know how to apply the
new histogram to the image and basically r
Am 10.08.2010 01:20, schrieb Aahz:
> The docs say, "Parses an XML section into an element tree incrementally".
> Sure sounds like it retains the entire parsed tree in RAM. Not good.
> Again, how do you parse an XML file larger than your available memory
> using something other than SAX?
The docum
Hi,
I was just wondering how would I be able to get some extra help regarding
editing an image's histogram using python's module? I have modified a
histogram of an image however I dont know how to apply the new histogram to
the image and basically reload the image based on its new modified histogra
In article ,
Stefan Behnel wrote:
>Aahz, 09.08.2010 18:52:
>> In article,
>> Stefan Behnel wrote:
>>>
>>> First of all: don't use SAX. Use ElementTree's iterparse() function. That
>>> will shrink you code down to a simple loop in a few lines.
>>
>> Unless I'm missing something, that only helps if
Νίκος wrote:
D:\>convert.py
File "D:\convert.py", line 34
SyntaxError: Non-ASCII character '\xce' in file D:\convert.py on line
34, but no
encoding declared; see http://www.python.org/peps/pep-0263.html for
details
D:\>
What does it refering too? what character cannot be identified?
Line 34
> >> I'm ok in python but I haven't done too much with web pages. I have a web
> >> page
> >> that is hand written in html that has about 1000 entries in a table and I
> >> want
> >> to convert the table from entries like this
>
> >>
> >> Some Date String
> >> SomeTag
> >>
I have it now. Had to beat my head over it a couple times. Thanks
everybody.
--
http://mail.python.org/mailman/listinfo/python-list
Νίκος wrote:
On 9 Αύγ, 23:17, MRAB wrote:
Νίκος wrote:
On 9 Αύγ, 21:05, Thomas Jollans wrote:
On Monday 09 August 2010, it occurred to Νίκος to exclaim:
On 9 Αύγ, 19:21, Peter Otten <__pete...@web.de> wrote:
Νίκος wrote:
Please tell me that no matter what weird charhs has inside ic an sti
I'm using the python mailbox class in a script that processes incoming
mail and delivers it to various mbox format mailboxes. It appears
that, although I am calling the lock method on the destination before
writing to the mbox and calling unlock afterwards the locking isn't
working correctly.
I a
On 2010-08-09 23:43, Stefan Schwarzer wrote:
> I got that traceback as soon as I typed in "%paste" and
> pressed enter, without pasting anything in the terminal.
> I had assumed it works like :paste in Vim, activating a
I meant ":set paste" of course.
Stefan
--
http://mail.python.org/mailman/lis
Hi Robert,
On 2010-08-09 22:23, Robert Kern wrote:
> On 2010-08-09 06:42 , Stefan Schwarzer wrote:
>> Unfortunatey, when I enter
>>
>>In [2]: %paste
>>
>> at the prompt it gives me (before I pasted anything)
>>
>>In [2]: %paste
>>
D:\>convert.py
File "D:\convert.py", line 34
SyntaxError: Non-ASCII character '\xce' in file D:\convert.py on line
34, but no
encoding declared; see http://www.python.org/peps/pep-0263.html for
details
D:\>
What does it refering too? what character cannot be identified?
Line 34 is:
src_data
On 08/09/2010 06:11 AM, saeed.gnu wrote:
> On Aug 9, 3:41 pm, "saeed.gnu" wrote:
>> "x is y" means "id(y) == id(y)"
>> "x is not y" means "id(x) != id(x)"
>> "x is not None" means "id(x) != id(None)"
>>
>> "x is not None" is a really silly statement!! because id(None) and id
On 9 Αύγ, 23:28, MRAB wrote:
> Íßêïò wrote:
> > On 9 Áýã, 10:07, Íßêïò wrote:
> >> Now the code looks as follows:
>
> >> =
> >> #!/usr/bin/python
>
> >> import re, os, sys
>
> >> id = 0 # unique page_id
>
> >> for currdir, files, dirs in os.walk('test'):
>
> >>
"Nobody" wrote in message
news:pan.2010.08.07.15.23.59.515...@nowhere.com...
> On Sat, 07 Aug 2010 13:48:32 +0200, News123 wrote:
>
>>> "Common sense" is wrong. There are many compelling advantages to
>>> numbering from zero instead of one:
>>>
>>> http://lambda-the-ultimate.org/node/1950
>>
>
On 9 Αύγ, 23:17, MRAB wrote:
> Νίκος wrote:
> > On 9 Αύγ, 21:05, Thomas Jollans wrote:
> >> On Monday 09 August 2010, it occurred to Νίκος to exclaim:
>
> >>> On 9 Αύγ, 19:21, Peter Otten <__pete...@web.de> wrote:
> Νίκος wrote:
> > Please tell me that no matter what weird charhs has ins
Νίκος wrote:
On 9 Αύγ, 10:07, Νίκος wrote:
Now the code looks as follows:
=
#!/usr/bin/python
import re, os, sys
id = 0 # unique page_id
for currdir, files, dirs in os.walk('test'):
for f in files:
if f.endswith('php'):
[snip]
I jus
On 2010-08-09 06:42 , Stefan Schwarzer wrote:
Hi Steven,
On 2010-08-09 10:21, Steven D'Aprano wrote:
And that it's quite finicky about blank lines between methods and inside
functions. Makes it hard to paste code directly into the interpreter.
And that pasting doesn't strip out any leading pro
Νίκος wrote:
On 9 Αύγ, 21:05, Thomas Jollans wrote:
On Monday 09 August 2010, it occurred to Νίκος to exclaim:
On 9 Αύγ, 19:21, Peter Otten <__pete...@web.de> wrote:
Νίκος wrote:
Please tell me that no matter what weird charhs has inside ic an still
open thosie fiels and make the neccessary
En Mon, 09 Aug 2010 08:41:23 -0300, saeed.gnu
escribió:
"x is y" means "id(y) == id(y)"
"x is not y" means "id(x) != id(x)"
No; consider this:
py> id([])==id([])
True
py> [] is []
False
Comparing id's is the same as using the is operator only if you can
guarantee that
Chris Rebert wrote:
> On Mon, Aug 9, 2010 at 3:19 AM, Peter Otten <__pete...@web.de> wrote:
>> Warning: I don't remember how Windows handles this, but unix will happily
>> perform os.rename("alpha/alpha.txt", "beta/beta.txt") and overwrite
>> beta/beta.txt with alpha/alpha.txt.
>>
>> I'd rather m
On 9 Αύγ, 10:07, Νίκος wrote:
> Now the code looks as follows:
>
> =
> #!/usr/bin/python
>
> import re, os, sys
>
> id = 0 # unique page_id
>
> for currdir, files, dirs in os.walk('test'):
>
> for f in files:
>
> if f.endswith('php'):
>
>
On Aug 9, 6:19 am, "Frank Millman" wrote:
> It has just happened again. I have organised my code into three modules,
> each representing a fairly cohesive functional area of the overall
> application. However, there really are times when Module A wants to invoke
> something from Module B, ditto fo
On Mon, Aug 9, 2010 at 3:19 AM, Peter Otten <__pete...@web.de> wrote:
> Chris Rebert wrote:
>
>> Hence (untested):
>> from os import listdir, rename
>> from os.path import isdir, join
>> directory = raw_input("input file directory")
>> s = raw_input("search for name")
>> r = raw_input("replace name
On 9 Αύγ, 21:05, Thomas Jollans wrote:
> On Monday 09 August 2010, it occurred to Νίκος to exclaim:
>
>
>
>
>
> > On 9 Αύγ, 19:21, Peter Otten <__pete...@web.de> wrote:
> > > Νίκος wrote:
> > > > Please tell me that no matter what weird charhs has inside ic an still
> > > > open thosie fiels and m
Hi Alex,
On Aug 7, 6:54 pm, Alex Willmer wrote:
> On Aug 7, 5:26 pm, GZ wrote:
>
> > I am wondering if there is a module that can persist a stream of
> > objects without having to load everything into memory. (For this
> > reason, I think Pickle is out, too, because it needs everything to be
> >
targetsmart wrote in news:cd83533b-f51e-4955-96c5-f8a10185bef1
@i18g2000pro.googlegroups.com in gmane.comp.python.general:
> Right now if I want to dump the contents of a generator object I use ,
> a snip from a bigger block of code..
>
> try:
> while gen: print gen.next()
> except StopIteratio
On 8 Αύγ, 20:29, John S wrote:
> When replacing text in an HTML document with re.sub, you want to use
> the re.S (singleline) option; otherwise your pattern won't match when
> the opening tag is on one line and the closing is on another.
Thats exactly the problem iam facing now with this stateme
EARN FROM HOME... ITS REAL
http://www.kamaraja.com/howitworks.htm?aff=naagaarjuna
...AND..
http://www.hyaffiliates.com?pid=d629b730
EARN FROM HOME... ITS REAL
http://www.kamaraja.com/howitworks.htm?aff=naagaarjuna
...AND..
http://www.hyaffiliates.com?pid=d629b730
-
"D'Arcy J.M. Cain" wrote in message
news:mailman.1735.1281185722.1673.python-l...@python.org...
> On Sat, 07 Aug 2010 13:48:32 +0200
> News123 wrote:
>> It makes sense in assembly language and even in many byte code languages.
>> It makes sense if you look at the internal representation of unsi
On Aug 9, 6:19 am, "Frank Millman" wrote:
> It has just happened again. I have organised my code into three modules,
> each representing a fairly cohesive functional area of the overall
> application. However, there really are times when Module A wants to invoke
> something from Module B, ditto fo
On Sun, Aug 8, 2010 at 11:31 PM, Ranjith Kumar wrote:
> I have described the theme of my project here,
It appears all you did was describe your project. Did you ask a
question or seek any specific guidance? Did I miss something?
Carey
--
http://mail.python.org/mailman/listinfo/python-list
> I highly doubt the Python source would build with a C++ compiler.
>
> C++ is "'mostly' 'backwards' compatible" with C insofar as you can
> pretty easily write C code that is also legal (and semantically
> equivalent) C++. But if you don't actively try to write code that is
> compatible with bot
On Aug 9, 6:39 am, Ulrich Eckhardt wrote:
> candide wrote:
> > Python is an object oriented langage (OOL). The Python main
> > implementation is written in pure and "old" C90. Is it for historical
> > reasons?
>
> The fact that Python is OOP doesn't mean that the implementation of it has
> to be w
On 2010-08-09, Terry Reedy wrote:
> On 8/9/2010 11:16 AM, Grant Edwards wrote:
>
>> IOW, the "Ugly American".
> [snip hate rant]
>
> Stereotypically bashing "Americans"
I wasn't bashing "Americans". I was making light of a certain type of
American tourist commonly denoted by the phrase "ugly ame
On Monday 09 August 2010, it occurred to Νίκος to exclaim:
> On 9 Αύγ, 19:21, Peter Otten <__pete...@web.de> wrote:
> > Νίκος wrote:
> > > Please tell me that no matter what weird charhs has inside ic an still
> > > open thosie fiels and make the neccessary replacements.
> >
> > Go back to 2.6 for
On 9 Αύγ, 19:21, Peter Otten <__pete...@web.de> wrote:
> Νίκος wrote:
> > Please tell me that no matter what weird charhs has inside ic an still
> > open thosie fiels and make the neccessary replacements.
>
> Go back to 2.6 for the moment and defer learning about unicode until you're
> done with th
Frank Millman wrote:
Hi all
I know the problems related to circular imports...
>
It has just happened again. I have organised my code into three modules,
each representing a fairly cohesive functional area of the overall
application. However, there really are times when Module A wants to
inv
Aahz, 09.08.2010 18:52:
In article,
Stefan Behnel wrote:
First of all: don't use SAX. Use ElementTree's iterparse() function. That
will shrink you code down to a simple loop in a few lines.
Unless I'm missing something, that only helps if the final tree fits into
memory. What do you suggest
On 8/9/2010 11:16 AM, Grant Edwards wrote:
IOW, the "Ugly American".
[snip hate rant]
Stereotypically bashing "Americans" is as ugly and obnoxious as bashing
any other ethnic group. I have traveled the world and Americans are no
worse, but are pretty much the same mix of good and bad. It is
On 8/9/2010 2:31 AM, Ranjith Kumar wrote:
I have described the theme of my project here,
Is this a class assignment or paid work?
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 8/9/2010 12:11 PM, daryn wrote:
I'm just playing around with the iter function and I realize that I
can use the iterator returned by it long after the original object has
any name bound to it. Example:
a=[1,2,3,4]
b=iter(a)
b.next()
1
a[1]=99
Changing a list while iterating through it i
> a = "{'a':'1','b':'2'}"
> how to change a into a dictionary ,says, a = {'a':'1','b':'2'}
See also the ast.literal_eval function:
http://docs.python.org/py3k/library/ast.html#ast.literal_eval
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
On 08/09/10 07:50, iu2 wrote:
Hi,
I have a SimpleXMLRPCServer running on one PC.
I need several ServerProxy-s talking to it, each one running on a
different PC. That is, I run on each PC a client application, that
talks to the one server using xml-rpc.
Is the xml-rpc designed to work like this?
In article ,
Stefan Behnel wrote:
>
>First of all: don't use SAX. Use ElementTree's iterparse() function. That
>will shrink you code down to a simple loop in a few lines.
Unless I'm missing something, that only helps if the final tree fits into
memory. What do you suggest other than SAX if you
On Aug 9, 2:50 am, iu2 wrote:
> Hi,
>
> I have a SimpleXMLRPCServer running on one PC.
> I need several ServerProxy-s talking to it, each one running on a
> different PC. That is, I run on each PC a client application, that
> talks to the one server using xml-rpc.
>
> Is the xml-rpc designed to wo
daryn wrote:
> I'm just playing around with the iter function and I realize that I
> can use the iterator returned by it long after the original object has
> any name bound to it. Example:
>
a=[1,2,3,4]
b=iter(a)
b.next()
> 1
a[1]=99
a[3]=101
del a
b.next()
> 99
b
On 8/9/2010 7:41 AM, saeed.gnu wrote:
"x is y" means "id(y) == id(y)"
"x is not y" means "id(x) != id(x)"
"x is not None" means "id(x) != id(None)"
"x is not None" is a really silly statement!!
Wrong. It is exactly right when that is what one means and is the
STANDARD I
Find a new release of python-ldap:
http://pypi.python.org/pypi/python-ldap/2.3.12
python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
st
Νίκος wrote:
> Please tell me that no matter what weird charhs has inside ic an still
> open thosie fiels and make the neccessary replacements.
Go back to 2.6 for the moment and defer learning about unicode until you're
done with the conversion job.
--
http://mail.python.org/mailman/listinfo/py
I'm just playing around with the iter function and I realize that I
can use the iterator returned by it long after the original object has
any name bound to it. Example:
>>>a=[1,2,3,4]
>>>b=iter(a)
>>>b.next()
1
>>>a[1]=99
>>>a[3]=101
>>>del a
>>>b.next()
99
>>>b.next()
3
>>>b.next()
101
it seem
Hi,
I have some problem with my actual code.
In fact, the script is done to work within nuke from the foundry which is a
compositing software.
Homever, I have some code difficulties as I quite new in the area.
Here the deal:
Im using subprocess command to copy some files into local directory, lik
Please tell me that no matter what weird charhs has inside ic an still
open thosie fiels and make the neccessary replacements.
--
http://mail.python.org/mailman/listinfo/python-list
EARN FROM HOME...EAZY... TRY THIS.
http://www.hymarkets.com/servlet/track?campaignID=7012000AS5B&a_aid=d629b730
EARN FROM HOME...EAZY... TRY THIS.
http://www.hymarkets.com/servlet/track?campaignID=7012000AS5B&a_aid=d629b730
EARN FROM HOME...EAZY... TRY THIS.
http://www.hyma
Johan a écrit :
Dear all,
Considering this test program:
def tst(a={}):
Stop here, we already know what will follow !-)
And yes, it's one of Python's most (in)famous gotchas : default
arguments values are computed only once, at function definition time
(that is, when the def statement is e
Johan wrote:
Dear all,
Considering this test program:
def tst(a={}):
print 1, a
a['1'] = 1
print 2, a
del a
def tstb(a=[]):
print 1, a
a.append(1)
print 2, a
del a
[snip]
Do this instead:
def tst(a=None):
if a is None:
a = {}
print 1, a
a[
Johan wrote:
> Dear all,
>
> Considering this test program:
>
> def tst(a={}):
> print 1, a
> a['1'] = 1
> print 2, a
> del a
The idiom to use is
def tst (a=None):
if a is None:
a = {}
# ...
and so on. This means that every call to tst with unspecified a
Dear all,
Considering this test program:
def tst(a={}):
print 1, a
a['1'] = 1
print 2, a
del a
def tstb(a=[]):
print 1, a
a.append(1)
print 2, a
del a
tst()
tst()
tstb()
tstb()
With output:
t...@tnjx:~/tst> python tt.py
1 {}
2 {'1': 1}
1 {'1': 1}
2 {'1': 1}
On 2010-08-07, Hexamorph wrote:
> Lurking for long enough to know your style. Looking at your Unicode
> rant, combined with some other comments and your general "I am right
> and you are wrong because you disagree with me." style, I came to
> the conclusion, that you are either a faschist or t
Νίκος wrote:
On 9 Αύγ, 16:52, MRAB wrote:
Νίκος wrote:
On 8 Αύγ, 17:59, Thomas Jollans wrote:
Two problems here:
str.replace doesn't use regular expressions. You'll have to use the re
module to use regexps. (the re.sub function to be precise)
'.' matches a single character. Any character, b
blur959 wrote:
Hi, all, I wonder if my post is relevant here, but i will still post
it anyway. I am working on creating a custom UI inside Maya and I
encountered some problems. Firstly, I am trying to create a textfield
button that creates a locator-shaped curve based on the coordinates
the user
On Aug 9, 9:18 am, genxtech wrote:
> On Aug 8, 7:34 pm, Tim Chase wrote:
>
>
>
> > On 08/08/10 17:20, genxtech wrote:
>
> > > if re.search(search_string, in_string) != None:
>
> > While the other responses have addressed some of the big issues,
> > it's also good to use
>
> > if thing_to_test
On Mon, 09 Aug 2010 04:41:23 -0700, saeed.gnu wrote:
> "x is not None" is a really silly statement!! because id(None) and id
> of any constant object is not predictable! I don't know whay people
> use "is" instead of "==". you should write "if x!=None" instead of "x
> is not None"
No, you should
MRAB wrote:
from os.path import isdir, join
Have a look at the imports, Dave. :-)
Oops. I should have noticed that it was a function call, not a
method. And there's no built-in called join(). I just usually avoid
using this kind of alias, unless performance requires.
thanks for ke
Hi, all, I wonder if my post is relevant here, but i will still post
it anyway. I am working on creating a custom UI inside Maya and I
encountered some problems. Firstly, I am trying to create a textfield
button that creates a locator-shaped curve based on the coordinates
the user keyed into the te
On 9 Αύγ, 16:52, MRAB wrote:
> Νίκος wrote:
> > On 8 Αύγ, 17:59, Thomas Jollans wrote:
>
> >> Two problems here:
>
> >> str.replace doesn't use regular expressions. You'll have to use the re
> >> module to use regexps. (the re.sub function to be precise)
>
> >> '.' matches a single character. An
saeed.gnu wrote:
On Aug 9, 3:41 pm, "saeed.gnu" wrote:
"x is y" means "id(y) =id(y)"
"x is not y" means "id(x) !=d(x)"
"x is not None" means "id(x) !=d(None)"
"x is not None" is a really silly statement!! because id(None) and id
of any constant object is not predictab
On 9 Αύγ, 13:47, Peter Otten <__pete...@web.de> wrote:
> Νίκος wrote:
> > On 9 Αύγ, 13:06, Peter Otten <__pete...@web.de> wrote:
>
> >> > So since its utf-8 what the problem of opening it?
>
> >> Python says it's not, and I tend to believe it.
>
> > You are right!
>
> > I tried to do the same exact
Dave Angel wrote:
blur959 wrote:
On Aug 9, 6:01 pm, Chris Rebert wrote:
os.rename() takes paths that are absolute (or possibly relative to the
cwd), not paths that are relative to some arbitrary directory (as
returned by os.listdir()).
Also, never name a variable "file"; it shadows the name
genxtech wrote:
On Aug 8, 7:34 pm, Tim Chase wrote:
On 08/08/10 17:20, genxtech wrote:
if re.search(search_string, in_string) != None:
While the other responses have addressed some of the big issues,
it's also good to use
if thing_to_test is None:
or
if thing_to_test is not None:
i
1 - 100 of 148 matches
Mail list logo