Re: [Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-12-17 Thread Steven D'Aprano

zicu radu wrote:

Hello,

How to prevent shadows a built-in in code.
Please if you are kind enougth to take the time to provide feedback I would
appreciate that it is constructive. 


The script is here: http://bpaste.net/show/12364/



Are you sure you have posted the right link? This is a function called 
"fixXML". It doesn't seem to have anything to do with preventing the 
shadowing of built-ins.



--
Steven



___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-11-05 Thread Walter Prins
One final suggestion to add to the others: Install and use both pylint, and
pychecker.  That will help ensure you don't make silly errors or omissions
and follow a consistent coding style that matches the generally accepted
format well.

PyLint: http://pypi.python.org/pypi/pylint
PyChecker: http://pypi.python.org/pypi/PyChecker/0.8.12

Aside: The easiest way to install these (and many other) Python modules is
using "Pip": http://pypi.python.org/pypi/pip/0.8.1

Using Pip, installing pylint is just the following command:

pip install pylint

Likewise for pychecker.

Have a good weekend.

Walter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-11-05 Thread Glen Clark
Thank you very much for the feedback Luke. I have taken it onboard. I
especially like the .lower().strip()[0] method ^^

Regards,
G

On 4 November 2010 22:38, Luke Paireepinart  wrote:

> Also for your confirm entries read about sentinel values for while loops.
> It saves you repeating the conditional in the loop body. And you might want
> to .lower().strip()[0] the input choice so that they can use y, Y, yes, or
> whatever. Remember, users suck at generating accurate and correct input so
> don't give them any credit you can avoid.
>
>
> -
> Sent from a mobile device with a bad e-mail client.
> -
>
> On Nov 4, 2010, at 3:10 PM, Glen Clark  wrote:
>
> Hello,
>
> I have completed my first python script. This is after watching a video
> guide on python and is my first attempt at writing code in python. While the
> code is not very useful I got the idea for it when googling "python projects
> for beginners".
>
> The idea was to create a script that asked the user to input a list of
> names and allow the user to change a name if he wanted before confirming the
> entries.
>
> I tried to incorporate what I had learnt from the videos, such as
> conditionals, error handling, functions etc... and write it how I would
> write code in future.
>
> Please if you are kind enougth to take the time to provide feedback I would
> appreciate that it is constructive :)
>
> The script is here: 
> http://bpaste.net/show/10658/
>
> ___
>
> Tutor maillist  -   Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-11-04 Thread Luke Paireepinart
Your code is not bad overall, pretty great for a beginner actually. I would say 
you should read guido's style guide though; some of your variable and function 
naming is nonstandard python.

-
Sent from a mobile device with a bad e-mail client.
-

On Nov 4, 2010, at 3:10 PM, Glen Clark  wrote:

> Hello,
> 
> I have completed my first python script. This is after watching a video guide 
> on python and is my first attempt at writing code in python. While the code 
> is not very useful I got the idea for it when googling "python projects for 
> beginners".
> 
> The idea was to create a script that asked the user to input a list of names 
> and allow the user to change a name if he wanted before confirming the 
> entries.
> 
> I tried to incorporate what I had learnt from the videos, such as 
> conditionals, error handling, functions etc... and write it how I would write 
> code in future.
>  
> Please if you are kind enougth to take the time to provide feedback I would 
> appreciate that it is constructive :)
> 
> The script is here: http://bpaste.net/show/10658/
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-11-04 Thread Luke Paireepinart
Also for your confirm entries read about sentinel values for while loops. It 
saves you repeating the conditional in the loop body. And you might want to 
.lower().strip()[0] the input choice so that they can use y, Y, yes, or 
whatever. Remember, users suck at generating accurate and correct input so 
don't give them any credit you can avoid.

-
Sent from a mobile device with a bad e-mail client.
-

On Nov 4, 2010, at 3:10 PM, Glen Clark  wrote:

> Hello,
> 
> I have completed my first python script. This is after watching a video guide 
> on python and is my first attempt at writing code in python. While the code 
> is not very useful I got the idea for it when googling "python projects for 
> beginners".
> 
> The idea was to create a script that asked the user to input a list of names 
> and allow the user to change a name if he wanted before confirming the 
> entries.
> 
> I tried to incorporate what I had learnt from the videos, such as 
> conditionals, error handling, functions etc... and write it how I would write 
> code in future.
>  
> Please if you are kind enougth to take the time to provide feedback I would 
> appreciate that it is constructive :)
> 
> The script is here: http://bpaste.net/show/10658/
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-11-04 Thread Luke Paireepinart
Also for your confirm entries function, read about while loops 

-
Sent from a mobile device with a bad e-mail client.
-

On Nov 4, 2010, at 3:10 PM, Glen Clark  wrote:

> Hello,
> 
> I have completed my first python script. This is after watching a video guide 
> on python and is my first attempt at writing code in python. While the code 
> is not very useful I got the idea for it when googling "python projects for 
> beginners".
> 
> The idea was to create a script that asked the user to input a list of names 
> and allow the user to change a name if he wanted before confirming the 
> entries.
> 
> I tried to incorporate what I had learnt from the videos, such as 
> conditionals, error handling, functions etc... and write it how I would write 
> code in future.
>  
> Please if you are kind enougth to take the time to provide feedback I would 
> appreciate that it is constructive :)
> 
> The script is here: http://bpaste.net/show/10658/
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor