[Tutor] Extract URL

2018-12-13 Thread Sammy Lee
I need help on the problem stated below. Given a URL, open the webpage and return the first anchor link url (a href). def extract_url_link(url): ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python

Re: [Tutor] Import CSV

2018-12-13 Thread Sammy Lee
def save_url_to_file(url, savefile): This is the starting code. > On December 13, 2018 at 11:56 AM Sammy Lee wrote: > > > I need help on how to open a webpage and save the HTML to a given file > path, given a URL. >

[Tutor] Python function

2018-12-13 Thread Sammy Lee
How do I create a python function that opens a CSV file and determines how many columns of data are in the file? The CSV files have been randomly generated from https://www.mockaroo.com/ def csv_column_count(openfile): ___ Tutor maillist - Tutor@pyth

[Tutor] Import CSV

2018-12-13 Thread Sammy Lee
I need help on how to open a webpage and save the HTML to a given file path, given a URL. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Open webpage and save CSV

2018-12-13 Thread Sammy Lee
I need help on the problem below, Given a URL, open the webpage and save the CSV to a given file path. def save_url_to_csv_file(url, savefile): ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.

Re: [Tutor] the big o

2015-07-28 Thread Joseph Lee
Hi Stephanie, I'm wondering which courses you were introduced to Python and which book you are using. I do understand how it might be difficult to understand this concept, especially for someone who is a complete novice to algorithm analysis where Big O shows up. I'll answer you inline. -Origi

Re: [Tutor] threading in python 2.7 - 2nd version

2015-01-05 Thread Joseph Lee
Hi, My answers are below. -Original Message- From: Tutor [mailto:tutor-bounces+joseph.lee22590=gmail@python.org] On Behalf Of Rance Hall Sent: Sunday, January 4, 2015 9:20 PM To: tutor Subject: [Tutor] threading in python 2.7 - 2nd version Thanks to the advice from Joseph and Alan, I

Re: [Tutor] threading in python2.7

2015-01-02 Thread Joseph Lee
Hi, Answers are below. -Original Message- From: Tutor [mailto:tutor-bounces+joseph.lee22590=gmail@python.org] On Behalf Of Rance Hall Sent: Friday, January 2, 2015 12:17 PM To: tutor Subject: [Tutor] threading in python2.7 Each of the lights and sound functions are placed in a "while

[Tutor] FW: Learning to program, not code.

