[Tutor] general basic question

2012-02-08 Thread ken brockman
Really close to it Robert. No delete but an error msg. Something akin to file dosen't exist, not found , or words to that effect . Something "akin to"? I'm back on the list again, and if not too late, here is the asked for trace.  i've managed to replicate the original error msg, by removing t

[Tutor] (no subject)

2012-02-08 Thread ken brockman
 Really close to it Robert. No delete but an error msg. Something akin to file dosen't exist, not found , or words to that effect . Something "akin to"? How about if you copy and paste the actual error message, instead of asking us to guess? Have been all afternoon' That means the full tracebac

Re: [Tutor] What the difference between the two RE?

2012-02-08 Thread Göran Törnquist
On 2012-02-09 08.16, Christian Witts wrote: On 2012/02/09 08:15 AM, daedae11 wrote: import re re.match("^hello", "hello") re.match("hello", "hello") Please give a string that matches RE "^hello" but does not match RE "hello", or matches RE "hello" but does not match RE "^hello". --

Re: [Tutor] What the difference between the two RE?

2012-02-08 Thread Christian Witts
On 2012/02/09 08:15 AM, daedae11 wrote: import re re.match("^hello", "hello") re.match("hello", "hello") Please give a string that matches RE "^hello" but does not match RE "hello", or matches RE "hello" but does not match RE "^hello". ---

[Tutor] What the difference between the two RE?

2012-02-08 Thread daedae11
import re re.match("^hello", "hello") re.match("hello", "hello") Please give a string that matches RE "^hello" but does not match RE "hello", or matches RE "hello" but does not match RE "^hello". daedae11___ Tutor maillist - Tutor@python.org To un

Re: [Tutor] This program has worked for me before.

2012-02-08 Thread Alan Gauld
On 09/02/12 00:43, Nathaniel Trujillo wrote: Hello, I stopped using python for about 4 months but now I am back. I and it keeps giving me this error message which I then googled to no avail Traceback (most recent call last): File "C:\Python31\pizza_panic_game.py", line 4, in from

Re: [Tutor] bogus characters in a windows file

2012-02-08 Thread Marc Tompkins
On Wed, Feb 8, 2012 at 6:09 PM, Marc Tompkins wrote: > On Wed, Feb 8, 2012 at 5:46 PM, Garry Willgoose < > garry.willgo...@newcastle.edu.au> wrote: > >> I'm reading a file output by the system utility WMIC in windows (so I can >> track CPU usage by process ID) and the text file WMIC outputs seems

Re: [Tutor] bogus characters in a windows file

