Re: [Tutor] how to invert tuples, one problem more

2015-11-27 Thread Alan Gauld
On 27/11/15 20:50, marcus lütolf wrote: x = Marcus Here you assign the variable x to the same thing as the variable Marcus. But that should be an error since Marcus is not defined. So I'm guessing you actually wrote: >>> x = 'Marcus' [ It's always better to copy real code into messages r

[Tutor] how to invert tuples, one problem more

2015-11-27 Thread marcus lütolf
dear pythonistas, thanks for your very valuable help. I am struggling with a simple piece of code: >>> x = Marcus >>> print '{0} {1} x'.format('a', '=') which gives me >>> a = x instead of >>> a = Marcus What's wrong ? Marcus. --- Diese E-Mail wurde von Avast Antivirus-Software auf Viren g

Re: [Tutor] Read lines opening with a particular set of characters from a file

2015-11-27 Thread Laura Creighton
In a message of Fri, 27 Nov 2015 17:05:21 +0530, "Br. Sayan" writes: >How can we read specific lines from a text files using python. File >attached. > >Suppose we want to read lines starting with 'R|1|^^^' and 'O|1|' > >Should we use: > >line.startswith(("..", "..", "")) that matches lines tha

[Tutor] Read lines opening with a particular set of characters from a file

2015-11-27 Thread Br. Sayan
How can we read specific lines from a text files using python. File attached. Suppose we want to read lines starting with 'R|1|^^^' and 'O|1|' Should we use: line.startswith(("..", "..", "")) H|\^&|||C311^1|host|RSUPL^BATCH|P|1 P|1 O|1|9060^MANWAL ^1^^010|R1|^^^989/\^^^99

Re: [Tutor] underscores

2015-11-27 Thread Laura Creighton
In a message of Fri, 27 Nov 2015 01:43:36 +, Kayla Phelps writes: >Hi, >When I go to type underscores in my program it doesn't work, they just turn >into spaces. I can use references from other programs I downloaded just fine >but I even tried copying and pasting underscores and they disappe

Re: [Tutor] underscores

2015-11-27 Thread Alan Gauld
On 27/11/15 01:43, Kayla Phelps wrote: > Hi, > When I go to type underscores in my program it doesn't work, they just turn > into spaces. Ok, this doesn't really have anything to do with Python itself, it depends on what you are using to type. Tell us : What OS you are using? What program are yo

Re: [Tutor] super and __init__ methods

2015-11-27 Thread Ben Finney
Sunil Tech writes: > Thanks I got it. Thanks for telling us! You should know that ‘super’ is a topic that confuses even quite experienced Python programmers. It is good to encounter this early, when you can learn about it. See the article “Python’s super() considered super!” https://rhettinger

[Tutor] underscores

2015-11-27 Thread Kayla Phelps
Hi, When I go to type underscores in my program it doesn't work, they just turn into spaces. I can use references from other programs I downloaded just fine but I even tried copying and pasting underscores and they disappeared. Any ideas of what to do? Even my teacher doesn't know what's wrong.