Newbie to python. Very newbie question

2013-04-07 Thread ReviewBoard User
Hi I am a newbie to python and am trying to write a program that does a sum of squares of numbers whose squares are odd. For example, for x from 1 to 100, it generates 165 as an output (sum of 1,9,25,49,81) Here is the code I have print reduce(lambda x, y: x+y, filter(lambda x: x%2, map(lambda x

Re: Newbie to python. Very newbie question

2013-04-07 Thread Kruno Saho
On Sunday, April 7, 2013 9:16:27 PM UTC+10, ReviewBoard User wrote: Hi I am a newbie to python and am trying to write a program that does a sum of squares of numbers whose squares are odd. For example, for x from 1 to 100, it generates 165 as an output (sum of 1,9,25,49,81

Re: Newbie to python. Very newbie question

2013-04-07 Thread Dave Angel
On 04/07/2013 07:16 AM, ReviewBoard User wrote: Hi I am a newbie to python Then why are you trying to do 7 or 8 things on one line? and am trying to write a program that does a sum of squares of numbers whose squares are odd. For example, for x from 1 to 100, it generates 165 as an output

Re: Newbie to python. Very newbie question

2013-04-07 Thread Miki Tebeka
I am a newbie to python Welcome! I hope you'll do great things with Python. and am trying to write a program that does a sum of squares of numbers whose squares are odd. OK. For example, for x from 1 to 100, it generates 165 as an output (sum of 1,9,25,49,81) I don't follow, you seem

Re: Newbie to python. Very newbie question

2013-04-07 Thread rusi
On Apr 7, 4:16 pm, ReviewBoard User lalitha.viswan...@gmail.com wrote: Hi I am a newbie to python and am trying to write a program that does a sum of squares of numbers whose squares are odd. For example, for x from 1 to 100, it generates 165 as an output (sum of 1,9,25,49,81) Here

Re: Newbie to python. Very newbie question

2013-04-07 Thread Ian Foote
On 07/04/13 20:09, Dennis Lee Bieber wrote: On Sun, 7 Apr 2013 04:16:27 -0700 (PDT), ReviewBoard User lalitha.viswan...@gmail.com declaimed the following in gmane.comp.python.general: Hi I am a newbie to python and am trying to write a program that does a sum of squares of numbers whose

Re: Newbie to python. Very newbie question

2013-04-07 Thread Arnaud Delobelle
On 7 April 2013 20:23, Ian Foote i...@feete.org wrote: I'm surprised no one has suggested: import math sum( x*x for x in range(1, int(math.sqrt(100)), 2)) Yeah! And I'm surprised no one came up with: from itertools import count, takewhile sum(takewhile((100).__gt__, filter((2).__rmod__,

Re: Newbie to python. Very newbie question

2013-04-07 Thread Miki Tebeka
I can't even read that mess... three nested lambda? I have to say this and other answers in this thread seem not that friendly to me. The OP said it's a newbie question, we should be more welcoming to newcomers. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie to python. Very newbie question

2013-04-07 Thread Steven D'Aprano
On Sun, 07 Apr 2013 04:16:27 -0700, ReviewBoard User wrote: Hi I am a newbie to python and am trying to write a program that does a sum of squares of numbers whose squares are odd. For example, for x from 1 to 100, it generates 165 as an output (sum of 1,9,25,49,81) Here is the code I have

I am a newbie for python and try to understand class Inheritance.

2011-10-15 Thread aaabbb16
Test.py #!/usr/bin/python from my_lib import my_function class my_class(my_function.name): def __initial__(self, name); pass def test(): print this is a test If __name__ == '__maim__': my_class.main() --- my_lib.py class

Re: I am a newbie for python and try to understand class Inheritance.

2011-10-15 Thread Chris Rebert
On Fri, Oct 14, 2011 at 11:20 PM, aaabb...@hotmail.com wrote: Test.py #!/usr/bin/python from my_lib import my_function class my_class(my_function.name): Why are you subclassing my_function.name and not just my_function?    def __initial__(self, name);         pass The initializer method

Re: I am a newbie for python and try to understand class Inheritance.

2011-10-15 Thread Jason Swails
On Sat, Oct 15, 2011 at 2:20 AM, aaabb...@hotmail.com wrote: Test.py #!/usr/bin/python from my_lib import my_function class my_class(my_function.name): Classes must inherit from other classes -- not variables or functions. def __initial__(self, name); This should be def

Re: I am a newbie for python and try to understand class Inheritance.

2011-10-15 Thread Chris Rebert
On Sat, Oct 15, 2011 at 12:09 AM, Jason Swails jason.swa...@gmail.com wrote: snip For instance, let's say you want to deal with shapes.  You can define a shape via a class class Shape(object):    Base shape class snip Now we get into inheritance.  Let's suppose that we want a specific type

Re: I am a newbie for python and try to understand class Inheritance.

2011-10-15 Thread aaabbb16
On 10月15日, 上午12时04分, Chris Rebert c...@rebertia.com wrote: On Fri, Oct 14, 2011 at 11:20 PM,  aaabb...@hotmail.com wrote: Test.py #!/usr/bin/python from my_lib import test class my_class(my_function.name): Why are you subclassing my_function.name and not just my_function? try to inherit

Re: I am a newbie for python and try to understand class Inheritance.

2011-10-15 Thread Chris Rebert
On Sat, Oct 15, 2011 at 12:59 AM, aaabb...@hotmail.com wrote: On 10月15日, 上午12时04分, Chris Rebert c...@rebertia.com wrote: On Fri, Oct 14, 2011 at 11:20 PM,  aaabb...@hotmail.com wrote: snip    my_class.main() Your class doesn't define any method named main (you only defined test() and

Re: I am a newbie for python and try to understand class Inheritance.

2011-10-15 Thread DevPlayer
On Oct 15, 2:20 am, aaabb...@hotmail.com wrote: Test.py --- #!/usr/bin/python from my_lib import my_function class MyClass(my_function): # usually class names start capital We know you're not forgetting to document.     def __init__(self, name): super(MyClass,

newbie to python

2010-10-24 Thread Hrishikesh
I want to start python, I have just downloaded python compiler, Can somebody please tell me what python really is and explain its architecture, in what problems it is used and from where should I start? -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie to python

2010-10-24 Thread Chris Rebert
On Sun, Oct 24, 2010 at 12:29 AM, Hrishikesh hrishikesh...@gmail.com wrote: I want to start python, I have just downloaded python compiler, Most consider it an interpreter (though it does compile the source code into high-level bytecode). Can somebody please tell me what python really is A

Re: newbie to python

2010-10-24 Thread Arnaud Delobelle
Hrishikesh hrishikesh...@gmail.com writes: I want to start python, I have just downloaded python compiler, Can somebody please tell me what python really is and explain its architecture, in what problems it is used and from where should I start? I would start by looking at

Re: newbie to python

2010-10-24 Thread Hrishikesh
On Oct 24, 12:48 am, Arnaud Delobelle arno...@gmail.com wrote: Hrishikesh hrishikesh...@gmail.com writes: I want to start python, I have just downloaded python compiler, Can somebody please tell me what python really is and explain its architecture, in what problems it is used and from

Re: newbie to python

2010-10-24 Thread Arnaud Delobelle
Hrishikesh hrishikesh...@gmail.com writes: Thanks guys, I knew its an interpreter, mistakenly put compiler [...] Oops! You just started a flame war ;) -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie to python

2010-10-24 Thread Steve Holden
On 10/24/2010 3:29 AM, Hrishikesh wrote: I want to start python, I have just downloaded python compiler, Can somebody please tell me what python really is and explain its architecture, in what problems it is used and from where should I start? If you don't know the answers to *any* of those

Re: newbie to python

2010-10-24 Thread rantingrick
On Oct 24, 7:31 am, Steve Holden st...@holdenweb.com wrote: On 10/24/2010 3:29 AM, Hrishikesh wrote: I want to start python, I have just downloaded python compiler, Can somebody please tell me what python really is and explain its architecture, in what problems it is used and from where

Re: newbie to python

2010-10-24 Thread Steve Holden
On 10/24/2010 5:19 PM, rantingrick wrote: On Oct 24, 7:31 am, Steve Holden st...@holdenweb.com wrote: On 10/24/2010 3:29 AM, Hrishikesh wrote: I want to start python, I have just downloaded python compiler, Can somebody please tell me what python really is and explain its architecture, in

Re: Newbie question: python versions differ per user?

2010-03-09 Thread BobAalsma
On Mar 8, 8:15 pm, BobAalsma bob.aal...@aalsmacons.nl wrote: I'm on Mac OS X 10.5.8 and downloaded 2.6.4 Mac Installer Disk Image as/in(?) the sys admin user. For this user Pyhton 2.6.4 is now the current version. I want to use Python outside the sys asdmin user. However, all other users

Newbie question: python versions differ per user?

2010-03-08 Thread BobAalsma
I'm on Mac OS X 10.5.8 and downloaded 2.6.4 Mac Installer Disk Image as/in(?) the sys admin user. For this user Pyhton 2.6.4 is now the current version. I want to use Python outside the sys asdmin user. However, all other users still use Python 2.5.1 (Apple delivered). The sys admin user looks in

Newbie In Python

2008-05-20 Thread andrew . smith . cpp
I have Heard About Python its a OOD Language. i have to Learn it where from i should start it. i have python compiler at linux Platform. anyone can suggest me about it. Thanks In advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie In Python

2008-05-20 Thread Thomas Troeger
[EMAIL PROTECTED] wrote: I have Heard About Python its a OOD Language. i have to Learn it where from i should start it. i have python compiler at linux Platform. anyone can suggest me about it. Thanks In advance. How about http://docs.python.org/tut/tut.html? --

Re: Newbie In Python

2008-05-20 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : I have Heard About Python its a OOD Language. 'OOD' = 'object oriented ???' ? i have to Learn it where from i should start it. Err... What about reading the docs on python.org - possibly starting with the tutorial: http://docs.python.org/tut/tut.html You'll

RE: Newbie In Python

2008-05-20 Thread Sells, Fred
: Re: Newbie In Python [EMAIL PROTECTED] a écrit : I have Heard About Python its a OOD Language. 'OOD' = 'object oriented ???' ? i have to Learn it where from i should start it. Err... What about reading the docs on python.org - possibly starting with the tutorial: http

Re: Newbie In Python

2008-05-20 Thread zerge69
On May 20, 5:15 am, [EMAIL PROTECTED] wrote: I have Heard About Python its a OOD Language. i have to Learn it where from i should start it. i have python compiler at linux Platform. anyone can suggest me about it. Thanks In advance. I recommend Pyscripter

Re: Newbie to python --- why should i learn !

2008-05-10 Thread Aahz
In article [EMAIL PROTECTED], Gary Herron [EMAIL PROTECTED] wrote: With Python, you can program with a smile on your face. +1 QOTW (Truly, when I found Python, programming became fun again.) Again? Looking back over the years, after I learned Python I realized that I never really had

Re: Newbie to python --- why should i learn !

2008-05-09 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Hi, i was reading/learning some hello world program in python. I think its very simillar to Java/C++/C#. Err... You saw a Python helloworld and a Java helloworld and you found them very similar ??? What's different (except syntax) ? dynamism (and not only

Re: Newbie to python --- why should i learn !

2008-05-09 Thread Bruno Desthuilliers
pistacchio a écrit : (snip) Technically speaking, it (Python) is not, for example, strongly typed, You're confusing strong typing with static typing. Somewhat orthogonal issues. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie to python --- why should i learn !

2008-05-09 Thread hdante
On May 8, 7:25 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, i was reading/learning some hello world program in python. I think its very simillar to Java/C++/C#. What's different (except syntax) ? All the languages have similar power, in a theoretical sense. If you can solve a problem

Re: Newbie to python --- why should i learn !

2008-05-09 Thread Marcelo de Moraes Serpa
I sincerely think that most languages in existence today have its place. Java has some great libraries and programs that were written in it. Try writing an Eclipse clone in Python, I don't think it would go well. On Fri, May 9, 2008 at 11:08 AM, hdante [EMAIL PROTECTED] wrote: On May 8, 7:25

RE: Newbie to python --- why should i learn !

2008-05-09 Thread Sells, Fred
write working programs -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: Thursday, May 08, 2008 6:25 AM To: python-list@python.org Subject: Newbie to python --- why should i learn ! Hi, i was reading/learning some hello

Books for a new generation of Pythoneers (was: Newbie to python --- why should i learn !)

2008-05-09 Thread Cameron Laird
In article [EMAIL PROTECTED], maxinbjohn [EMAIL PROTECTED] wrote: Hi Raxit, One of the the tempting features of Python is that it is fun to code in Python. If you are really trying to learn python, you should read Adventures with Neko (http://gnuvision.com/books/pybook/) . It is an introductory

Re: Newbie to python --- why should i learn !

2008-05-08 Thread A.T.Hofkamp
On 2008-05-08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, i was reading/learning some hello world program in python. I think its very simillar to Java/C++/C#. What's different (except syntax) ? Yes, and all programs that people write typically look like the hello world program. Look at

Re: Newbie to python --- why should i learn !

2008-05-08 Thread s0suk3
On May 8, 5:25 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, i was reading/learning some hello world program in python. I think its very simillar to Java/C++/C#. What's different (except syntax) ? what can i do easily with python which is not easy in c++/java !? Are you a newbie

Re: Newbie to python --- why should i learn !

2008-05-08 Thread pistacchio
[EMAIL PROTECTED] ha scritto: Hi, i was reading/learning some hello world program in python. I think its very simillar to Java/C++/C#. What's different (except syntax) ? well, it's similar in the sense that it is a programming language. So you can say that assembly is similar to BASIC, but

Re: Newbie to python --- why should i learn !

2008-05-08 Thread maxinbjohn
Hi Raxit, One of the the tempting features of Python is that it is fun to code in Python. If you are really trying to learn python, you should read Adventures with Neko (http://gnuvision.com/books/pybook/) . It is an introductory book on Python programming for school children by Mr. Pramode CE.

RE: Newbie to python --- why should i learn !

2008-05-08 Thread Mark Jordaan
pls dont learn it Move on The world is full enough of 9 to 5 coders Mark From: [EMAIL PROTECTED] Subject: Newbie to python --- why should i learn ! Date: Thu, 8 May 2008 03:25:17 -0700 To: python-list@python.org Hi, i was reading/learning some hello world program in python. I think its

Re: Newbie to python --- why should i learn !

2008-05-08 Thread cokofreedom
C# using System; namespace HelloWorld { Class HelloWorld { static void Main(String[] args) { Console.WriteLine(Hello World); } } } -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie to python --- why should i learn !

2008-05-08 Thread Krishnakant Mane
hello, I have programmed co insidentally in all the 3 languages. so out of my experience of 10 + years, I got my personal share of reasons to prefer python over the other 2 namely c++ and java. firstly as every one has already explained, python is easy, fun to learn and can do many things much

Re: Newbie to python --- why should i learn !

2008-05-08 Thread Eduardo O. Padoan
On Thu, May 8, 2008 at 7:25 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, i was reading/learning some hello world program in python. I think its very simillar to Java/C++/C#. What's different (except syntax) ? what can i do easily with python which is not easy in c++/java !?

Re: Newbie to python --- why should i learn !

2008-05-08 Thread Marc 'BlackJack' Rintsch
On Thu, 08 May 2008 04:17:01 -0700, s0suk3 wrote: Are you a newbie to Python, or to programming in general? I'll assume you are a newbie to programming in general because of that last question you asked. Things in Python are easier than in almost any other programming language. Here are three

Re: Newbie to python --- why should i learn !

2008-05-08 Thread pistacchio
Marc 'BlackJack' Rintsch ha scritto: On Thu, 08 May 2008 04:17:01 -0700, s0suk3 wrote: Are you a newbie to Python, or to programming in general? I'll assume you are a newbie to programming in general because of that last question you asked. Things in Python are easier than in almost any other

Re: Newbie to python --- why should i learn !

2008-05-08 Thread Marc 'BlackJack' Rintsch
On Thu, 08 May 2008 15:49:01 +0200, pistacchio wrote: Marc 'BlackJack' Rintsch ha scritto: On Thu, 08 May 2008 04:17:01 -0700, s0suk3 wrote: Are you a newbie to Python, or to programming in general? I'll assume you are a newbie to programming in general because of that last question you

Re: Newbie to python --- why should i learn !

2008-05-08 Thread Gary Herron
[EMAIL PROTECTED] wrote: Hi, i was reading/learning some hello world program in python. I think its very simillar to Java/C++/C#. What's different (except syntax) ? what can i do easily with python which is not easy in c++/java !? With Python, you can program with a smile on your face.

Re: Newbie to python --- why should i learn !

2008-05-08 Thread Benjamin Kaplan
On Thu, May 8, 2008 at 6:25 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, i was reading/learning some hello world program in python. I think its very simillar to Java/C++/C#. What's different (except syntax) ? what can i do easily with python which is not easy in c++/java !? Python

Re: Newbie to python --- why should i learn !

2008-05-08 Thread Arnaud Delobelle
pistacchio [EMAIL PROTECTED] writes: ocalm forces you to di OOP Ocaml *allows* you to do OOP. It's very much an optional feature of the language, just like for Python. -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie in python

2008-02-23 Thread cmpython
On Feb 21, 5:52 am, [EMAIL PROTECTED] wrote: Hi anyone I'm very interesed to learn python and really willing to do so,but unfortunately dont know where to start, or what programs need to install to start. Can someone help me to get in the right track, and get a good move? Thanks for all

Re: newbie in python

2008-02-21 Thread Jeroen Ruigrok van der Werven
-On [20080221 11:56], [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: Can someone help me to get in the right track, and get a good move? http://wiki.python.org/moin/BeginnersGuide -- Jeroen Ruigrok van der Werven asmodai(-at-)in-nomine.org / asmodai イェルーン ラウフロック ヴァン デル ウェルヴェン

Re: newbie in python

2008-02-21 Thread cokofreedom
Can someone help me to get in the right track, and get a good move? http://wiki.python.org/moin/BeginnersGuide http://www.diveintopython.org/ -- http://mail.python.org/mailman/listinfo/python-list

newbie in python

2008-02-21 Thread ctechnician
Hi anyone I'm very interesed to learn python and really willing to do so,but unfortunately dont know where to start, or what programs need to install to start. Can someone help me to get in the right track, and get a good move? Thanks for all help pls reply on [EMAIL PROTECTED] or [EMAIL

Re: newbie in python

2008-02-21 Thread 7stud
[EMAIL PROTECTED] wrote: Hi anyone I'm very interesed to learn python and really willing to do so,but unfortunately dont know where to start, or what programs need to install to start. Can someone help me to get in the right track, and get a good move? Thanks for all help If you're a

Re: newbie in python

2008-02-21 Thread subeen
Dive into Python is a very good book but it's for people who have experience in other languages. I liked the book. Whatever book you read, please take a look at the Python Tutorial: http://docs.python.org/tut/tut.html, it will help. regards, Subeen. http://love-python.blogspot.com/ On Feb 21,

Re: newbie in python

2008-02-21 Thread Michael Poeltl
A big help for 'easily learning python was and is Learning Python (a book written by Mark Lutz) after having studied this book you are able to think in python another book I like very much is Core Python Programming (written by Wesley Chun) regards michael On Thursday 21 February 2008

Re: newbie in python

2008-02-21 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: I'm very interesed to learn python and really willing to do so,but unfortunately dont know where to start, or what programs need to install to start. There are several good replies already on this thread, but in case any experienced programmers searching the Google

Re: newbie: stani's python editor if-else

2007-09-11 Thread Bruno Desthuilliers
madzientist a écrit : hi, two quick questions: a) i am using SPE (latest version) and for some reason, when i type, say if 1==2: print not equal else: print equal the else is at the same indentation level as the preceding print statement, and i get a syntax error

Re: newbie: stani's python editor if-else

2007-09-11 Thread Steve Holden
madzientist wrote: hi, two quick questions: a) i am using SPE (latest version) and for some reason, when i type, say if 1==2: print not equal else: print equal the else is at the same indentation level as the preceding print statement, and i get a syntax error

Re: newbie: stani's python editor if-else

2007-09-11 Thread kyosohma
On Sep 10, 11:24 pm, madzientist [EMAIL PROTECTED] wrote: hi, two quick questions: a) i am using SPE (latest version) and for some reason, when i type, say if 1==2: print not equal else: print equal the else is at the same indentation level as the preceding print

RE: newbie: stani's python editor if-else

2007-09-11 Thread Hamilton, William
-Original Message- From: [EMAIL PROTECTED] [mailto:python- [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 8:26 AM To: python-list@python.org Subject: Re: newbie: stani's python editor if-else On Sep 10, 11:24 pm, madzientist [EMAIL PROTECTED

Re: newbie: stani's python editor if-else

2007-09-11 Thread Gregor Horvath
[EMAIL PROTECTED] schrieb: I agree with Steve. I have yet to see an IDE for Python (or anything else) that unindents statements. Even IDLE, the Official IDE for Python, doesn't do that. emacs in python-mode Just hit TAB and it unindents else in the given example. Hit TAB again and it cylces

Re: newbie: stani's python editor if-else

2007-09-11 Thread Steve Holden
Hamilton, William wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:python- [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 8:26 AM To: python-list@python.org Subject: Re: newbie: stani's python editor if-else On Sep 10, 11:24 pm

Re: newbie: stani's python editor if-else

2007-09-11 Thread Bruno Desthuilliers
Steve Holden a écrit : madzientist wrote: hi, two quick questions: a) i am using SPE (latest version) and for some reason, when i type, say if 1==2: print not equal else: print equal the else is at the same indentation level as the preceding print statement, and i

Python code-writing for the blind. Was (Re: newbie: stani's python editor if-else)

2007-09-11 Thread madzientist
Thanks, everybody, for the very very useful and kind responses. There is a second reason why I asked the question about automatic de- indenting. I am teaching myself Python partly so I can then help my technically astute, but blind friend learn programming. For the many reasons that Pythonistas

Re: Python code-writing for the blind. Was (Re: newbie: stani's python editor if-else)

2007-09-11 Thread Gregor Horvath
madzientist schrieb: Is Python a bad choice for the blind programmer, as a result of a tight linkage between visual aspects of the code and its function ? I wish the site blindprogramming.com weren't so lifeless... There was a thread regarding blind people and python indentation shortly:

Re: Python code-writing for the blind. Was (Re: newbie: stani's python editor if-else)

2007-09-11 Thread madzientist
Thanks, Gregor. Very helpful thread. Suresh On Sep 11, 1:26 pm, Gregor Horvath [EMAIL PROTECTED] wrote: madzientist schrieb: Is Python a bad choice for the blind programmer, as a result of a tight linkage between visual aspects of the code and its function ? I wish the site

newbie: stani's python editor if-else

2007-09-10 Thread madzientist
hi, two quick questions: a) i am using SPE (latest version) and for some reason, when i type, say if 1==2: print not equal else: print equal the else is at the same indentation level as the preceding print statement, and i get a syntax error why doesn't spe automatically

Newbie Question: python mysqldb performance question

2007-05-20 Thread cjl
Group: I'm new to python and new to mysql. I have a csv file that is about 200,000 rows that I want to add to a mysql database. Yes, I know that I can do this directly from the mysql command line, but I am doing it through a python script so that I can munge the data before adding it. I have

Re: Newbie Question: python mysqldb performance question

2007-05-20 Thread rurpy
On May 20, 5:55 pm, cjl [EMAIL PROTECTED] wrote: ...snip... conn = MySQLdb.connect(db=database, host=localhost, user=root, passwd=password) c = conn.cursor() reader = csv.reader(open(sys.argv[1])) for row in reader: data1, data2, data3, data4 = row data = (data1,data2,data3,data4)

Re: Newbie Question: python mysqldb performance question

2007-05-20 Thread John Nagle
cjl wrote: Group: I'm new to python and new to mysql. I have a csv file that is about 200,000 rows that I want to add to a mysql database. Yes, I know that I can do this directly from the mysql command line, but I am doing it through a python script so that I can munge the data before

Re: Caution newbie question: python window to stay open ?

2006-11-22 Thread jim-on-linux
Michael, put this at the top of your code. After the window closes read the testLog.out file. It may give you a clue as to what is happening. sys.stdout = open('testLog.out', 'w') jim-on-linux http://www.inqvista.com On Tuesday 21 November 2006 22:20, mkengel wrote: Caution: newbie

Caution newbie question: python window to stay open ?

2006-11-21 Thread mkengel
Caution: newbie question I am using python 2.4.3-11 on Windows XP. Problem: Python window closes immediately after executing a *.py file (e.g. containing a print... command. What do I have to do to keep it open to see the results ? Interactive window stays open. Thank you. Michael --

Re: Caution newbie question: python window to stay open ?

2006-11-21 Thread doobiz
mkengel wrote: Caution: newbie question If you're pretty sure it's a common newbie question, then begin by going to the Google repository at: http://groups.google.com/group/comp.lang.python Search in the box at upper right, on, say, keep cmd window open, or keep dos window open. Like so:

Re: Caution newbie question: python window to stay open ?

2006-11-21 Thread BartlebyScrivener
mkengel wrote: Caution: newbie question If you're pretty sure it's a common newbie question, then begin by going to the Google repository at: http://groups.google.com/group/comp.lang.python Search in the box at upper right, on, say, keep cmd window open, or keep dos window open. Like so:

Re: Caution newbie question: python window to stay open ?

2006-11-21 Thread Fredrik Lundh
mkengel wrote: Problem: Python window closes immediately after executing a *.py file (e.g. containing a print... command. What do I have to do to keep it open to see the results ? Simple scripts that print to a console, or read from it, works best if you run them from a standard Command

Newbie question: python doesn't search the cwd for my module

2006-10-03 Thread izak marais
Hello AllI want to import a module I wrote to use it in a script. But, it is not in the same directory as the script I want to import it into. So my solution is to put the following piece of code in the script:import osos.chdir(the direcotry where the module is kept)import the moduleThis generates

Re: Newbie question: python doesn't search the cwd for my module

2006-10-03 Thread Ben Finney
izak marais [EMAIL PROTECTED] writes: I want to import a module I wrote to use it in a script. But, it is not in the same directory as the script I want to import it into. I can think of two sensible solutions. One is to change the 'sys.path' list to include the directory where you want

Re: Newbie in python

2006-03-02 Thread Simon Brunning
On 3/2/06, - C Saha - [EMAIL PROTECTED] wrote: Hello Python Experts I am Chirantan, a beginner in python programming world. I have some programming knowledge in SHELL, BATCH and little bit PERL. I subscribed to this list with the hope that I will get support and help from all of you. To

Newbie in python

2006-03-01 Thread - C Saha -
Hello Python ExpertsI am Chirantan, a beginner in python programming world. I have some programming knowledge in SHELL, BATCH and little bit PERL. I subscribed to this list with the hope that I will get support and help from all of you. To start with, I thought it will be a good idea to

Re: newbie to python

2005-12-16 Thread Johhny
Hello, Here is the script then the problem. cat testing.py import crypt import random, string def getsalt(chars = string.letters + string.digits): return random.choice(chars) + random.choice(chars) username = raw_input('password : ') print crypt.crypt(username,getsalt()) python

Re: newbie to python

2005-12-16 Thread Peter Otten
Johhny wrote: Here is the script then the problem. cat testing.py import crypt import random, string def getsalt(chars = string.letters + string.digits): return random.choice(chars) + random.choice(chars) username = raw_input('password : ') print crypt.crypt(username,getsalt())

Re: newbie to python

2005-12-16 Thread Johhny
Thankyou, I appreciate your help. I did not realise that python would behave that way. -- http://mail.python.org/mailman/listinfo/python-list

newbie to python

2005-12-15 Thread exter_c
Hello, How do I find out what modules have been included in my python install? I am having issues with crypt functions not working on ubuntu or redhat but they work on Slackware. Any assistance would be great. Regards, Johhny. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie to python

2005-12-15 Thread Lawrence Oluyede
Il 2005-12-15, [EMAIL PROTECTED] [EMAIL PROTECTED] ha scritto: How do I find out what modules have been included in my python install? Look in site-packages directory I am having issues with crypt functions not working on ubuntu or redhat but they work on Slackware. Crypt functions? Are u

Re: newbie to python

2005-12-15 Thread Johhny
Hello, If I go into the python shell and type help(modules) It does show that crypt is there. However Im unsure if that means that there is help or its got the module installed. From a dpkg --list python* I have ii python2.4-crypto 2.0+dp1-2ubuntu1

Re: newbie to python

2005-12-15 Thread Lawrence Oluyede
Il 2005-12-15, Johhny [EMAIL PROTECTED] ha scritto: From a dpkg --list python* I have ii python2.4-crypto 2.0+dp1-2ubuntu1 cryptographic algorithms and protocols for Python Which means it should work. However Im not really getting anything from it. Which

Newbie using python to update sql table

2005-10-06 Thread LenS
I have created a python program that takes a flat file and changes some of the data and create a new flat file with the changes. Part of this process requires that I try to find a particular model car in an MS Sql table. This part of the program is now working great. It has come to my attention