Re: [Tutor] Read a file, Load a dictionary

2014-07-24 Thread Alan Gauld
On 25/07/14 04:00, Steven D'Aprano wrote: 3.5 is a dev version. Not for production nor for learning python one gets it by fetching from the repository and doing their own compile. Do you figure that many beginners to Python are doing that? I think Dave was being a bit tongue in cheek. H

Re: [Tutor] Security and Reliability of Python

2014-07-24 Thread Danny Yoo
> Python is only as secure as the code *you* write. If you write code > where you accept text from untrusted people over the Internet and then > execute it as code using eval() or exec(), then your code is vulnerable > to code injection attacks. The solution to this is simple: don't use > eval() or

Re: [Tutor] Security and Reliability of Python

2014-07-24 Thread Steven D'Aprano
On Thu, Jul 24, 2014 at 10:11:41AM +, Allahondoum Mbaibarem wrote: > I'm new at python and I would like to have knowledge about the Security and > the Reliability factor of Python thank you. Python is very reliable. The language has been around for over 20 years, and is in use in tens of tho

Re: [Tutor] Read a file, Load a dictionary

2014-07-24 Thread Steven D'Aprano
On Thu, Jul 24, 2014 at 10:25:59PM -0400, Dave Angel wrote: > Deb Wyatt Wrote in message: > >> assuming you're using version 3.5 > > > > How do you get version 3.5? Python.org shows 3.41 as being the latest. > > I could as easily figured 2.6. My point is that people need to > specify what v

Re: [Tutor] Read a file, Load a dictionary

2014-07-24 Thread Dave Angel
Deb Wyatt Wrote in message: > assuming you're >> using version 3.5 >> > > How do you get version 3.5? Python.org shows 3.41 as being the latest. > > I could as easily figured 2.6. My point is that people need to specify what version they're asking about. 3.5 is a dev version. Not for

Re: [Tutor] Read a file, Load a dictionary

2014-07-24 Thread Deb Wyatt
assuming you're > using version 3.5 > How do you get version 3.5? Python.org shows 3.41 as being the latest. Deb in WA, USA FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family! Visit http://www.inbox.c

Re: [Tutor] Inquiry

2014-07-24 Thread Danny Yoo
On Jul 24, 2014 3:21 PM, "Allahondoum Mbaibarem" wrote: > > Please I would like to know about the Security and the Reliability of Python. This is somewhat outside the domain of python-tutor discussion. You may want to contact the folks at: http://www.pythonsecurity.org instead. ___

Re: [Tutor] Inquiry

2014-07-24 Thread Dave Angel
Allahondoum Mbaibarem Wrote in message: > > (use text messages here) Python is no more secure than the code written in it. It is very reliable, according to the experience of thousands of users. Much of that comes from it being open-source; many eyes catch the bugs faster than anything propr

Re: [Tutor] Security and Reliability of Python

2014-07-24 Thread Dave Angel
Allahondoum Mbaibarem Wrote in message: > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > Post here using text messages, not html. Wait 24 hours, not one, b

Re: [Tutor] Read a file, Load a dictionary

2014-07-24 Thread Dave Angel
Glenn Lester Wrote in message: > ? You forgot to make your message a text one, and also omitted your Python version. So I'll respond from memory, assuming you're using version 3.5 The csv reader can make a dictionary from each line of the csv file. So you can readily make a list o

Re: [Tutor] Read a file, Load a dictionary

2014-07-24 Thread Emile van Sebille
On 7/24/2014 3:50 PM, Glenn Lester wrote: I have been looking around for a way to read a comma delimited csv file start with the csv module. http://www.python.org/doc/current/lib/module-csv.html DESCRIPTION This module provides classes that assist in the reading and writing of Co

Re: [Tutor] Security and Reliability of Python

2014-07-24 Thread Emile van Sebille
On 7/24/2014 3:11 AM, Allahondoum Mbaibarem wrote: I'm new at python and I would like to have knowledge about the Security and the Reliability factor of Python thank you. That's a pretty open-ended question. It's as secure and reliable as what you write. For most of us, it's as secure and r

[Tutor] Read a file, Load a dictionary

2014-07-24 Thread Glenn Lester
I have been looking around for a way to read a comma delimited csv file and then load it into a dictionary. So far any of my usual sources don't deal with such simple stuff. My current code is # create a dictionary (dict) to store the order # and Remark testVariables = {} # Read the file an

