hi,
How can i create python code, for which filename can be defined on the
fly..?
for example, in a blog, when each article selected, respective python code
with headline of the article as filename should be called.
thanks
bijoy
--
http://mail.python.org/mailman/listinfo/python-list
noydb wrote:
> On May 14, 4:13 pm, Scott David Daniels wrote:
>> Peter Otten wrote:
>> > Hm, if ordered_raster_list is guaranteed to contain one string item for
>> > every month the above can be simplified to
>>
>> > months = [
>> > 'precip_jan', 'precip_feb', 'precip_mar', 'precip_apr',
>> > 'pr
On May 14, 8:24 pm, vava...@cpu111.math.uwaterloo.ca (Stephen Vavasis)
wrote:
> In my previous posting, I inquired how to change a python numeric object
> in place. Several people responded that this is not possible. Perhaps I
> should explain the larger problem that I am trying to solve, and the
On May 13, 5:26 pm, Steve Howell wrote:
> On May 12, 12:51 pm, wdveloper wrote:
>
>
>
> > On May 12, 8:38 pm, Steve Howell wrote:
>
> > > On May 12, 8:59 am, wdveloper wrote:
>
> > > > Hi everyone,
>
> > > > I am trying to call a webservice which requires an http
> > > > authentication.
> > > >
In my previous posting, I inquired how to change a python numeric object
in place. Several people responded that this is not possible. Perhaps I
should explain the larger problem that I am trying to solve, and then the
solution will become apparent. I have a C routine R that invokes a Python
I've released the latest version of my UpLib personal digital library
system.
For those of you unfamiliar with UpLib, here's the abstract:
The UpLib personal digital library system provides a secure
long-term storage system, and a visually-oriented retrieval
mechanism, for a wide variety of
En Thu, 14 May 2009 08:42:07 -0300, Lawrence D'Oliveiro escribió:
In message <787d6072-3381-40bd-
af20-8e1a40405...@h23g2000vbc.googlegroups.com>, CinnamonDonkey wrote:
I have a script running which occa[s]ionally fails because it is trying
to delete a file in use by another process. When this
On May 15, 10:46 am, Dave Angel wrote:
> kj wrote:
> > In Dave Angel
> > writes:
>
> >> kj wrote:
>
> >>> In Terry Reedy
> >>> writes:
>
> kj wrote:
>
> > Suppose I have the following:
>
> > def foo(x=None, y=None, z=None):
> > d = {"x": x, "y": y, "z": z}
> > re
On Thu, 14 May 2009 11:16:51 -0500, Grant Edwards wrote:
> On 2009-05-14, Chris Curvey wrote:
>> I'm trying to get this invocation right, and it is escaping me. How
>> can I capture the stdout and stderr if I launch a subprocess using
>> subprocess.check_call()? The twist here is that the call
On May 14, 3:55 pm, a...@pythoncraft.com (Aahz) wrote:
> In article <4a0c6e42$0$12031$426a7...@news.free.fr>,
> Bruno Desthuilliers wrote:
>
> >Marco Mariani a écrit :
> >> Bruno Desthuilliers wrote:
>
> >>> Oh, you meant the "return type" ? Nope, no way. It just doesn't make
> >>> sense given Py
On May 14, 1:26 pm, kj wrote:
> I've written a tiny module that I'd like to make available online
> from my website. This module is not "production-grade" code; it
> is meant only as an illustration, but still I'd like to make its
> download and installation as painless as possible.
>
> I could s
kj wrote:
In Dave Angel
writes:
kj wrote:
In Terry Reedy
writes:
kj wrote:
Suppose I have the following:
def foo(x=None, y=None, z=None):
d = {"x": x, "y": y, "z": z}
return bar(d)
I.e. foo takes a whole bunch of named arguments and ends up
On May 15, 6:24 am, Jason Tackaberry wrote:
> On Thu, 2009-05-14 at 20:15 +, kj wrote:
> > That problem is easily solved: just make "x = locals()" the first
> > statement in the definition of foo.
>
> That doesn't solve the problem. You'd need locals().copy()
Dave's solution doesn't formally
On Thu, 14 May 2009 17:49:33 +0100, norseman wrote:
Rhodri James wrote:
On Wed, 13 May 2009 23:08:26 +0100, norseman
wrote:
Evan Kroske wrote:
I'm working on a simple file processing utility, and I encountered a
weird error. If I try to get the first element of a list I'm
splitting fr
norseman wrote:
Scott David Daniels wrote:
kj wrote:
Suppose that f is an object whose type is 'function'.
Is there a way to find out f's list of formal arguments?...
I can write a wrapper now:
def tracer(function):
def internal(*args, **kwargs):
print('calling %s(%s)'
* FINAL REMINDER *
we have about 10-15 spaces remaining for our June course coming up in
about a month. if you have coworkers or colleagues that need to learn
Python, the weather is great up here in northern california in the
city by the bay.
there are discounts for students and teachers, as well
Thank you to all who responded. You were right about the solution. That
helped alot. Now maybe i can ask if anyone has any ideas for learning, such
as websites or videos. I found one that i liked alot.
http://iamar.net/subpages/PythonVid.html
But i wondered how other people learned as beginners i
guangshan chen wrote:
Hi MRAB,
Thanks. That is not what I am doing.
It seems only there is MV module used. I also googled a lot.
I just try to delete MV in the program. I found the program still can be
run without any problem.
So maybe the MV module is not used.
From the trackback I can see
On May 13, 8:27 pm, CTO wrote:
> On May 13, 8:19 am, bearophileh...@lycos.com wrote:
>
> > godshorse, you may use the "shortestPaths" method of this graph class
> > of mine:http://sourceforge.net/projects/pynetwork/
>
> > (It uses the same Dijkstra code by Eppstein).
> > (Once you have all distanc
On May 14, 7:01 pm, TomF wrote:
> I'm looking for a medium-sized Python system with very good coding
> style and good code organization, so I can learn from it. I'm reading
> various books on Python with advice on such things but I'd prefer to
> see a real system.
>
> By medium-sized I mean 5-20
I'm looking for a medium-sized Python system with very good coding
style and good code organization, so I can learn from it. I'm reading
various books on Python with advice on such things but I'd prefer to
see a real system.
By medium-sized I mean 5-20 classes, 5-20 files, etc; a code base th
John,
Thanks for pointing out the loop issue. I just typed these sloppy
lines the demonstrate the issue, they were not part of any code by any
means. I will make sure that I will post cleaner lines next time.
--
http://mail.python.org/mailman/listinfo/python-list
I think the problem I am experiencing bears a resemblance to the
content of this post:
http://mail.python.org/pipermail/python-list/2001-February/071421.html
Does anyone know what the GUID for the DAO 3.6 library is (or can
explain how I can find it)?
On May 12, 11:00 pm, David Lyon wrote:
> On
Hi,
I have read several articles and emails:
http://www.cafepy.com/article/python_types_and_objects/python_types_and_objects.html#relationships-transitivity-figure
http://mail.python.org/pipermail/python-list/2007-February/600128.html
I understand how type serves to be the default metaclass whe
On May 15, 7:38 am, kk wrote:
> Hi
>
> I am working on something here and I cannot get the full dictionary
> out of a function. I am sure I am missing something here.
>
> Anyways here is a simple code that repeats my problem. Basically I am
> just trying to get that values function to return the d
Hi MRAB,
Thanks. That is not what I am doing.
It seems only there is MV module used. I also googled a lot.
I just try to delete MV in the program. I found the program still can
be run without any problem.
So maybe the MV module is not used.
Guangshan
On May 14, 2009, at 5:04 PM, MRAB wrote:
On May 10, 6:56 pm, Steven D'Aprano wrote:
> > 4. What's the python way to emit warnings? (The script below should
> > warn the user that arguments after the first one are ignored.)
>
> import warnings
> warnings.warn("The end of the world is coming!")
The warnings module is used for warnings
On May 11, 12:30 pm, Nick Craig-Wood wrote:
> def __init__(self):
> usage = '''Usage: %prog [options] YYMMDD
> %prog -h|--help
> '''
> parser = OptionParser(usage=usage)
> parser.add_option("-n", "--no-newline", dest="nonl",
> action
Hi
Thank you so much. It makes perfect sense. I actually tried the second
suggested syntax before posting here but it was inside of my actual
code which probably had another problem. The suggested solution works
perfectly.
thanks again
--
http://mail.python.org/mailman/listinfo/python-list
bearophileh...@lycos.com wrote:
Piet van Oostrum:
You may not have seen it, but Fortran and Algol 60 belong to that
category.
I see. It seems my ignorance is unbounded, even for the things I like.
I am very sorry.
Some early versions of Basic were also flexible when it came to spaces.
The ex
QOTW: "Tail recursion *unifies* message passing and function calling.
*This* is the reason tail recursion is cool." - JRM
http://funcall.blogspot.com/2009/05/you-knew-id-say-something-part-iii.html
First beta of Python 3.1 released
http://groups.google.com/group/comp.lang.python/
kk wrote:
Hi
I am working on something here and I cannot get the full dictionary
out of a function. I am sure I am missing something here.
Anyways here is a simple code that repeats my problem. Basically I am
just trying to get that values function to return the diky as a
dictionary so that I c
kk:
>I am sure I am missing something here.<
This instruction created a new dicky dict for every iteration:
diky={chr(a):a}
What you want is to add items to the same dict, that you later output.
The normal way to do it is:
diky[chr(a)] = a
Your fixed code:
def values(x):
diky = {}
for i
def values(x):
diky={}
for a in range(x):
a=a+100
diky[chr(a)] = a
return diky
it is not working b/c you are creating a new dictionary with each
iteration of the loop, rather you want to update the same dictionary
with the new value you have..
--
http://mail.python.org
On May 14, 4:13 pm, Scott David Daniels wrote:
> Peter Otten wrote:
> > Hm, if ordered_raster_list is guaranteed to contain one string item for
> > every month the above can be simplified to
>
> > months = [
> > 'precip_jan', 'precip_feb', 'precip_mar', 'precip_apr',
> > 'precip_may', 'pre
kk schrieb:
Hi
I am working on something here and I cannot get the full dictionary
out of a function. I am sure I am missing something here.
Anyways here is a simple code that repeats my problem. Basically I am
just trying to get that values function to return the diky as a
dictionary so that I
On May 14, 5:44 pm, kk wrote:
> Btw my main problem is that when I assign the function to 'b' variable
> I only get the last key from the dictionary. Sorry about that I forgot
> to mention the main issue.
You're creating a new dictionary with each iteration of your loop, use
d[k] = v syntax inst
guangshan chen wrote:
Hi all,
I am new. I just want to run a python program.
When I run it, python can not find MV module. The follow is the error
information:
Traceback (most recent call last):
File "MakeCouplerRestart.py", line 22, in
import MV,struct,Numeric,string
ImportError: No m
Zhenhai Zhang wrote:
Really weired; Here is my code:
a = ["a", 1, 3, 4]
print "a:", a
c = copy(a)
SyntaxError: unexpected indent
If you correct that, you would get a NameError
c[0] = "c"
c[1] = 2
print "c:", c
print "a:",a
When posting, copy and paste the complete co
Piet van Oostrum:
> You may not have seen it, but Fortran and Algol 60 belong to that
> category.
I see. It seems my ignorance is unbounded, even for the things I like.
I am very sorry.
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Aahz wrote:
In article <4a0c6e42$0$12031$426a7...@news.free.fr>,
Bruno Desthuilliers wrote:
Marco Mariani a �crit :
Bruno Desthuilliers wrote:
Oh, you meant the "return type" ? Nope, no way. It just doesn't make
sense given Python's dynamic typing.
Unless he's really trying to write in Noht
Btw my main problem is that when I assign the function to 'b' variable
I only get the last key from the dictionary. Sorry about that I forgot
to mention the main issue.
--
http://mail.python.org/mailman/listinfo/python-list
Scott David Daniels wrote:
kj wrote:
Suppose that f is an object whose type is 'function'.
Is there a way to find out f's list of formal arguments?
The reason for this is that I'm trying to write a decorator and
I'd like the wrapper to be able to check the number of arguments
passedbut I'm
Presuming there is a reason to want block-local variables,
does this seem like a good way to do something like it?
@contextlib.contextmanager
def blocklocal(**kwargs):
bl = type('', (object,), {})()
for (k, v) in kwargs.items():
bl.__setattr__(k, v)
yield bl
for k in bl.__d
Hi
I am working on something here and I cannot get the full dictionary
out of a function. I am sure I am missing something here.
Anyways here is a simple code that repeats my problem. Basically I am
just trying to get that values function to return the diky as a
dictionary so that I can query val
> James (J) wrote:
>J> Hey all, I'm looking for suggestions on how to tackle distributed
>J> locking across several Python programs on several different machines.
Have you looked at the multiprocessing package? It has distributed
Locks's with timeouts which might well fit your requirements.
Hi all,
I am new. I just want to run a python program.
When I run it, python can not find MV module. The follow is the error
information:
Traceback (most recent call last):
File "MakeCouplerRestart.py", line 22, in
import MV,struct,Numeric,string
ImportError: No module named MV
Could
kj wrote:
Suppose that f is an object whose type is 'function'.
Is there a way to find out f's list of formal arguments?
The reason for this is that I'm trying to write a decorator and
I'd like the wrapper to be able to check the number of arguments
passed. Specifically, I'd like the wrapper
> bearophileh...@lycos.com (b) wrote:
>b> Nimrod also seems to ignore underscores inside names, seeing them as
>b> blanks. Some languages ignore underscores inside number literals, but
>b> I have never seen a language ignoring them into names too.
You may not have seen it, but Fortran and Alg
vava...@cpu111.math.uwaterloo.ca (Stephen Vavasis) writes:
> If x is a C variable of type PyObject*, and I happen to know already
> that the object is of a numeric type, say int, is there a way to
> change the value of x in place to a different number? In the C/API
> documentation I found routine
On Thu, May 14, 2009 at 12:31 PM, kj wrote:
>
>
> Suppose that f is an object whose type is 'function'.
>
> Is there a way to find out f's list of formal arguments?
>
> The reason for this is that I'm trying to write a decorator and
> I'd like the wrapper to be able to check the number of argument
kj wrote:
Suppose that f is an object whose type is 'function'.
Is there a way to find out f's list of formal arguments?
The reason for this is that I'm trying to write a decorator and
I'd like the wrapper to be able to check the number of arguments
passedbut I'm missing something like the
Stef Mientki wrote:
hello,
I would like to make my programs available under the "standard" OS's,
like Windows, Linux (,Mac)
One of the problems I encounter, is launching of files through their
file associates (probably a windows only terminology ;-)
Now I can detect the OS, but only the main
You can pull it out of f.func_code.co_varnames, but I don't believe
that's a very good approach. I tend to veer away from code objects
myself.
If you know how many arguments are passed into the wrapped function
when it's defined, you can write a function that returns your
decorator. As an example.
On Thu, 2009-05-14 at 20:15 +, kj wrote:
> That problem is easily solved: just make "x = locals()" the first
> statement in the definition of foo.
That doesn't solve the problem. You'd need locals().copy()
Cheers,
Jason.
--
http://mail.python.org/mailman/listinfo/python-list
I've written a tiny module that I'd like to make available online
from my website. This module is not "production-grade" code; it
is meant only as an illustration, but still I'd like to make its
download and installation as painless as possible.
I could simply bundle everything into a .tgz fil
Stephen Vavasis wrote:
If x is a C variable of type PyObject*, and I happen to know already that
the object is of a numeric type, say int, is there a way to change the
value of x in place to a different number? In the C/API documentation I
found routines to increment or decrement it in place,
In Dave Angel
writes:
>kj wrote:
>> In Terry Reedy
>> writes:
>>
>>
>>> kj wrote:
>>>
Suppose I have the following:
def foo(x=None, y=None, z=None):
d = {"x": x, "y": y, "z": z}
return bar(d)
I.e. foo takes a whole bunch of named arguments
Peter Otten wrote:
Hm, if ordered_raster_list is guaranteed to contain one string item for
every month the above can be simplified to
months = [
'precip_jan', 'precip_feb', 'precip_mar', 'precip_apr',
'precip_may', 'precip_jun', 'precip_jul', 'precip_aug',
'precip_sep', 'precip_oc
In article <4a0c6e42$0$12031$426a7...@news.free.fr>,
Bruno Desthuilliers wrote:
>Marco Mariani a écrit :
>> Bruno Desthuilliers wrote:
>>>
>>> Oh, you meant the "return type" ? Nope, no way. It just doesn't make
>>> sense given Python's dynamic typing.
>>
>> Unless he's really trying to write i
Suppose that f is an object whose type is 'function'.
Is there a way to find out f's list of formal arguments?
The reason for this is that I'm trying to write a decorator and
I'd like the wrapper to be able to check the number of arguments
passed. Specifically, I'd like the wrapper to look as
Tim Chase a écrit :
(snip)
try:
self.ser = Serial()
self.ser.baudrate = DEFAULT_BAUD
self.ser.open()
except SomeSpecificException:
print "Fail!"
Please make it:
try:
self.ser = Serial()
self.ser.baudrate = DEFAULT_BAUD
sel
Marco Mariani a écrit :
Bruno Desthuilliers wrote:
Oh, you meant the "return type" ? Nope, no way. It just doesn't make
sense given Python's dynamic typing.
I thought that the OP was writing a tool to document not-very-dynamic code.
Unless he's really trying to write in Nohtyp,
You mean
hello,
I would like to make my programs available under the "standard" OS's,
like Windows, Linux (,Mac)
One of the problems I encounter, is launching of files through their
file associates (probably a windows only terminology ;-)
Now I can detect the OS, but only the main OS and not e.g. Ubunt
kj wrote:
In Terry Reedy
writes:
kj wrote:
Suppose I have the following:
def foo(x=None, y=None, z=None):
d = {"x": x, "y": y, "z": z}
return bar(d)
I.e. foo takes a whole bunch of named arguments and ends up calling
a function bar that takes a single dictionary as argum
Stephen Vavasis cpu111.math.uwaterloo.ca> writes:
>
> If x is a C variable of type PyObject*, and I happen to know already that
> the object is of a numeric type, say int, is there a way to change the
> value of x in place to a different number? In the C/API documentation I
> found routines
>> OpenOfficeXML document format AKA ODF? ;)
>
> No...Office Open XML, which is used in Microsoft Office 2007 and which
> Microsoft rammed through the ISO:
> http://en.wikipedia.org/wiki/Office_Open_XML
Even worse, Microsoft Office 2007 doesn't even implement the ISO
standard for Open XML.
--
noydb wrote:
> On May 12, 12:26 pm, John Machin wrote:
>> On May 13, 1:58 am, Jaime Fernandez del Rio
>> wrote:
>>
>>
>>
>>
>>
>> > On Tue, May 12, 2009 at 5:02 PM, MRAB
>> > wrote:
>> > > John Machin wrote:
>>
>> > >> MRAB mrabarnett.plus.com> writes:
>>
>> > >>> Sort the list, passing a func
On May 12, 12:26 pm, John Machin wrote:
> On May 13, 1:58 am, Jaime Fernandez del Rio
> wrote:
>
>
>
>
>
> > On Tue, May 12, 2009 at 5:02 PM, MRAB wrote:
> > > John Machin wrote:
>
> > >> MRAB mrabarnett.plus.com> writes:
>
> > >>> Sort the list, passing a function as the 'key' argument. The fu
If x is a C variable of type PyObject*, and I happen to know already that
the object is of a numeric type, say int, is there a way to change the
value of x in place to a different number? In the C/API documentation I
found routines to increment or decrement it in place, but I didn't find a
rou
Chris Rebert wrote:
They really should just add grouper() to itertools rather than leaving
it as a recipe. People keep asking for it so often...
I've just added it to the issue tracker: http://bugs.python.org/issue6021
--
http://mail.python.org/mailman/listinfo/python-list
Thank you Paul for your reply!
I'm looking into pxdom right now and it looks very good and useful!
Thank you again!
Manu
--
http://mail.python.org/mailman/listinfo/python-list
Chris Curvey wrote:
I'm trying to get this invocation right, and it is escaping me. How
can I capture the stdout and stderr if I launch a subprocess using
subprocess.check_call()? The twist here is that the call is running
from within a Windows service.
I've tried:
check_call("mycmd.exe", std
Rhodri James wrote:
On Wed, 13 May 2009 23:08:26 +0100, norseman wrote:
Evan Kroske wrote:
I'm working on a simple file processing utility, and I encountered a
weird error. If I try to get the first element of a list I'm
splitting from a string, I get an error:
key = string.split()[0]
Erro
"Tomas Svarovsky" wrote in message
news:747b0d4f-f9fd-4fa6-bb6d-0a4365f32...@b1g2000vbc.googlegroups.com...
> This is a good point, but then it would manifest regardless of the
> language used AFAIK. And this is not the case, ruby and php
> implementations are working quite fine.
What I meant
Tim Golden wrote:
norseman wrote:
I did try these.
Doc at once:
outputs two x'0D' and the file. Then it appends x'0D' x'0D' x'0A'
x'0D' x'0A' to end of file even though source file itself has no EOL.
( EOL is EndOfLine aka newline )
That's cr cr There are two blank lines at be
On 2009-05-14, Chris Curvey wrote:
> I'm trying to get this invocation right, and it is escaping me. How
> can I capture the stdout and stderr if I launch a subprocess using
> subprocess.check_call()? The twist here is that the call is running
> from within a Windows service.
>
> I've tried:
>
>
Ant wrote:
Hi All,
I am trying to get matplotlib to overlay a couple of graphs, but am
getting nowhere. I originally thought that the following may work:
x = [1,2,3,4,5]
y = [2,4,6,8,10]
y2 = [1,4,9,16,25]
plot(x, y)
plot(x, y2)
Now this works as desired, however, the actual case I have i
On Thu, May 14, 2009 at 8:57 AM, Chris Curvey wrote:
> I'm trying to get this invocation right, and it is escaping me. How
> can I capture the stdout and stderr if I launch a subprocess using
> subprocess.check_call()? The twist here is that the call is running
> from within a Windows service.
>
Wells wrote:
Why can't I do this?
teams = { "SEA": "Seattle Mariners" }
for team, name in teams.items():
teams[team]["roster"] = ["player1", "player2"]
Because,
team will be "SEA",
so
teams[team] will be "Seattle Mariners"
and
"Seattle Mariners"["roster"] makes no sense.
Ga
On Thu, May 14, 2009 at 8:45 AM, Wells wrote:
> Why can't I do this?
>
> teams = { "SEA": "Seattle Mariners" }
> for team, name in teams.items():
> teams[team]["roster"] = ["player1", "player2"]
> I get an error:
>
> Traceback (most recent call last):
> File "./gamelogs.py", line 53, in
>
On Thu, May 14, 2009 at 8:53 AM, Ned Deily wrote:
> In article ,
> Neal Becker wrote:
>> Is there any canned iterator adaptor that will
>>
>> transform:
>> in = [1,2,3]
>>
>> into:
>> out = [(1,2,3,4), (5,6,7,8),...]
>>
>> That is, each time next() is called, a tuple of the next N items is
>
Bruno Desthuilliers wrote:
Oh, you meant the "return type" ? Nope, no way. It just doesn't make
sense given Python's dynamic typing.
I thought that the OP was writing a tool to document not-very-dynamic code.
Unless he's really trying to write in Nohtyp, the language where value
types are mo
I'm trying to get this invocation right, and it is escaping me. How
can I capture the stdout and stderr if I launch a subprocess using
subprocess.check_call()? The twist here is that the call is running
from within a Windows service.
I've tried:
check_call("mycmd.exe", stdout=subprocess.PIPE)
Thanks a lot everyone! This really cleared it up for me! :)
"Adam Gaskins" wrote in message
news:rxhol.41113$5n7.8...@newsfe09.iad...
>I am a bit confused as too when, if ever, it is not appropriate to prepend
>'self' to objects in a class. All of the examples of how to use 'self' that
>I find
Wells wrote:
> Why can't I do this?
>
> teams = { "SEA": "Seattle Mariners" }
> for team, name in teams.items():
> teams[team]["roster"] = ["player1", "player2"]
>
> I get an error:
>
> Traceback (most recent call last):
> File "./gamelogs.py", line 53, in
> teams[team]["roster"]
In Terry Reedy
writes:
>kj wrote:
>>
>> Suppose I have the following:
>>
>> def foo(x=None, y=None, z=None):
>> d = {"x": x, "y": y, "z": z}
>> return bar(d)
>>
>> I.e. foo takes a whole bunch of named arguments and ends up calling
>> a function bar that takes a single dictionary as
In article ,
Neal Becker wrote:
> Is there any canned iterator adaptor that will
>
> transform:
> in = [1,2,3]
>
> into:
> out = [(1,2,3,4), (5,6,7,8),...]
>
> That is, each time next() is called, a tuple of the next N items is
> returned.
This topic was discussed here just a few days a
Why can't I do this?
teams = { "SEA": "Seattle Mariners" }
for team, name in teams.items():
teams[team]["roster"] = ["player1", "player2"]
I get an error:
Traceback (most recent call last):
File "./gamelogs.py", line 53, in
teams[team]["roster"] = ["player1", "player2"]
TypeError:
For beginners, this ultra-low-cost Python Boot Camp developed by the
Triangle Zope and Python Users Group makes you productive so you can get
your work done quickly. PyCamp emphasizes the features which make Python
a simpler and more efficient language. Following along by example speeds
your le
On May 14, 3:52 pm, Hyuga wrote:
...
> On the other hand, I just took a peek at the matplotlib example
> gallery, which is very diverse, and it has an example that I think is
> exactly what you're looking
> for:http://matplotlib.sourceforge.net/examples/api/two_scales.html
Superb - spot on. Than
Neal Becker wrote:
Is there any canned iterator adaptor that will
transform:
in = [1,2,3]
into:
out = [(1,2,3,4), (5,6,7,8),...]
That is, each time next() is called, a tuple of the next N items is
returned.
An option, might be better since it handles infinite list correctly:
>>>
On May 14, 2:37 pm, Dave Angel wrote:
> daved170 wrote:
> > On May 13, 7:42 pm, Dave Angel wrote:
>
> >> daved170 wrote:
>
> >>> Hi there,
> >>> I'm newbie in pythonCard.
> >>> I have an application with 2 buttons : START , STOP
> >>> Start execute a while(1) loop that execute my calculations.
>
> In message <787d6072-3381-40bd-
> af20-8e1a40405...@h23g2000vbc.googlegroups.com>, CinnamonDonkey wrote:
>
>> I have a script running which occa[s]ionally fails because it is trying
>> to delete a file in use by another process. When this happens I want
>> it to log which process has the lock.
norseman wrote:
I did try these.
Doc at once:
outputs two x'0D' and the file. Then it appends x'0D' x'0D' x'0A' x'0D'
x'0A' to end of file even though source file itself has no EOL.
( EOL is EndOfLine aka newline )
That's cr cr There are two blank lines at begining.
cr
On May 14, 7:41 am, Ant wrote:
> Hi All,
>
> I am trying to get matplotlib to overlay a couple of graphs, but am
> getting nowhere. I originally thought that the following may work:
>
> >>> x = [1,2,3,4,5]
> >>> y = [2,4,6,8,10]
> >>> y2 = [1,4,9,16,25]
> >>> plot(x, y)
> >>> plot(x, y2)
>
> Now t
Neal Becker wrote:
> Is there any canned iterator adaptor that will
>
> transform:
> in = [1,2,3]
>
> into:
> out = [(1,2,3,4), (5,6,7,8),...]
>
> That is, each time next() is called, a tuple of the next N items is
> returned.
Depending on what you want to do with items that don't make a c
bearophileh...@lycos.com wrote:
rump...@web.de:
Eventually the "rope" data structure (that the compiler uses heavily)
will become a proper part of the library:
Ropes are a complex data structure, that it has some downsides too.
Python tries to keep its implementation too simple, this avoids lo
Neal Becker wrote:
> Is there any canned iterator adaptor that will
>
> transform:
> in = [1,2,3]
>
> into:
> out = [(1,2,3,4), (5,6,7,8),...]
>
> That is, each time next() is called, a tuple of the next N items is
> returned.
This is my best effort... not using itertools as my br
> It might be, if the local server doesn't scale well enough to handle
> 100 concurrent requests.
true.. I didn't think of that. I was assuming the client machine
wasn't resource constrained. That would definitely lead to inaccurate
timings if that was the case.
--
http://mail.python.org/ma
1 - 100 of 138 matches
Mail list logo