[Tutor] anomaly

2018-04-19 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
I have a situation in which the same code gives an error in idle but works in qtconsole regards, *​in idle* v = np.zeros(len(x)) for i in range(len(x)): if x[i] < 1.0: v[i] = 0 else: v[i] = V print v​ RESTART: C:\Users\SHARMA\Documents\Python Scripts\sqwell.py

Re: [Tutor] File handling Tab separated files

2018-04-19 Thread Alan Gauld via Tutor
On 19/04/18 17:50, Niharika Jakhar wrote: > Hi again > I tried re-writing the code with all your advices(i assume to cover all of > them). I have extended the code a little bit to store the data in the form > of lists and am trying to access it. > I also changed the file name to BioGRID.txt > >

[Tutor] Fwd: File handling Tab separated files

2018-04-19 Thread Brian Lockwood
>> >> Here are some fixes >> >> filename is a variable and hence should not be in quotes. >> file_ is then called ‘f’ on the next line. >> The indenting is a bit wrong but this may just be your email. >> >> the line read_data … should be followed by something that appends the >> read_data to

Re: [Tutor] File handling Tab separated files

2018-04-19 Thread Niharika Jakhar
Hi again I tried re-writing the code with all your advices(i assume to cover all of them). I have extended the code a little bit to store the data in the form of lists and am trying to access it. I also changed the file name to BioGRID.txt Here's what I wrote(Please ignore the identation, there

Re: [Tutor] beginning encryption

2018-04-19 Thread Emil Natan
if char != alphabet: should be if char not in alphabet: Otherwise you are comparing char with alphabet. What you want to do if to check if char is in alphabet. Emil On Thu, Apr 19, 2018 at 2:39 AM, Roger Lea Scherer wrote: > I am absolutely stumped. I've tried a number of

Re: [Tutor] Help!

2018-04-19 Thread Neil Cerutti
On 2018-04-19, Steven D'Aprano wrote: > Some program ideas... > > Encrypt and decrypt text using a Caesar Cipher. > > https://en.wikipedia.org/wiki/Caesar_cipher > > or one of many other simple ciphers. > > Calculate the prime numbers up to a certain limit. > >

Re: [Tutor] XML Programs

2018-04-19 Thread Peter Otten
Glen wrote: > Hey guys, > > I have the following code: > > https://repl.it/@glendog/HurtfulPunctualInterface from lxml import etree catalog = etree.parse("example.xml") def getbooks(xmldata): books = xmldata.xpath("//catalog")[0] for item in books:

Re: [Tutor] Beginner Level Projects

2018-04-19 Thread David Rock
> On Apr 18, 2018, at 20:34, Joshua Nghe wrote: > > Hi, > > This is Joshua N from Campus Middle School in CO. Our science class is > collectively participating in a project that consumes 20% of our classtime > every week. For my project, I chose to learn Python,

Re: [Tutor] Beginner Level Projects

2018-04-19 Thread William Ray Wing
> On Apr 18, 2018, at 9:34 PM, Joshua Nghe wrote: > > Hi, > > This is Joshua N from Campus Middle School in CO. Our science class is > collectively participating in a project that consumes 20% of our classtime > every week. For my project, I chose to learn Python,

Re: [Tutor] File handling Tab separated files

2018-04-19 Thread Mats Wichmann
On 04/19/2018 07:57 AM, Wolfgang Maier wrote: > On 04/19/2018 10:45 AM, Niharika Jakhar wrote: >> Hi >> I want to store a file from BioGRID database (tab separated file, big >> data) >> into a data structure(I prefer lists, please let me know if another would >> be better) and I am trying to print

Re: [Tutor] XML Programs

2018-04-19 Thread Glen
Hey guys, I have the following code: https://repl.it/@glendog/HurtfulPunctualInterface Using the function I have define I can print to screen a list of books. However, how can I search for records within the xml using an ID or the title of the book etc? I've tried reading the tutorial but the

Re: [Tutor] File handling Tab separated files

2018-04-19 Thread Wolfgang Maier
On 04/19/2018 10:45 AM, Niharika Jakhar wrote: Hi I want to store a file from BioGRID database (tab separated file, big data) into a data structure(I prefer lists, please let me know if another would be better) and I am trying to print the objects. Here’s my code: class BioGRIDReader: def

Re: [Tutor] File handling Tab separated files

2018-04-19 Thread Steven D'Aprano
On Thu, Apr 19, 2018 at 10:45:07AM +0200, Niharika Jakhar wrote: > Hi > I want to store a file from BioGRID database (tab separated file, big data) > into a data structure(I prefer lists, please let me know if another would > be better) and I am trying to print the objects. You should probably

Re: [Tutor] Help!

2018-04-19 Thread Steven D'Aprano
Hello Joshua, and welcome! My comments below. On Thu, Apr 19, 2018 at 01:15:59AM +, Joshua Nghe wrote: > Hi, > This is Joshua N from Campus Middle School. You are talking to people from all over the world, and some of us are not familiar with what you mean by "Middle School". What is it?

Re: [Tutor] beginning encryption

2018-04-19 Thread Steven D'Aprano
Hi Roger, and welcome. See my comments below. On Wed, Apr 18, 2018 at 04:39:27PM -0700, Roger Lea Scherer wrote: > def encryptor(address): > encrypted = "" > for char in address: > if char != alphabet: > encrypted += char > else: > pos =

[Tutor] File handling Tab separated files

2018-04-19 Thread Niharika Jakhar
Hi I want to store a file from BioGRID database (tab separated file, big data) into a data structure(I prefer lists, please let me know if another would be better) and I am trying to print the objects. Here’s my code: class BioGRIDReader: def __init__(self, filename): with

[Tutor] Beginner Level Projects

2018-04-19 Thread Joshua Nghe
Hi, This is Joshua N from Campus Middle School in CO. Our science class is collectively participating in a project that consumes 20% of our classtime every week. For my project, I chose to learn Python, and create something from what I learned. I currently have around 10 hours spent learning

[Tutor] beginning encryption

2018-04-19 Thread Roger Lea Scherer
I am absolutely stumped. I've tried a number of different scenarios and copied the answer more than I like, but I still can't figure this out. I don't want to copy the answer verbatim because then I won't learn. I'm doing the beginning cipher, mix up the letters routine. I get the entire

[Tutor] Help!

2018-04-19 Thread Joshua Nghe
Hi, This is Joshua N from Campus Middle School. In my science class, we are learning topics of our choice. I chose coding as my project, and I am contacting you to ask about certain projects which would be appropriate for a programmer at a beginner level. I only have 15 hours on Python, however