[Tutor] Retain UTF-8 Character in Python List

2015-06-01 Thread Boy Sandy Gladies Arriezona
Hi, it's my first time in here. I hope you don't mind if I straight to the question. I do some work in python 2 and my job is to collect some query and then send it to java program via json. We're doing batch update in Apache Phoenix, that's why I collect those query beforehand. My question is: *C

[Tutor] creat a program that reads frequency of words in file

2015-06-01 Thread Stephanie Quiles
Hello. i need serious help. i am a very very new python programmer. I have never done any code in my life. I am lost with these assignments for a class i am taking. I hope someone can assist. below is what i have so far which i know is incorrect. my question is how do i create a dictionary and s

Re: [Tutor] Retain UTF-8 Character in Python List

2015-06-01 Thread Peter Otten
Boy Sandy Gladies Arriezona wrote: > Hi, it's my first time in here. Welcome! > I hope you don't mind if I straight to the > question. > I do some work in python 2 and my job is to collect some query and then > send it to java program via json. We're doing batch update in Apache > Phoenix, that

Re: [Tutor] creat a program that reads frequency of words in file

2015-06-01 Thread Alan Gauld
On 01/06/15 05:01, Stephanie Quiles wrote: Hello. i need serious help. i am a very very new python programmer. Welcome. Write a program that reads the contents of a text file. OK, Well you have done that bit OK. The program should create a dictionary in which the keys are the individual w

Re: [Tutor] Retain UTF-8 Character in Python List

2015-06-01 Thread Steven D'Aprano
On Mon, Jun 01, 2015 at 09:39:03AM +0700, Boy Sandy Gladies Arriezona wrote: > Hi, it's my first time in here. I hope you don't mind if I straight to the > question. > I do some work in python 2 and my job is to collect some query and then > send it to java program via json. We're doing batch updat

[Tutor] Should error checking be duplicated for both functions if one function calls another one?

2015-06-01 Thread boB Stepp
Suppose in a given state of a program, function 1 calls function 2. Function 1 includes checks for possible error conditions. If there are no issues, then function 2 should execute with no issues as well. The question is, should function 2 include the error checking done in function 1 if function 2

Re: [Tutor] Should error checking be duplicated for both functions if one function calls another one?

2015-06-01 Thread David Palao
Hello, Not sure if I got it, but, in my opinion functions should do only one thing.So if function 2 finds an error, it should raise it. There should be another function (function 1 in your case?) taking care of possible raised errors. Best 2015-06-01 16:27 GMT+02:00 boB Stepp : > Suppose in a gi

Re: [Tutor] Should error checking be duplicated for both functions if one function calls another one?

2015-06-01 Thread boB Stepp
On Mon, Jun 1, 2015 at 9:33 AM, David Palao wrote: > Hello, > Not sure if I got it, but, in my opinion functions should do only one > thing.So if function 2 finds an error, it should raise it. There > should be another function (function 1 in your case?) taking care of > possible raised errors.

Re: [Tutor] Should error checking be duplicated for both functions if one function calls another one?

2015-06-01 Thread Peter Otten
boB Stepp wrote: > On Mon, Jun 1, 2015 at 9:33 AM, David Palao > wrote: >> Hello, >> Not sure if I got it, but, in my opinion functions should do only one >> thing.So if function 2 finds an error, it should raise it. There >> should be another function (function 1 in your case?) taking care of >

Re: [Tutor] Should error checking be duplicated for both functions if one function calls another one?

2015-06-01 Thread Laura Creighton
How many layers do you expect your program to have? (And if the answer is 'a whole lot' then maybe your design needs to be reconsidered.) Dealing with the exception at the lowest level that can deal with it is usually a good idea. Also dealing with the exception at the top level, so that when ba

Re: [Tutor] Should error checking be duplicated for both functions if one function calls another one?

2015-06-01 Thread Steven D'Aprano
On Mon, Jun 01, 2015 at 09:27:07AM -0500, boB Stepp wrote: > Suppose in a given state of a program, function 1 calls function 2. > Function 1 includes checks for possible error conditions. If there are > no issues, then function 2 should execute with no issues as well. The > question is, should fu

