[Tutor] Fwd: Re: How do I display a picture?

2017-05-17 Thread Alan G via Tutor
t kind of window/screen)? There are a dozen possible ways to "display a picture" depending on what you specifically want. -- Alan G Author of the Learn to Program web site [2]http://www.alan-g.me.uk/ [3]http://www.amazon.com/author/alan_gauld

Re: [Tutor] Writing decorators?

2016-07-05 Thread Alan G via Tutor
because I was the tech editor but the book Professional Python has a nice chapter on decorators. HTH -- Alan G Author of the Learn to Program web site [3]http://www.alan-g.me.uk/ [4]http://www.amazon.co

Re: [Tutor] Slack Token Invalid Syntax

2016-04-19 Thread Alan G
Apologies for top posting I blame the tablet! Malcolm, don't make us guess, show us how you put the quotes in and the error messages (in full). Alan g. Sent from my Fonepad Malcolm Boone <oasis.bo...@gmail.com> wrote: So you are saying the right side

Re: [Tutor] Alan's responce frustrated beginner

2005-09-29 Thread Alan G
as possible...) HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Flattening multi-dimentional list

2005-09-29 Thread Alan G
tuples but it should work for either) Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python equiv to PHP include ?

2005-09-29 Thread Alan G
can't use import because then Python would try to parse the HTML from the imported file. I thought PHP also parsed any html rendered through an included file? It does but PHP 'understands' HTML - or more specifically ignores it! Alan G

Re: [Tutor] call a def/class by reference

2005-09-29 Thread Alan G
(as strings) in which case a mapping has to exist somewhere already. I'm curious as to how you are addressing those issues? Is this something that only developers will be using? How will the user know what names are possible? Alan G. ___ Tutor maillist

Re: [Tutor] Prevent Coder's Remorse?

2005-09-28 Thread Alan G
(or class based) list of instances and write a del() method that removes itself. Then a class method can iterate that instance list doing whatever it needs to do... HTH, Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman

Re: [Tutor] Will the following code ever exit?

2005-09-17 Thread Alan G
. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why won't it enter the quiz? (off topic)

2005-09-17 Thread Alan G
quagmire. However given the nature of the code Nathan is producing and the prices he's charging I doubt if we are going to be contesting our share of his millions! It seems pretty harmless at this level. Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld

Re: [Tutor] Getting rid of the newline in file

2005-09-17 Thread Alan G
in the file handling topic of my tutorial. Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do fix this error?

2005-09-17 Thread Alan G
of string formatting. Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why won't it enter the quiz? (off topic)

2005-09-17 Thread Alan G
interests to maximise their own input. Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Multiple buttons, One callback (fwd)

2005-09-17 Thread Alan G
and the older 16 bit Win 3 API. Why 'thunk' I do not know but the term seems to have stuck long after everyone stopped using Win32 thunks... Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist

Re: [Tutor] Aschenputtel problem - Shorter is not better?

2005-09-16 Thread Alan G
-liner did!) then better to be slowly correct than rapidly wrong... :-) Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Multiple buttons, One callback

2005-09-16 Thread Alan G
is set up as a default parameter value in the lambda definition. HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] running scripts with windows

2005-09-15 Thread Alan G
If you are a Unix head using windows run to the cygwin site and install the whole caboodle. You'll think you are back in Unix land... If thats impossible them open a DOS boc (aka Command Prompt) and type python foo.py Or even just double click the file in Windows explorer... Alan G

Re: [Tutor] running scripts with windows

2005-09-15 Thread Alan G
Cygwin (http://www.cygwin.com/) It gives you a bash shell in Windows. Actually it gives you a whole Unix environment including X Windows and over 500 unix command line tools plus GNU C, sendmail, etc etc... Alan G. ___ Tutor maillist - Tutor

Re: [Tutor] Multiple Simultaneous Loops

2005-09-15 Thread Alan G
for f, x in bunch_of_files, range(z): ... Or maybe can I access the number of times the loop has run? I think thats what enumerate does... for x,y in enumerate([1,3,5]): ... print x,y ... 0 1 1 3 2 5 Yep, looks like what you need. Alan G Author of the Learn to Program web tutor

Re: [Tutor] Aschenputtel problem

2005-09-15 Thread Alan G
the intent even more explicit... Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] mamelauncher (fwd)

2005-09-14 Thread Alan G
if we see the full error text. Alan G ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] (no subject)

