[Tutor] Grabbing Info from Text files?

2010-11-12 Thread Michael Stover
Hello, I have been getting lost when trying to find the needed information on how to grab information from text files to be used in a python script I am working on. Essentially the script is calling upon other programs to grab specific information about files and putting that information into ba

Re: [Tutor] Tutor Digest, Vol 81, Issue 48

2010-11-12 Thread marupalli charan
Re:please, send me programms as a file ( like "word.py" ) for easy understanding of the programmes. On 11/12/10, tutor-requ...@python.org wrote: > Send Tutor mailing list submissions to > tutor@python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.pyth

Re: [Tutor] A deeper explanation of ability to modify list elementsin-place

2010-11-12 Thread Alan Gauld
"Serdar Tumgoren" wrote So is a reference simply a Python-level symbol (ie some collections of characters accessible from Python code) that corresponds to a pointer, which in turn points to the location in memory where the object is stored? Or to think of it in Python terms a reference or

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

2010-11-12 Thread Alan Gauld
"Richard D. Moores" wrote Is k then a state variable in that its state is 23? What sorts of variables are, and are not, state variables? The concept of a state variable seems central to Kent's article. If only I knew exactly what it was. First, do you understand what ste is in mathematical/

Re: [Tutor] Tutor Digest, Vol 81, Issue 48

2010-11-12 Thread Alan Gauld
"marupalli charan" wrote Re:please, send me programms as a file ( like "word.py" ) for easy understanding of the programmes. Please read the instructions below and follow them. And please remove extraneous content. That way you asre more likely to get a listening ear. You have many sample p

Re: [Tutor] Grabbing Info from Text files?

2010-11-12 Thread Christian Witts
On 12/11/2010 08:28, Michael Stover wrote: Hello, I have been getting lost when trying to find the needed information on how to grab information from text files to be used in a python script I am working on. Essentially the script is calling upon other programs to grab specific information abo

Re: [Tutor] List comprehension question

2010-11-12 Thread Steven D'Aprano
Richard D. Moores wrote: I find using that at the interactive prompt a bit onerous -- lots of copy and pasting. And doubly so when comparing times for 2 or more functions. Does your Python not support readline? Normally, if you press UP ARROW or DOWN ARROW, Python will cycle through the previ

Re: [Tutor] List comprehension question

2010-11-12 Thread Richard D. Moores
On Fri, Nov 12, 2010 at 02:11, Steven D'Aprano wrote: > Richard D. Moores wrote: > >> I find using that at the interactive prompt a bit onerous -- lots of >> copy and pasting. And doubly so when comparing times for 2 or more >> functions. > > Does your Python not support readline? Normally, if you

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

2010-11-12 Thread Richard D. Moores
On Fri, Nov 12, 2010 at 01:27, Alan Gauld wrote: > > "Richard D. Moores" wrote > >> Is k then a state variable in that its state is 23? What sorts of >> variables are, and are not, state variables? >> >> The concept of a state variable seems central to Kent's article. If >> only I knew exactly wh

[Tutor] Building input for a function call

2010-11-12 Thread David Hutto
Hey Buddy Pals, In the below *function*(if you can call it that yet:) I'm trying to do the following: interpolate this string: 'OptionMenu(self.frame,self.var,'%s','%s')' with this list turned into variables: ['default1', 'default2'] which would become: self.default1 = 'default1' self.defa

Re: [Tutor] List comprehension question

