Re: [Tutor] ImportError: No module named connect

2015-11-03 Thread Tommy Peterson
As I typed this out I double checked something. I resolved my own problem. Should have stepped back before posting. It is import mysql.connector not import mysql.connection From: stpete...@hotmail.com To: tutor@python.org Subject: ImportError: No module named connect Date: Tue, 3 Nov 2015 12:

[Tutor] ImportError: No module named connect

2015-11-03 Thread Tommy Peterson
I have been trying to install the MySQL Connect module for a day and a half. First I got an error saying that "No module named mysql" was installed. After a lot of trial and error I got passed that. I realized that because I have python installed in /usr/local that I needed to build and then in

Re: [Tutor] Programming Collective Intelligence Study Group (Mark Lybrand)

2011-11-29 Thread tommy
deeper into via a collective group. >> >> This is the first I've heard of this, Im not sure if you've posted before >> but which book are you using? >> >> /Regards >> Tommy >> On Tue, 29 Nov 2011 10:18:25 +0100, tutor-requ...@python.org wrote: >&g

Re: [Tutor] Programming Collective Intelligence Study Group (Mark Lybrand)

2011-11-29 Thread tommy
h book are you using? /Regards Tommy On Tue, 29 Nov 2011 10:18:25 +0100, tutor-requ...@python.org wrote: > Send Tutor mailing list submissions to > tutor@python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/tuto

Re: [Tutor] where to look for python codes

2011-09-29 Thread Tommy Kaas
resource > for that kind of thing. Uselesspython is down, but you can reach a lot of the stuff through archive.org: http://web.archive.org/web/20080719092030/http://www.uselesspython.com/ Tommy > ___ > Tutor maillist - Tutor@python.org > To

[Tutor] Building games

2011-06-11 Thread Tommy Bell
ut outside of simply taking apart an existing game and looking at how they did it, are there any ressources to help me learn? I apologize if this is not the correct place to ask for this. Regards Tommy ___ Tutor maillist - Tutor@python.org To u

Re: [Tutor] search-replace

2011-06-06 Thread Tommy Kaas
> -Oprindelig meddelelse- > Fra: tutor-bounces+tommy.kaas=kaasogmulvad...@python.org > [mailto:tutor-bounces+tommy.kaas=kaasogmulvad...@python.org] På vegne > af Alan Gauld > Sendt: 6. juni 2011 11:51 > Til: tutor@python.org > Emne: Re: [Tutor] search-replace >

[Tutor] search-replace

2011-06-06 Thread Tommy Kaas
step below. I'm using Python 2.6.6 on a windows pc. fin = open("dirtyfile.txt") fout = open("cleanfile.txt", "w") for line in fin: fout.write(line.replace('## ', '#')) fin.close() fout.close() Thanks, Tommy ___

Re: [Tutor] folder and file list

2011-05-10 Thread Tommy Bell
uliarities such as the one Brett Ritter pointed. On Tue, May 10, 2011 at 8:45 AM, Brett Ritter <mailto:swift...@swiftone.org>> wrote: On Tue, May 10, 2011 at 8:17 AM, Tommy Bell mailto:to...@enkelthed.dk>> wrote: > scandir('c:\tmp') > this doesnt work

[Tutor] folder and file list

2011-05-10 Thread Tommy Bell
ake it print like so folder: file1 file2 folder2 folder2.1 file1 file2 etc. Any ideas? I dont mind reading if i could justbe pointed in the right direction Regards Tommy ___ Tutor maillist - Tutor@python.org To u

Re: [Tutor] Write new line(enter) in txt

2011-03-28 Thread Tommy Kaas
e: log.write('No existe el archivo ' +dbf+"\n") log.close() Try: ”\r\n” Tommy ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo

Re: [Tutor] Need Help in installing MySQLdb-Python

2011-02-01 Thread Tommy Kaas
onlibs/ Tommy ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] no luck with sqlinsert

2011-01-15 Thread Tommy Kaas
> >I get a invalid syntax error when I try to run this script - and it's > > con.commit() which is highlighted when I get the error. > > Aren't you one closing parenthesis short? > > Alan Gauld Yes, you're absolutely right. Thanks. Tommy __

[Tutor] no luck with sqlinsert