2005-09-14 Thread Alan G
or assembler, just be prepared to write a lot of code... HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python as operating system?

2005-09-14 Thread Alan G
to the hardware. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Another regular expression question

2005-09-14 Thread Alan G
easier to use a proper parser - such as beautiful soup. http://www.crummy.com/software/BeautifulSoup/ Is there any special reason why you are using a regex sledgehammer to crack this particular nut? Or is it just to gain experience using regex? Alan G

Re: [Tutor] Another regular expression question

2005-09-14 Thread Alan G
However is it normal that to parse a 2618 lines xml file it takes 20-30 seconds or so? Only if you are running it on an original Palm Pilot! Seriously, I'd expect it to be more like 2-3 seconds. Something fishy there. Alan G. ___ Tutor maillist

Re: [Tutor] IDEs

2005-09-14 Thread Alan G
in page. It was looking a tad daunting, now I don't need to. Excellent, thanks Kent. Alan G. PS Now off to find out what the heck 'Groovy' looks like! :-) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] socket question

2005-09-13 Thread Alan G
handling topic for some info and examples of usage: Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] hey i need some help here

2005-09-12 Thread Alan G
to do that before you can use it. When i insert python it says it is not recognizable as an internal or external command. can somebody help me? The installer should set everything up OK, but try typing PATH at the OS prompt and see if Python appears anywhere in the output. HTH, Alan G Author

Re: [Tutor] mamelauncher

2005-09-12 Thread Alan G
happening. HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] mamelauncher

2005-09-09 Thread Alan G
(scrollable listboxes etc) 2) Your mailer seems to be adding extra lines, ie I assume the code isn't really double spaced? :-) So whats the specific problem? Oh yes - and what version of Python? Alan G. I haven't added my error handling yet. Can anyone help? I've tried using spawn, system etc

Re: [Tutor] python strings?

2005-09-08 Thread Alan G
so the programmer doesn't need to. An alternative way to solve your probnlem is to use format strings: print Years = %s;\tPrincipal = %s % (years,principal) HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld

Re: [Tutor] Making Applets

2005-09-07 Thread Alan G
that is hearsay!) so I suspect you need to ask again on the MacPython programming list, they will know there what to do I'm sure. Sorry, but I suspect its just a tad too specialised a topic for the tutor list. Alan G. (Now someone will post the answer and prove me wrong - again

Re: [Tutor] New GUI module

2005-09-04 Thread Alan G
is an enhancement of the older SpecTcl which I used when I did Tcl GUI programming. Its quite easy to use although in common with mamy such tools the code it produces is not particularly pretty. I've never tried IDE Studio... Alan G. Currently learning JSP with the aid of the NetBeans IDE... Next step

Re: [Tutor] Print Output Location in Windows XP

2005-09-03 Thread Alan G
go? I've never tried that, being a command line junkie, but surely a similar prooblem ensues? Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org

[Tutor] New GUI module

2005-09-03 Thread Alan G
I haven't seen this mentioned on the list, but has anyone else noticed that v2.4 now includes the Tix GUI library in addition to Tkinter. Tix is a collection of more advanced Tk widgets (trees, tables etc) similar in many ways to PMW. Just in case its useful to anyone. Alan G

Re: [Tutor] Batch file to detect if Python is installed

2005-09-02 Thread Alan G
... just not programming in Python. Seems relevant to me... BUT if you can be sure Windows Host Scripting is installed ands active that is much much easier to use... Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman

Re: [Tutor] FIREWALLS

2005-09-02 Thread Alan G
? And if its not too long the code too? It saves us from guessing... :-) Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Working with files

2005-08-26 Thread Alan G
it all back to the file in one move. file.write(contents[pos + len(name):]) file.close() HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http

Re: [Tutor] IndexError and appending to lists [Was: Re: Need Helpon Assignment]

2005-08-25 Thread Alan G
for that to happen. put in those print statements to verify that the contents of those variables are what I expected them to be. That's all that mess is for. The debug/test print statements are fine, I was only pointing out that one line did nothing, not the entire block. HTH, Alan G Author

Re: [Tutor] Importing modules/classes

2005-08-25 Thread Alan G
- naturally! :-) Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] checking substrings in strings

