Re: [Tutor] Strange list behaviour in classes

2010-02-25 Thread Walter Prins
On 25 February 2010 11:22, Dave Angel wrote: > The indentation in your code is lost when I look for it -- everything's > butted up against the left margin except for a single space before def > variance. This makes it very hard to follow, so I've ignored the thread > till now. This may be caus

Re: [Tutor] help with loops

2010-03-25 Thread Walter Prins
So, am I right that for each X value in file 2, you want to look up to see if you can find a corresponding line in file 1 where the value from file 2 falls between the X and Y value from file 1, and if found, then output the original line from file 2 and the 6th column from the found line from file

Re: [Tutor] how to change some words in a text file

2010-03-28 Thread Walter Prins
On 28 March 2010 23:37, Shurui Liu (Aaron Liu) wrote: > Tell me how to do what i want, please. > Both me and someone else have already told you how to replace a substring in a string with something else in your earlier question/posting/thread. If you've not understood what was written there, th

Re: [Tutor] Iterating through a list of strings

2010-05-05 Thread Walter Prins
On 03/05/10 06:16, Thomas C. Hicks wrote: I am using Python 2.6.4 in Ubuntu. Since I use Ubuntu (with its every 6 months updates) and want to learn Python I have been working on a post-install script that would get my Ubuntu system up and running with my favorite packages quickly. As an aside,

Re: [Tutor] Trying to get this to work - attached is the source code

2010-05-17 Thread Walter Prins
Hi Peter, We're not familiar with the book, so you'll have to tell us exactly what you're doing, what you're seeing, and what you're expecting ot see instead. Suffice it to say, the script seems fine. When you run it (from an operating system command prompt) it will print, in the command window,

Re: [Tutor] PYTHON 3.1

2010-05-18 Thread Walter Prins
IMHO: If you're new to Python and just trying to learn the language, I'd suggest sticking to Python 2.x for now, as the vast majority of Python material out there still use and refer to Python 2.x syntax. IMHO it'll be a lot easier learning and coping with what's changed in Python 3 only once you

Re: [Tutor] while loops causing python.exe to crash on windows

2010-06-07 Thread Walter Prins
On 7 June 2010 02:37, Alex Hall wrote: > I am not sure how else to explain it. I want to loop until the value > of a variable changes, but while that loop is taking place, the user > should be able to perform actions set up in a wx.AcceleratorTable. > Looping, though, causes Windows to tell me th

Re: [Tutor] finally

2010-06-24 Thread Walter Prins
On 24 June 2010 15:08, Christopher King wrote: > so if you encounter an error that you won't handle, but you still to close > files and save data, you could use finally? > More strongly, you *should* use finally, as there's no other way to ensure your cleanup code will run regardless of unpredic

Re: [Tutor] finally

2010-06-24 Thread Walter Prins
On 24 June 2010 15:34, Chris wrote: > cleanup code means code to close files and save data, right > Possibly yes, although I'm referring generally to freeing any resources (objects, memory, files, whatever) your code has acquired/opened that should be freed whether or not the code succeeds (with

Re: [Tutor] Fwd: HELP!

2010-06-28 Thread Walter Prins
On 28 June 2010 21:36, Chris wrote: > My friend jacob had a question. I can't really answer it, but you guys > can. Send you replies to him not me. Oh, and jacob, I'm forwarding you > message to the Python Mailing list. > > Hi Chris/Jacob, I'm not sure if it's just me, but I'd have been slightl

Re: [Tutor] OT: need computer advice from wise Tutors