2014-12-19 Thread Joseph Lee
Oops, sent it to the original poster only. -Original Message- From: Joseph Lee [mailto:joseph.lee22...@gmail.com] Sent: Friday, December 19, 2014 1:43 AM To: 'Brandon Dorsey' Subject: RE: [Tutor] Learning to program, not code. Hi Brandon, Answers are below. -Origin

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-15 Thread Joseph Lee
Hi Terry (if that's your name), Start slow - don't think ahead too much. It is a good thing that you know the end product, but sometimes when building a real-life system, you might want to work with one aspect of the program at a time (input, calculations, print, etc.) to make sure it works a

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-15 Thread Joseph Lee
Hi, My thoughts are in the message: - Original Message - From: Terry--gmail Subject: [Tutor] Building Starships -- object of type 'int' has no len() Python 3.3 This has something to do with the nature of FOR statements and IF statements, and I am sure it must be a simple mistake...b

Re: [Tutor] Exercise to work on

2014-08-13 Thread Joseph Lee
Hi Keith, It depends on what you want to do with Python in the end (by the way, if statement is not a function). Here are some of my suggestions (based on current topics and things to come later): 1. Write a loop which prints even numbers from 1 to 100. 2. Write a program which determines

Re: [Tutor] Exercise to work on

2014-08-13 Thread Joseph Lee
Hi Keith, As a follow-up: I'm sure others might have mentioned this, but I also recommend doing exercises presented in the book or reference you're using to learn Python. Cheers, Joseph - Original Message - From: keith papa Hi, am a newbie to python and I wondering if you guys can give

Re: [Tutor] Is this possible for a newbie?

2014-07-21 Thread Joseph Lee
Hi, Answers are below. - Original Message - From: keith papa Am a newbie to programming and I started learning python days ago. I have this idea I want to execute, am a big sport and fantasy fan and I wanted to create something that will make it things a little easy for me. My idea

Re: [Tutor] Python 2 Vs python 3

2014-07-13 Thread Joseph Lee
Hi, Answers are below. From: Tutor [mailto:tutor-bounces+joseph.lee22590=gmail@python.org] On Behalf Of idiallo.s...@gmail.com Sent: Sunday, July 13, 2014 9:16 AM To: Python Tutor Mailing List Subject: [Tutor] Python 2 Vs python 3 I am in the process to dive into python and start lear

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Joseph Lee
Hi Steve, In your conditionals: … while message != 'q' or 'Q'/message != “q” or message != “Q”: … Python will only match the first variable. A better approach (which might be a good solution) would be capturing the exit commands in a list like this: JL’s code: while message not in [“q”, “Q”]

Re: [Tutor] Anti-Patterns in Python Programming

2014-07-11 Thread Joseph Lee
Hi Deb and others, Most are for people coming from different languages like C/C++, Java and so on (I myself am coming from C++ world, and can speak both C++ and Python). Unless if you're working on specific things, don't worry about some of the concepts until later (e.g. if you're working on variab

Re: [Tutor] Anti-Patterns in Python Programming

2014-07-11 Thread Joseph Lee
Hi Deb and others, Answers are below. -Original Message- From: Deb Wyatt [mailto:codemon...@inbox.com] Sent: Friday, July 11, 2014 9:51 PM To: Joseph Lee; tutor@python.org Subject: RE: [Tutor] Anti-Patterns in Python Programming Thank you for answering. I used to be a Clipper/dBase

[Tutor] IndexError: list index out of range

2014-06-26 Thread Myunggyo Lee
Hi all I just started to learn python language. I'm trying to figure out the reason of error but i couldn't find it. first imports short.txt(is attached to this mail) and read in dictionary named gpdic1 Traceback (most recent call last): File "/home/ercsb/test.py", line 11, in hgene = line

[Tutor] which book to read next??

2014-04-21 Thread lee
Hi, I have read the book 'a byte of python' and now I want to read another book. But I just get confused about which one to read next. There is a book list below: 1, pro python 2, python algorithms 3, python cookbook 4, the python standard library by examples which one is suitable for me?? Or I ne

Re: [Tutor] Printing from python

2014-03-21 Thread Lee Harr
> is there another way to print a PDF form python? > > My problem is a PDF which is printed well by evince, but not with lp,  > even not out of python using > > os.system("lp some_options file.pdf") > > Later on I have to build the PDF in a python program (using reportlab)  > and then print it, eve

Re: [Tutor] Python & Django

2014-01-10 Thread Lee Harr
> I am very interested to hear your opinion on which version of Python > to use in conjunction with Django. Currently, I am taking a class at > Udemy and they recommend using Python 2.7 with Django 1.6. because > both versions work well with each other. > > Over the last few months I got pretty muc

[Tutor] Python Error

2012-10-17 Thread Benjamin Lee
Hello, I am using python to calculate distances across the cell.  I used this command:  python calculate_distances.py This was the response: Traceback (most recent call last): file "calculate_distances.py" line 4, in import celltool.simple_interface as si ImportError: No module named celltool.simp

Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread Lee Harr
>   grep ^TTCTGTGAGTGATTTCCTGCAAGACAGGAATGTCAGT$> with no results How about: grep TTCTGTGAGTGATTTCCTGCAAGACAGGAATGTCAGT outfile Just in case there is some non-printing character in there... Beyond that ... my guess would be that you are either not readingthe file you think you are, or not writi

Re: [Tutor] writing function changeColor

2012-07-18 Thread Lee Harr
> I learned python so that if I were to put in 0.9, it'd decrease red by 10%.> > The way this function needs to be written, -0.1 decreases red by 10% It sounds like you have something like ... def f1(color, redchange=0, bluechange=0, greenchange=0):    # some code here to make the changes    ret

Re: [Tutor] How to interact with users on IRC using Python

2012-04-18 Thread Lee Harr
> How do I create a small IRC program which can send and receive private > messages from users? I created a multiplayer game that can create a standalone server like a MUD, or communicate over IRC, or both (I think) acting as a gateway between the two. It uses Twisted, which some find arcane, b

Re: [Tutor] Sequencing

2011-05-19 Thread Cindy Lee
Apples and 7 oranges From: Alan Gauld To: tutor@python.org Sent: Wednesday, 18 May 2011, 8:07 Subject: Re: [Tutor] Sequencing "Cindy Lee" wrote > ...asked to make a function that receives text as an argument > and returns the same text, but with 1 added to

Re: [Tutor] Sequencing

2011-05-18 Thread Cindy Lee
Thanks for the advice. I seem to keep getting the same errror: >> help(str.__add__) Help on wrapper_descriptor: __add__(...)     x.__add__(y) <==> x+y From: Dave Angel To: Cindy Lee Cc: "tutor@python.org" Sent: Wednesday, 18 May

[Tutor] Sequencing

2011-05-18 Thread Cindy Lee
Hi Pyton Tutors thanks for adding me, I am new to Python and missed one of my classes and am not sure of my homework. We are currently on sequencing and are being asked to make a function that receives text as an argument and returns the same text, but with 1 added to each number. So far I have

Re: [Tutor] (de)serialization questions

2010-10-01 Thread Lee Harr
>>> I have data about zip codes, street and city names (and perhaps later also >>> of >>> street numbers). I made a dictionary of the form {zipcode: (street, city)} >> >> One dictionary with all of the data? >> >> That does not seem like it will work. What happens when >> 2 addresses have the sam

Re: [Tutor] (de)serialization questions

2010-09-30 Thread Lee Harr
> I have data about zip codes, street and city names (and perhaps later also of > street numbers). I made a dictionary of the form {zipcode: (street, city)} One dictionary with all of the data? That does not seem like it will work. What happens when 2 addresses have the same zip code? > Are th

Re: [Tutor] Question about Dictionaries

2010-08-16 Thread Lee Harr
> I know that I can look up the value for a particular key in a > dictionary, but can I look up the key associated with a particular > value? I am using bidict in one of my projects: http://pypi.python.org/pypi/bidict/0.1.1 It's probably a bit more complex than what I need, but the parts I am u

Re: [Tutor] Scripting Blender

2010-08-11 Thread Lee Harr
> Are there any Python modules to script Blender? For example, placing > predefined objects into a new Blender project to create a 3D model. If you are using 2.5, I saw this posted on blendernation.com just today: http://blenderartists.org/forum/showthread.php?t=193908

Re: [Tutor] can i run the last saved input again

2010-07-24 Thread Lee Harr
> hey this is a crazy question but i want to know it.. > suppose i have this code > > a=raw_input("enter the string :") > print a > > then i type python prog.py > > output: > enter the string:hello > hello > > > now i want to ask is there's any way that python remembers the input i gave > it t

Re: [Tutor] Strange range and round behaviour

2010-06-07 Thread Lee Harr
> Just out of curiosity does anyone know why you get a deprecation warning if > you pass a float to range but if you use round, which returns a float, there > is no warning? It has nothing to do with the round. It's just that the warning is only shown once: $ python Python 2.6.5 (r265:79063, Ap

Re: [Tutor] Python workspace - IDE and version control

2010-01-18 Thread Matthew Lee
I usually just use NetBeans or the Python IDLE. I prefer to use NetBeans because it's easier to change and modify code and test. And also because I like to use Jython. Anything wrong with my setup? On Tue, Jan 19, 2010 at 8:17 AM, Alan Gauld wrote: > > wrote > > > order to create an efficient

[Tutor] Problem with converting Python to EXE using py2exe

2009-04-10 Thread Chris Lee
Hi tutors, So I finally made my program. When I run it with python, it works perfectly! But when I convert it to an executable using py2exe (correctly), I get an error: Traceback (most recent call last): File "oentry.py", line 52, in File "Tkinter.pyc", line 3270, in __init__

[Tutor] Executing a GUI from another GUI with a click of a button

2009-04-06 Thread Chris Lee
Hello! Before I tell you about my problems, I ask for your consideration as I am a newbie at python... I was having problems as I tried to open another program within a program (both programs are Tkinter UIs) As for the reference, here is my code: #program: realprogram.py from Tkinter impor

[Tutor] problems finding position in list and changing it for GO game

2008-12-15 Thread Lee Meredith
or when you hit the letter "b" Traceback (most recent call last): File "C:/Users/Lee/Desktop/pyGame01/GO/GO_1_2_3.py", line 46, in for stone in len(black0): TypeError: 'int' object is not iterable Which I'm not really sure what that means or how to reme

Re: [Tutor] Tutor Digest, Vol 53, Issue 89

2008-07-25 Thread lee lucia
> From: [EMAIL PROTECTED]> Subject: Tutor Digest, Vol 53, Issue 89> To: > tutor@python.org> Date: Fri, 25 Jul 2008 12:01:02 +0200> > 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

[Tutor] urlencode

2007-06-05 Thread Lee Jones
Hello, I am trying to urlencode a string. In python the only thing I can see is the urllib.urlencode(). But this takes a dictionary, and returns "key=value", which is not what I want. I only want to url-encode a string. Does any one know how to do this in python T

Re: [Tutor] XML-RPC data transfers.

2006-12-29 Thread Lee Harr
>http://www.velocityreviews.com/forums/t343990-xmlrpc-send-file.html > >Using this example I get error's about 'expected binary .read(), but got >instance instead. I assume you are using this ... >d = xmlrpclib.Binary(open("C:\\somefile.exe").read()) Are you using windows? I think you would n

[Tutor] detect 64-bit windows

2006-06-16 Thread Sean Lee
In Python, how to do that ?   sys.platform only gives 'win32', no info about 32-bit or 64 bit ?   Thanks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Meaning of %g ?

2006-04-17 Thread Sean Lee
> >>> print "%14.3g\n%14.3e\n%14.3f" % (bignum,bignum,bignum)> 1.23e+009 >1.235e+009> 1234567898.235>> But in practice, we do not know how big is the data in advance when> doing scientific computation in a compiled program.That is irrelevant, the format you display the data in has no b

[Tutor] Meaning of %g ?

2006-04-13 Thread Sean Lee
What is the exact meaning of %g in Python ?   From Python ducumentation:   %g: Same as "e" if exponent is greater than -4 or less than precision, "f" otherwise.   But if %.mg is used, I don't see the rules. See the following example:   So here it follows the above rule:   >>> print "%.16g" % 0.00

Re: [Tutor] Pygame mailing list info needed

2005-12-21 Thread Lee Harr
>I subscribed to the pygame-users mailing list through [EMAIL PROTECTED], >but I don't know where to send the mail too so that everybody can see it. > >Any suggestion on how to use that mailing list? > http://www.google.com/search?q=pygame+mailing+list 2nd link ... """ Pygame maintains an active

Re: [Tutor] Python as Application (OT now)

2005-10-29 Thread Lee Harr
Sorry about misposting this here. I always mix up the tutor@ and edu-sig@ lists. I am just going to follow up two things that seem tutor related. If this seems interesting, you may want to join the edu-sig list for more... >>More frightening to me than the ubiquitous use of MS Office is the >>o

Re: [Tutor] Python as Application

2005-10-26 Thread Lee Harr
>My son is learning something about using a spreadsheet - extremely >useful and I support it 100%. That he thinks what he is learning is >Excel is absolutely unforgivable, in terms of my understanding of >ethical norms that once prevailed in an institute of higher education. > I guess it depends

Re: [Tutor] Making a character jump with pygame

2005-10-07 Thread Lee Harr
> I've edited the aliens.py example to make my character just move >back and forth. However I can't make him jump! It is not really clear to me from your code where you expect the character to jump. I do not see the word "jump" anywhere. I do see the word "bounce" and one reference to the to

Re: [Tutor] Pager in Python?

2005-07-25 Thread Lee Harr
> > >Is there a command like more(1) or less(1) in python to display > > >the output of a command (e.g. dir()) one page at a time? > > > > > > How are you using dir() ? > > > > Is it in the "DOS Window" ? > > One option would be to just get a better console. > >I am using Python 2.4 on RedHat Linux

Re: [Tutor] Pager in Python?

2005-07-19 Thread Lee Harr
>Is there a command like more(1) or less(1) in python to display >the output of a command (e.g. dir()) one page at a time? How are you using dir() ? Is it in the "DOS Window" ? One option would be to just get a better console. You also might want to look at something like ipython. Using that,

Re: [Tutor] newbie help> audio IO + python

2005-07-19 Thread Lee Harr
>I've been looking at lots of sites and checked out the docs, but can't >find the info I am looking for to be able to detect audio input from >my sound card. You do not say if you need to do this in a cross-platform way. I thought maybe SDL (which is wrapped by pygame) might help, but this is cl

Re: [Tutor] Newsreader list name?

2005-06-09 Thread Lee Cullens
lone or in combination with a group (e.g. + gmane.comp.python.tutor), or alone (server) with the group in the subscription window to work. Are you using Gmane successfully? Thanks Lee C On Jun 9, 2005, at 4:12 PM, Karl Pflästerer wrote: > On 9 Jun 2005, [EMAIL PROTECTED] wrote: > > &g

Re: [Tutor] Newsreader list name?

2005-06-09 Thread Lee Cullens
is list using a newsreader and I would appreciate the list name used. Thanks, Lee C ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] remove from python

2005-06-08 Thread Lee Harr
how can i get my email address removed, I'm receiving way too many emails You have a few options. You may want to see if just turning the Tutor mailing list setting to "Digest Mode" might help. You can do this through: http://mail.python.org/mailman/options/[EMAIL PROTECTED] Personally, I fi

Re: [Tutor] OO re-factoring (was Pythonese/Efficiency/Generalesecritique)

2005-06-08 Thread Lee Cullens
ram ;') Anyway, starting with assembler in the 60s, and doing my last substantial technical work in the 80s with C and Pascal, I have a bit of catching up to do :~) Thank you all for pointing me in the right direction, Lee C ___ Tutor maillist

Re: [Tutor] OO re-factoring (was Pythonese/Efficiency/Generalese critique)

2005-06-07 Thread Lee Cullens
le code structure to re-map is shaping up otherwise. Thanks, Lee C On Jun 8, 2005, at 1:10 AM, Javier Ruere wrote: > Lee Cullens wrote: > > >> I was thinking of extending the learning exercise by re-factoring it >> as an OO approach, since it would contain a minimum altered met

[Tutor] OO re-factoring (was Pythonese/Efficiency/Generalese critique)

2005-06-07 Thread Lee Cullens
lot on OOP, but seem to have a problem with the practical use of such in this utility. I'm undoubtedly creating a mountain of an ant hill in my mind, so any thoughts would be appreciated. Thanks, Lee C ___ Tutor maillist - Tutor@

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-05 Thread Lee Cullens
s in posting this exercise is to first understand alternatives before I decide what I like best :~) Your points, together with Javier's points on presentation and thoroughness, and Liam's point on making the logic more obvious are appreciated. Thank you all for taking the time to offer y

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-05 Thread Lee Cullens
Such would serve to pull the test and the reason for it together - more obvious. Which is a good point in writing code that others may read. Thanks Liam On Jun 5, 2005, at 9:29 AM, Liam Clarke wrote: > > > > There is no need for the if(dlst); if the list is empty the > iteration will do n