2005-08-25 Thread Alan G
I would like to check if a certain word exists in a given string. since I learned to love lists, I used if myword in mystring: ...didnt work. I have now resorted to Which version of Python? 'boo' in 'mybigbooboo' True Works for me in Python 2.4... Alan G. (Regular readers

Re: [Tutor] (no subject)

2005-08-25 Thread Alan G
reading make a difference? Guessing, Alan G. PS. Anyone else notice how some topics seem to come up in bunches. We haven't had any questions involving binary files for months and this last week we've had at least 3! ___ Tutor maillist - Tutor

Re: [Tutor] (no subject)

2005-08-25 Thread Alan G
' list(s) [u'\u8c01', u'\u4eca', u'\u5929', u'\u7a7f', u'\u4ec0', u'\u4e48'] What seemed to be the problem? Or am I missing something? Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Remove a number from a string

2005-08-24 Thread Alan G
s = ' '.join(s.split()[1:]) or just s = s.split(None, 1)[1] Neat, I hadn't noticed the maxsplit parameter before. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] IndexError and appending to lists [Was: Re: Need Helpon Assignment]

2005-08-24 Thread Alan G
to increment N either. print N for i in range(N): And you can use len(T) to replace N here. T[i] This doesn't do anything! :-) print T[i] print date[i], open[i], hi[i], lo[i], close[i], vol[i] print T[1][2], T[0][0] z = (hi[2] +lo[2])/2.0 print z HTH, Alan G Author

Re: [Tutor] Split a string into characters

2005-08-23 Thread Alan G
How do I split a string like Hans into a list of characters ['H','a','n','s']? list('fred') ['f', 'r', 'e', 'd'] HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor

Re: [Tutor] Counting help

2005-08-23 Thread Alan G
Smith, Jack Smith, Sam Love, Joe Smith] counts = {} for name in names: if name in counts: counts[name] += 1 else: counts[name] = 1 print counts You could also use a list comprehension combined with the list count() method but I doubt if its much faster. HTH, Alan G Author

Re: [Tutor] Remove a number from a string

2005-08-23 Thread Alan G
()[1:]) If the numbes may form a more complex pattern then a regex would be better. Use the regex to find the end index and use a slice around the index. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Importing serial module

2005-08-22 Thread Alan G
small blocks of data and it should seem to function concurrently. If you can't do that then threads are your next best option. Alternatively write two programs and join them via a common UI program using popen or subprocess... Alan g ___ Tutor maillist

Re: [Tutor] Writing to text files

2005-08-22 Thread Alan G
a restaurant menu with a daily updated header. Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] reading excel and access files

2005-08-22 Thread Alan G
of trial and error. OTOH If you have ever done it from VB you will know that already1 Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Network Tutorials

2005-08-22 Thread Alan G
and accurate and quite good fun. Of course I may be a tad biased... http://www.btplc.com/thegroup/Networkstory/index.html Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] FW: How do you turn something into a number?

2005-08-22 Thread Alan G
corrected to fix a bug reported by a recent reader...) Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] reading excel and access files

2005-08-22 Thread Alan G
useful under Win32: http://www.microsoft.com/technet/scriptcenter/scripts/python/pyindex.mspx Excellent! thanks for posting this, I hadn't seen it before. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Confused about embedding python in Html

2005-08-21 Thread Alan G
JavaScript where you really need client side scripting. HTH, Alan G. ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Searching Sorted Lists

2005-08-20 Thread Alan G
1000 members. Premature optimisation is a dangerous trap. If you find you really have a problem then we can start to consider the options! Alan g ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] a little help

2005-08-18 Thread Alan G
Forwarding to tutor. ok. yes i do use windows. how do i write my own encription?? and yes i am going to use Tkinter You might like to take a look at this: http://docs.python.org/lib/crypto.html Alan G. ___ Tutor maillist - Tutor@python.org http

Re: [Tutor] Linux app question

2005-08-18 Thread Alan G
installer.py? THe usual unix shebang trick will work just fine. call your install script 'install' and put #! /bin/env/python as the first line. It should then run directly with no problems. Assuming of course that Python is already installed on the web server! HTH, Alan G

Re: [Tutor] Float Addition

2005-08-18 Thread Alan G
of that list. Another option might be to use -1 as the index to ensure you always use the last element: Dis_Tot = Dis_N + DEF_CARRIER_DIS[-1] HTH, Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Linux app question

2005-08-18 Thread Alan G
, tcl, ruby etc. It's been standard Unix practice for many years. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Is there anyway to set how many numbers are used after thedecimal in floating numbers?

