On 08/02/2011 10:36 PM, Richard D. Moores wrote:
Puzzled again. Why the error. Line 36 is the line just above "import
os.path". I have many other functions in mycalc.py with examples
formatted exactly the same way.
def convertPath(path):
"""
Given a path with backslashes, return that p
On 08/03/2011 02:07 AM, Richard D. Moores wrote:
On Tue, Aug 2, 2011 at 21:59, Dave Angel wrote:
When I paste that from your email into a file and run Python 2.7 on it, it
behaves fine with no errors. That's in Linux.
I should have said that I'm using Wing IDE Professional 4.
On 08/03/2011 01:48 PM, Richard D. Moores wrote:
On Wed, Aug 3, 2011 at 10:11, Peter Otten<__pete...@web.de> wrote:
Dave was close, but Steven hit the nail: the string r"C:\Users\Dick\..." is
fine, but when you put it into the docstring it is not a raw string within
an
On 08/06/2011 07:32 AM, Norman Khine wrote:
hello,
i know that there are no indexes/positions in a python dictionary,
what will be the most appropriate way to do this:
addresses = {}
for result in results.get_documents():
addresses[result.na
On 08/07/2011 01:00 AM, Steven D'Aprano wrote:
Robert Sjoblom wrote:
I have a quite odd problem, and I've come across it before but
probably ignored it at the time because I had other concerns. I've
tried googling for the answer but haven't really come closer to
solving it.
This is what happens:
On 08/12/2011 03:47 AM, Alan Gauld wrote:
On 12/08/11 07:04, Emeka wrote:
Hello All,
I need help here, type(item) == [].__class__:. What is the idiomatic way
of doing it?
if type(item) == type([])...
or in this case
if type(item) == list...
But probably preferrable to using type is to use
Oh, good catch Dave.
So you'd want to add an explicit check for a string.
And in fact you probably don't want to "flatten" a string into
individual characters anyway!
Alan G.
I agree with you about probably not wanting to flatten a string. So I'd
add an isinstance()
and PDF data block but when I execute
msg.is_multipart()
I get False ???
And when I execute
msg.get_payload()
I get nothing
Any ideas anyone, at a guess its because my string is not formatted
correctly, can anyone advise ?
Cheers
Dave
--
Please avoid sending me Word or PowerPoint attachments
Did a lot more digging and finally sorted it, sorry for bothering you guys,
Cheers
Dave
On 20 August 2011 10:58, dave selby wrote:
> I am trying to read and decode an emails PDF attachment via python,
> its a dedicated mailbox, anything emailed there is to be read by the
> script, del
On 08/21/2011 05:35 PM, D. Guandalino wrote:
Python documentation says:
exception TypeError
Raised when an operation or function is applied to an object of
inappropriate type. The associated value is a string giving details
about the type mismatch.
For example:
'foo' + (1, 2)
Traceback (mo
On 08/25/2011 05:46 AM, Lisi wrote:
I copied and ran the following script:
multiplier = 12
for j in range(1,13):
print "%d x %d = %d" %(j, multiplier, j*multiplier)
That ran perfectly and gave me the 12 times table.
I then decided that it would be fun to branch out and make teh
script "u
On 08/26/2011 11:49 AM, Prasad, Ramit wrote:
Yep, it is. Thanks those charts are exactly what I wanted! Now I have another
question. What is the difference between what print shows and what the
interpreter shows?
print s.decode('latin-1')
MÉXICO
The decoded characters are a Unicode string.
On 09/09/2011 06:44 AM, kitty wrote:
Hi,
I'm new to python and I have read through the tutorial on:
http://docs.python.org/tutorial/index.html
which was really good, but I have been an R user for 7 years and and am
finding it difficult to do even basic things in python, for example I want
to imp
On 09/12/2011 01:29 AM, Richard D. Moores wrote:
Win 7, Python 3.2.1
I'm trying to improve my skills with opening text files, reading from them,
and writing to them.
But while I'm doing this sometimes I want to manually modify the text file
I'm using, C:\t\text.txt . Say I've done this:
f = o
1. Don't top-post. Put your response after whatever parts of a previous
message you're quoting. And delete the parts that are no longer relevant.
2. If you used tabs in your code, convert to spaces before pasting into
some email editors. Apparently your email editor is converting the tabs
t
On 09/14/2011 10:35 PM, Andre Engels wrote:
On Thu, Sep 15, 2011 at 4:01 AM, c smithwrote:
hi list, i am trying the MIT opencourseware assignments.
one was to find the 1000th prime.
since this isn't actually my homework, I modified the solution as I would
like to collect lists of primes and non
On 09/22/2011 10:27 AM, Joel Knoll wrote:
Given a range of integers (1,n), how might I go about printing them in the
following patterns:
1 2 3 4 ... n2 3 4 5 ... n 13 4 5 6 ... n 1 2
etc., e.g. for a "magic square". So that for the range (1,5) for example I
would get
1 2 3 42 3 4 13 4 1 24 1 2
On 09/22/2011 10:43 AM, Hugo Arts wrote:
forgot to forward to list:
From: Hugo Arts
Date: Thu, Sep 22, 2011 at 4:42 PM
Subject: Re: [Tutor] range question
To: d...@davea.name
On Thu, Sep 22, 2011 at 4:37 PM, Dave Angel wrote:
On 09/22/2011 10:27 AM, Joel Knoll wrote:
Given a range of
On 09/23/2011 01:15 AM, Cheeyung wrote:
I'm creating a mobile application and I'm using python for a desktop
server. However, I don't have access to a static IP on the desktop,
but do have a website. Is it possible to connect from mobile -> http
website -> desktop server and back?
What kind o
On 09/25/2011 07:21 PM, questions anon wrote:
Hi All,
I am trying to move from writing one long script each time I need to do a
new thing but I do not quite understand how functions work, even after
reading many manuals.
My first attempt is to create a python file where I have defined a number of
On 09/26/2011 06:53 AM, Sajjad wrote:
Hello forum,
It has been two days that i have started with python and i am stuck with the
following simple issue:
i have created a python file and inside the file i have defined a function
as follows:
//
(Don't top-post. Put your new remarks after whatever you're quoting)
On 09/26/2011 08:26 PM, questions anon wrote:
Thanks for your feedback. I might be asking the wrong questions.
I have written a number of scripts that do various things for each step:
1. get data (e.g. Dec-jan-feb, only januar
On 09/29/2011 10:22 AM, lina wrote:
Hi,
I want to read a bunch of *.doc file in present working directory,
how can I use for to read one by one and do further work,
sorry,
what's the best reference webpage I can use?
I googled, lots of distracting info, and I barely can understand how they
t
(Please don't top-post. Put your remarks AFTER the part you're quoting
from the previous message)
On 09/29/2011 10:55 AM, lina wrote:
import os.path
tokens=['E']
result=[]
for fileName in os.listdir("."):
if os.path.isfile(fileName) and os.path.splitext(fileName)=="xpm":
fileda
(Please don't top-post. Place your remarks after whatever quoting you
do from the previous message. And trim the parts that are no longer
relevant)
On 09/30/2011 03:18 PM, ADRIAN KELLY wrote:
please guys
still stuck on this problem and i have been at it for hours so please if anyone
can hel
On 09/30/2011 03:24 PM, Cameron Macleod wrote:
Hi,
When you type
Input("\n\nPress The Enter Key To Exit")
it forces you to press the enter key to close the program. Why is it the
enter key instead of e.g. the 'esc' key?
The input() function (not the Input()) function accepts a line of text
On 10/01/2011 02:06 AM, R. Alan Monroe wrote:
I'm revisiting the fake defrag program I posted about a few months
ago. The concept is basically a screensaver or light show where you
can enjoy watching entropy being reversed as colored blocks order
themselves visually.
I set it aside for a while b
On 10/01/2011 11:53 AM, R. Alan Monroe wrote:
achieve the cosmetic randomness, until I realized the real problem is
magically determining the correct sequence in which to perform the
moves without ruining a future move inadverently.
If I move 0-to-1 first, I've now ruined the future 1-to-22 whic
On 10/04/2011 12:01 PM, bob gailer wrote:
On 10/4/2011 10:07 AM, lina wrote:
want to do a statistic of the concurrence of E,
namely,
how many times the E showed up,
so the first column is 1, second column and then following.
Thanks,
I have one, which showed something like
On 10/04/2011 10:26 AM, lina wrote:
On Thu, Sep 29, 2011 at 11:28 PM, Dave Angel wrote:
(Please don't top-post. Put your remarks AFTER the part you're quoting
from the previous message)
On 09/29/2011 10:55 AM, lina wrote:
import os.path
tokens=['E']
result=[]
for fi
On 10/04/2011 01:09 PM, lina wrote:
But I still don't know how to get the
statistic result of each column,
Thanks for further suggestions,
Best regards,
lina
As I said before, your current code counts across a line at a time,
while you need to count vertically. That could be done by transpo
On 10/04/2011 10:22 PM, lina wrote:
On Wed, Oct 5, 2011 at 1:30 AM, Prasad, Ramitwrote:
But I still don't know how to get the
statistic result of each column,
Thanks.
try:
cols = len( text[0] ) # Find out how many columns there are (assuming
each row has the same number of columns)
except
On 10/04/2011 11:13 PM, lina wrote:
On Wed, Oct 5, 2011 at 10:45 AM, Dave Angel wrote:
On 10/04/2011 10:22 PM, lina wrote:
On Wed, Oct 5, 2011 at 1:30 AM, Prasad,
Ramit
w
SyntaxError: invalid syntax
for fileName in os.listdir("."):
if os.path.isfile(fileName) and os.pat
On 10/01/2011 03:53 PM, R. Alan Monroe wrote:
You missed the rest of the paragraph. Don't wait for the sort to
finish, you do the swapping in the compare function.
Either I'm too dumb to understand your answer, or explained my
original problem too poorly.
Have you ever played the Rush Hour
On 10/05/2011 02:51 AM, lina wrote:
On Wed, Oct 5, 2011 at 1:42 PM, Dave Angel wrote:
On 10/04/2011 11:13 PM, lina wrote:
On Wed, Oct 5, 2011 at 10:45 AM, Dave Angel wrote:
On 10/04/2011 10:22 PM, lina wrote:
On Wed, Oct 5, 2011 at 1:30 AM, Prasad, Ramit
*com
w
SyntaxError
On 10/05/2011 07:58 AM, R. Alan Monroe wrote:
Since all the moves are swaps, it'll be guaranteed to be in a sequence
that converges on the correct final order. Will it be the minimum
number of moves? Definitely not. But that wasn't a requirement, and if
it were, you wouldn't start by building t
On 10/05/2011 08:46 AM, lina wrote:
On Wed, Oct 5, 2011 at 8:21 PM, Dave Angel wrote:
#these two are capitalized because they're intended to be constant
TOKENS = "BE"
LINESTOSKIP = 43
INFILEEXT = ".xpm"
OUTFILEEXT = ".txt"
def dofiles(topdirect
On 10/06/2011 12:21 PM, lina wrote:
As for splitting into functions, consider:
#these two are capitalized because they're intended to be constant
TOKENS = "BE"
LINESTOSKIP = 43
INFILEEXT = ".xpm"
OUTFILEEXT = ".txt"
def dofiles(topdirectory):
for filename in os.listdr(topdirectory):
On 10/07/2011 04:08 AM, lina wrote:
I thought it might be some loop reason made it double output the results, so
I made an adjustation in indent, now it showed:
$ python3 counter-vertically-v2.py
{'B': [0, 0, 0, 0, 0, 0], 'E': [1, 0, 1, 0, 1, 0]}
{'B': [0, 0, 0, 0, 0, 0], 'E': [1, 0, 1, 0, 1, 0]
On 10/07/2011 06:06 AM, Alan Gauld wrote:
On 07/10/11 09:08, lina wrote:
summary=[]
for a,b in zip(results['E'],results['B']):
summary.append(a+b)
I don't know why this gives a key error on 'E' (which basically means
that there is no key 'E') since the code above should gu
On 10/08/2011 03:03 PM, Christopher King wrote:
Okay, here's what I what to do
*--Target.py--*
print "Hello World"
*--Target.py Output--*
*Hello World*
*--Main.py--*
target=open("target.py", "r")
old=target.read()
target.close()
target=open("target.py", "w")
target.write('''
Str.__repr__ = Str.__
On 10/09/2011 11:27 AM, Christopher King wrote:
I know the method of finding every string, and inserting a swapcase in to
the code. Does anyone now a way just to insert code at the top though?
P.S. I use python 2.*
Would you consider answering the rest of my questions? Since this is
obviousl
On 10/10/2011 08:56 PM, Christopher King wrote:
Okay, there is a python file called target.py. In the same directory there
is a file named main.py. You are the author of main.py. The code in main.py
will write to target.py. Then the antivirus catches main.py and removes, but
not the modification
On 10/12/2011 09:57 AM, lina wrote:
I do have problems to write each blocks (differentiated by chainID) back
one by one, but this will leave it at the end. at present I still have
following problems
Q1: why the D E F G H I stopped being processed.
In what sense do you mean stopped? There are
On 10/12/2011 03:59 PM, Anna Olofsson wrote:
(PLEASE don't top-post. And don't start multiple similar threads a
couple of hours apart. Send your message as text without tons of blank
lines, and don't assume the attachments will make it. In my case, I
haven't a clue to what the file looks li
On 10/13/2011 09:09 AM, lina wrote:
I think your final version of sortfile() might look something like:
def sortfile(infilename=**INFILENAME, outfilename=OUTFILENAME):
infile = open(infilename, "r")
intext = infile.readlines()
outfile = open(OUTFILENAME, "w")
for chainid in CH
On 10/13/2011 10:44 AM, Praveen Singh wrote:
2.
a='microsoft'
set(a)
set(['c', 'f', 'i', 'm', 'o', 's', 'r', 't'])
print ''.join(set(a))
cfimosrt
When i print "Hello", i get the output as "helo"(in same sequence) but when
i write "microsoft" i get this-"cfimosrt". So, it means i can't pred
On 10/14/2011 10:17 AM, Rafael Durán Castañeda wrote:
2011/10/14 Max S.
I have seen classes created with 'class Class_Name:' and 'class
Class_Name(object):'. I'm using the latter, just in case it has some sort
of method that could be useful that I don't know about, but *are *there
any methods
On 10/17/2011 11:55 AM, Sagar Shankar wrote:
The "real" value of 4/3.0 is 1 followed by an unending number of 3's.
Each successive fraction's floating point value will be "off" by some
relatively small value. Those errors will probably add up.
Another limitation of floating point numbers is
On 10/18/2011 01:59 PM, Navneet wrote:
Hi,
I am trying to search a list for prime numbers but it's throwing me an
error at line no.25.
I am not able to figure what exactly is the prob
ne help ??? Error is this:
$ python "prime1 - Copy.py"
Unhandled exception in thread started by
Traceback (mos
On 10/22/2011 06:10 PM, Chris Kavanagh wrote:
Hello, First, thank you for providing this GREAT service, & THANKS to
everyone who contributes. It's greatly appreciated. . .I'm new to
Python (2.7, Win XP) & new to programming in general. I have been
studying on my own for about a month now. I bel
: Sun, 23 Oct 2011 16:53:40 -0400
From: Chris Kavanagh
Organization: Home Office
To: d...@davea.name
On 10/22/2011 6:59 PM, Dave Angel wrote:
My question is regarding the tell methods in the subclasses,the code
{SchoolMember.tell(self)}, in the class Teacher & Student. I just
don't u
On 10/23/2011 08:01 AM, lina wrote:
On Sun, Oct 23, 2011 at 6:06 PM, Peter Otten<__pete...@web.de> wrote:
lina wrote:
tobetranslatedparts=line.strip().split()
strip() is superfluous here, split() will take care of the stripping:
" alpha \tbeta\n".split()
['alpha', 'beta']
for residue in
On 10/24/2011 09:10 AM, Praveen Singh wrote:
In Dictionary-
How to print corresponding keys if the values of dictionary is given??
-d={'a':1,'b':2,'c':3}
-i can print the corresponding values by using get() method-
- d.get('a')
-1
What if i have to print reverse???
A dictionary can be viewed
(You forgot to include the list on your reply. Easiest way is to do a
reply-all when you're replying)
On 10/24/2011 12:21 PM, Praveen Singh wrote:
On Mon, Oct 24, 2011 at 9:18 AM, Dave Angel wrote:
def getkey(dictionary, value):
for key, val in dictionary.items():
On 10/24/2011 02:04 PM, Johan Martinez wrote:
Hi,
I am struggling to understand Python string immutability. I am able to
modify Python string object after initializing/assigning it a value. So how
does immutability work? I am not following it. Sorry for really stupid
question. Any help?
You're c
after initializing/assigning it a value.
s = "First"
print s.__class__
print s
First
s = "Second"
print s
Second
Dave, Sander and Wayne have already explained why you aren't modifying
string objects in your example.
With the id()-function you can also see
On 10/25/2011 12:20 AM, Chris Kavanagh wrote:
On 10/24/2011 12:06 AM, Marc Tompkins wrote:
On Sun, Oct 23, 2011 at 8:08 PM, Chris Kavanagh
My problem was, I wasn't seeing {member} as referring to the class
objects {t} and {s}. Since it was, we now can use member just like any
class object
(Once again, please don't top-post. It makes your responses out of order)
On 10/25/2011 04:24 AM, apometron wrote:
I did it very much times, Anssi.
Beyond of run it on Python 2.7 latest build, what do you suggest?
Do install Python 3.2 along the Python 2.7 installation could give me
any prob
On 10/28/2011 01:38 AM, Praveen Singh wrote:
splitWord('google', 2)
['go', 'og', 'le']
>>> splitWord('google', 3)
['goo', 'gle']
>>> splitWord('apple', 1)
['a', 'p', 'p', 'l', 'e']
>>> splitWord('apple', 4)
['appl', 'e']
def splitWord(word, number):
On 10/31/2011 06:09 PM, Alan Gauld wrote:
On 31/10/11 20:55, Steven D'Aprano wrote:
You may prefer to change to individual emails instead of digest mode. In
my opinion, digest mode is only useful when you want to read other
people's comments without commenting yourself.
It depends, I've used
(Pleas put your reply after the part you're quoting. What you did is
called top-posting, and makes reading the messages very confusing)
On 11/01/2011 12:10 AM, Chris Kavanagh wrote:
I'm going to thank Steven once again, and answer my own question in
the 2nd paragraph directly below (Steven hasn
On 11/01/2011 10:05 AM, Hugo Arts wrote:
On Tue, Nov 1, 2011 at 2:48 PM, Jefferson Ragot wrote:
In a Vista command prompt if I typed this:
>>> python somescript.py filename
Will sys.argv[1] return a valid path or just the filename?
If it just returns the filename, is there a simpl
On 11/01/2011 10:19 AM, Jose Amoreira wrote:
HiOn Tuesday, November 01, 2011 01:55:18 PM Joel Goldstick wrote:
On Tue, Nov 1, 2011 at 9:48 AM, Jefferson Ragot wrote:
In a Vista command prompt if I typed this:
>>> python somescript.py filename
Will sys.argv[1] return a valid path o
On 11/01/2011 10:11 AM, lina wrote:
Hi,
The following code (luckily) partial achieved what I wanted, but I
still have few questions:
#!/usr/bin/python3
import os.path
INFILEEXT=".txt"
OUTFILEEXT=".new"
DICTIONARYFILE="dictionary.pdb"
orig_dictionary={}
new_dictionary={}
abetaABresidues={}
d
On 11/01/2011 11:11 AM, lina wrote:
On Tue, Nov 1, 2011 at 10:33 PM, Dave Angel wrote:
On 11/01/2011 10:11 AM, lina wrote:
Hi,
The following code (luckily) partial achieved what I wanted, but I
still have few questions:
#!/usr/bin/python3
import os.path
INFILEEXT=".txt"
OUTFIL
On 11/01/2011 11:11 AM, lina wrote:
On Tue, Nov 1, 2011 at 10:33 PM, Dave Angel wrote:
On 11/01/2011 10:11 AM, lina wrote:
Hi,
The following code (luckily) partial achieved what I wanted, but I
still have few questions:
#!/usr/bin/python3
import os.path
INFILEEXT=".txt"
OUTFIL
On 11/02/2011 11:54 AM, lina wrote:
Regard the sorted(),
I still have a question,
how to sort something like
results
['1A', '10B', '2C', '3D']
sorted(results)
['10B', '1A', '2C', '3D']
as [ '1A', '2C', '3D','10B']
Thanks,
mainly based on their digital value.
Peter answered essential
(You mistakenly top-posted, so now in order to keep this next message in
order, I have to delete the out of order history)
On 11/03/2011 09:01 AM, Chris Hare wrote:
Thanks for the advice. When I do that, I get this error
Exception in Tkinter callback
Traceback (most recent call last):
File
On 11/03/2011 12:30 PM, lina wrote:
Hi,
['1AB','57GL', '76LE']
How can I extract 1, 57 , 76 out?
except the one I tried as:
for i in range(len(a)):
print(a[i][:-2])
1
57
76
are there some way to tell the difference between the [0-9] and [A-Z],
In the last thread, somebod
On 11/03/2011 12:37 PM, lina wrote:
I have another question, regarding the generator,
def translate_process(dictionary,tobetranslatedfile):
results=[]
with open(tobetranslatedfile,"r") as f:
results=(dictionary[line.split()[2]] for line in f)
print(list(results))
On 11/03/2011 10:39 PM, lina wrote:
On Wed, Nov 2, 2011 at 12:14 AM, Peter Otten<__pete...@web.de> wrote:
lina wrote:
items
[('83ILE', 1), ('84ALA', 2), ('8SER', 0), ('9GLY', 0)]
parts = re.split(r"(\d+)",items)
Traceback (most recent call last):
File "", line 1, in
parts = re.s
On 11/04/2011 07:00 PM, Steven D'Aprano wrote:
Dinara Vakhitova wrote:
Hello,
I need to find the words in a corpus, which letters are in the
alphabetical
order ("almost", "my" etc.)
Quoting Jamie Zawinski:
Some people, when confronted with a problem, think "I know, I'll
use regular
On 11/05/2011 03:04 PM, Mayo Adams wrote:
Code to build a list z to contain all the first words in each line of a
text file:
z=[]
f=open('C:/atextfile.txt')
for aLine in f:
str=aLine
a=str.split()
z.append(a)
I would like to work further with the list z once the file has been
stripped, an
On 11/05/2011 03:31 PM, Mayo Adams wrote:
Thank you for your reply, this is all I needed to know:
the loop is over when you outdent back to line up with the for statement
Indeed, the indentation rules are very simple. I just wanted to be sure
about what they were.
Sounds good. Three
On 11/05/2011 08:57 PM, Nathaniel Trujillo wrote:
I recently subscribed to tutor and I am trying to visit the subscribers
list so I can ask a question but I was'nt given an admin address. Not only
that but I don't know what an admin address is. Your help is greatly
appreciated.
You've figured o
On 11/05/2011 10:02 PM, Nathaniel Trujillo wrote:
Hello. I am currently working with Python version 3.1.1 . I am working out
of the book called Python Programming for the Absolute Beginner Third
Edition which teaches version 3.1.1 . I wrote the following blackjack
program that is on page 275 and
On 11/06/2011 04:45 AM, Sarma Tangirala wrote:
On 6 November 2011 13:11, Peter Otten<__pete...@web.de> wrote:
Joe Batt wrote:
I am learning Python 3 and programming and am very new so please bear
for item in items:
... print(item, end="WHATEVER")
Another way of writing the above.
On 11/06/2011 05:23 AM, Sarma Tangirala wrote:
python 3
.
Please bear with me on this, but does the following not print "end" for
every iteration of "items"?
for item in items:
print(item, end="")
Sure it does. And the value of end is the empty string. So it prints
nothing but th
On 11/06/2011 05:23 AM, Sarma Tangirala wrote:
I just joined the list and did
WELCOME to the list. I should have said that first.
--
DaveA
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.pyth
On 11/07/2011 09:45 PM, Jose Amoreira wrote:
Hello!
Is there any way to configure tkFileDialogs so that they don't display hidden
files?
Thanks.
Ze Amoreira
I can't help you with tk, but maybe I can help you ask a better question.
"Hidden files" means a different thing on various operating sys
On 11/08/2011 11:56 AM, Cranky Frankie wrote:
How do you tell how many splits the string split funtion returns? For example:
field = 'The Good Wife ;' # a string separated by spaces
new_list = field.split(' ') # create a list of space delimited elements
print (new_list[0])
On 11/10/2011 03:54 PM, Cranky Frankie wrote:
What is the easiest way in Python 3.x to write output positionally?
For example I have one literal I want in column 1, the next one in
column 40, the third one in column 50. I've tried usings tabs and I'm
not getting what I want. Is it something to do
On 11/10/2011 08:01 PM, Nathaniel Trujillo wrote:
Okay, I typed into the command line of version 2.7.2, python -c "import
sys; print sys.version". I tried it with and without the quotes. I tried
copying the error messages from the command line but it wouldn't let me so
I copied them from the pyth
On 11/12/2011 03:54 AM, lina wrote:
The one I tried :
if longest>= 2:
sublist=L1[x_longest-longest:x_longest]
result=result.append(sublist)
if sublist not in sublists:
sublists.append(sublis
On 11/12/2011 09:48 AM, lina wrote:
On Sat, Nov 12, 2011 at 9:22 PM, Dave Angel wrote:
On 11/12/2011 03:54 AM, lina wrote:
The one I tried :
if longest>= 2:
sublist=L1[x_longest-longest:x_longest]
result=result.append(subl
On 11/13/2011 08:06 AM, lina wrote:
Finally, if I am not wrong again, I feel I am kinda of starting
figuring out what's going on. Why it's None.
The main mistake here I use result = result.append(something)
the "="
I checked the print(id(result)) and print(id(result.append()),
For the NoneTyp
On 11/15/2011 10:47 AM, Wayne Watson wrote:
> Highlight the line for ".py". Click the button (yes, the one that says
"Change
> program..."). You'll
Yes, did that.
> get another dialog box, and in that one there will be a button labeled
> "Browse". Click it. This will open up an "Open with.
Top-posting is what I'm doing here. Putting my remarks BEFORE the
part I'm quoting.
On 11/16/2011 12:44 PM, Mic wrote:
Oh, by top-posting you mean that I include everything I have written before in
my post, and that it is no good to do?
So I just post what I wrote, and nothing from earli
(You're top-posting. Put your remarks AFTER what you're quoting)
On 11/16/2011 12:52 PM, Jack Keegan wrote:
Ok, I thought that processes would do the same job as threads. So would the
general rule be some thing like so:
If I want another piece of work to run (theoretically) along side my main
On 11/17/2011 12:54 PM, Nidian Job-Smith wrote:
Sorry about the code format in last E-mail. I'll attach the code in notepad, as
my e-mail doesnt seem to like sending plain text..
But attachments aren't visible to everyone on the list, and even when
they are, some people are (rightfully) parano
On 11/17/2011 01:47 PM, ADRIAN KELLY wrote:
hi all,keep getting the above error, can't understand or fix it, can anyone
help.
def exchange():euro=1dollar=1.35base=50amount = input ('how much
do you want to change')if amount>base:totalreturn=amount*dollar
else:
On 11/18/2011 10:29 AM, John wrote:
Hi all,
When i run a doctest on this piece of code (shown at bottom) i get
this error message [from the doctest]:
Trying:
rot13('5 The Parade')
Expecting:
'5 Gur Cnenqr'
**
File "
On 11/17/2011 04:29 PM, ADRIAN KELLY wrote:
#i am nearly there guys..please loop at the infinite loop i am getting
here..PLEASE!!#ADRIAN
def exchange(cash_in):euro=1dollar=float(1.35)base=50if
cash_in>base:totalreturn=cash_in*dollarelse:
On 11/17/2011 10:56 PM, Nidian Job-Smith wrote:
Date: Thu, 17 Nov 2011 22:49:33 -0500
From: d...@davea.name
To: nidia...@hotmail.com
CC: tutor@python.org
Subject: Re: [Tutor] Doctest error!
On 11/18/2011 10:29 AM, John wrote:
Hi all,
When i run a doct
On 11/18/2011 04:01 AM, Alan Gauld wrote:
On 18/11/11 08:16, Mic wrote:
What if I don’t write the same line of code more than once, but I write
similiar lines more than once. Is that okay? Ler
For example:
value="green”
value_1=”green”
If you had a lot of these you could shorten it with a loo
On 11/18/2011 08:16 AM, Kĩnũthia Mũchane wrote:
Hi,
I am trying to do something which is really stupid :-)
I would like to count the number of occurrences of a certain character
in a list.
This is more of an exercise in recursion rather than the underlying
problem.
I could have used a *for* l
On 11/18/2011 11:12 AM, Joe Batt wrote:
Hi All,Sorry to trouble you all again with more nooby problems! Only been
programming a week so still all a haze especially since self taught…..
I am opening a url and saving it to a file on my computer, then I am trying to
pickle it. I have written the u
] == val:
return 1 + counter(mylist[1:], val)
else:
return counter(mylist[1:])
The intermediate variable explanation by Dave actually clinched it for
me. Actually, the one I wrote is suspiciously similar to yours ;-).
Anyway, thanks Asokan!
FWIW, Asokan's code
nd text, I split the HTML and print text and I get loads of
\x00T\x00r\x00i\x00a\x00 ie I get \x00 breaking up every character.
Any idea what is happening and how to get back to a list of ascii strings ?
Cheers
Dave
--
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.o
801 - 900 of 2089 matches
Mail list logo