[Tutor] Security and Reliability of Python

2014-07-24 Thread Allahondoum Mbaibarem
I'm new at python and I would like to have knowledge about the Security and the Reliability factor of Python thank you. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Inquiry

2014-07-24 Thread Allahondoum Mbaibarem
Please I would like to know about the Security and the Reliability of Python. Thank you ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Error Handling in python

2014-07-24 Thread Wolfgang Maier
On 24.07.2014 14:37, Chris “Kwpolska” Warrick wrote: It’s recommended to switch to the [[ syntax anyways, some people consider [ deprecated. Also, [ is actually /bin/[ while [[ lives in your shell (and is therefore faster). About the equals sign, == is the preferred syntax, and = is also consi

Re: [Tutor] Error Handling in python

2014-07-24 Thread Chris “Kwpolska” Warrick
On Thu, Jul 24, 2014 at 2:23 PM, Wolfgang Maier wrote: > On 24.07.2014 14:19, Chris “Kwpolska” Warrick wrote: >> >> > python test.py > if [ $? = 0 ]; then > python second.py > fi > > as your shell script. The [ ] and = should be doubled. >>> >>> >>

Re: [Tutor] Error Handling in python

2014-07-24 Thread Wolfgang Maier
On 24.07.2014 14:19, Chris “Kwpolska” Warrick wrote: python test.py if [ $? = 0 ]; then python second.py fi as your shell script. The [ ] and = should be doubled. ?? why that ? Double brackets can do more: http://stackoverflow.com/questions/2188199/how-to-use-double-or-single-br

Re: [Tutor] Error Handling in python

2014-07-24 Thread Chris “Kwpolska” Warrick
On Thu, Jul 24, 2014 at 2:14 PM, Wolfgang Maier wrote: > On 24.07.2014 14:09, Chris “Kwpolska” Warrick wrote: >> >> On Thu, Jul 24, 2014 at 2:01 PM, Wolfgang Maier >> wrote: >>> >>> Try something like this (assuming bash): >>> >>> python test.py >>> if [ $? = 0 ]; then >>> python second.py >

Re: [Tutor] Error Handling in python

2014-07-24 Thread Wolfgang Maier
On 24.07.2014 14:09, Chris “Kwpolska” Warrick wrote: On Thu, Jul 24, 2014 at 2:01 PM, Wolfgang Maier wrote: Try something like this (assuming bash): python test.py if [ $? = 0 ]; then python second.py fi as your shell script. The [ ] and = should be doubled. ?? why that ? But all th

Re: [Tutor] Error Handling in python

2014-07-24 Thread Chris “Kwpolska” Warrick
On Thu, Jul 24, 2014 at 2:01 PM, Wolfgang Maier wrote: > Try something like this (assuming bash): > > python test.py > if [ $? = 0 ]; then > python second.py > fi > > as your shell script. The [ ] and = should be doubled. But all this is not needed, all you need is: python test.py && python

Re: [Tutor] Error Handling in python

2014-07-24 Thread Steven D'Aprano
On Thu, Jul 24, 2014 at 05:05:24PM +0530, jitendra gupta wrote: > Hi All > > My shell script is not throwing any error when I am having some error in > Python code. This is a question about the shell, not about Python. I'm not an expert on shell scripting, but I'll try to give an answer. > ~~

Re: [Tutor] Error Handling in python

2014-07-24 Thread Wolfgang Maier
On 24.07.2014 13:35, jitendra gupta wrote: Hi All My shell script is not throwing any error when I am having some error in Python code. test.py ~~ def main(): print "Test" #some case error need to be thrown raise Exception("Here is error") if __name__ == "__main__"

Re: [Tutor] Error Handling in python

2014-07-24 Thread Chris “Kwpolska” Warrick
On Thu, Jul 24, 2014 at 1:35 PM, jitendra gupta wrote: > Hi All > > My shell script is not throwing any error when I am having some error in > Python code. > > In this case, I dont want to run my second.py > Even I am throwing error from my test.py, but still second.py is getting > executed, whic

[Tutor] Error Handling in python

2014-07-24 Thread jitendra gupta
Hi All My shell script is not throwing any error when I am having some error in Python code. test.py ~~ def main(): print "Test" #some case error need to be thrown raise Exception("Here is error") if __name__ == "__main__" main() ~~ second.py ~~ def