On 2012-11-06, at 5:55 PM, Steven D'Aprano
wrote:
> I'm not entirely sure what your point is here. The OP screwed up -- he
> didn't generate a 4-dimensional array. He generated a 2-dimensional
> array. If his intuition about the number of dimensions is so poor, why
> should his intuition abou
Thanks ...this works perfectly fine now.
On Tuesday, November 6, 2012 11:28:46 PM UTC+5:30, Prasad, Ramit wrote:
> Dennis Lee Bieber wrote:
>
> >
>
> > On Tue, 06 Nov 2012 13:26:11 +0100, Peter Otten <__pete...@web.de>
>
> > declaimed the following in gmane.comp.python.general:
>
> >
>
> >
In article ,
Gregory Ewing wrote:
> Steven D'Aprano wrote:
> > The downside is that if spaces are not argument separators, then you need
> > something else to be an argument separator. Or you need argument
> > delimiters. Or strings need to be quoted. Programming languages do these
> > things
Steven D'Aprano wrote:
The downside is that if spaces are not argument separators, then you need
something else to be an argument separator. Or you need argument
delimiters. Or strings need to be quoted. Programming languages do these
things because they are designed to be correct. Shell do not
Ian Kelly wrote:
Although I find it a bit easier to just use
something like unshorten.com, which is the first Google hit for "url
unshortener". Assuming that you trust that site to not be hosting
malware itself. :-)
Ah yes, beware the Hungarian unshortening service that redirects
every request
If anything is to be done in this area, it would be better
as an extension of list comprehensions, e.g.
[[None times 5] times 10]
which would be equivalent to
[[None for _i in xrange(5)] for _j in xrange(10)]
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Roy Smith wrote:
Call by social network? The called function likes the object.
Depending on how it feels, it can also comment on some of the object's
attributes.
And then finds that it has inadvertently shared all its
private data with other functions accessing the object.
--
Greg
--
http:/
On 2012/11/7 11:36, Dave Angel wrote:
On 11/06/2012 10:14 PM, jack wrote:
I have three tables:
What's a table? I'll assume you're using Python, but what version, and
what extra libraries do you have installed ? At least show your import
statements, so we might have a chance at guessing. I'll as
In article <5099ec1d$0$21759$c3e8da3$76491...@news.astraweb.com>,
Steven D'Aprano wrote:
> On Wed, 07 Nov 2012 00:23:44 +, MRAB wrote:
>
> >> Incorrect. Python uses what is commonly known as call-by-object, not
> >> call-by-value or call-by-reference. Passing the list by value would
> >>
On Wed, 07 Nov 2012 00:23:44 +, MRAB wrote:
>> Incorrect. Python uses what is commonly known as call-by-object, not
>> call-by-value or call-by-reference. Passing the list by value would
>> imply that the list is copied, and that appends or removes to the list
>> inside the function would no
On Nov 7, 5:26 am, MRAB wrote:
> I prefer the term "reference semantics".
Ha! That hits the nail on the head.
To go back to the OP:
On Nov 5, 11:28 am, Demian Brecht wrote:
> So, here I was thinking "oh, this is a nice, easy way to initialize a 4D
> matrix" (running 2.7.3, non-core libs not a
On 11/6/2012 11:04 PM, Terry Reedy wrote:
On 11/6/2012 7:52 PM, Stephen Bunn wrote:
I'm looking for some help with multiprocessing.
Questions about using Python go to python-list.
python-dev is for developing future versions of Python.
My apologies. I intended to and thought I had opened pyt
On 11/6/2012 7:52 PM, Stephen Bunn wrote:
I'm looking for some help with multiprocessing.
Questions about using Python go to python-list.
python-dev is for developing future versions of Python.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 11/06/2012 10:14 PM, jack wrote:
> I have three tables:
What's a table? I'll assume you're using Python, but what version, and
what extra libraries do you have installed ? At least show your import
statements, so we might have a chance at guessing. I'll assume the db
stands for database, but wh
I have three tables:
table1
|———|
| id | f1 |
|———|
table2
|———|
| id | f2 |
|———|
table3
|———|
| id | f3 |
|———|
I want define a function to insert records to someone,but
On Nov 7, 1:08 am, cyberira...@gmail.com wrote:
> Just got answer, I didn't call a class it's self. Correct code is:
> class derivedClass(baseClassMod.baseClass):
> def ..
Incidentally, this is why it's recommended to give modules lowercase
names - baseclass - and classes camelcased ones
On Tue, 06 Nov 2012 14:41:24 -0800, Andrew Robinson wrote:
> Yes. But this isn't going to cost any more time than figuring out
> whether or not the list multiplication is going to cause quirks, itself.
> Human psychology *tends* (it's a FAQ!) to automatically assume the
> purpose of the list mul
I'm looking for some help with multiprocessing. Essentially what I'm
trying to do is the following:
1. create a main process that gets daemonized
2. spawn two subprocess that live for the life of the daemon
3. each subprocess creates children that do heavy work and exit when
the work is don
On Tue, 06 Nov 2012 23:14:40 +, Steven D'Aprano wrote:
> On Tue, 06 Nov 2012 11:51:03 -0500, GangGreene wrote:
>
>> I have just finished a 251 line bash shell script that builds my linux
>> distro from scratch.
>
> "From scratch"? So if you run it on bare metal with no OS, it works?
It has
On 2012-11-06 23:52, Ian Kelly wrote:
On Tue, Nov 6, 2012 at 3:41 PM, Andrew Robinson
wrote:
Q: What about other mutable objects like sets or dicts?
A: No, the elements are never copied.
They aren't list multiplication compatible in any event! It's a total
nonsense objection.
If th
On Tue, 06 Nov 2012 23:08:11 +, Prasad, Ramit wrote:
> Steven D'Aprano wrote:
>>
>> On Tue, 06 Nov 2012 17:16:44 +, Prasad, Ramit wrote:
>>
>> >> To enter the newline, I typed Ctrl-Q to tell bash to treat the next
>> >> character as a literal, and then typed Ctrl-J to get a newline.
>> >
iMath wrote:
> how to get a list of names of everything in the current directory ?
http://lmgtfy.com/?q=python+get+files+in+directory
~Ramit
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and
On Tue, Nov 6, 2012 at 3:41 PM, Andrew Robinson
wrote:
>> Q: What about other mutable objects like sets or dicts?
>> A: No, the elements are never copied.
>
> They aren't list multiplication compatible in any event! It's a total
> nonsense objection.
>
> If these are inconsistent in my i
Andrew Robinson wrote:
>
> On 11/06/2012 01:04 AM, Steven D'Aprano wrote:
> > On Mon, 05 Nov 2012 21:51:24 -0800, Andrew Robinson wrote:
> >
[snip]
> > Q: What about other mutable objects like sets or dicts?
> > A: No, the elements are never copied.
> They aren't list multiplication comp
On Tue, 06 Nov 2012 22:13:21 +0100, python wrote:
> I have a problem with the standard "turtle" module. When a turtle has a
> custom shape of type "compound", it doesn't seem to respond to click
> events. No problem with polygon shapes.
[...]
> When I run this and click on the black square (i.e. t
In iMath
writes:
> how to get a list of names of everything in the current directory ?
Try os.listdir() .
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey,
On Tue, 06 Nov 2012 11:51:03 -0500, GangGreene wrote:
> I have just finished a 251 line bash shell script that builds my linux
> distro from scratch.
"From scratch"? So if you run it on bare metal with no OS, it works?
:-P
But seriously -- bash is a mature, powerful shell. It works well for wha
在 2012年11月6日星期二UTC+8下午1时24分41秒,Chris Angelico写道:
> On Tue, Nov 6, 2012 at 4:19 PM, iMath wrote:
>
> > How to only get a list of the names of the non-directory files in current
> > directory ('.')?
>
> > (Note excluding its subdirectories ).
>
> >
>
> > I need the code : )
>
>
>
> Start by
Steven D'Aprano wrote:
>
> On Tue, 06 Nov 2012 17:16:44 +, Prasad, Ramit wrote:
>
> >> To enter the newline, I typed Ctrl-Q to tell bash to treat the next
> >> character as a literal, and then typed Ctrl-J to get a newline.
> >
> > That sounds complicated, my version of bash lets me type
> >
On Tue, 06 Nov 2012 17:16:44 +, Prasad, Ramit wrote:
>> To enter the newline, I typed Ctrl-Q to tell bash to treat the next
>> character as a literal, and then typed Ctrl-J to get a newline.
>
> That sounds complicated, my version of bash lets me type
> 'foobar' for the same effect.
Well, I
On 11/06/2012 01:04 AM, Steven D'Aprano wrote:
On Mon, 05 Nov 2012 21:51:24 -0800, Andrew Robinson wrote:
The most compact notation in programming really ought to reflect the
most *commonly* desired operation. Otherwise, we're really just making
people do extra typing for no reason.
There are
On Tue, Nov 6, 2012 at 2:36 PM, Andrew Robinson
wrote:
> I meant all lists are shallow copied from the innermost level out.
> Equivalently, it's a deep copy of list objects -- but a shallow copy of any
> list contents except other lists.
Why only list objects, though? When a user writes [[]] *
On 11/06/2012 01:19 AM, Ian Kelly wrote:
On Tue, Nov 6, 2012 at 1:21 AM, Andrew Robinson
If you nest it another time;
[[[None]]]*4, the same would happen; all lists would be independent -- but
the objects which aren't lists would be refrenced-- not copied.
a=[[["alpha","beta"]]]*4 would yield:
On 11/06/2012 09:32 AM, Prasad, Ramit wrote:
Ian Kelly wrote:
On Tue, Nov 6, 2012 at 1:21 AM, Andrew Robinson
[snip]
See if you can find *any* python program where people desired the
multiplication to have the die effect that changing an object in one of the
sub lists -- changes all the objec
On 11/06/2012 06:35 AM, Oscar Benjamin wrote:
> In general, people don't use element multiplication (that I have
*ever* seen) to make lists where all elements of the outer most list
point to the same sub-*list* by reference. The most common use of the
multiplication is to fill an array with
I have a problem with the standard "turtle" module. When a turtle has
a custom shape of type "compound", it doesn't seem to respond to click
events. No problem with polygon shapes.
Running python 3.2.3, turtle version 1.1b on Windows XP.
Here is my test file:
I have a problem with the standard "turtle" module. When a turtle has
a custom shape of type "compound", it doesn't seem to respond to click
events. No problem with polygon shapes.
Running python 3.2.3, turtle version 1.1b on Windows XP.
Here is my test file:
>From this line, "data" appears to be a class
if 0 < ix < data.width and 0 < iy < data.height:
>From this line, "data" appears to be a list, although a two
dimensional list would be accessed as data[ix][iy]
point = data[ix, iy]
Also, returning a list from a function is a matter of pref
Levi Nie wrote:
>
> Who can give me some practical tutorials on django 1.4 or 1.5?
> Thank you.
Maybe this will help: http://gettingstartedwithdjango.com/resources/
~Ramit
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sa
Dennis Lee Bieber wrote:
>
> On Tue, 06 Nov 2012 13:26:11 +0100, Peter Otten <__pete...@web.de>
> declaimed the following in gmane.comp.python.general:
>
> > anuradha.raghupathy2...@gmail.com wrote:
[snip]
> > > def main():
> > >logging.basicConfig(Filename='c://myapp.log', level=logging.ERRO
Ian Kelly wrote:
>
> On Tue, Nov 6, 2012 at 1:21 AM, Andrew Robinson
>
[snip]
> > See if you can find *any* python program where people desired the
> > multiplication to have the die effect that changing an object in one of the
> > sub lists -- changes all the objects in the other sub lists.
> >
Steven D'Aprano wrote:
>
> On Mon, 05 Nov 2012 14:47:47 -0500, Dennis Lee Bieber wrote:
>
[snip]
>
> Nevertheless, I do tend to prefer underscores to spaces, simply because I
> often use naive tools that treat spaces as separators. That is, command
> line shells.
I visually prefer spaces but it
On Tue, 06 Nov 2012 08:52:36 -0500, Roy Smith wrote:
[putolin]
> Programming languages are designed to write programs. Not only will the
> code be {used, read, maintained} for a much longer period of time, it
> will be used by people other than the original author, and on inputs
> other than ori
Grant Edwards wrote:
> On 2012-11-05, Roy Smith wrote:
> > In article ,
> > Chris Angelico wrote:
> >
> >> It's nothing to do with operating system. File names are names, and
> >> spaces in them are seldom worth the hassle unless you manipulate those
> >> files solely using a GUI.
> >
> > That's
On 2012-11-02 15:50:30 +, nepaul said:
What the diferences : web.py Tornado Twisted ?!
There really is a lot of material on this online, including numerous
videos. But in my experience Tornado is basically a (really cool and
easy to use) programmable web server whereas Twisted is a frame
On 6/11/12 14:47:03, cyberira...@gmail.com wrote:
> Hey guys,
> I'm trying to understand how is working base class and derived class.
> So, I have to files baseClass.py and derivedClass.py.
> baseClass.py :
> [CODE]class baseClass():
> def bFunction(self):
> print "We are in a base cl
On Tuesday, November 6, 2012 4:35:47 PM UTC+1, Ian wrote:
> On Tue, Nov 6, 2012 at 8:03 AM,
>
> > I've used angle brackets just for posting here,becauze this forum doesn't
> > support [code][/code]
>
>
>
> This is a Usenet group, not a web forum.
>
>
>
> > Just got answer, I didn't call a
On Tue, Nov 6, 2012 at 8:03 AM, wrote:
> I've used angle brackets just for posting here,becauze this forum doesn't
> support [code][/code]
This is a Usenet group, not a web forum.
> Just got answer, I didn't call a class it's self. Correct code is:
> class derivedClass(baseClassMod.baseClass)
Just got answer, I didn't call a class it's self. Correct code is:
class derivedClass(baseClassMod.baseClass):
def ..
--
http://mail.python.org/mailman/listinfo/python-list
> in what Python version ?
Python 2.7.3
> How did all those angle brackets get into the file? Are you confusing
>
> an interactive interpreter session with running source files?
I've used angle brackets just for posting here,becauze this forum doesn't
support [code][/code]
I have a file c
On 06/11/2012 06:17, Amit Agrawal wrote:
i want to delete list in upper and lower some specific value
I think you want to delete a slice so read about slicing here
http://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range
--
Cheers.
Mark Lawrence.
--
http://mail.py
On Nov 6, 2012 6:00 AM, "Andrew Robinson" wrote:
>
> On 11/05/2012 06:30 PM, Oscar Benjamin wrote:
>>
>> stuff = [[obj] * n] * m
>>
>> I thought that the multiplication of the inner list ([obj] * n) by m
>> could create a new list of lists using copies. On closer inspection I
>> see that the l
On 11/06/2012 08:50 AM, cyberira...@gmail.com wrote:
> Hey guys,
> I'm trying to understand how is working base class and derived class.
in what Python version ?
> So, I have to files baseClass.py and derivedClass.py.
> baseClass.py :
class baseClass():
How did all those angle brackets get
On 11/06/2012 01:17 AM, Amit Agrawal wrote:
> i want to delete list in upper and lower some specific value
>
>
That question will have to be rephrased, in clearer English.
What Python version are you using?
What data do you start with, and what data do you want to end up with?
Be specific w
In article <50989a16$0$29980$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> Shell do not [quote strings, etc] because they
> are designed for lazy users and merely aim to be "good enough".
Well, sort of. Or, perhaps more correctly, "Yes, but that's a good
thing".
Shells are d
Hey guys,
I'm trying to understand how is working base class and derived class.
So, I have to files baseClass.py and derivedClass.py.
baseClass.py :
>>> class baseClass():
def bFunction(self):
print "We are in a base class"
derivedClass.py:
>>>import baseClass as baseClassMod
reload(
Hey guys,
I'm trying to understand how is working base class and derived class.
So, I have to files baseClass.py and derivedClass.py.
baseClass.py :
[CODE]class baseClass():
def bFunction(self):
print "We are in a base class"[/CODE]
derivedClass.py:
[CODE]import baseClass as baseClas
Well said Steve, I agree with you...
-Shambhu
-Original Message-
From: Steven D'Aprano [mailto:steve+comp.lang.pyt...@pearwood.info]
Sent: Tuesday, November 06, 2012 2:35 PM
To: python-list@python.org
Subject: Re: Multi-dimensional list initialization
On Mon, 05 Nov 2012 21:51:24 -0800,
On 11/06/2012 07:31 AM, inshu chauhan wrote:
> I am getting this error while running my programme.. :
>
> error: index is out of range
Please paste the whole error, including the traceback. It'll show you
the line that had the error, as well as the calling sequence that got
you there.
>
> I can
I am getting this error while running my programme.. :
error: index is out of range
I cannot find a valid reason for it in my prog can somebody suggest what
may be possible reasons for this error..
The part of the code is :
def addpoints (data, points, ix, iy): # makes a list of relevant point
anuradha.raghupathy2...@gmail.com wrote:
> Hi,
>
> Below is the python code that I have. I want to redirect the output to my
> C drive..myapp.log.
>
> I am editing and creating scripts in IDLE and running it as a python shell
> or module.
>
> Can you help?
>
> import logging
>
> def main():
>
Hi,
Below is the python code that I have. I want to redirect the output to my C
drive..myapp.log.
I am editing and creating scripts in IDLE and running it as a python shell or
module.
Can you help?
import logging
def main():
logging.basicConfig(Filename='c://myapp.log', level=logging.ERR
Am 05.11.2012 20:39, schrieb Kwpolska:
On Mon, Nov 5, 2012 at 8:34 PM, Monkey wrote:
Hi,
i wonderd if there is a way to convert a py-file to a exe-file with version 3.x
of python.
I know that it was possible till version 2.7.x. But is there a way to do it in
version 3.x?
Yours sincerely,
Mo
On Tue, Nov 6, 2012 at 1:21 AM, Andrew Robinson
wrote:
> If you nest it another time;
> [[[None]]]*4, the same would happen; all lists would be independent -- but
> the objects which aren't lists would be refrenced-- not copied.
>
> a=[[["alpha","beta"]]]*4 would yield:
> a=[[['alpha', 'beta']], [
On Mon, 05 Nov 2012 21:51:24 -0800, Andrew Robinson wrote:
> The most compact notation in programming really ought to reflect the
> most *commonly* desired operation. Otherwise, we're really just making
> people do extra typing for no reason.
There are many reasons not to put minimizing of typin
On Tue, Nov 6, 2012 at 7:49 PM, Ian Kelly wrote:
> On Mon, Nov 5, 2012 at 3:01 PM, Chris Angelico wrote:
>> By "URL unshortening service" you mean a simple HTTP request to
>> bit.ly:80, right? :) Though I admit there aren't many easy and
>> convenient ways to do that without immediately following
On 11/05/2012 10:07 PM, Chris Angelico wrote:
On Tue, Nov 6, 2012 at 4:51 PM, Andrew Robinson
wrote:
I really don't think doing a shallow copy of lists would break anyone's
program.
Well, it's a change, a semantic change. It's almost certainly going to
break _something_. But for the sake of a
67 matches
Mail list logo