2010-06-29 Thread Walter Prins
At the risk of adding more fuel to the fire, I'll simply note that a) I sometimes use Gmail while we visit folks in South Africa who are still on 56k dial-up. Initial log-in can be a bit slow, but generally you'd be surprised at how efficient/quick it is w.r.t bandwidth. (As an aside, with the am

Re: [Tutor] "x and y" means "if x is false, then x, else y"??

2010-07-05 Thread Walter Prins
On 5 July 2010 08:27, Richard D. Moores wrote: > See < > http://docs.python.org/py3k/library/stdtypes.html#boolean-operations-and-or-not > >. > I am quite familiar with the meaning of "x and y" in Python, and how > it is evaluated -- first x, and only if x is False, then evaluate y. > Sorry if t

Re: [Tutor] string to list

2010-08-05 Thread Walter Prins
Just a minor related/tangential suggestion -- O'Reilly had a stand at the recent EuroPython conference I attended and I was paging through "Bioinformatics Programming using Python", Book reference: http://oreilly.com/catalog/9780596154516 Just thought I'd mention it as it seems relevant to the cur

Re: [Tutor] word_probles.py

2010-08-08 Thread Walter Prins
Hi, On 08/08/10 20:01, Shurui Liu wrote: Okay. I am using WinXP, Python 3.1 on my workstation. And this is the Python version information I got from putty.exe: Python 2.5.4 (r254:67916, Apr 13 2009, 18:09:11) [GCC 4.2.1 20070719 [FreeBSD]] on freebsd7 To add a small comment to what Dave's alr

Re: [Tutor] Multiple file open

2010-08-20 Thread Walter Prins
Hello Nitin, On 20/08/10 16:21, nitin chandra wrote: import sys,os, fileinput [...] while True: try: line1 = fp1.readline().split(",") line2 = fp2.readline().split(",") [...] fp3.write(str3) You're missing the completion for the try/finally block. Tr

Re: [Tutor] Databases in Python

2010-08-24 Thread Walter Prins
On 24 August 2010 17:47, aug dawg wrote: > if searcher in database: >> # Figure this out. >> if "exit database" in command: >> print "Bye!" >> sys.exit() >> > The first thing that caught my eye was the "#figure me out" line -- python is expecting a statement there, a comment doesn't count. You

Re: [Tutor] exercise problem

2010-08-27 Thread Walter Prins
Hi Roelof, See below On 27 August 2010 16:05, Roelof Wobben wrote: > > uitkomst = add_vectors[u,v] > > But now I get this error message : > > > Traceback (most recent call last): > *File "C:\Users\wobben\workspace\oefeningen\src\test.py", line 27, in > * > > uitkomst = add_vectors[u,v] > > Type

Re: [Tutor] exercise correct ??

2010-09-06 Thread Walter Prins
Hi Roelof, On 6 September 2010 18:32, Roelof Wobben wrote: >>>> index_of(5, (1, 2, 4, 5, 6, 10, 5, 5), 4) > 6 > > But in that tuple 5 is on position 3. > > Is the exercise here wrong ? > > Not neccesarily... I notice that the call is similar to the previous test case, but has an

Re: [Tutor] recursive problem

2010-09-09 Thread Walter Prins
On 9 September 2010 12:59, Shashwat Anand wrote: > > Let's say n, l = 2, [2, 9, [2, 1, 13, 2], 8, [2, 6]] > Simply Flatten the list l, which will be then be; flatten(l) = [ 2, [2, 9, > 2, 1,13, 2, 8, 2, 6 ] > Now count for n; flatten.count(n) > > This is fine except that the excercise probably ha

Re: [Tutor] recursive problem

2010-09-11 Thread Walter Prins
> That's the whole point! You don't WANT to know what type it is. You want to > just use it how you want, an if it behaves properly, who cares what type it > is? > > See when you type check you are forcing the user to use those types. What > if they want to derive a subclass from list? Is there rea

Re: [Tutor] recursive problem

2010-09-11 Thread Walter Prins
Just a quick contribution for what it's worth: One of the subjects being implicitly talked about here is "introspection" -- you may want to google that and see else you can find. That said, a nice article covering some of Python's introspection features is presented here on IBM's site: http://www.i

Re: [Tutor] FW: wierd replace problem

2010-09-14 Thread Walter Prins
On 14 September 2010 08:38, Roelof Wobben wrote: > > I understand what you mean but we're talking about a text-file which will > be read in a string. > So I can't escape the quotes. As far as I know I can't control how Python > is reading a text-file with quotes. > > Putting a value into a strin

Re: [Tutor] FW: wierd replace problem

2010-09-14 Thread Walter Prins
On 14 September 2010 11:09, James Mills wrote: > $ python > Python 2.6.5 (r265:79063, Jun 13 2010, 14:03:16) > [GCC 4.4.4 (CRUX)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> s = "foo\"bar'" > >>> s > 'foo"bar\'' > I'd like to point something out here.

Re: [Tutor] FW: wierd replace problem

2010-09-14 Thread Walter Prins
Roelof, On 14 September 2010 17:35, Roelof Wobben wrote: > But how can I use the triple quotes when reading a textf-file ? > To repeat what I said before, obviously not clearly enough: All the quoting stuff, escaping stuff, all of that ONLY APPLIES TO STRINGS/DATA INSIDE OF YOUR PYTHON CODE.

Re: [Tutor] FW: wierd replace problem

2010-09-14 Thread Walter Prins
On 14 September 2010 21:10, Roelof Wobben wrote: > I understand it but I try to understand why in a file there is this 'word > python makes a "'word. > Python doesn't change what it reads from the file. However, depending on how you ask Python to tell you what it's read (or what the contents of

Re: [Tutor] FW: wierd replace problem

2010-09-14 Thread Walter Prins
Correction on my last paragraph on my last mail: "See also when Python is asked to "print" the string, you can see the escape characters really there." -> "See also when Python is asked to "print" the string, you can see the escape characters aren't part of the actual contents of the string." _

Re: [Tutor] Test Drive Development, DocTest, UnitTest

2010-09-22 Thread Walter Prins
You might also have a look at some of the other popular testing frameworks e.g. Nose (http://somethingaboutorange.com/mrl/projects/nose/0.11.2/) and py.test (http://wiki.python.org/moin/PyTest) Both of these have the advantage that they're discovery based, so they'll go and sniff out tests from yo

Re: [Tutor] EXECUTING PYTHON AND SQL STAMENTS

2010-10-05 Thread Walter Prins
Thank you for taking the time to answer. I already changed my os.system() for your code. I got an error, when I executed this: > os.system(" 'C:/Archivos de programa/FWTools2.4.7/bin/ogr2ogr.exe ' "+arg1 > +" -where "+arg2 +" " +arg3) > it throws me that "C:/Archivos" is not recognized as an exec

Re: [Tutor] WRITING XLS FROM OS.WALK()

2010-10-08 Thread Walter Prins
On 8 October 2010 20:34, Susana Iraiis Delgado Rodriguez < susana.delgad...@utzmg.edu.mx> wrote: > Hello members: > I developed a Python module to make a list which contains all the files > ending with .shp and .dbf extensions, I have solved this already, but now I > want to write an excel file fr

Re: [Tutor] Hiding Superclass Methods

2010-10-11 Thread Walter Prins
On 11 October 2010 15:55, Adam Bark wrote: > You can use __getslice__, __setslice__ etc. methods. They're detailed in > the list docstrings. Here's an example of using __getslice__ > > >>> dir([]) > ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', > '__delslice__', '__doc__'

Re: [Tutor] WRITING XLS FROM OS.WALK()

2010-10-11 Thread Walter Prins
On 11 October 2010 14:37, Susana Iraiis Delgado Rodriguez < susana.delgad...@utzmg.edu.mx> wrote: > The other question is about the excel files management, if I want to > manipulate this data to work it in Excel should I look for an excel library > in python right? > > Yes. I already mentioned one

Re: [Tutor] Attempt to overwrite excel cell Python

2010-10-11 Thread Walter Prins
Hi Susana, On 11 October 2010 21:08, Susana Iraiis Delgado Rodriguez < susana.delgad...@utzmg.edu.mx> wrote: > > *Exception*: *Attempt to overwrite cell*: sheetname='shp' rowx=1 colx=0, > don't know what is wrong > > This is a default of xlwt behaviour for writing Excel files. It assumes it woul

Re: [Tutor] pickle problem

2010-10-12 Thread Walter Prins
On 12 October 2010 18:35, Roelof Wobben wrote: > image = urllib.URLopener() > image.retrieve("http://www.pythonchallenge.com/pc/def/peak.html","banner.p"; > ) > OK firstly, image is an URLopener, so whatever URL you specify, that's the file that it will download. (I would therefore suggest you

Re: [Tutor] Zip Command

2010-10-14 Thread Walter Prins
On 14 October 2010 07:12, wrote: > Does window os have a zip command for python like linux and unix. > If yes, please what is it. > If no, please what does it use to create a zip folder. > I am working on an example in byte of python but the zip command is from > linux but I use windows. > Thank

Re: [Tutor] Zip Command

2010-10-14 Thread Walter Prins
Alan, On 14 October 2010 09:51, Alan Gauld wrote: > gzip - aka gunzip GNU opensource version - probably your best bet. > This is not correct. Gzip zip's format is not the same as the pkzip related format used by Winzip and other "zip" utilities. Gzip also only compresses, it does not deal with

Re: [Tutor] pythonpath

2010-11-01 Thread Walter Prins
On 1 November 2010 21:57, Chris King wrote: > On 11/1/2010 5:47 PM, Vince Spicer wrote: > it didn't work > > Then you've done something wrong. Post the code, and/or the error message, if any. Walter ___ Tutor maillist - Tutor@python.org To unsubscr

Re: [Tutor] pythonpath

2010-11-01 Thread Walter Prins
On 1 November 2010 21:58, Chris King wrote: > the first way with work for Window, the second is for Linux or posix > systems > > Sorry I can't help with PYTHONPATH on windows. > > To set a PYTHONPATH in Windows, click "Start", right click "My computer", click "Properties", click "Advanced" tab

Re: [Tutor] argparse: how to use the returned Namespace object?

2010-11-04 Thread Walter Prins
On 4 November 2010 23:20, Mac Ryan wrote: > My question boils down to: how can I expand the Namespace object in > order to get a list of keyword arguments? > If "ns" is your Namespace object, then use ns.__dict__, which you can directly pass to your commands, e.g. do_stuff(**ns.__dict__) I'll

Re: [Tutor] argparse: how to use the returned Namespace object?

2010-11-04 Thread Walter Prins
On 5 November 2010 00:40, Mac Ryan wrote: > > Thank you Walter. I got it and it works! :) > Excellent. I thought I'd mention here you can also create your own Namespace object (e.g. if you find accessing __dict__ not ideal or something you can do your own implementation, which will work as long

Re: [Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-11-05 Thread Walter Prins
One final suggestion to add to the others: Install and use both pylint, and pychecker. That will help ensure you don't make silly errors or omissions and follow a consistent coding style that matches the generally accepted format well. PyLint: http://pypi.python.org/pypi/pylint PyChecker: http://

Re: [Tutor] Commercial or Famous Applicattions.?

2010-11-08 Thread Walter Prins
Hi Jorge, Have a look at this page: http://www.python.org/about/quotes/ A few choice points to maybe make him think: 1.) Python is one of the top 3 languages at Google. (Where is PHP?...) 2.) Python can be used for GUI apps and has bindings for several GUI widget sets. (PHP?) 3.) Python can be

Re: [Tutor] What is a "state variable"?

2010-11-11 Thread Walter Prins
On 11 November 2010 20:11, Richard D. Moores wrote: > The term comes up in the 2nd section of > > > > > didn't help. > >

Re: [Tutor] What is a "state variable"?

2010-11-11 Thread Walter Prins
On 11 November 2010 22:47, Walter Prins wrote: > Enter object orientation: If instead however, you turn those functions > into a class, you can then instead have them all "share" the same > variable(s) that's commonly visible to each of them due to paramter passing >

Re: [Tutor] Grabbing Information from txt files

2010-11-12 Thread Walter Prins
Random thoughts: 1.) Maybe you should be looking at something like Fuppes instead: http://fuppes.ulrich-voelkel.de/ ? 2.) Even so, continuing with your current direction: there appears to be a module/wrapper of MediaInfo for Python, thus removing the need to scrape information from MediaInfo's ou

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread Walter Prins
Additionally to what's already been said, you may also want to have a look at the Pyjamas project (which can work in conjunction with Django as a back-end), there's a short article about implementing an MVC architecture in Pyjamas here: http://pyjs.org/wiki/modelviewcontroller/ Also you may want t

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-14 Thread Walter Prins
On 15 November 2010 00:12, Alex Hall wrote: > Again: is there a basic tutorial that would explain how control works > when dealing with a gui, especially one that is meant to last a long > time but occasionally block input? > Normally the way is for the GUI controls (e.g. widgets, grids, objects

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-16 Thread Walter Prins
Not wanting to hijack Terry's conversation, but for what it's worth: On 16 November 2010 18:08, Patty wrote: > If I just can't figure out how to do this with Tkinter and the Python > Imaging Library, is 'wxPython' the additional software I would want to > install and try with? Is its purpose to

Re: [Tutor] new to python

2010-11-18 Thread Walter Prins
On 18 November 2010 21:13, gary engstrom wrote: > Being new to python I was wondering if there is a way to import exel data > into pyrhon matrix/arrays so that I have some data to work with. I know R > uses Rcmdr as an easy interface > for excel data, which helps keep the reader engaged while lea

Re: [Tutor] new to python

2010-11-19 Thread Walter Prins
On 19 November 2010 00:20, Joel Schwartz wrote: > For those of us who are new to writing code that makes various software > packages interact with each other, can you say more about what "COM object > model" means in this context and where one can learn how to use it to make > Python interact wit

Re: [Tutor] Fw: Installing Pyserial for Python27 on Win 7

2010-11-23 Thread Walter Prins
On 23 November 2010 03:02, John Smith wrote: > I _assume_ the source is the one that is a tar.gz thingy. Since Windows > will not handle the unpacking of that, I have to install a > decompressor/unpacker to do it. Then I can finally get around to installing > the serial package. Maybe. Unless I r

Re: [Tutor] Is Python useful for emulating?

2010-11-27 Thread Walter Prins
On 28 November 2010 02:59, Mauricio Alejandro wrote: > I never created any emulator before, and i'm learning C++. Let's say i try > to write an emulator for... SNES. Would Python be fast enough? > Also, any useful advice you can give me? Things i should know about before > i start coding? > Beca

Re: [Tutor] Pyserial and invalid handle

2010-11-28 Thread Walter Prins
John, On 28 November 2010 15:55, John Smith wrote: > Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] > on win32 > Type "copyright", "credits" or "license()" for more information. > > >>> import serial > >>> ser = serial.Serial('com1', timeout = 5) > >>> x = ser.read() >

Re: [Tutor] Pyserial and invalid handle

2010-11-28 Thread Walter Prins
Also note this link: http://ur.ly/vVU9 It confirms that PySerial 2.4 works fine on Windows 7 64 bit. (I've also just downloaded and checked that installing pyserial 2.4 replaces the existing pyserial and it does on my Python installation.) Walter ___ T

Re: [Tutor] Pyserial and invalid handle

2010-11-30 Thread Walter Prins
Hello John On 29 November 2010 21:44, John Smith wrote: > Hi, Walter - > > Thanks for all the research. This was my second attempt at installing the > 2.4 version. I did it thus: > > E:\Python27\pyserial-2.4>..\python setup.py install > standart distutils > running install > running build > ru

Re: [Tutor] Pyserial and invalid handle

2010-11-30 Thread Walter Prins
Hello John, On 30 November 2010 16:57, John Smith wrote: > Hi, Walter - > > I did the above and then got this: > > >>> import serial > > > Traceback (most recent call last): > File "", line 1, in >import serial > File "E:\Python27\lib\site-packages\serial\__init__.py", line 18, in > >

Re: [Tutor] Web Harvesting & AJAX/Javascript

2010-11-30 Thread Walter Prins
Hello Roy On 29 November 2010 19:42, Roy Hinkelman wrote: > Researching this has led me to PAMIE and Selenium. PAMIE is giving me > problems with permissions, and the discussion group appears to be fading > away. I have not tried Selenium yet. Both open a browser instance, and PAMIE > is quite s

Re: [Tutor] print problem

2010-12-03 Thread Walter Prins
Please post the exact contents of "test_script_test.py", don't paraphrase, don't abbreviate. A good place to post code snippets are here: http://pastebin.com/ That said, I'll try to put down some of the troubleshooting thought process you should be having. Firstly, the error message is telling yo

Re: [Tutor] Newline

2010-12-03 Thread Walter Prins
Hello Ava/Ashley On 4 December 2010 01:47, Ashley Blackwell wrote: > Exactly what is a newline character? Not all characters used to encode information are printable/displayable characters like the letters in the alphabet or numerals or punctuation and symbols. There's several "special" chara

Re: [Tutor] 'or' in assignment (not if statement)?

2010-12-10 Thread Walter Prins
Hi Steven On 10 December 2010 03:50, Steven D'Aprano wrote: > Some languages (Pascal comes to mind) doesn't have short-circuit behaviour > at all. > Don't mean to nit pick, but in my experience it really depends on the compiler implementation and which version of Pascal you're talking about. Ce

Re: [Tutor] role playing game - help needed

2010-12-12 Thread Walter Prins
On 12 December 2010 19:16, David Hutto wrote: > I recall you making a habit of being an > asshole(pystats should ring a bell, thanks for giving me the credit > for inspiration...bitch) > Rudeness objection. Ad-hominem objection. Come on, this is not kindergarten. We all have our foibles, and

Re: [Tutor] Trying to parse a HUGE(1gb) xml file in python

2010-12-21 Thread Walter Prins
On 21 December 2010 14:11, Alan Gauld wrote: > But I don't understand how uncompressing a file before parsing it can > be faster than parsing the original uncompressed file? > Because of IO overhead/benefits. It's not so much that the parsing aspect of it is faster of course (it is what it is),

Re: [Tutor] Trying to parse a HUGE(1gb) xml file in python

2010-12-21 Thread Walter Prins
On 21 December 2010 17:57, Alan Gauld wrote: > > "Stefan Behnel" wrote > > But I don't understand how uncompressing a file before parsing it can >>> be faster than parsing the original uncompressed file? >>> >> >> I didn't say "uncompressing a file *before* parsing it". I meant >> uncompressing

Re: [Tutor] Java Virtual Machine Launcher Question

2010-12-28 Thread Walter Prins
I'm guessing this question has something to do with this: http://isatab.sourceforge.net/validator.html Which appears to be some sort of Java application that validates "isatab" files, which appear to be related to mentioned magetab files. I'm further guessing that you thought a .jar file (A Java

Re: [Tutor] subclass not inheriting attributes?

2011-01-03 Thread Walter Prins
On 4 January 2011 00:47, Alex Hall wrote: > class parent(object): > def __init__(self, l=None): > if l is None: l=[] > Missing "self". Perhaps you meant: class parent(object): def __init__(self, l=None): if l is None: self.l=[] else: self.l=l Walter __

Re: [Tutor] subclass not inheriting attributes?

2011-01-03 Thread Walter Prins
Sorry, my last post was too hasty. You also had a problem calling super. It should be like this: class parent(object): def __init__(self, l=None): if l is None: self.l=[] else: self.l=l class child(parent): def __init__(self, *args, **kwords): super(child, self).__init__(*args, **kwor

Re: [Tutor] subclass not inheriting attributes?

2011-01-03 Thread Walter Prins
On 4 January 2011 01:16, Vern Ceder wrote: > I believe you need to pass the object both to super() and to the method > itself, as in: > > super(parent, self).__init__(self, *args, **kwords) > > See the example at > http://docs.python.org/library/functions.html?highlight=super#super > > HTH, > > V

Re: [Tutor] Parse MPL files

2011-01-08 Thread Walter Prins
On 7 January 2011 22:16, PyProg PyProg wrote: > Hi all, > > I'm looking for a way to parse MPL files (.MPL or .mpl extension). > These files are contained in the tree of some cameras that support the > AVCHD ... and some cameras filming with a stream mpeg-ts. > I've only been able to locate this

Re: [Tutor] Ideas about global variables for accessing project's file

2011-01-12 Thread Walter Prins
Hi, On 12 January 2011 13:11, Kann Vearasilp wrote: > Below is the structure of my project > > /src > /src/modules/mod1 > /src/modules/mod2 > /src/data/file1 > /src/data/file2 > > > I wrote some codes in mod1 to access data in file1. And to read the file1, > I am hard coding in the mod1, which i

Re: [Tutor] How to plot graph?

2011-01-20 Thread Walter Prins
Hi Tee, On 20 January 2011 03:48, tee chwee liong wrote: > actually i just want to plot a simple x and y graph. any suggestion? > how about using excel to plot? any sample code that i can follow to: > 1) launch excel > 2) read x-y from a text file > 3) plot graph > Try this page: http://www.bl

Re: [Tutor] Telephone app

2011-01-22 Thread Walter Prins
Hi David, On 22 January 2011 20:03, David Hutto wrote: > This is just a reach question. What modules would i want to use if i > wanted to just send the signal, and receive the signal, other than > maybe, signal. In other words please tone.dumb it down, and show a > pseudo example. > I've read

Re: [Tutor] Telephone app

2011-01-23 Thread Walter Prins
On 23 January 2011 21:04, David Hutto wrote: > So I have to receive the signal that the phone is ringing(then I'm > assuming it sends the caller id info in between rings in some form)/or > transmit a series of tones to them to connect. > > So I think my main question is what modules might be rele

Re: [Tutor] extracting text from word files (.doc, .docx) and pdf

2011-01-25 Thread Walter Prins
On 25 January 2011 21:52, Juan Jose Del Toro wrote: > Dear List; > > I am looking for a way to extract parts of a text from word (.doc,.docx) > files as well as pdf; the idea is to walk through the whole directory tree > and populate a csv file with an excerpt from each file. > For PDF I found Py

Re: [Tutor] Need help on Setup.py

2011-02-01 Thread Walter Prins
Hi Victor, On 1 February 2011 07:38, Victor Binns wrote: > I have been trying to add some of the extras with python such as pywin32 > and others. > > when i click on setup.py it does not work. > > I need help on the problem. > > This is because setup.py is not intended to just be run without pa

Re: [Tutor] Higher-Order Function Examples

2011-02-14 Thread Walter Prins
2011/2/14 Rafael Durán Castañeda > Could we consider sorted as an high order function? > > sorted_list = sorted(list_strings, key = str.lower) > > No because sorted() returns a list as a result. A higher order function produces another function as a result, or takes one or more functions as a p

Re: [Tutor] Higher-Order Function Examples

2011-02-14 Thread Walter Prins
2011/2/14 Rafael Durán Castañeda > In the example I gave: > > > sorted_list = sorted(list_strings, key = str.lower) > > sorted takes str.lower as a parameter, doesn't it? So, it should be a high > order function > My apologies! Yes, you are of course quite correct! :) Walter __

Re: [Tutor] Convert string to long

2011-02-24 Thread Walter Prins
On 24 February 2011 11:50, tee chwee liong wrote: > > int(s,16) for a hex string > > > > great but the leading zeroes are being truncated. > You need to seperate the concept of display/formatting of some thing from the actual thing/value being displayed. Normally when we humans communicate num

Re: [Tutor] Help on Python Looping Please

2011-02-24 Thread Walter Prins
On 24 February 2011 14:52, pyhx0r wrote: > *Why do in my code, it loops to all values and not in Mark Pilgrim’s code? > * > > Because in Mark's code the loop is terminated by the return statement (contained in the utility function approximate_size().) In your code you've removed the entire funct

Re: [Tutor] Help on Python Looping Please

2011-02-24 Thread Walter Prins
On 24 February 2011 16:22, Dave Angel wrote: > > (Is there a reason you double-spaced all that code? It makes it very hard > to read, and quite difficult to quote, since I had to delete every other > line.) > For what it's worth the code came out perfectly fine on my email reader (GMail). (No d

Re: [Tutor] Cross-Module Interaction

2011-02-26 Thread Walter Prins
On 26 February 2011 05:33, Corey Richardson wrote: > Aha, that explains why I didn't get any results. Each file got its own > interpreter instance. > Not wanting to nit pick, but no: It's not that each *file* does has its own interpreter instance, it's that every python instance that you start d

Re: [Tutor] Cross-Module Interaction

2011-02-26 Thread Walter Prins
On 26 February 2011 05:33, Corey Richardson wrote: > > I'm slightly concerned about performance when it comes to > reading/writing to disk a lot when doing things like that, since if this > thing ever needs to scale I want it to be able to do that. > I'd be tempted to say you should not be worry

Re: [Tutor] Cross-Module Interaction

2011-02-26 Thread Walter Prins
On 26 February 2011 11:06, Corey Richardson wrote: > I ran them like this: > python use1.py > python use2.py > python plib.py > > Each file got its own instance of the interpreter. > Yes, but not because instances are intrinsically linked to seperate python modules, which is what it sounds like

Re: [Tutor] Cross-Module Interaction

2011-02-26 Thread Walter Prins
On 26 February 2011 11:10, Corey Richardson wrote: > On 02/26/2011 06:05 AM, Walter Prins wrote: > > I'd be tempted to say you should not be worrying about such performance > > issues at this stage. > > Indeed, but I can't have every piece of variable information

Re: [Tutor] accessing another system's environment

2011-02-26 Thread Walter Prins
On 26 February 2011 04:26, Bill Allen wrote: > Yes, that's it exactly.:-) > > I administrate the workstations in our engineering environment and some of > the major pieces of software we use are configured via the Windows system > environment variables. Being able to reach out to a PC and ch

Re: [Tutor] Running Existing Python

2011-02-26 Thread Walter Prins
On 26 February 2011 21:18, Justin Bonnell wrote: > --I tried to follow this using: > /jwbonnell/bin/Python 2.7/Extras/Demo/tkinter/guido/hello.py > which is the correct location of the hello.py file. > Try putting quotes around the full path. The problem is that the space between "Python" and "2

Re: [Tutor] Saving information for my program

2011-03-21 Thread Walter Prins
On 21 March 2011 15:11, michael scott wrote: > I was thinking I have 2 options, which is save the information to a text > file a write / read it in every session, but I have no idea how to do this > with class attributes. I know how to do it for like a paragraph of text, but > I have no idea how

Re: [Tutor] script conversion windows -> linux error

2011-03-25 Thread Walter Prins
On 25 March 2011 18:26, Rance Hall wrote: > config_version = config.get('versions','configver',0) > > This line fails under 3.2 Linux with the error message: > > TypeError: get() takes exactly 3 positional arguments (4 given) > > What could the 4th argument be? I only see three. > > This same

Re: [Tutor] script conversion windows -> linux error

2011-03-25 Thread Walter Prins
Ugh, please excuse my tardiness and ignore the numbered items below my signature which I was intending to delete, I accidentally hit "end" before I cleaned up the post... :red faced: ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscri

Re: [Tutor] How to read remote text file?

2011-03-28 Thread Walter Prins
Hi On 28 March 2011 11:53, Steven D'Aprano wrote: > There are some projects that have tried to reverse-engineer the format, > like the xlrd package. > Yes, just to add, xlrd is the "reader" module, the Excel "writer" is xlwt, available here: http://pypi.python.org/pypi/xlwt Walter

Re: [Tutor] HELP

2011-04-02 Thread Walter Prins
2011/4/2 ISAAC Ramírez Solano > > Hi... My name is Isaac, I need some help to programm in python, I know some > things that are really basic like lists and recursivity and with that we > shoul create an GPS with a global variable, but what I'm trying to do is to > make a function that could call

Re: [Tutor] Tutor Digest, Vol 86, Issue 12

2011-04-03 Thread Walter Prins
Hello, 2011/4/3 Mateusz Koryciński > > (2) You have a *mess* of unreadable variable names. You have: >> >> w.steps w.x w.y w.world data.c data.n data.e data.s data.w data.cc >> >> (yes, you have data.c AND data.cc!!!) plus loop variables z i j and r, >> and z is never used! How is anyone sup

Re: [Tutor] Python 3.2 Install Not Responding To Python Command!!

2011-04-09 Thread Walter Prins
On 9 April 2011 17:44, Nevins Duret wrote: > Compiling with Ubuntu > > # get required packages for buildsudo apt-get install build-essential > libncursesw5-dev libreadline5-dev libssl-dev libgdbm-dev libc6-dev > libsqlite3-dev tk-dev > # get sourcewget http://www.python.org/ftp/python/3.2/Pyth

Re: [Tutor] Python 3.2 Install Not Responding To Python Command!!

2011-04-10 Thread Walter Prins
On 9 April 2011 19:45, Nevins Duret wrote: > I can't thank you enough for your help. Yes, I usually use the Synaptic > Package Manager, however in this case, Python version 3.2 is not on the > Synaptic package Manager. This is why I chose to build it from source. As > far as what I think is ca

Re: [Tutor] voluntary work :p:

2011-04-26 Thread Walter Prins
On 26 April 2011 04:59, Wolf Halton wrote: > I didn't get anything out of pythonchallenge. All seems static. Do you > need flash or something to make the magic happen? > > To add to what the others have said and explain the "flow" a bit more: Each challenge is a puzzle, with hints present in v

Re: [Tutor] Gtk - relational data display and edit

2011-04-26 Thread Walter Prins
On 26 April 2011 16:34, wrote: > Hi, > > I am reading in data from a csv file which will be in a format like this > > User1, attrib1, attrib2 > User2, attrib1, attrib2 > Etc. > Why would the data be in this format? Are you defining it? Reason I ask is that, relationally speaking, (e.g. databas

Re: [Tutor] How to compile source code in debian

2011-05-09 Thread Walter Prins
Hello, On 9 May 2011 14:04, Ganesh Kumar wrote: > Hi Gurus, > > I want compile ubuntu software centre source code from debian how to > compile...please help me.. > I downloaded all file contents have python file .. > > https://launchpad.net/ubuntu/maverick/+source/software-center/3.0.4 > > Pyth

Re: [Tutor] Python assignment

2011-05-09 Thread Walter Prins
Hello Matthew, On 9 May 2011 23:42, Matthew Rezaei wrote: > Hi There, > > > > I am hoping you can help me! > > > > I have a python assignment and I need help regarding it, is there anyone > that can help me out with it? > Yes. We won't do the assignment for you, but if you try to solve it a

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread Walter Prins
On 11 May 2011 03:57, tax botsis wrote: > I tried to work that out with xlwt but couldn't. Actually, I started > working on the following script but I couldn't even split the line for > further processing: > > OK, I've thrown together a quick sample demonstrating all the concepts you need (obviou

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread Walter Prins
On 11 May 2011 14:34, tee chwee liong wrote: > hi all, > > thanks for this sharing. when i copy and run this code, i got this error: > > Traceback (most recent call last): > File "C:/Python25/myscript/excel/sampleexcel.py", line 1, in > import csv > File "C:/Python25/myscript/excel\csv.

Re: [Tutor] Just Joined!

2011-05-12 Thread Walter Prins
On 12 May 2011 12:34, Alex Smith wrote: > Hi All, > > I just joined this list and am really new to python. I have an assignment > to create a function with (a_string, width) which returns the a_string with > all the lower case characters changed to upper case characters and vice > versa and cente

Re: [Tutor] RuntimeError: file does not exist

2011-05-18 Thread Walter Prins
On 18 May 2011 15:45, Susana Iraiis Delgado Rodriguez < susana.delgad...@utzmg.edu.mx> wrote: > Hello Alan!! > Can you please tell me, how to rebuild my path? I've tried it, but I didn't > succed =( > > Always post the code you tried, and the full error message you received, otherwise you make it

  1   2   3   4   5   >