2005-08-18 Thread Alan G
But usually simply controlling the display witrh a format string is all you want to do. HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman

Re: [Tutor] Need help with serial input

2005-08-18 Thread Alan G
# data is list of 65, 67, 69 for b in bytes: print 0x%X % b # represent number as hex You can use the struct module too, but it's a wee bit more complicated to use. An explanation of handling binary data can be found in the 'sidebar' in my File Handling tutorial topic HTH, Alan G Author

Re: [Tutor] Very simple question

2005-08-17 Thread Alan G
, like so: print Here is a split \ ... line Here is a split line HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] IOError with fcntl.ioctl

2005-08-17 Thread Alan G
it. Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] a little help

2005-08-17 Thread Alan G
(which I think you do?) then you will need to write your own encryption routine or find another module that works on Windows systems - anyone? Hopefully those hints will get you started. As before build it up slowly, get the login fixed first then add the features of the final program one by one. Alan

Re: [Tutor] Silly loop question

2005-08-16 Thread Alan G
changeIndex = nextRightBracket + 1 else: i += 1 read Alan's tutorial again. *grin* Umm, well the section on branching does refer to the two loops and when each is most appropriate, so... :-) Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld

Re: [Tutor] parsing through an output stream

2005-08-15 Thread Alan G
will need to use popen2 (Or the new subprocess module) to access stderr. I don't know for sure that mplayer is dping that but I'd say its a strong possibility. HTH, Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo

Re: [Tutor] Is it possible to...

2005-08-15 Thread Alan G
people is a basic question, Nope, this is a very good question. I haven't been paying attention to the card dealing functions posted recently but I assume adding in a dictionary to assign a value per card dealt wouldn't be too hard. You could then return the cards as tuples or somesuch... Alan G

Re: [Tutor] How can I make this run right?

2005-08-15 Thread Alan G
! What is it doing wrong? Is there an error message? What output did you expect? What did you get? Without that information we have to read the code and guess what you were trying to do. Then try to guess what might be different to what you expected. Alan G

Re: [Tutor] How can I make this run right?

2005-08-15 Thread Alan G
): result = 1 for x in range(2,n+1): result *= x return result By avoiding while loops you avoid all the mess of trying to maintain the counter - one of the most common causes of errors in programming! For a different approach see the recursion topic in my tutor. HTH, Alan G Author

Re: [Tutor] iterating in the same line

2005-08-14 Thread Alan G
can't even begin to guess from that what it is you are actually trying to do. Can you give us more explanation and maybe some sample data? Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Invoking bash from within a python program

2005-08-14 Thread Alan G
in practice? Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Sorting a list of lists aka nested lists

2005-08-14 Thread Alan G
it will take two of your lists and return -1,0 or 1. Or you can use Python's own logic to help def cmplists(lst1,lst2): return cmp(lst1[2],lst2[2]) Now you can sort Quant by passing your function into sort... HTH, Alan G. ___ Tutor maillist

Re: [Tutor] iterating in the same line

2005-08-14 Thread Alan G
in s: if line.startswith(substring): # do something here Alternatively a regular exression match as suggested by others is probably faster. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] re

2005-08-14 Thread Alan G
7th. But it depends on what exactly you want to do with it. If you do want a basic intro to regex you can try my tutorial topic on them. It doesn't cover the deeper bits but gives the 30% I use 70% of the time... HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk

Re: [Tutor] pychecker: x is None or x == None

2005-08-13 Thread Alan G
exists which could potentially change in some future exotic version of Python... You really are interested in the value of x not its identity. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] More problems with Learning Python example

2005-08-12 Thread Alan G
loop is doing, but thats the reason for the key error. HTH, Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] More problems with Learning Python example (fwd)

2005-08-12 Thread Alan G
the code was still in RAM or somesuch This is a good example of why timing tests must be done over many repetitions and averaged. Since you are running near the limit of recordability you might increase the number of loop iterations to 1000... Alan G

Re: [Tutor] pattern matching is too slow

2005-08-12 Thread Alan G
. Finally, lookaing at tyour regex you might be better using a simple string method - startswith() if temp.startswith(A): That should be even faster still. HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld

Re: [Tutor] Untainting CGI parameters

2005-08-11 Thread Alan G
= 'page' HTH Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Untainting CGI parameters

