Sure, but let me include the full working program after fixup
On 29 April 2015 at 19:09, Cameron Simpson wrote:
>
> These could all do with docstrings. add() is pretty obvious, but the
> distinction between minus() and subtract() could do with elaboration.
etc, etc.
Thanks. Very comprehens
On 29 April 2015 at 21:14, Dave Angel wrote:
> But why are you surprised? There's no try/except protecting the latter
> line, so the exception will be uncaught, and you'll see it reported in
> parse_string().
>
I think I meant something like this. An exception in a function is caught
by the cal
boB Stepp writes:
> One problem I have with searching the Python documentation is this:
> https://docs.python.org/release/2.4.4/lib/lib.html
If you actually need to read the documentation specifically for a Python
version that has not been supported since 2008, then I agree that is a
problem.
T
On 04/30/2015 12:28 AM, boB Stepp wrote:
The main danger as I see it is that if I am not careful, then the code
on the dev environment could diverge from the state of code on my
Windows PC, i.e., I forgot to do the scp part. But when I am actively
working on a section of code I always insert a fe
On Wed, Apr 29, 2015 at 10:39 PM, Cameron Simpson wrote:
> On 29Apr2015 22:10, boB Stepp wrote:
>> On the smart enterprise where we (now) do our clinical planning they
>> are very strict: no installing any external software; no accessing the
>> Internet; no email; etc. Not all centers adhere to
On 04/29/2015 09:05 PM, Jim Mooney Py3.4.3winXP wrote:
I raised an exception in the parse_string function in my math parser
program, function_tosser.py, and caught it in the calling routine, and that
worked fine. But when I imported function_tosser.py into a test program,
tester.py, it threw the
On 29Apr2015 22:10, boB Stepp wrote:
On Wed, Apr 29, 2015 at 9:40 PM, Cameron Simpson wrote:
On 29Apr2015 12:12, boB Stepp wrote:
... (3) install git if needed ...
It seems Git is needed, but I am not allowed to install it on the
Solaris workstation. So is there a way around this?
What d
On Wed, Apr 29, 2015 at 5:49 PM, Peter Otten <__pete...@web.de> wrote:
> boB Stepp wrote:
>> So I have stumbled (With your gracious help!) into a legitimate use of
>> eval()?
>
> No. To expand on Marks hint here's how to do it without evil eval().
>
> import operator
>
> comps = {
> "=": opera
On Wed, Apr 29, 2015 at 4:42 PM, Mark Lawrence wrote:
> This isn't a job for Bicycle Repair Man!!!
Not even if we only use the latest, greatest,
computer-aided bicycle repair technology???
> ... It smacks to me of dictionaries
> and the operator module but I'm too bone idle to look it up mysel
On 04/29/2015 02:37 PM, diliup gabadamudalige wrote:
I do not understand how Alan does not get the code that is in this thread.
There are at least 3 ways of posting to "this thread":
A) email
B) newsgroup
C) googlegroups
and at least 5 ways of looking at "this thread"
A) email
B
On Wed, Apr 29, 2015 at 9:40 PM, Cameron Simpson wrote:
> On 29Apr2015 12:12, boB Stepp wrote:
>>>
>>> ... (3) install git if needed ...
>>
>>
>> It seems Git is needed, but I am not allowed to install it on the
>> Solaris workstation. So is there a way around this?
>
>
> What do you mean by "ins
On 29Apr2015 08:34, Jim Mooney Py3.4.3winXP wrote:
On 28 April 2015 at 22:40, Cameron Simpson wrote:
We can pick over your code as well if you like. Should we?
Sure, but let me include the full working program after fixup. Although I
still have to write another program to feed it random prob
On 29Apr2015 12:12, boB Stepp wrote:
... (3) install git if needed ...
It seems Git is needed, but I am not allowed to install it on the
Solaris workstation. So is there a way around this?
What do you mean by "install"? Bear in mind that while you may be forbidden
from installing git in the
On Wed, Apr 29, 2015 at 8:28 PM, eryksun wrote:
> After disabling the check, my previous example should work fine:
Except it doesn't accept paths relative to a UNC working directory:
(test) \\127.0.0.1\C$>cd Temp
The system cannot find the path specified.
And the cd command appears to i
On Wed, Apr 29, 2015 at 7:48 PM, eryksun wrote:
> cmd.exe was developed for OS/2 (1987) to replace COMMAND.COM (1981).
Actually, I stand corrected about the reason being cmd's 1980s
crustiness. Per [KB156276][1] this check was added to NT 4.0 (1996) to
address a vaguely described problem ("a UNC
I raised an exception in the parse_string function in my math parser
program, function_tosser.py, and caught it in the calling routine, and that
worked fine. But when I imported function_tosser.py into a test program,
tester.py, it threw the exception in the parse_string function instead of
handlin
On Wed, Apr 29, 2015 at 7:08 PM, Alan Gauld wrote:
> On 30/04/15 00:12, eryksun wrote:
>
>> the working directory, but the cmd.exe shell (being a crusty relic of
>> the 1980s) does not.
>
> Actually cmd.exe is fine with UNC paths. It's only when you
> combine them with Windows /option style that i
On 30/04/15 00:12, eryksun wrote:
the working directory, but the cmd.exe shell (being a crusty relic of
the 1980s) does not.
Actually cmd.exe is fine with UNC paths. It's only when you
combine them with Windows /option style that it has issues
but even then putting the path in quotes will usua
Hi Bob,
By the way, it sounds like you're starting to learn about how to write
interpreters. If that's the case, you might find PLAI helpful:
http://cs.brown.edu/~sk/Publications/Books/ProgLangs/
helpful. (Full disclosure: the author was my external advisor. :P)
Another good book is EoP
On Wed, Apr 29, 2015 at 11:54 AM, Albert-Jan Roskam
wrote:
> Hmmm, that sounds pretty convincing indeed (makes it even stranger that CD
> works the way it works).
> I believe it threw a WindowsError, indicating that the file(s) could not be
> found, because the dir was
> not changed. I actually
On 29/04/15 22:11, Roel Schroeven wrote:
Alan Gauld schreef op 2015-04-29 18:43:
On 29/04/15 17:03, Jugurtha Hadjar wrote:
http://docs.python-guide.org/en/latest/writing/style/#create-an-ignored-variable
I've seen this before and strongly disagree with it.
I disagree with your disagreement
boB Stepp wrote:
> On Wed, Apr 29, 2015 at 3:46 PM, Marc Tompkins
> wrote:
>> On Wed, Apr 29, 2015 at 1:10 PM, boB Stepp
>> wrote:
>>>
>>> Python 2.4.4, Solaris 10.
>>>
>>> I have some functions that I believe I could collapse into a single
>>> function if I only knew how:
>>>
>>> def choose_com
Roel Schroeven wrote:
> Alan Gauld schreef op 2015-04-29 18:43:
>> On 29/04/15 17:03, Jugurtha Hadjar wrote:
>>> http://docs.python-guide.org/en/latest/writing/style/#create-an-ignored-variable
>>
>> I've seen this before and strongly disagree with it.
>
> I disagree with your disagreement. I'll
On 29/04/15 21:19, diliup gabadamudalige wrote:
It is partly due to curiosity but I also wanted to have a common update
method. And as I almost always use the x+= some code, y+=some code for
animation stuff I wanted to know how it could be done using this method
rather than finding each position
On Wed, Apr 29, 2015 at 11:37 AM, diliup gabadamudalige
wrote:
> I do not understand how Alan does not get the code that is in this thread.
Hi Dilliup,
Please try to avoid using the phrase, "I don't understand how does
not get ...".
You might not realize it, but it's radioactive: it's has a v
Thanks Alan.
It is partly due to curiosity but I also wanted to have a common update
method. And as I almost always use the x+= some code, y+=some code for
animation stuff I wanted to know how it could be done using this method
rather than finding each position separately and assigning with x= som
I forget. You are writing these things as functions rather than
methods of a class, because you don't know how to use classes yet?
Because you are absolutely correct that there are ways to simplify this,
but if you don't know how to use classes yet, put this on hold until
you do. And this partic
On 04/29/2015 09:50 AM, Peter Otten wrote:
My random observations:
(1) find() and create() look very similar. Try hard to factor out common
code. You might even combine it into a single method ensure_balance(phone).
I'll think about it. I can't see for now how I would combine the two
(each
On 29/04/2015 21:10, boB Stepp wrote:
Python 2.4.4, Solaris 10.
I have some functions that I believe I could collapse into a single
function if I only knew how:
def choose_compare(operator, value0, value1, pass_color, fail_color):
"""
Perform the comparison indicated by operator. Retu
On Wed, Apr 29, 2015 at 3:50 PM, Laura Creighton wrote:
> I forget. You are writing these things as functions rather than
> methods of a class, because you don't know how to use classes yet?
You forget nothing! ~(:>))
> Because you are absolutely correct that there are ways to simplify this,
>
On Wed, Apr 29, 2015 at 3:46 PM, Marc Tompkins wrote:
> On Wed, Apr 29, 2015 at 1:10 PM, boB Stepp wrote:
>>
>> Python 2.4.4, Solaris 10.
>>
>> I have some functions that I believe I could collapse into a single
>> function if I only knew how:
>>
>> def choose_compare(operator, value0, value1, pa
Alan Gauld schreef op 2015-04-29 18:43:
On 29/04/15 17:03, Jugurtha Hadjar wrote:
http://docs.python-guide.org/en/latest/writing/style/#create-an-ignored-variable
I've seen this before and strongly disagree with it.
I disagree with your disagreement. I'll try to explain.
They are ambiguous
On Wed, Apr 29, 2015 at 1:10 PM, boB Stepp wrote:
> Python 2.4.4, Solaris 10.
>
> I have some functions that I believe I could collapse into a single
> function if I only knew how:
>
> def choose_compare(operator, value0, value1, pass_color, fail_color):
> """
> Perform the comparison ind
Python 2.4.4, Solaris 10.
I have some functions that I believe I could collapse into a single
function if I only knew how:
def choose_compare(operator, value0, value1, pass_color, fail_color):
"""
Perform the comparison indicated by operator. Return pass_color if
true, fail_color if false
I do not understand how Alan does not get the code that is in this thread.
Anyway I can conclude by saying that a friend of mine who is not in this
thread solved the problem and I would like to share it with you. He has
changed only a very smal portion in the original code that i posted in this
thr
- Original Message -
> From: boB Stepp
> To: tutor
> Cc:
> Sent: Wednesday, April 29, 2015 7:12 PM
> Subject: Re: [Tutor] How to use Git from Windows PC for files on Solaris
> machine where Git cannot be installed?
>
> On Wed, Apr 29, 2015 at 12:04 PM, Albert-Jan Roskam
> wrote:
>
Glad things are going better.
Next step. Can you get git running on your solaris machines? Easiest is
if it is already installed or if the powers that be will install it
for you.
But if not, you ought to be able to build your own git from source
and run it on your Solaris machines.
This li
On 29/04/15 18:12, boB Stepp wrote:
But uhhm, this is not Python at all ;-)
I was hoping for clemency on this point due to the earlier thread(s) I
started (Which included Python's unittest module.).
I've been blurring the lines on this one because version control
is something everyone should
On Wed, Apr 29, 2015 at 12:04 PM, Albert-Jan Roskam wrote:
>
> --
> On Wed, Apr 29, 2015 4:21 PM CEST boB Stepp wrote:
>
>>I now have Git installed on my Windows 7 PC at work. The files that I
>>wish to put under Git version control exist on a Solaris 10
>>workstation.
--
On Wed, Apr 29, 2015 4:21 PM CEST boB Stepp wrote:
>I now have Git installed on my Windows 7 PC at work. The files that I
>wish to put under Git version control exist on a Solaris 10
>workstation. In the Git bash provided, I can ssh into the Solaris 10
>machine. I a
-
On Wed, Apr 29, 2015 4:11 PM CEST Peter Otten wrote:
>Albert-Jan Roskam wrote:
>
>> Hello,
>>
>> Windows has the 'feature' that the CD command does not work with UNC
>> paths. So in the code below, I cannot use the 'cwd' parameter of
>> subprocess.Popen. Therefore I
On 29/04/15 17:03, Jugurtha Hadjar wrote:
(__, cursor) = self.init_db()
Don't use the __ 'variable' here, be explicit, it makes
maintenance much easier.
I actually searched specifically for something like this. In MATLAB,
there's the ~ that does this. I'm not trying to write Python
On 29/04/15 10:15, diliup gabadamudalige wrote:
x=42 good
x += 42 -x ?
That does not go by a mile of what I asked.
You've asked three different things:
1) Why the += form gives different results from the assignment form,
2) Why some code you apparently wriotre worked outside a class
but no
x=42 good
x += 42 -x ?
That does not go by a mile of what I asked.
Alan, are you telling me that there is no way that one can arrive at X2
which is the NEXT place that X1 will be after "some increment"?
old x position = X1
new x position= X1 + some increment value
which can be written as :new X =
question to Lucas.
Not sure if this is what you're looking for, but I would also use cos for
the x coordinate as suggested. If:
self.rect.x = self.radius * math.cos(self.angle) + self.center_x
self.rect.y = self.radius * math.sin(self.angle) + self.center_y
Take a derivative (assume: angle +=
Thank you Alan. Understood. I already knew that. My question is
How to to do it the second way.
some code = what?
My question is, how does one arrive at the code to put in place of "some
code"? The code I used does not work correctly.
The code is in this chain of email.
I hope I am clear in what I
On 04/29/2015 09:06 AM, Alan Gauld wrote:
In principle its an acceptable strategy. A close alternative
would be to name the queries as explicit class variables.
So for example you would use:
cur.execute(self.find_phone_query,())
Its less typing and less error prone in that you get a
syntax
On 28 April 2015 at 22:40, Cameron Simpson wrote:
>
> As with all things, sometimes that cannot be reasonably achieved, but it
> is usually so.
>
> We can pick over your code as well if you like. Should we?
>
> Cheers,
> Cameron Simpson
Sure, but let me include the full working program after f
I now have Git installed on my Windows 7 PC at work. The files that I
wish to put under Git version control exist on a Solaris 10
workstation. In the Git bash provided, I can ssh into the Solaris 10
machine. I also can the CuteFTP program on my Windows PC to
move/copy/etc. files between the two mac
Albert-Jan Roskam wrote:
> Hello,
>
> Windows has the 'feature' that the CD command does not work with UNC
> paths. So in the code below, I cannot use the 'cwd' parameter of
> subprocess.Popen. Therefore I use pushd/popd to accomplish the same
> effect. Is there a better way to do this? (other th
On 04/29/2015 08:47 AM, Albert-Jan Roskam wrote:
Hello,
Windows has the 'feature' that the CD command does not work with UNC paths.
So in the code below, I cannot use the 'cwd' parameter of subprocess.Popen.
Therefore I use pushd/popd to accomplish the same effect. Is there a better way
to do t
Hello,
Windows has the 'feature' that the CD command does not work with UNC paths.
So in the code below, I cannot use the 'cwd' parameter of subprocess.Popen.
Therefore I use pushd/popd to accomplish the same effect. Is there a better way
to do this?
(other than using full path names everywhere,
On 04/29/2015 03:15 AM, diliup gabadamudalige wrote:
Thanks all for the responses.
Charles Cossé - yes I can write a simple pygame program that makes a
sprite move in a circle but it may not be the style and order that many may
approve or accept. I consider myself a student. :)
No one has pointe
Ok thanks. I thought it would be better with just a while True loop; for simple
clarity.
> Date: Wed, 29 Apr 2015 21:14:06 +1000
> From: st...@pearwood.info
> To: tutor@python.org
> Subject: Re: [Tutor] comparison on Types
>
> On Wed, Apr 29, 2015 at 09:44
On 04/28/2015 09:24 PM, Jacqueline G Solis wrote:
hello,
I keep getting a syntax error. Could you please explain why that happens and
how to correct it.
def main ():
print( "Welcome to Gonzo Burger!")
order= int(input("Enter 1 if you want a hamburger,\
or 2 if you want a cheese
On Tue, Apr 28, 2015 at 08:24:57PM -0500, Jacqueline G Solis wrote:
> hello,
>
> I keep getting a syntax error. Could you please explain why that
> happens and how to correct it.
Syntax errors are sometimes a bit tricky. Usually, they tell you were
the error is:
py> if (x + 1:
File "", line
On Wed, Apr 29, 2015 at 09:44:28AM +, Ian D wrote:
> I was looking at the example code below. I am using python 2.7.
>
> I am wondering why when I substitute the while n! = "guess" to while
> n!= guess (<-- no quotes) I get a problem?
Really? What sort of problem? It looks okay to me, altho
Ian D wrote:
> I was looking at the example code below. I am using python 2.7.
>
> I am wondering why when I substitute the while n! = "guess" to while n!=
> guess (<-- no quotes) I get a problem?
What is that problem? The only thing I see is that the
> else:
> print "you guessed it
I was looking at the example code below. I am using python 2.7.
I am wondering why when I substitute the while n! = "guess" to while n!= guess
(<-- no quotes) I get a problem?
The Type string is used for the first conditional comparison in the outer While
loop, but afterwards the Type is an int
Jugurtha Hadjar wrote:
> I have a class with methods that access a database (SQLite3). I have
> included an excerpt showin reading and writing and would like to know if
> I'm doing it right. (i.e: Is it bad code and what to improve).
>
> Here are some improvements and my rationale (check my thi
On 29/04/15 09:03, diliup gabadamudalige wrote:
Thank you Alan. Understood. I already knew that. My question is
How to to do it the second way.
some code = what?
The point is you cannot do it.
The second approach always uses the current value of x.
The first approach may or may not use the cur
On 29/04/15 04:58, Jim Mooney Py3winXP wrote:
numbers = []
Note that you chose to make this global.
def parse_string(math_string):
"""Input: A math string with a verbal or mathematical operation
and two valid numbers to operate on. Extra numbers and operations
are ignored. Out
On 29/04/15 02:24, Jacqueline G Solis wrote:
hello,
I keep getting a syntax error.
If you get an error always include the full message text in your
queries. It helps enormously in finding the problem.
Could you please explain why that happens and how to correct it.
But in this case its o
On 29/04/15 04:06, Jugurtha Hadjar wrote:
- Initially, each method had its SQL statement(s) inside, but I grouped
all statements in a dictionary, with operations as keys, as a class
'constant' as per previous advice on this mailing list.
We can't see that in the code you posted.
In principle i
On 29/04/2015 02:24, Jacqueline G Solis wrote:
hello,
I keep getting a syntax error. Could you please explain why that happens and
how to correct it.
def main ():
print( "Welcome to Gonzo Burger!")
order= int(input("Enter 1 if you want a hamburger,\
or 2 if you want a cheesebur
On 29/04/15 08:15, diliup gabadamudalige wrote:
1. x = some code
That is what I used and it worked. I was trying to find how we can do the
same thing by updating the current position by doing
2. x += some code
Above 1 works. 2 does not. Why is that?
Because they do completely different th
hello,
I keep getting a syntax error. Could you please explain why that happens and
how to correct it.
def main ():
print( "Welcome to Gonzo Burger!")
order= int(input("Enter 1 if you want a hamburger,\
or 2 if you want a cheeseburger:" ))
if order == 1 :
print("
Thanks all for the responses.
Charles Cossé - yes I can write a simple pygame program that makes a
sprite move in a circle but it may not be the style and order that many may
approve or accept. I consider myself a student. :)
No one has pointed out why the object moves in a circle properly in the
68 matches
Mail list logo