On Wed, Apr 17, 2013 at 1:11 AM, Jim Mooney wrote:
2to3 loops.py
> File "", line 1
> 2to3 loops.py
>^
> SyntaxError: invalid syntax
The script 2to3.py is run from the system's terminal/console shell
(e.g. cmd or PowerShell on Windows), not the python shell.
If the current dire
Hi,
On 17 April 2013 06:11, Jim Mooney wrote:
> > Generally the 2to3 script does an OK job. If you're using Windows it's
> > [Python_Dir]\Tools\Scripts\2to3.py.
> >
> > http://docs.python.org/3/library/2to3
>
>
> Thanks. I didn't know where to find it and though
> The script 2to3.py is run from the system's terminal/console shell
> (e.g. cmd or PowerShell on Windows), not the python shell.
Yay, it worked! A decade of Windows and I'm back to the DOS Command
Line ;') Well, it worked the second time.I thought I could do without
the -w but nothing happened.
Op 17-04-13 18:09, Jim Mooney schreef:
The script 2to3.py is run from the system's terminal/console shell
(e.g. cmd or PowerShell on Windows), not the python shell.
Yay, it worked! A decade of Windows and I'm back to the DOS Command
Line ;')
If you want to program, the command line is your frien
Dear Python Tutor,
I have the code below(file.py):
import sys
a = 'This is A'
b = 'This is B'
c = 'This is C'
for i in sys.argv[1]:
if sys.argv[1] == 'a':
print a
if sys.argv[1] == 'b':
print b
if sys.argv[1] == 'c':
print c
I run python file.py a and return
What's the part that's "changing"? What's the part that stays the same?
I would recommend thinking of this in terms of a function.
Can you write a function that consumes a letter l and returns the
string "This is ..." where "..." is the uppercased l?
As an example of a simple function on string
On 04/17/2013 03:27 PM, Danilo Chilene wrote:
Dear Python Tutor,
I have the code below(file.py):
import sys
a = 'This is A'
b = 'This is B'
c = 'This is C'
for i in sys.argv[1]:
if sys.argv[1] == 'a':
print a
if sys.argv[1] == 'b':
print b
if sys.argv[1] == 'c
On Wed, Apr 17, 2013 at 1:03 PM, Danny Yoo wrote:
> ##
> ## double: string -> string
> def double(x):
> return x + x
>
>
> ## For example, a blast from the past:
> print "The Noid says: " + double("pizza")
> ##
>
I'm sorry, but this is a bug.
Hello Dave,
1) I'm using Python 2.7
2) The program wasn't suppose to really work, was just a example.
3) You assumed correct.
That's was what I looking for, worked like charm.
Thanks!
On Wed, Apr 17, 2013 at 5:18 PM, Dave Angel wrote:
> On 04/17/2013 03:27 PM, Danilo Chilene wrote:
>
>> Dear
Wait. If the solution that we're stopping at to use a hashtable here,
that's not quite right. A good solution to this should be _much_
shorter, on the order of a one-liner. Hashtables are great, but
they're not the answer to everything.
If we're doing something like:
a -> "This is A"
b
On 04/17/2013 04:49 PM, Danny Yoo wrote:
Wait. If the solution that we're stopping at to use a hashtable here,
that's not quite right.
Nothing wrong with a dict, if a proper specification of the problem were
available. Notice that in my solution, the messages were not all
trivially related
Yup! Sorry about my tone for its stridency. But I just got concerned
that the original poster seemed content about turning the chain of if
statements into a table definition. To my mind, they're very closely
related, data and control. I'm trying to push the OP to realizing
that if they are doin
Registration is open for three upcoming PyCamps produced by the Triangle
Python Users Group:
- A five-day PyOhio PyCamp hosted by the Ohio State University Open
Source Club, July 22-26, 2013 the week prior to the PyOhio regional
Python conference weekend. PyCamp is a training program and spons
On 04/17/2013 05:15 PM, Danny Yoo wrote:
Yup! Sorry about my tone for its stridency. But I just got concerned
that the original poster seemed content about turning the chain of if
statements into a table definition. To my mind, they're very closely
related, data and control. I'm trying to pus
Forwarding message to Python-tutor mailing list. I did not realize
that your reply didn't show up for the rest of Python tutor. Please
use Reply to All in the future.
-- Forwarded message --
From: Danilo Chilene
Date: Wed, Apr 17, 2013 at 2:17 PM
Subject: Re: [Tutor] Sys.argv
On 17/04/2013 20:27, Danilo Chilene wrote:
Dear Python Tutor,
I have the code below(file.py):
import sys
a = 'This is A'
b = 'This is B'
c = 'This is C'
for i in sys.argv[1]:
if sys.argv[1] == 'a':
print a
if sys.argv[1] == 'b':
print b
if sys.argv[1] == 'c':
-- Forwarded message --
From: Danilo Chilene
Date: Wed, Apr 17, 2013 at 2:17 PM
Subject: Re: [Tutor] Sys.argv read parameters
To: Danny Yoo
Hello Danny,
The part that is changing is just the sys.argv[1]
The vars will have always the same content.
What I don't want is to hav
On 17/04/13 20:27, Danilo Chilene wrote:
import sys
a = 'This is A'
b = 'This is B'
c = 'This is C'
for i in sys.argv[1]:
if sys.argv[1] == 'a':
print a
if sys.argv[1] == 'b':
print b
if sys.argv[1] == 'c':
print c
I run python file.py a and returns t
Hi! I was having a bit of nostalgia today, and thought I'd try to write a
simple, old school BBS. I found the 'paramiko' library, and I've got
something I can SSH into that would have impressed my 1990's self.
I found some example code of the "threading" library, and I've managed to
use it to ta
On 04/17/2013 08:12 PM, Alan Gauld wrote:
On 17/04/13 20:27, Danilo Chilene wrote:
import sys
a = 'This is A'
b = 'This is B'
c = 'This is C'
for i in sys.argv[1]:
if sys.argv[1] == 'a':
print a
if sys.argv[1] == 'b':
print b
if sys.argv[1] == 'c':
pr
20 matches
Mail list logo