2005-08-11 Thread Alan G
the call to group(). I was just thinking if we got a None match. Ironic since it was me tagged the group call on in the first place! try/except it needs to be then... Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo

Re: [Tutor] changes made if IDLE not updating when application executed?

2005-08-11 Thread Alan G
before hitting F5? (I'm not sure whether this would have the result you see but its all I can think of!) Finally, what version of Python/IDLE and which OS? Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] changes made if IDLE not updating when application executed?

2005-08-11 Thread Alan G
before hitting F5? (I'm not sure whether this would have the result you see but its all I can think of!) Finally, what version of Python/IDLE and which OS? Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Customized endswith/startswith version

2005-08-10 Thread Alan G
'])] If the strings are all three chars you could do: [valid for valid in f if valid[:3] in ['abc', '123', 'ff5'] ] HTH, Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] SSH commands in Python on Linux

2005-08-10 Thread Alan G
explain it in fairly dense detail. 2- If not, then is it possible to feed the SSH password input with my Python script? Yes but you probably need the python version of expect module. Not part of the standard library but available on source-forge I believe. Alan G

Re: [Tutor] Untainting CGI parameters

2005-08-10 Thread Alan G
it's better to ask forgiveness than permission so... try: type = re.search('\w+', parameters['type'].value).group() except KeyError: type = 'page' HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld

Re: [Tutor] Curses example on Linux?

2005-08-09 Thread Alan G
curses mscvrt = curses.initscr() mscvcrt.getch() I will make the changes and upload the fixed file as soon as possible. Thanks for bringing it up. Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld Hi Hossein, According to: http://www.amk.ca

Re: [Tutor] function won't import from module

2005-08-09 Thread Alan G
with the function definition. Did you try calling mycalc.cmpSeq in this same session? Clutching at straws... Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] help

2005-08-09 Thread Alan G
to display the result on a console window, but by naming the script .pyw there will be no console so you won't see the output! Again you probably need to use a global Label control and set the text proprty to the result. HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk

Re: [Tutor] Using urllib to retrieve info

2005-08-09 Thread Alan G
then it could be anywhere in between those two extremes. HTH, Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] function won't import from module

2005-08-09 Thread Alan G
will see both and check the modification date but if it finds an isolated pyc first it will just use that. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Curses example on Linux?

2005-08-09 Thread Alan G
at the bottom of each page - it saves bandwidth on the tutor list (and my embarrasment :-) BTW Which version of the tutor are you reading? The inti bug seems to have been fixed in the latest English version... Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld

Re: [Tutor] How do I fix this ValueError?

2005-08-09 Thread Alan G
. Shelve would be pretty much ideal for this application. Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] raw string - solution to open_new() problem

2005-08-08 Thread Alan G
becoming unable to locate the file in question), I'm eager to hear it. It's not the function that does it, it's Python itself. If you just try using print for the two values(with and without 'r') you will see the same effect. It's standard Python string handling. Alan G

Re: [Tutor] Using urllib to retrieve info

2005-08-08 Thread Alan G
It runs fine but the file saved to disk is the information at : 'http://support.mywork.co.uk' not 'http://support.mywork.co.uk/index.php?node=2371pagetree=fromid=20397objectid=21897;' Could there be cookies involved? Just a thought, Alan G

Re: [Tutor] What's the invalid syntax? Code supplied

2005-08-08 Thread Alan G
a posting with no clue as to the problem but full of basic syntax errors. And maybe it could have been expressed more subtly but having returned from 3 long days I was not in the mood for sweet talking! :-( Sorry if it offended, it was not meant so to do. Alan G Author of the Learn to Program web

Re: [Tutor] Lots of variables

2005-08-07 Thread Alan G
as the values. See the bank account example in my OOP topic for an example. Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What's the invalid syntax? Code supplied

2005-08-07 Thread Alan G
take the time to *understand* what you are doing before doing it! Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do I fix the following error? Code and error messagesupplied.

2005-08-04 Thread Alan G
exactly extract the string from within in_line). The answer to most of your questions is given inthe error messages Nathan, just look at what it tells you and the approximate location of the error in your code. HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp

Re: [Tutor] Web Browser in Python

2005-08-04 Thread Alan G
mentined it does at least have an HTML rendering control to start from, I assume you don't really want to have to write a complete rendering engine too?! Although if you do at least Python has its HTMLparser module to help... Alan g ___ Tutor maillist

  1   2   3   >