2012-02-08 Thread Dave Angel
On 02/08/2012 08:46 PM, Garry Willgoose wrote: I'm reading a file output by the system utility WMIC in windows (so I can track CPU usage by process ID) and the text file WMIC outputs seems to have extra characters in I've not seen before. I use os.system('WMIC /OUTPUT:c:\cpu.txt PROCESS GET Pr

Re: [Tutor] bogus characters in a windows file

2012-02-08 Thread Marc Tompkins
On Wed, Feb 8, 2012 at 5:46 PM, Garry Willgoose < garry.willgo...@newcastle.edu.au> wrote: > I'm reading a file output by the system utility WMIC in windows (so I can > track CPU usage by process ID) and the text file WMIC outputs seems to have > extra characters in I've not seen before. > > I use

[Tutor] bogus characters in a windows file

2012-02-08 Thread Garry Willgoose
I'm reading a file output by the system utility WMIC in windows (so I can track CPU usage by process ID) and the text file WMIC outputs seems to have extra characters in I've not seen before. I use os.system('WMIC /OUTPUT:c:\cpu.txt PROCESS GET ProcessId') to output the file and parse file c:\c

[Tutor] This program has worked for me before.

2012-02-08 Thread Nathaniel Trujillo
Hello, I stopped using python for about 4 months but now I am back. I tried running my pizza_panic_game.py program again thinking nothing had changed since a last ran it but boy was I wrong. Are we allowed to send the program as an attachment? Here is the program # Pizza Panic # Player must catch

Re: [Tutor] general basic question

2012-02-08 Thread Steven D'Aprano
ken brockman wrote: Really close to it Robert. No delete but an error msg. Something akin to file dosen't exist, not found , or words to that effect . Something "akin to"? How about if you copy and paste the actual error message, instead of asking us to guess? That means the full traceba

Re: [Tutor] (no subject)

2012-02-08 Thread Joel Goldstick
On Wed, Feb 8, 2012 at 6:00 PM, Jerry Hill wrote: > On Wed, Feb 8, 2012 at 5:21 PM, Joel Goldstick > wrote: >> >> The else clause runs if the loop breaks for some reason.  So you would >> use it only to do some processing if the loop completes completely. >> > > No.  The else clause only runs if

Re: [Tutor] (no subject)

2012-02-08 Thread Jerry Hill
On Wed, Feb 8, 2012 at 5:21 PM, Joel Goldstick wrote: > The else clause runs if the loop breaks for some reason. So you would > use it only to do some processing if the loop completes completely. > > No. The else clause only runs if the loop does NOT break out early. The else clause only runs i

[Tutor] For/else construct was: Re: (no subject)

2012-02-08 Thread Alan Gauld
On 08/02/12 19:04, Patrick Dempster wrote: I might be missing something but I can't see a reason for the "else:" clause attached to the "for" statement, could anyone provide an example where or why someone might use the "else:" clause with the for loop? There have been a couple of sample case

Re: [Tutor] (no subject)

2012-02-08 Thread Joel Goldstick
On Wed, Feb 8, 2012 at 2:04 PM, Patrick Dempster wrote: > On 07/02/2012 19:07, Hugo Arts wrote: >> On Tue, Feb 7, 2012 at 7:50 PM, Debashish Saha wrote: >>> for i in range(1, 8): >>>    print(i) >>>    if i==3: >>>        break >>> else: >>>    print('The for loop is over') >>> >>> >>>  Output: >

Re: [Tutor] general basic question

2012-02-08 Thread Alan Gauld
On 08/02/12 21:28, ken brockman wrote: Really close to it Robert. No delete but an error msg. Something akin to file dosen't exist, not found , or words to that effect . Without sight of code it's only a guess but are you creating the file with the 'wb' mode - ie. write binary? :- myPickleFil

Re: [Tutor] general basic question

2012-02-08 Thread Joel Goldstick
On Wed, Feb 8, 2012 at 4:28 PM, ken brockman wrote: > Got it. I manage to get it to save to disk, but only by using the shell to > create an empty dictionary then pickling it and saving it to a file. Priming > the pump as it were. I had thought i had read that when you pickle and save > a list or

[Tutor] general basic question

2012-02-08 Thread ken brockman
Got it. I manage to get it to save to disk, but only by using the shell to create an empty dictionary then pickling it and saving it to a file. Priming the pump as it were. I had thought i had read that when you pickle and save a list or dictionary to file, if it didn't already exist, it would b

Re: [Tutor] general basic question

2012-02-08 Thread Robert Berman
On Wed, Feb 8, 2012 at 2:57 PM, ken brockman wrote: > > > On Wed, Feb 8, 2012 at 12:33 PM, ken brockman wrote: > >> Using pickling I have somehow managed to save two separate lists, but > the > >> dictionary is giving me much more of a struggle. > > Got it. I manage to get it to save to disk, bu

Re: [Tutor] Python Database Scripting

2012-02-08 Thread Timo
Op 08-02-12 20:20, Brad Hudson schreef: Thanks for the responses Alan & Modulok. I will start with SQLAlchemy and see where it takes me. I was looking for something similar a couple of months ago and chose to use SQLObject over SQLAlchemy. In my eyes it was much easier to use. Timo ___

[Tutor] general basic question

2012-02-08 Thread ken brockman
On Wed, Feb 8, 2012 at 12:33 PM, ken brockman wrote: >> Using pickling I have somehow managed to save two separate lists, but the >> dictionary is giving me much more of a struggle. Got it. I manage to get it to save to disk, but only by using the shell to create an empty dictionary then pic

Re: [Tutor] Python Database Scripting

2012-02-08 Thread Brad Hudson
Thanks for the responses Alan & Modulok. I will start with SQLAlchemy and see where it takes me. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Database Scripting

2012-02-08 Thread Alan Gauld
On 08/02/12 18:03, Brad Hudson wrote: Can someone provide information on the best modules/python tools to use for general database scripting? I'm interested in something that works across the board for Oracle, MySQL, MS SQL Server, and DB2. I was hoping a good generic ODBC module would be out the

Re: [Tutor] (no subject)

2012-02-08 Thread Patrick Dempster
On 07/02/2012 19:07, Hugo Arts wrote: > On Tue, Feb 7, 2012 at 7:50 PM, Debashish Saha wrote: >> for i in range(1, 8): >>print(i) >>if i==3: >>break >> else: >>print('The for loop is over') >> >> >> Output: >> 1 >> 2 >> 3 >> >> Question:but after breaking the for loop why the

Re: [Tutor] dictionary of methods calling syntax

2012-02-08 Thread Mark Lawrence
On 08/02/2012 17:41, Gregory, Matthew wrote: Alan Gauld wrote: Since a class is effectively a disguised dictionary I'm not sure why you want to do this? If you just want to access the method by name then why not just call getattr(spam,'get_mean')? Thanks for the feedback and, yes, this makes s

Re: [Tutor] Python Database Scripting

2012-02-08 Thread Modulok
The closest thing you'll find will probably be the third party module 'sqlalchemy'. You can install it via easy_install or pip. If that doesn't meet your needs I'm not sure what else would. (But would love to hear about it.) -Modulok- On 2/8/12, Brad Hudson wrote: > Can someone provide informati

[Tutor] Python Database Scripting

2012-02-08 Thread Brad Hudson
Can someone provide information on the best modules/python tools to use for general database scripting? I'm interested in something that works across the board for Oracle, MySQL, MS SQL Server, and DB2. I was hoping a good generic ODBC module would be out there, but I'm having difficulty locating o

Re: [Tutor] dictionary of methods calling syntax

2012-02-08 Thread Gregory, Matthew
Alan Gauld wrote: > Since a class is effectively a disguised dictionary I'm not sure why you > want to do this? If you just want to access the method by name then why > not just call getattr(spam,'get_mean')? Thanks for the feedback and, yes, this makes sense. My use case was when the statistic

Re: [Tutor] general basic question

2012-02-08 Thread Joel Goldstick
On Wed, Feb 8, 2012 at 12:33 PM, ken brockman wrote: >> Using pickling I have somehow managed to save two separate lists, but the >> dictionary is giving me much more of a struggle. > > Well do post back if you don't manage to solve your issues (with full > error messages & stack traces as relevan

[Tutor] general basic question

2012-02-08 Thread ken brockman
> Using pickling I have somehow managed to save two separate lists, but the > dictionary is giving me much more of a struggle. Well do post back if you don't manage to solve your issues (with full error messages & stack traces as relevant please.)  Re dictionaries -- I actually forgot to mention,

Re: [Tutor] confusion about scipy

2012-02-08 Thread Evert Rol
> ImportError Traceback (most recent call last) > C:\Python27\lib\site-packages\IPython\utils\py3compat.pyc in > execfile(fname, glob, loc) >166 else: >167 filename = fname > --> 168 exec compile(scripttext, filename, 'ex

[Tutor] confusion about scipy

2012-02-08 Thread Debashish Saha
ImportError Traceback (most recent call last) C:\Python27\lib\site-packages\IPython\utils\py3compat.pyc in execfile(fname, glob, loc) 166 else: 167 filename = fname --> 168 exec compile(scripttext, filename, 'exec') in gl

Re: [Tutor] python editor

2012-02-08 Thread Tino Dai
On Wed, Feb 8, 2012 at 9:17 AM, R.S. wrote: > I'm using Spyder (http://code.google.com/p/spyderlib/) and Notepad++ on > Windows. > > I don't like pycharm. This software is consuming too much resources witch > for me is poinless. Pycharm can eat even 500MB+ of RAM for simple > application. > > > 2

[Tutor] PyQT GUI Threading example

2012-02-08 Thread R.S.
I can't find any full example of threading with many threads working and updating GUI (precisely i need QTreeWidget). I can only find: not updating GUI examples, updating GUI examples with one thread. But i just can't find what i need. Could anyone share working example with many threads updating G

Re: [Tutor] how to change the current working directory path in ipython.

2012-02-08 Thread Joel Goldstick
On Wed, Feb 8, 2012 at 9:24 AM, Debashish Saha wrote: > how to change  the current working directory path in ipython. > > my current directory path is >                       pwd >               Out[2]: u'C:\\Users\\as' > > now if i want to take the path to a subfolder of above > 'C:\\Users\\as',

Re: [Tutor] general basic question

2012-02-08 Thread Walter Prins
Hi Ken, On 8 February 2012 14:17, ken brockman wrote: > Thank you Walter for your help and speedy reply. You're welcome. > Using pickling I have somehow managed to save two separate lists, but the > dictionary is giving me much more of a struggle. Well do post back if you don't manage to solve

[Tutor] how to change the current working directory path in ipython.

2012-02-08 Thread Debashish Saha
how to change the current working directory path in ipython. my current directory path is pwd Out[2]: u'C:\\Users\\as' now if i want to take the path to a subfolder of above 'C:\\Users\\as', what do i have to do? _

Re: [Tutor] python editor

2012-02-08 Thread R.S.
I'm using Spyder (http://code.google.com/p/spyderlib/) and Notepad++ on Windows. I don't like pycharm. This software is consuming too much resources witch for me is poinless. Pycharm can eat even 500MB+ of RAM for simple application. 2012/2/8 Jamie Paul Griffin > On Mon, Feb 06, 2012 at 06:11:1

[Tutor] general basic question

2012-02-08 Thread ken brockman
On 8 February 2012 13:40, ken brockman wrote: > Hello all: > I have a general and very basic question if I may. I am in the process > of attempting to write my first python app. I wanted to collect information > and save it to lists and dictionaries. My question is, is it possible to > save said l

Re: [Tutor] Character Buffer Object Error

2012-02-08 Thread bob gailer
On 2/8/2012 12:56 AM, Michael Lewis wrote: I want to find all digits in a string and then increment those digits by 1 and then return the same string with the incremented digits. [snip] You got lots of good advice from others and some not-so-good advice. Michael said: 2. The following line app

Re: [Tutor] general basic question

2012-02-08 Thread Walter Prins
Hi Ken, Welcome to Python and to programming in general. On 8 February 2012 13:40, ken brockman wrote: > Hello all: > I have a general and very basic question if I may. I am in the process > of attempting to write my first python app. I wanted to collect information > and save it to lists and di

[Tutor] general basic question

2012-02-08 Thread ken brockman
Hello all: I have a general and very basic question if I may. I am in the process of attempting to write my first python app. I wanted to collect information and save it to lists and dictionaries. My question is, is it possible to save said lists and dictionaries in the program proper, or do i n

Re: [Tutor] python editor

2012-02-08 Thread Jamie Paul Griffin
On Mon, Feb 06, 2012 at 06:11:13PM +, Alan Gauld wrote: > On 06/02/12 17:17, bob gailer wrote: > >On 2/6/2012 10:25 AM, Kapil Shukla wrote: > > > >>Please also suggest a free editor for python which can at least repeat > >>previous command with a key stroke > > That depends on the editor's mod

Re: [Tutor] Character Buffer Object Error

2012-02-08 Thread Alan Gauld
On 08/02/12 05:56, Michael Lewis wrote: I've tried the following code, but I am getting the following error. How do I do this properly? Christian answered the reason for the error. Here are some other comments... def AlterInput(user_input): print user_input new_output = '' make t