2011-01-14 Thread Tommy Kaas
int(cols[2]), int(cols[3]), int(cols[4]), int(cols[5]), int(cols[6]), int(cols[7])) con.commit() except: con.rollback() con.close() Tommy Kaas ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how avoid writing a newline?

2011-01-12 Thread Tommy Kaas
Yes – you’re right! Thanks, Tommy Fra: Jason Staudenmayer [mailto:jas...@adventureaquarium.com] Sendt: 12. januar 2011 16:50 Til: Tommy Kaas; tutor@python.org Emne: RE: [Tutor] how avoid writing a newline? You should have a comma after the "#" in the highlighted print state

[Tutor] how avoid writing a newline?

2011-01-12 Thread Tommy Kaas
an I avoid that in a simple way? Thanks in advance for any help Tommy from BeautifulSoup import BeautifulSoup from mechanize import Browser f = open("forbes.txt", "w") br = Browser() url = "http://www.forbes.com/lists/2010/10/billionaires-2010_The-Worlds

Re: [Tutor] variabel from raw input into re.search?

2011-01-07 Thread Tommy Kaas
.*'.format(name) '.*Sir Arthur.*' >>> '.*{name}.*'.format(name=name) '.*Sir Arthur.*' The last two examples are different ways to accomplish the same thing. HTH, Wayne Thanks for the suggestion. Very useful. Tommy

[Tutor] variabel from raw input into re.search?

2011-01-07 Thread Tommy Kaas
#x27;m using Python 2.6.6. TIA Tommy import re name = raw_input('Who would you like to check'? ') mytxt = open("text.txt", "r") antal = [] for line in mytxt: if re.search("(.*)name(.*)", line): antal.append(line)

[Tutor] more scraping and saving

2011-01-03 Thread Tommy Kaas
0'}): tds = row('td') output = ";".join(tds[i].string for i in (0, 1, 2, 3, 4)) f.write(output + '\n') f.close() Tommy Kaas Kaas & Mulvad Lykkesholms Alle 2A, 3. 1902 Frederiksberg C Mobil: 27268818 Mail: <

[Tutor] scraping and saving in file SOLVED

2010-12-29 Thread Tommy Kaas
With Stevens help about writing and Peters help about import codecs - and when I used \r\n instead of \r to give me new lines everything worked. I just thought that \n would be necessary? Thanks. Tommy > -Oprindelig meddelelse- > Fra: tutor-bounces+tommy.kaas=kaasogmulvad...@pyth

Re: [Tutor] scraping and saving in file

2010-12-29 Thread Tommy Kaas
ot;, line 36, in f.write(output + '\n') # don't forget the newline after each row UnicodeEncodeError: 'ascii' codec can't encode character u'\xf8' in position 5: ordinal not in range(128) I have tried to add # -*- coding: utf-8 -*- to the top of the

[Tutor] scraping and saving in file

2010-12-29 Thread Tommy Kaas
Kommunenr # Kommune # Region # Regionsnr 101 # København # Hovedstaden # 1084 147 # Frederiksberg # Hovedstaden # 1084 151 # Ballerup # Hovedstaden # 1084 153 # Brøndby # Hovedstaden # 1084 155 # Dragør # Hovedstaden # 1084 Thanks in advance Tommy Kaas Kaas & Mulvad

Re: [Tutor] Newbie question - syntax - BeautifulSoup

2010-07-29 Thread Tommy Kaas
Thanks for the explanation. It's clearer now. Tommy "Tommy Kaas" wrote > > > for row in soup('table', {'class' : 'spad'})[0].tbody('tr'): > > > >Do you understand the syntax from a Python point of view? > > No.

Re: [Tutor] Newbie question - syntax - BeautifulSoup

2010-07-28 Thread Tommy Kaas
-Oprindelig meddelelse- Fra: tutor-bounces+tommy.kaas=kaasogmulvad...@python.org [mailto:tutor-bounces+tommy.kaas=kaasogmulvad...@python.org] På vegne af Alan Gauld Sendt: 28. juli 2010 20:00 Til: tutor@python.org Emne: Re: [Tutor] Newbie question - syntax - BeautifulSoup "Tommy

[Tutor] Newbie question - syntax - BeautifulSoup

2010-07-28 Thread Tommy Kaas
n't understand how I am supposed to the fourth line - after "for row in soup". I can clearly see it defines the area I want to scrape, but how is the syntax build? And almost as important - where should I have found that information myself? I have tried to read the help-file of Bea