2010-11-12 Thread David Hutto
>        repeatedly, returning a list of results. ... > > I'm sorry, Steven, but I could you revise this code to use repeat=5 > instead of the for loop? I can't see how to do it. >>> help(timeit.Timer repeat(self, repeat=3, number=100) | Call timeit() a few times. | | This is a

Re: [Tutor] Building input for a function call

2010-11-12 Thread David Hutto
Apologies, forgot to add I'm using 2.6.4 on ubuntu 9.10 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] variables question.

2010-11-12 Thread Jeff Honey
Steven D'Aprano, et al, Thanks everyone for the thorough explanations on variable use and scope in Python. It was enlightening...and sometimes confusing, but I'm working on that. It just points out all the new things I have yet to learn about the language. -- ¤¤ ¤ kyoboku kazeo

Re: [Tutor] List comprehension question

2010-11-12 Thread Richard D. Moores
On Fri, Nov 12, 2010 at 05:15, David Hutto wrote: >>        repeatedly, returning a list of results. ... >> >> I'm sorry, Steven, but I could you revise this code to use repeat=5 >> instead of the for loop? I can't see how to do it. > help(timeit.Timer > >  repeat(self, repeat=3, number=1

Re: [Tutor] Tutor Digest, Vol 81, Issue 35

2010-11-12 Thread Wangolo Joel
Hello tutor i want to thnak you for that efort but it's enough . I no longer want  you messages a bout python sorry .The reason is my conputer is infected with alot of TROJANs and WORMS , VIRUSES,SPYWARES and all to me comes from you poeple so i just want to a void you.   I will learn python thro

Re: [Tutor] List comprehension question

2010-11-12 Thread David Hutto
Apologies, missed that part. Didn't mean to seem rude. import timeit def anyName(): pass for num in range(10): t = timeit.Timer('anyName()','from __main__ import anyName') print t.repeat(repeat=5) #or import timeit def anyName(): pass t = timeit.Timer('anyNa

Re: [Tutor] Tutor Digest, Vol 81, Issue 35

2010-11-12 Thread Stefan Behnel
Wangolo Joel, 12.11.2010 15:45: I NO LONGER WANT YOU MESSAGES DON'T REPLY ME Nice try. Stefan PS: You can unsubscribe at any time by following the instructions on the mailing list web site. See the footer of any message sent to this list. ___ Tut

Re: [Tutor] Tutor Digest, Vol 81, Issue 35

2010-11-12 Thread delegbede
Hi Joel, To start with, I sincerely appreciate your concern and I am deeply sorry your computer is so infected. Having said that, I think it is unfair to pile all the blames and as a matter of fact, any at all, on this group. That is very unfair to say the least. I don't have an idea of how

Re: [Tutor] List comprehension question

2010-11-12 Thread Richard D. Moores
On Fri, Nov 12, 2010 at 07:13, David Hutto wrote: > import timeit > > > def anyName(): >        pass > > t = timeit.Timer('anyName()','from __main__ import anyName') > print t.repeat(repeat=5) > > > If I get the gist of what you're asking. > Yes. That's it! Thank you! And if I don't want the def

Re: [Tutor] Tutor Digest, Vol 81, Issue 35

2010-11-12 Thread Patty
Hi - I just wanted to comment that my Windows XP system hasn't found any threats like this coming from the Python list emails. I also have a netbook with Windows 7 Starter and no problems there either. I am using AVG 9.0.869 on both systems which is *Great* for security and if a threat is found

Re: [Tutor] Building input for a function call

2010-11-12 Thread David Hutto
This is a more precise question, the above was after trying different methods, and it got a little confusing. Why in the below does using in line 12:self.objectsvars = 'menuitemhere','menuitemhere','menuitemhere','menuitemhere', not work, but placing 'menuitemhere','menuitemhere','menuitemhere','m

Re: [Tutor] Building input for a function call

2010-11-12 Thread Evert Rol
> This is a more precise question, the above was after trying different methods, > and it got a little confusing. > > Why in the below does using in line 12:self.objectsvars = > 'menuitemhere','menuitemhere','menuitemhere','menuitemhere', not work, > but placing 'menuitemhere','menuitemhere','menu

[Tutor] 'pydoc' is not recognized as an internal or external command, ...

2010-11-12 Thread R Johnson
Hello All, I'm currently attempting to work my way through Zed Shaw's "Learn Python the Hard Way" (suggested by co-workers) and have come across an instruction to: 1. In Terminal where you normally run python to run your scripts, type: pydoc raw_input. Read what it says. So in a terminal, at the

Re: [Tutor] 'pydoc' is not recognized as an internal or external command, ...

2010-11-12 Thread David Hutto
For what you're looking for you could use: >>>help(raw_input) In the python terminal,meaning type python first. For pydoc on ubuntu in the command line, pydoc -p 1234 and then take your browser to http://localhost:1234, you might need to select the work offline mode. On windows IIRC it's abou

Re: [Tutor] Building input for a function call

2010-11-12 Thread David Hutto
> > Singled out the two lines for clarity: >> 12:           self.objectsvars = >> 'menuitemhere','menuitemhere','menuitemhere','menuitemhere' >> 17:           self.optionmenu = >> OptionMenu(self.frame,self.var,self.objectsvars) > > > Because in the first case, you're passing 3 items to OptionMen

Re: [Tutor] Building input for a function call

2010-11-12 Thread David Hutto
Fixed with: def obOpMenu(self): self.oblist = self.canvas.find_withtag('object') self.list = [] for item in self.oblist: self.itemname = self.canvas.gettags(item) if self.itemname[1] != 'default

Re: [Tutor] List comprehension question

2010-11-12 Thread Steven D'Aprano
Richard D. Moores wrote: OK, but why can't I do what the timeit doc suggests, only put 2 or more functions in the file, as I do here: def test(): "Stupid test function" L = [] for i in range(100): L.append(i) if __name__=='__main__':

Re: [Tutor] 'pydoc' is not recognized as an internal or external command, ...

2010-11-12 Thread Steven D'Aprano
R Johnson wrote: 'pydoc' is not recognized as an internal or external command, operable program or batch file. This means that the program "pydoc" is not installed on your computer, or is installed somewhere where the operating system (I'm guessing you're using Windows?) can't find it. Use

Re: [Tutor] 'pydoc' is not recognized as an internal or external command, ...

2010-11-12 Thread Jerry Hill
On Fri, Nov 12, 2010 at 6:44 PM, Steven D'Aprano wrote: > Use the Find File command, and see if you can find something called "pydoc". > You may need to call the full path to the program, e.g.: > > C:\My Documents\path\to\program\pydoc raw_input On my windows PC, it's c:\Python31\Lib\pydoc.py So

Re: [Tutor] Python 2.5 Problem

2010-11-12 Thread Steven D'Aprano
Patrick Forbes wrote: I was pointed towards ignoblekey/pub pyw's and couldn't figure out to work them. I was told to use Python 2.6 but couldn't find it as I was unaware it was buried in the Library and didn't know how to work Terminal. I made several boo boo's and lost the Python 2.5 that my

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

2010-11-12 Thread Alan Gauld
"Richard D. Moores" wrote For example if I say that the state of any object can be represented by a vector whose values correspond to the collected set of variables of the object, does that make sense? No. Not the vector idea. Sorry. A vector is just a fancy mathematical name for an arra

[Tutor] Grabbing Information from txt files

2010-11-12 Thread Michael Stover
My apologies for my last email, admittedly I was more tired that I thought as after re-reading it and the emails coming in, I found that I did not provided "proper" information. 1. I have a script that is detecting multiple various bits of information of a video file using MediaInfo and putting

Re: [Tutor] 'pydoc' is not recognized as an internal or external command, ...

2010-11-12 Thread R Johnson
Thank you to all who have responded. I have a bit of an update that reflects some of these suggestions. I was able to snag some time from one of the more experienced engineers and here is what we found: On my system (Windows 7) the path to the lib file is C:\Python26\lib and "pydoc.py" is in t

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] Grabbing Information from txt files

2010-11-12 Thread David Hutto
On Fri, Nov 12, 2010 at 9:43 PM, Michael Stover wrote: > My apologies for my last email, admittedly I was more tired that I thought > as after re-reading it and the emails coming in, I found that I did not > provided "proper" information. > > 1. I have a script that is detecting multiple various b

Re: [Tutor] Grabbing Information from txt files

2010-11-12 Thread Michael
>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 Media

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

2010-11-12 Thread Richard D. Moores
On Fri, Nov 12, 2010 at 17:07, Alan Gauld wrote: > > "Richard D. Moores" wrote > >>> For example if I say that the state of any object can be represented >>> by a vector whose values correspond to the collected set of variables >>> of the object, does that make sense? I think I would have unders

Re: [Tutor] Grabbing Information from txt files

2010-11-12 Thread Steven D'Aprano
Michael Stover wrote: My apologies for my last email, admittedly I was more tired that I thought as after re-reading it and the emails coming in, I found that I did not provided "proper" information. 1. I have a script that is detecting multiple various bits of information of a video file usi

Re: [Tutor] List comprehension question

2010-11-12 Thread Richard D. Moores
On Fri, Nov 12, 2010 at 15:26, Steven D'Aprano wrote: > Richard D. Moores wrote: > >> OK, but why can't I do what the timeit doc suggests, only put 2 or >> more functions in the file, as I do here: >> >> >> def test(): >>    "Stupid test function" >>    L =

Re: [Tutor] List comprehension question

2010-11-12 Thread Richard D. Moores
On Fri, Nov 12, 2010 at 23:25, Richard D. Moores wrote: > See Sorry, forgot to paste. Dick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: h