Re: [Tutor] Detecting my own IP address?

2005-06-05 Thread Lee Harr
>At present, the only thing I can think of is to redirect the >output of 'ifconfig' into a temporary file, then read it back in and use >Python and regular expressions to try and extract the IP info from that. That is basically how I do it. See here: http://mail.python.org/pipermail/python-list/2

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
vline so that csvline would end up '"",'*x plus '"c","d",' >>> pl = ['a', 'b', 'c'] >>> csvl = '"",' >>> csvl += '"'.join(pl[0:2]) + '",' >>&g

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
On Jun 4, 2005, at 9:32 PM, Javier Ruere wrote: > Lee Cullens wrote: > >> The initial os.walk() approach I tried is simple in concept: >> >> pgo = os.walk(base_directory) >> for xnode in pgo: >> >> >> but I ended up with much more process

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
Thanks for the critique Kent On Jun 4, 2005, at 6:54 PM, Kent Johnson wrote: > Lee Cullens wrote: > > >> Pythonese/Efficiency/Generalese critique please >> >> I'm new to Python and as an exercise created a little utility module. >> I'm learnin

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
Sorry about the double post. I sent with the wrong from address so I resent with the correct address and before I could cancel the first the moderator had let it through :~) Lee C ___ Tutor maillist - Tutor@python.org http://mail.python.org

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
ordering in one pass. Lee C ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
ordering in one pass. Lee C ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
you see fit to offer.Thank you,Lee CDual 2.5 Power Macintosh G5 (OS 10.4.1) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Postgresql+Python -tutorial?