Re: [Tutor] Retain UTF-8 Character in Python List

2015-06-01 Thread Boy Sandy Gladies Arriezona
On Mon, Jun 1, 2015 at 6:22 PM, Steven D'Aprano wrote: What do you mean, the Java program inserts it directly? Inserts it into what? I mean that java program use the list and directly send it into apache phoenix to do "batch upsert". I thought that because the list is not show me the way I set it

Re: [Tutor] Should error checking be duplicated for both functions if one function calls another one?

2015-06-01 Thread Mark Lawrence
On 01/06/2015 15:37, boB Stepp wrote: On Mon, Jun 1, 2015 at 9:33 AM, David Palao wrote: Hello, Not sure if I got it, but, in my opinion functions should do only one thing.So if function 2 finds an error, it should raise it. There should be another function (function 1 in your case?) taking ca

Re: [Tutor] creat a program that reads frequency of words in file :p:

2015-06-01 Thread Thomas C. Hicks
On 06/01/2015 05:56 PM, Alan Gauld wrote: if text in line: count += 1 print("This word appears", count, "times in the file") And this is, of course, completely off track. You need to split the line into its separate words and store each word into the dictionary. OP may want

[Tutor] Trouble using bioread to convert files from .acq to .mat

2015-06-01 Thread Ila Kumar
Hello, I am a new Python user attempting to use bioread ( https://pypi.python.org/pypi/bioread/0.9.5) to convert files from aqknowledge to matlab. I am using a 64-bit PC, and I have downloaded Matlab, Python, numpy, scipy and bioread. Can someone walk me through the installation process for this p

Re: [Tutor] Trouble using bioread to convert files from .acq to .mat

2015-06-01 Thread Alan Gauld
On 01/06/15 20:50, Ila Kumar wrote: Hello, I am a new Python user attempting to use bioread ( https://pypi.python.org/pypi/bioread/0.9.5) to convert files from aqknowledge to matlab. I am using a 64-bit PC, and I have downloaded Matlab, Python, numpy, scipy and bioread. Can someone walk me throu

Re: [Tutor] Trouble using bioread to convert files from .acq to .mat

2015-06-01 Thread Mark Lawrence
On 01/06/2015 23:50, Alan Gauld wrote: On 01/06/15 20:50, Ila Kumar wrote: Hello, I am a new Python user attempting to use bioread ( https://pypi.python.org/pypi/bioread/0.9.5) to convert files from aqknowledge to matlab. I am using a 64-bit PC, and I have downloaded Matlab, Python, numpy, scip

[Tutor] Parsing/Crawling test College Class Site.

2015-06-01 Thread bruce
Hi. I'm creating a test py app to do a quick crawl of a couple of pages of a psoft class schedule site. Before I start asking questions/pasting/posting code... I wanted to know if this is the kind of thing that can/should be here.. The real issues I'm facing aren't so much pythonic as much as prob

Re: [Tutor] Parsing/Crawling test College Class Site.

2015-06-01 Thread Alan Gauld
On 02/06/15 00:06, bruce wrote: Hi. I'm creating a test py app to do a quick crawl of a couple of pages of a psoft class schedule site. Before I start asking questions/pasting/posting code... I wanted to know if this is the kind of thing that can/should be here.. Probably. we are targeted at b

Re: [Tutor] creat a program that reads frequency of words in file

2015-06-01 Thread Alan Gauld
I've CCd the list. Please use reply all when responding to the list. Also please use plain text as HTML/RTF doesn't work on all systems and code in particular often gets mangled. On 01/06/15 23:59, Stephanie Quiles wrote: Hello again, here is the final code… I think :) please see below. Is this

Re: [Tutor] Parsing/Crawling test College Class Site.

2015-06-01 Thread Mark Lawrence
On 02/06/2015 00:06, bruce wrote: Hi. I'm creating a test py app to do a quick crawl of a couple of pages of a psoft class schedule site. Before I start asking questions/pasting/posting code... I wanted to know if this is the kind of thing that can/should be here.. The real issues I'm facing are