On 12 Jan, 14:50, Rick Johnson wrote:
> Of course many people will piss and moan about the extra typing.
You just ignored the fact that your original claim was incorrect and
kept going on with your rant anyway.
> Since more time is spent /maintaining/ code bases than /writing/ them
In your case
On 12 Jan, 14:34, Rick Johnson wrote:
> If you don't know which names are modules and which names are members
> then how could a programmer possibly use the API in an intelligent way
Your initial argument is that with import's current dot notation, it's
not obvious which is a module or not withou
On 12 Jan, 17:14, Dieter Maurer wrote:
> Adelbert Chang writes:
> > In the Scala language there is the Simple Build Tool that lets me specify
> > on a project-by-project basis which libraries I want to use (provided they
> > are in a central repository somewhere) and it will download them for m
On Fri, Jan 11, 2013 at 10:28 PM, Rick Johnson
wrote:
> On Friday, January 11, 2013 12:30:27 AM UTC-6, Chris Angelico wrote:
>> Why is it better to import from the current directory first?
>
> Opps. I was not explicit enough with my explanation :). I meant, "look in the
> current directory FIRST
Adelbert Chang writes:
> In the Scala language there is the Simple Build Tool that lets me specify on
> a project-by-project basis which libraries I want to use (provided they are
> in a central repository somewhere) and it will download them for me. Better
> yet, when a new version comes out
Harold writes:
> I recently upgraded my system from ubuntu 11.4 to 12.4 and since run into an
> issue when trying to import several packages in python2.7, e.g.
>
> harold@ubuntu:~$ python -c 'import gtk'
> Traceback (most recent call last):
> File "", line 1, in
> File "/usr/lib/python2.7/d
On Fri, Jan 11, 2013 at 9:34 PM, Rick Johnson
wrote:
> No the rules are:
> * "Colon" must be used to access a "module" (or a package).
> * "Dot" must be used to access a "module member".
What about module a that does not natively contain module b, but
imports it as a member like so?
a.py
On Fri, 11 Jan 2013 21:46:36 -0800, Rick Johnson wrote:
> On Friday, January 11, 2013 10:40:36 PM UTC-6, Chris Angelico wrote:
>> On Sat, Jan 12, 2013 at 3:34 PM, Rick Johnson
>
>> > *The problem:*
>> > ... is readability. The current dot syntax used ubiquitously in paths
>> > is not conveying th
On Fri, 11 Jan 2013 20:34:20 -0800, Rick Johnson wrote:
>> > import lib:gui:tkinter:dialogs.SimpleDialog as Blah
>>
>> Which names are packages, modules, classes, methods, functions, or
>> other objects?
>>
>> Why do you have lib:gui but dialogs.SimpleDialog? Is the rule "classes
>> should alw
Hi,
I am looking to write a short program to query the windows event log.
It needs to ask the user for input for The event type (Critical, Error, and
Information), and the user needs to be able to specify a date since when they
want to view results.
I understand I will need the pywin32 extensi
On Sat, Jan 12, 2013 at 4:28 PM, Rick Johnson
wrote:
> On Friday, January 11, 2013 12:30:27 AM UTC-6, Chris Angelico wrote:
>> Welcome back to the list, Rick. Got any demonstrable code
>> for Python 4000 yet?
>
> I am working on it. Stay tuned. Rick is going to rock your little programming
> worl
On Sat, Jan 12, 2013 at 4:46 PM, Rick Johnson
wrote:
> This is a matter of READABILITY, Christopher. It's one or the other (or the
> status quo):
>
> 1. Enforce naming conventions.
> 2. Enforce path syntax.
> 3. Continue to duck type, like Python is good at.
>
> The choice is yours.
FTFY.
Chris
On Friday, January 11, 2013 10:40:36 PM UTC-6, Chris Angelico wrote:
> On Sat, Jan 12, 2013 at 3:34 PM, Rick Johnson
> > *The problem:*
> > ... is readability. The current dot syntax used ubiquitously in paths is
> > not conveying the proper information to the reader, and in-fact obfuscating
> >
On Friday, January 11, 2013 12:30:27 AM UTC-6, Chris Angelico wrote:
> Why is it better to import from the current directory first?
Opps. I was not explicit enough with my explanation :). I meant, "look in the
current directory FIRST when in a package". Since many times (most all times)
packages
On 01/11/2013 11:37 PM, Tim Roberts wrote:
> Dave Angel wrote:
>> As Adnan has pointed out, Python is case insensitive.
> That's not really what you meant to say...
Nope. I meant Python is case sensitive.
Thanks for the catch. I think the rest of my discourse made it clear
that case matters.
On Friday, January 11, 2013 7:35:37 AM UTC-6, Terry Reedy wrote:
> On 1/11/2013 1:13 AM, Rick Johnson wrote:
> > The fact that Python looks in the stdlib _first_ is not a good idea.
>
> And the fact is that it does not do so. The order depends on sys.path,
> and '' is the first entry.
>
> > It w
On Sat, Jan 12, 2013 at 3:37 PM, Tim Roberts wrote:
> Dave Angel wrote:
>>
>>As Adnan has pointed out, Python is case insensitive.
>
> That's not really what you meant to say...
UNinsensitive, your Majesty means, of course. UNinsensitive, of course, I meant.
*watches the jurors write it down, s
On Sat, Jan 12, 2013 at 3:43 PM, wrote:
> def fnc1(pp):
> print "fnc1-",pp
>
> fnc1()
Like the message says, the function has been defined to take one
argument, and you're giving it none. Try giving it an argument:
fnc1("five-minute")
ChrisA
--
http://mail.python.org/mailman/listinfo/pyth
Hello.
Can someone help me to resolv error.
code:
import threading
class TimeoutError(RuntimeError):
pass
class AsyncCall(object):
def __init__(self, fnc, callback = None):
self.Callable = fnc
self.Callback = callback
def __call__(self, *args, **kwargs):
s
On Sat, Jan 12, 2013 at 3:34 PM, Rick Johnson
wrote:
> *The problem:*
> ... is readability. The current dot syntax used ubiquitously in paths is not
> conveying the proper information to the reader, and in-fact obfuscating the
> code.
Please explain how this is a problem. As Steven said, there
Dave Angel wrote:
>
>As Adnan has pointed out, Python is case insensitive.
That's not really what you meant to say...
--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
On Friday, 1-11-2013 10:02:34 AM, Steven D'Aprano wrote:
> Solution to what? You can only have a solution once you have identified a
> problem. You have not identified a problem. In any case, your suggestion
> is *not* obvious.
The problem is that by using the dot ubiquitously we are obfuscatin
I have solutions manuals to all problems and exercises in these textbooks. To
get one in an electronic format contact me at: reganrexman(at)gmail(dot)com and
let me know its title, author and edition. Please this service is NOT free.
SOLUTIONS MANUAL TO Field and Wave Electromagnetics 2nd Ed by
On 1/11/2013 5:17 PM, su29090 wrote:
Circle.py
import math
class circle:
By current convention, you should call the file 'circle.py' and the
class 'Circle'. Using all lower case for module filenames is the sanest
thing to do in a world where different filesystems do different things
with
Perfect, PIP and virtualenv look great.
Another question - how do we then get PIP to the latest version? Or is it
relatively easy to uninstall/reinstall PIP?
--
http://mail.python.org/mailman/listinfo/python-list
On 11/01/13 16:35:10, kwakukwat...@gmail.com wrote:
> def factorial(n):
> if n<2:
> return 1
> f = 1
> while n>= 2:
> f *= n
> f -= 1
U think this line should have been:
n -= 1
> return f
Hope this helps,
-- HansM
--
http://mail.python.o
On 10/01/13 19:35:40, kwakukwat...@gmail.com wrote:
> pls this is a code to show the pay of two people.bt I want each of to be
> able to get a different money when they enter their user name,and to use
> it for about six people.
> database = [
> ['Mac'],
> ['Sam'],
> ]
> pay1 = 1000
> p
On Friday, January 11, 2013 5:43:10 PM UTC-5, Dave Angel wrote:
> On 01/11/2013 05:17 PM, su29090 wrote:
>
> > I'm trying to import a python file it keeps saying:
>
> >
>
> > ImportError: cannot import name Circle
>
> >
>
> > Here is the file I'm trying to import:
>
> >
>
> > Circle.py
>
>
On 11/01/13 22:34, Rodrick Brown wrote:
On Fri, Jan 11, 2013 at 5:23 PM, Adelbert Chang mailto:adelbe...@gmail.com>> wrote:
Hi all,
I've been using Python for a while now but one of my concerns is if
it is possible to have some sort of dependency management (not sure
if right te
On 01/11/2013 05:17 PM, su29090 wrote:
> I'm trying to import a python file it keeps saying:
>
> ImportError: cannot import name Circle
>
> Here is the file I'm trying to import:
>
> Circle.py
>
> import math
>
> class circle:
> #Construct a circle object
> def __init__(self, radius = 1):
>
On Friday, January 11, 2013 5:27:21 PM UTC-5, Chris Angelico wrote:
> On Sat, Jan 12, 2013 at 9:17 AM, su29090 wrote:
>
> > Circle.py
>
> >
>
> > class circle:
>
> >
>
> > from Circle import Circle
>
>
>
> Inside the Circle module is a class named circle. You can't import
>
> Circle from
On Friday, January 11, 2013 5:25:24 PM UTC-5, Adnan Sadzak wrote:
> Python is case sensitive.
>
> Circle and circle is not same.
>
>
>
>
>
>
> /* sent from android */
>
> On Jan 11, 2013 11:22 PM, "su29090" <129...@gmail.com> wrote:
>
> I'm trying to import a python file it keeps saying:
>
On Fri, Jan 11, 2013 at 5:23 PM, Adelbert Chang wrote:
> Hi all,
>
> I've been using Python for a while now but one of my concerns is if it is
> possible to have some sort of dependency management (not sure if right
> term) for Python?
>
> In the Scala language there is the Simple Build Tool that
On Sat, Jan 12, 2013 at 9:17 AM, su29090 <129k...@gmail.com> wrote:
> Circle.py
>
> class circle:
>
> from Circle import Circle
Inside the Circle module is a class named circle. You can't import
Circle from that.
But Python isn't Java. You don't have to put each class into its own
file. Just put
Hi all,
I've been using Python for a while now but one of my concerns is if it is
possible to have some sort of dependency management (not sure if right term)
for Python?
In the Scala language there is the Simple Build Tool that lets me specify on a
project-by-project basis which libraries I
Python is case sensitive.
Circle and circle is not same.
/* sent from android */
On Jan 11, 2013 11:22 PM, "su29090" <129k...@gmail.com> wrote:
> I'm trying to import a python file it keeps saying:
>
> ImportError: cannot import name Circle
>
> Here is the file I'm trying to import:
>
> Circle
I'm trying to import a python file it keeps saying:
ImportError: cannot import name Circle
Here is the file I'm trying to import:
Circle.py
import math
class circle:
#Construct a circle object
def __init__(self, radius = 1):
self.radius = radius
def getPerimeter(self):
On 11/01/2013 20:16, Ian Kelly wrote:
On Fri, Jan 11, 2013 at 12:03 PM, Rotwang wrote:
Hi all,
the other day I 2to3'ed some code and found it ran much slower in 3.3.0 than
2.7.2. I fixed the problem but in the process of trying to diagnose it I've
stumbled upon something weird that I hope some
joshua.kimb...@gmail.com wrote:
> I have a set of utility modules that were all added to a folder called
> (util_mods). Recently the set of modules grew to be too large and I've
> been working on splitting it up into sets of sub modules, for example,
> util_mods\set_a. The issue is that if I start
On Fri, Jan 11, 2013 at 12:03 PM, Rotwang wrote:
> Hi all,
>
> the other day I 2to3'ed some code and found it ran much slower in 3.3.0 than
> 2.7.2. I fixed the problem but in the process of trying to diagnose it I've
> stumbled upon something weird that I hope someone here can explain to me. In
>
Mohit Khanna writes:
> I am trying the following code--
>
> from rpy import *
> r.library("ltm")
>
> dat= #some data frame or matrix
> r.ltm(r('dat~z1'))
>
> error coming is---
> RPy_RException: Error in eval(expr, envir, enclos) : object 'dat' not found
>
> Please tell me the right way to call l
I read the question as "I've got this function and it does what I expect
but I don't understand the code".
On that basis...
The function creates a factorialfor the input number 'n' (i.e.
1*2*3*4.*n)
The first 2 lines checks to see that the input is less than 2 and, if
so, returns a value
I have a set of utility modules that were all added to a folder called
(util_mods). Recently the set of modules grew to be too large and I've been
working on splitting it up into sets of sub modules, for example,
util_mods\set_a. The issue is that if I start moving modules to sub folders I
have
Hi all,
the other day I 2to3'ed some code and found it ran much slower in 3.3.0
than 2.7.2. I fixed the problem but in the process of trying to diagnose
it I've stumbled upon something weird that I hope someone here can
explain to me. In what follows I'm using Python 2.7.2 on 64-bit Windows
7
[This announcement is in German since it targets a local user group
meeting in Düsseldorf, Germany]
ANKÜNDIGUNG / ERINNERUNG
Python Meeting Düsseldorf
http://pyddf.de/
On 01/11/2013 09:24 AM, Matt Jones wrote:
Pay isn't linked to the "people" in any way. A dictionary would serve
this purpose better (at least in this simple example).
database = {
'Mac' : 1000,
'Sam' : 2000
}
name = raw_input('Enter your name:')
if name in database.keys(): print "your
On 11/01/13 01:59, Nick Mellor wrote:
Hi,
I've got a unit test that will usually succeed but sometimes fails. An
occasional failure is expected and fine. It's failing all the time I want to
test for.
What I want to test is "on average, there are the same number of males and females
in a samp
On 01/10/2013 11:13 PM, Rick Johnson wrote:
>
> Python's import resolution order is terrible.[1]
>
> The fact that Python looks in the stdlib _first_ is not a good idea.
Whether or not the default behavior is desirable or not, sys.path is set
by default to look in the current directory first on
On Fri, 11 Jan 2013 16:26:20 +, Alister wrote:
> On Thu, 10 Jan 2013 17:59:05 -0800, Nick Mellor wrote:
>
>> Hi,
>>
>> I've got a unit test that will usually succeed but sometimes fails. An
>> occasional failure is expected and fine. It's failing all the time I
>> want to test for.
>>
>> Wh
On Thu, 10 Jan 2013 17:59:05 -0800, Nick Mellor wrote:
> Hi,
>
> I've got a unit test that will usually succeed but sometimes fails. An
> occasional failure is expected and fine. It's failing all the time I
> want to test for.
>
> What I want to test is "on average, there are the same number of
On 01/11/2013 10:37 AM, Steven D'Aprano wrote:
> On Fri, 11 Jan 2013 10:06:30 -0500, Dave Angel wrote:
>
>>
>
>> Not sure what you mean by beforehand. Don't you run all your unit tests
>> before putting each revision of your code into production? So run those
>> tests twice, once on 2.7, and onc
On Thu, 10 Jan 2013 22:01:37 -0800, Rick Johnson wrote:
> Python's module/package access uses dot notation.
>
> mod1.mod2.mod3.modN
>
> Like many warts of the language, this wart is not so apparent when first
> learning the language. The dot seems innocently sufficient, however, in
> truth it
On 09 Jan 2013, at 00:02:11 Steven D'Aprano wrote:
> The point I keep making, that everybody seems to be ignoring, is that
> eyeballing a line of best fit is subjective, unreliable and impossible to
> verify. How could I check that the line you say is the "best fit"
> actually *is* the *best
On Fri, 11 Jan 2013 10:06:30 -0500, Dave Angel wrote:
> On 01/11/2013 03:29 AM, The Night Tripper wrote:
>> Gisle Vanem wrote:
>>
>>> "jkn" wrote:
>>>
I have to write python code which must run on an old version of
python (v2.4) as well as a newer (v2.7). I am using pylint and would
On 01/11/2013 09:36 AM, MRAB wrote:
> On 2013-01-11 14:15, Roy Smith wrote:
>> I have a list of items. I need to generate n samples of k unique items
>> each. I not only want each sample set to have no repeats, but I also
>> want to make sure the sets are disjoint (i.e. no item repeated between
>
On 01/11/2013 03:29 AM, The Night Tripper wrote:
> Gisle Vanem wrote:
>
>> "jkn" wrote:
>>
>>>I have to write python code which must run on an old version of
>>> python (v2.4) as well as a newer (v2.7). I am using pylint and would
>>> like to check if is possible to check with pylint the use o
On 2013-01-11 14:15, Roy Smith wrote:
I have a list of items. I need to generate n samples of k unique items
each. I not only want each sample set to have no repeats, but I also
want to make sure the sets are disjoint (i.e. no item repeated between
sets).
random.sample(items, k) will satisfy t
Pay isn't linked to the "people" in any way. A dictionary would serve this
purpose better (at least in this simple example).
database = {
'Mac' : 1000,
'Sam' : 2000
}
name = raw_input('Enter your name:')
if name in database.keys(): print "your pay is $", database[name]
*Matt Jones*
On
I have a list of items. I need to generate n samples of k unique items
each. I not only want each sample set to have no repeats, but I also
want to make sure the sets are disjoint (i.e. no item repeated between
sets).
random.sample(items, k) will satisfy the first constraint, but not the
sec
pls this is a code to show the pay of two people.bt I want each of to be able
to get a different money when they enter their user name,and to use it for
about six people.
database = [
['Mac'],
['Sam'],
]
pay1 = 1000
pay2 = 2000
name = raw_input('Enter your name: ')
if [name] in datab
On 1/11/2013 3:29 AM, The Night Tripper wrote:
Gisle Vanem wrote:
"jkn" wrote:
I have to write python code which must run on an old version of
python (v2.4) as well as a newer (v2.7). I am using pylint and would
like to check if is possible to check with pylint the use of operators
etc.
On 1/11/2013 1:13 AM, Rick Johnson wrote:
Python's import resolution order is terrible.[1]
The fact that Python looks in the stdlib _first_ is not a good idea.
And the fact is that it does not do so. The order depends on sys.path,
and '' is the first entry.
It would seem more intuitive fo
Am 11.01.2013 17:33 schrieb kwakukwat...@gmail.com:
def factorial(n):
if n<2:
return 1
f = 1
while n>= 2:
f *= n
f -= 1
return f
please it works.
I doubt this.
If you give n = 4, you run into an endless loop.
but don’t get why the ret
kwakukwat...@gmail.com writes:
> 11.01.2013 17:35, kwakukwat...@gmail.com wrote:
> > def factorial(n):
> > if n<2:
> > return 1
> > f = 1
> > while n>= 2:
> > f *= n
> > f -= 1
> > return f
>
> please it works.but don’t get why the return 1 and th
>> Hi,
>>
>> I want to interpolate (with quadratic splines) a stack of 2D-arrays/matrices
>> y1, y2, y3, ... in a third dimension (which I call x) e.g. for crossfading
>> images. I already have a working code which unfortunately still contains two
>> explicit loops over the rows and colums of the
On 11/01/2013 17:33, kwakukwat...@gmail.com wrote:
-Original Message- From: K. Elo
Sent: Friday, January 11, 2013 3:56 AM
To: python-list@python.org
Subject: Re: please i need explanation
Hi!
Since there is no stated question, I need to guess:
n -= 1 (instead of "f -= 1")
should wor
-Original Message-
From: K. Elo
Sent: Friday, January 11, 2013 3:56 AM
To: python-list@python.org
Subject: Re: please i need explanation
Hi!
Since there is no stated question, I need to guess:
n -= 1 (instead of "f -= 1")
should work.
Or maybe the question was a totally different
Le 11/01/13 16:35, kwakukwat...@gmail.com a écrit :
> def factorial(n):
> if n<2:
> return 1
> f = 1
> while n>= 2:
> f *= n
> f -= 1
> return f
>
>
>
I guess you mean:
f = 1
while n>= 2:
f *= n
n -= 1
return f
Try it.
-
On 11/01/2013 16:35, kwakukwat...@gmail.com wrote:
def factorial(n):
if n<2:
return 1
f = 1
while n>= 2:
f *= n
f -= 1
return f
What explanation this a function representing the math factorial.
You provide a parameter n:
if n est lower than 2 the
Hi!
Since there is no stated question, I need to guess:
n -= 1 (instead of "f -= 1")
should work.
Or maybe the question was a totally different one...
-Kimmo
11.01.2013 17:35, kwakukwat...@gmail.com wrote:
def factorial(n):
if n<2:
return 1
f = 1
while n>= 2:
def factorial(n):
if n<2:
return 1
f = 1
while n>= 2:
f *= n
f -= 1
return f
--
http://mail.python.org/mailman/listinfo/python-list
On Thursday, January 10, 2013 12:45:32 AM UTC+1, jkn wrote:
> Hi all
>
> I have to write python code which must run on an old version of
>
> python (v2.4) as well as a newer (v2.7). I am using pylint and would
>
> like to check if is possible to check with pylint the use of operators
>
> et
Gisle Vanem wrote:
> "jkn" wrote:
>
>>I have to write python code which must run on an old version of
>> python (v2.4) as well as a newer (v2.7). I am using pylint and would
>> like to check if is possible to check with pylint the use of operators
>> etc. which are not present in 2.4; the te
73 matches
Mail list logo