2005-06-03 Thread Lee Harr
>> > I've been using MySQL up this day, but would like to convert my >> > program to use Postgresql. >> >>I'm curious. Why? >>Is there some advantage to Postgres over MySql? > >Postgres behaves a lot like Python in that it'll die early rather than try >to guess at what the user means. Postgres han

Re: [Tutor] Building an SQL query

2005-06-03 Thread Lee Harr
>data = {} >data['ids_to_process'] = ['1','2','3','5','7','11'] > >query = ''' >UPDATE my_table > SET state = 'processed' > WHERE id IN ARRAY%(ids_to_process)s >''' >db.execute(query, data) > Sorry. It should look like ... query = ''' UPDATE my_table SET state = 'processed

Re: [Tutor] Building an SQL query

2005-06-02 Thread Lee Harr
>data = {} >data['start_date'] = '2005-6-2' >data['last_name'] = 'Johnson' > >query = ''' >SELECT * > FROM my_table > WHERE date >= '%(start_date)s' > AND last_name = '%(last_name)s' >''' % data >results = my_database.Execute(query) First up. This is a "bad idea". It may be ok

Re: [Tutor] increment operator

2005-05-27 Thread Lee Cullens
I find the following invaluable - maybe you will also. http://rgruet.free.fr/PQR24/PQR2.4.html Lee C On May 27, 2005, at 11:25 PM, Servando Garcia wrote: > Hello > Is there a increment operator in python similar to c++ > like so &quo

Re: [Tutor] Eclipse and Member Function Availability

2005-05-27 Thread Lee Harr
>using autocomplete feature within Eclipse Are you using pydev? http://pydev.sourceforge.net/ Their website says: """ New Release: 0.9.3!! Wohooo!! Code completion Rules! Check it out! """ So apparently this is something they are actively working on. You may have an old version, or you may have

Re: [Tutor] Formatted writing to a file

2005-05-27 Thread Lee Harr
>Content-Type: text/html; format=flowed > > [...] What a mess. You should to post to the list in plain text. Someone might take the time to weed through that for your question, but you will get a lot more help and a lot sooner if you just configure your mailer to send plain text. __

Re: [Tutor] Python won't play .wav file

2005-05-25 Thread Lee Harr
stem, or you could use pygame. > >Ok drat. I was hoping that it would play the files. > > > >>-- >>Lee Harr wrote: >> >>If you are on windows try the winsound module. > >And if I'm on Linux or programing for Mac? >

Re: [Tutor] Python Date picker

2005-05-25 Thread Lee Harr
>>>What I need to do is validate a date field (better if it's already done) >>>and >>>I want to know if anyone knows about a code to do that (a made code, >>>don't >>>mean you to do my work). I was hoping to find a calendar combo box as in >>>Visual Basic DropDown Calendar >>> >>> >>For which GUI s

Re: [Tutor] Python Date picker

2005-05-24 Thread Lee Harr
>What I need to do is validate a date field (better if it's already done) >and >I want to know if anyone knows about a code to do that (a made code, don't >mean you to do my work). I was hoping to find a calendar combo box as in >Visual Basic DropDown Calendar For which GUI system? py-qt has Da

Re: [Tutor] Python won't play wav file

2005-05-24 Thread Lee Harr
>I can't get: > >import wave as w > >... to play a .wav music file. I tried w.play() but got an error that >module has no attribute 'play'. >What do I use to get it to play? Strangely... I do not believe the wave module is meant to actually _play_ a wav file. It looks to me like it is only inte

Re: [Tutor] __init__.py

2005-05-22 Thread Lee Cullens
ative to a common root directly. We'll let the experts take it from there. Lee C On May 22, 2005, at 7:54 PM, Joseph Quigley wrote: > I've seen many (python) "plugins" (some located in site-packages > [windows > here]) with the name __init__.py. > What'

Re: [Tutor] Python debugger under Tiger?

2005-05-18 Thread Lee Cullens
Mike, You may not be looking for a commercial IDE, but I am very happy with WingIDE and using it with Tiger. Lee C On May 18, 2005, at 6:54 PM, Mike Hall wrote: > I should of specified that I'm looking for an IDE with full > debugging. Basically something like Xcode, but with Pyt

Re: [Tutor] I know you will hate this but...

2005-05-18 Thread Lee Harr
>>Inconsistent indentation styles are very >>annoying in >>other languages, but a fatal problem in Python. > >But there is no way to enforce standard settings. When new versions are >installed or someone just makes a mistake the settings might change and >you won't know until it's too late...possi

Re: [Tutor] Python Interest Group Query

2005-05-16 Thread Lee Cullens
n such anymore :~) Thank you, Lee C ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] help: space formatting for multiplication table

2005-05-14 Thread Lee Harr
>The idea is to print out a multiplication table on the command line >with numbers lining up in the ones column. I want to eventually >emulate programs like top with their spacing. But this code is mostly >for my amusement. How would you make this work? > Try print string formatting using % >>>p

Re: [Tutor] Linux variable to Python

2005-05-13 Thread Lee Harr
>import os os.system("fec=cam`date +%Y%m%d%H%M%S`.jpg") >0 os.system("echo $fec") >0 os.system("mv hola.txt grabacion/$fec") >0 Each system() call gets a fresh shell, and a fresh env ... >>>import os >>>os.environ['foo'] = 'bar' >>>os.system('echo $foo') bar 0 >>>os.system('foo=zzz')

Re: [Tutor] Web Calendar written in Python

2005-05-04 Thread Lee Harr
>Does anyone know of a Web Calendar written in Python? I believe that SchoolBell is using Zope 3 ... http://www.schooltool.org/schoolbell _ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.m

Re: [Tutor] import problem

2005-04-18 Thread Lee Cullens
I assume you mean PythonIDE for Python 2.3 (I usually use 2.4 and WingIDE). Here it is (indents screwed up with var font): HTH, Lee C Python 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] Type "copyright", "credits" or "lice

Re: [Tutor] for loop

2005-04-18 Thread Lee Cullens
> yes = 0 >>> for num in x: ... if 5 not in num: ... if not yes: ... print 'yes' ... yes = 1 ... yes On Apr 19, 2005, at 12:31 AM, Lee Cullens wrote: As you probably have already found out the expression >>> print [ e for e in x if 5 in e] will pro

Re: [Tutor] Newbie question

2005-04-18 Thread Lee Cullens
Thank you Brian for making the point that I did such a poor job of conveying. My post did indeed fail to clearly and concisely answer the question. Lee C On Apr 18, 2005, at 11:34 PM, Brian van den Broek wrote: Lee Cullens said unto the world upon 2005-04-18 21:07: That just gives you a spacer

Re: [Tutor] for loop

2005-04-18 Thread Lee Cullens
inting yes. If you change your test to check for 5 in a sub list and, print yes and break at that point you will get the results you are looking for. >>> for num in x: ... if 5 in num: ...print "yes" ...break ... yes >>> Lee C On Apr 18, 2005, at 1

Re: [Tutor] Newbie question

2005-04-18 Thread Lee Cullens
That just gives you a spacer line after your output. To see such as a separator change it to print '*'*10 On Apr 18, 2005, at 8:55 PM, Hoffmann wrote: Hi All: I am a newbie, and I am enjoying to study Python a lot. I have a question about an example I got from one of my books. The program is: d

Re: [Tutor] More Function Questions (Joseph Q.)

2005-04-17 Thread Lee Cullens
of a more involved algorithm. Functions are also useful (even necessary) in various approaches to problem solving. If you need an example one might be the recursive matrix solution approach I posted a link to in another post to this list. Lee C On Apr 17, 2005, at 12:29 PM, Joseph Quigley

[Tutor] Re: newbie intro to pickle

2005-04-16 Thread Lee Harr
Pickling simply converts an object to a string (unpickling does the opposite, convert a string to an object). The dump() function writes the generated string directly to a file, but you can use the dumps() function to get the generated string as such and do something else with it (e.g. put it in

[Tutor] Re: PyGTk and Glade help

2005-04-14 Thread Lee Harr
We are developing a CBT based "Free Software" for our social activities. We are using PyGTK alongwith Glade. We want to print a document through Printer and also we want to provide "Sound" support in our software. Has somebody worked on PyGTK or Python? We are not getting the PyGTK API's for sound

Re: [Tutor] Re: Recursion....what are the best situations to use it?

2005-04-14 Thread Lee Cullens
packages to do the grunt work, but it helps to understand the problem. Lee C On Apr 14, 2005, at 21:06, [EMAIL PROTECTED] wrote: I've seen a couple of nice tutorials on recursion, and a lot of awful ones. The latter always trot out the fibonacci and factorial examples for some reason

Re: [Tutor] Re: GUI module selection?

2005-04-13 Thread Lee Cullens
Thank you, Liam and Steve, for the informative feedback. Lee C ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Re: Interesting anomaly with the Eight Queens problem

2005-04-13 Thread Lee Cullens
, On Apr 13, 2005, at 1:04 PM, Lee Cullens wrote: John The type of problem you mention and the extent of positioning you go to could result in an incomplete solution. In very general terms one would need to place the first Queen then find an appropriate position for the second, and each of the

Re: [Tutor] Re: Interesting anomaly with the Eight Queens problem

2005-04-13 Thread Lee Cullens
ore academic (an younger) members of this list can point you in such a direction. Lee C On Apr 13, 2005, at 12:15 PM, [EMAIL PROTECTED] wrote: I read through Magnus Hetland's book and noticed the Eight Queens problem, which I had solved some time ago using Visual Basic. This time, I wanted to u

Re: [Tutor] Python backwards program (fwd)

2005-04-12 Thread Lee Cullens
for the slicing see: http://docs.python.org/lib/typesseq.html for a longhand loop approach see: http://docs.python.org/tut/node6.html#SECTION00620 On Apr 13, 2005, at 12:46 AM, Danny Yoo wrote: -- Forwarded message -- Date: Tue, 12 Apr 2005 22:37:44 -0500 From: J

[Tutor] Re: GUI module selection?

2005-04-12 Thread Lee Cullens
imedia presentations) potentially for cross platform (and pyObjC for Mac only) - opinions/pointers anyone or maybe *another* better course? Thanks, Lee C ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Re: problems with doctest: apparent interferance between tests (LONG)

2005-04-10 Thread Lee Harr
I have apparent interference between doctests embedded in the docstrings of different methods, and this interference also appears to be influenced by seemingly irrelevant things such as whether the module has a (non-doctest-containing) docstring or not. I, and what hair I've not yet torn out, woul

  1   2   >