Re: Problem getting a file pathname with tkFileDialog

2006-11-09 Thread Eric Brunel
On Wed, 08 Nov 2006 20:01:08 +0100, <[EMAIL PROTECTED]> wrote: > Hello, > I am working on a school project that requires me to get the path of a > filename for future treatment. > I've tried getting a file with tkFileDialog.askopenfile. > > > > import t

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, skip wrote: > > Irmen> So there. Finally back on the original subject ;-) > > And without satisfying Godwin's Law. Pretty good. Which was very hard with all those language nazis out there. Ooops… SCNR, Marc 'BlackJack' Rintsch -- http://mail.python.org/ma

Re: Problem getting a file pathname with tkFileDialog

2006-11-09 Thread Eric Brunel
On Wed, 08 Nov 2006 21:59:38 +0100, Tim Daneliuk <[EMAIL PROTECTED]> wrote: > Sefyroth wrote: >> Thanks, >> but I get this error when I try this. >> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in >> position 12: ordinal not in range(128) >> I had encountered it with the

Re: Problem getting a file pathname with tkFileDialog

2006-11-09 Thread jmdeschamps
Tim Daneliuk wrote: > Sefyroth wrote: > > Thanks, > > > > but I get this error when I try this. > > > > UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in > > position 12: ordinal not in range(128) > > > > I had encountered it with the askdirectory method as well. Is there an > >

Re: opening excel

2006-11-09 Thread timmy
John Machin wrote: > timmy wrote: > >>Hello, >> >>has anybody got any experience opening and manilpulating excel >>spreedsheets via python? it seems pythoncom allows this to happen but >>i'm a total newb to it. (i usually work in the unix world) >>all i need to do, is open the xls files and read v

Re: PIL: match for ImageMagick's display -ping

2006-11-09 Thread Mohammad Tayseer
>>> import Image>>> im = Image.open('myimage.jpg')>>> im.size(200, 100)PIL reads the header only in the Image.open() call above. Sponsored Link Mortgage rates near 39yr lows. $420,000 Mortgage for $1,399/mo - Calculate new house payment-- http://mail.python.org/mailman/listinfo/python-list

Re: Python Jogos

2006-11-09 Thread Douglas Soares de Andrade
Em Quarta 08 Novembro 2006 13:29, [EMAIL PROTECTED] escreveu: > Jogo da velha > Jogo do galo > Codigos em python kem me arranja > Please excuse me for talking in portuguese here, just want to show the better place for Manelito to ask this. Olá Manelito, O idioma usado nessa lista é o inglês

IndentationError: expected an indented block

2006-11-09 Thread Antonios Katsikadamos
hi all. I am using python 2.4. I have to run an older python code and when i run it i get the following messageIndentationError: expected an indented block.1)what does this mean?2)how can i overcome this problemThanks for any advice.kind regards,Antonios Sponsored LinkMortgage rates near his

Re: tkFileDialog

2006-11-09 Thread Mohammad Tayseer
use askopenfilename() instead of askopenfile()> > import tkFileDialog> file = tkFileDialog.askopenfile()> print file> Access over 1 million songs - Yahoo! Music Unlimited.-- http://mail.python.org/mailman/l

Re: Python cgi Apache os.system()

2006-11-09 Thread naima . mans
Hello thanks for your help.. it was a problem of path as you mentionned... my command was "O:\\ ccm start" and i have change it with the path of the drive O thanks a lot have a good day Tachi -- http://mail.python.org/mailman/listinfo/python-list

Re: opening excel

2006-11-09 Thread wesley chun
> has anybody got any experience opening and manilpulating excel > spreedsheets via python? it seems pythoncom allows this to happen i posted a couple of snippets along with others in this earlier thread: http://groups.google.com/group/comp.lang.python/browse_thread/thread/a7ed60067ca5a8d4 the

ANN: BayPIGgies, Thu Nov 9 @ 7:30p, Air Traffic Control

2006-11-09 Thread wesley chun
the silicon valley-san francisco bay area python users group meets at the Googleplex once a month in mountain view, CA. more info and directions available at http://baypiggies.net -- Forwarded message -- From: Dennis Reinhardt Date: Nov 2, 2006 9:03 PM To: Python <[EMAIL PROTECTED

Re: Python to tell what is the IP of my PC .

2006-11-09 Thread MC
http://monip.org/ -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: assigning values in __init__

2006-11-09 Thread Steven D'Aprano
On Thu, 09 Nov 2006 12:27:12 +1100, Ben Finney wrote: > John Salerno <[EMAIL PROTECTED]> writes: > >> Ben Finney wrote: >> > If you pass a *mapping* of the >> > "I-might-want-to-add-more-in-the-future" values, then you get both >> > explicit *and* expandable, without an arbitrary unneeded sequenc

win32com/python different behavour.

2006-11-09 Thread bli
I have been developing an application driving a device through COM. I used win32com (brilliant ) and was at a fairly advanced stage being able to access the functions of the device and access/ retrieve its data. A week or two ago I did some overdue upgrading to all the components of the application

Sorted list - how to change it

2006-11-09 Thread Lad
I have a sorted list for example [1,2,3,4,5] and I would like to change it in a random way e.g [2,5,3,1,4] or [3,4,1,5,2] or in any other way except being ordered. What is the best/easiest way how to do it? Thank you for help L. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorted list - how to change it

2006-11-09 Thread Wolfram Kraus
On 09.11.2006 10:52, Lad wrote: > I have a sorted list for example [1,2,3,4,5] and I would like to change > it in a random way > e.g [2,5,3,1,4] or [3,4,1,5,2] or in any other way except being > ordered. > What is the best/easiest > way how to do it? > > Thank you for help > L. > use random.shu

Re: Sorted list - how to change it

2006-11-09 Thread Lad
Wolfram Kraus wrote: > On 09.11.2006 10:52, Lad wrote: > > I have a sorted list for example [1,2,3,4,5] and I would like to change > > it in a random way > > e.g [2,5,3,1,4] or [3,4,1,5,2] or in any other way except being > > ordered. > > What is the best/easiest > > way how to do it? > > > > Th

Re: Can not download plugins for jEdit (help!!)

2006-11-09 Thread Lich_Ray
jEdit Vim, it can handle all the things. http://www.vim.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a commas-in-between idiom?

2006-11-09 Thread Magnus Lycka
Ernesto García García wrote: > list = [1,2,3,4,5,6] Just a nit-pick: It's considered an anti-idiom to hide builtins just as list by using it as a name for a variable. >>> list=[1,2,3,4,5] >>> tuple = (1,2,3,4,5) >>> if list == list(tuple): print "equal" ... Traceback (most recent call last):

Re: Sorted list - how to change it

2006-11-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Lad wrote: > I have a sorted list for example [1,2,3,4,5] and I would like to change > it in a random way > e.g [2,5,3,1,4] or [3,4,1,5,2] or in any other way except being > ordered. lst = [1, 2, 3, 4, 5] tmp = list(lst) while lst == tmp: random.shuffle(lst) If you *

Re: help using smtplib to work ..

2006-11-09 Thread Tim Williams
On 8 Nov 2006 19:45:00 -0800, Jordan <[EMAIL PROTECTED]> wrote: > For some reason, > smtp for gmail seems to require that you call server.ehlo() a second > time, after having called server.starttls(), otherwise, the server > won't accept authorization. Thanks. Not just GMAIL, all (RFC Complian

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Nick Craig-Wood
John Salerno <[EMAIL PROTECTED]> wrote: > Dan Lenski wrote: > > > So, is there another toolkit I should be looking at? > > I highly recommend wxPython. I'd second that! There is a book also "WxPython in Action" http://www.amazon.com/Wxpython-Action-Noel-Rappin/dp/1932394621 Which is ce

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Christophe
Nick Craig-Wood a écrit : > There is also PyQT which we wrote off as we wanted to write commercial > applications too. As it happens we have a commercial QT licence, but > we decided we didn't want to have to incurr the additional expense of > renewing it. Note: Nothing in the GPL prevents you fro

cx_Oracle and NCLOBs

2006-11-09 Thread [12]Nitro
Greetings, I'm currently working in a Python project to create a multi-platform database replication tool, and cx_Oracle was the chosen provider to handle the Oracle connections. So far the results have been very interesting, but I've been experiencing some problems when inserting CLOB objects thr

Re: assigning values in __init__

2006-11-09 Thread Antoon Pardon
On 2006-11-09, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 09 Nov 2006 12:27:12 +1100, Ben Finney wrote: > >> John Salerno <[EMAIL PROTECTED]> writes: >> >>> Ben Finney wrote: >>> > If you pass a *mapping* of the >>> > "I-might-want-to-add-more-in-the-future" values, then you get both >>>

Re: substring search without using built in utils

2006-11-09 Thread Bruno Desthuilliers
Gabriel Genellina wrote: > At Wednesday 8/11/2006 22:29, zeal elite wrote: > >> I am looking for substring search python program without using the >> built in funtions like find, or 'in'. > > The only reasonable usage for such a constraint would be a school > assignment so: don't cheat and do you

Re: Sorted list - how to change it

2006-11-09 Thread Tim Chase
>> I have a sorted list for example [1,2,3,4,5] and I would like to change >> it in a random way >> e.g [2,5,3,1,4] or [3,4,1,5,2] or in any other way except being >> ordered. >> What is the best/easiest >> way how to do it? > > use random.shuffel: > import random x = [1,2,3,4,5]

Re: Sorted list - how to change it

2006-11-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Marc 'BlackJack' Rintsch wrote: > lst = [1, 2, 3, 4, 5] > tmp = list(lst) > while lst == tmp: > random.shuffle(lst) Argh, that fails if the list is empty or contains just one item. lst = [1, 2, 3, 4, 5] if len(lst) > 1: tmp = list(lst) while lst == tmp:

Re: substring search without using built in utils

2006-11-09 Thread John Machin
Bruno Desthuilliers wrote: > Gabriel Genellina wrote: > > At Wednesday 8/11/2006 22:29, zeal elite wrote: > > > >> I am looking for substring search python program without using the > >> built in funtions like find, or 'in'. > > > > The only reasonable usage for such a constraint would be a school

Re: Is there a commas-in-between idiom?

2006-11-09 Thread Peter van Kampen
On 2006-11-08, Georg Brandl <[EMAIL PROTECTED]> wrote: > Peter van Kampen schrieb: >> On 2006-11-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >>> I've collected a bunch of list pydioms and other notes here: >>> >>> http://effbot.org/zone/python-list.htm >> >> """ >> A = B = [] # both names wil

Re: Is there a commas-in-between idiom?

2006-11-09 Thread Peter van Kampen
On 2006-11-08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Wednesday 8/11/2006 16:51, Peter van Kampen wrote: > >>""" >>A = B = [] # both names will point to the same list >>""" >> >>I've been bitten by this once or twice in the past, but I have always >>wondered what it was useful for? Can a

Re: cx_Oracle and NCLOBs

2006-11-09 Thread Bernard Delmée
Sorry I have no direct answer for you, but suspect you should post to the cx_Oracle group. Check the sourceforge project page. It is also conveniently mirrored at news.gmane.org. -- http://mail.python.org/mailman/listinfo/python-list

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-09 Thread Paul Boddie
robert wrote: > Shane Hathaway wrote: > > of multiple cores. I think Python only needs a nice way to share a > > relatively small set of objects using shared memory. POSH goes in that > > direction, but I don't think it's simple enough yet. > > > > http://poshmodule.sourceforge.net/ > > interesti

Re: Sorted list - how to change it

2006-11-09 Thread Christophe
Lad a écrit : > I have a sorted list for example [1,2,3,4,5] and I would like to change > it in a random way > e.g [2,5,3,1,4] or [3,4,1,5,2] or in any other way except being > ordered. > What is the best/easiest > way how to do it? > > Thank you for help > L. Not accepting that the shuffle outp

Re: Exception Handling in TCPServer (was; Problem exiting application in Windows Console.)

2006-11-09 Thread Ant
Steve Holden wrote: ... > First of all, five hour response time is a high expectation, you must be > a Platinum customer :-) I'm in the last week of my current job - start a new one on Monday, and so I haven't got a great deal to do at the moment. Five hours is a lifetime when you're staring at a

Post data using the libcurl

2006-11-09 Thread Raj
Hi, I am newbie to programming with libcurl. the problem is i want to send my gmail username and password outside the browser and get access to my mail. this i am doing with LibCurl. Though i dont get any errors, i am nt able to get the o/p Can anyone kindly help. i will attach the program here #in

Post data using the libcurl

2006-11-09 Thread Raj
Hi, I am newbie to programming with libcurl. the problem is i want to send my gmail username and password outside the browser and get access to my mail. this i am doing with LibCurl. Though i dont get any errors, i am nt able to get the o/p Can anyone kindly help. i will attach the program here #in

Post data to http server using libcurl

2006-11-09 Thread Raj
Hi, I am newbie to programming with libcurl. the problem is i want to send my gmail username and password outside the browser and get access to my mail. this i am doing with LibCurl. Though i dont get any errors, i am nt able to get the o/p Can anyone kindly help. i will attach the program here #in

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-09 Thread Paul Boddie
Cliff Wells wrote: > > But of course "not everyone" is a double-edged sword that can just as > easily be turned against either party. If we limit ourselves to saying > what is going to be the most palatable for the widest audience we will > most likely find ourselves confined to discussing the wea

[Ann] ctypes wiki

2006-11-09 Thread Thomas Heller
I have installed a wiki which could / should be used to document the ctypes package and ctypes related packages (like comtypes, for example). ctypes is a foreign function library for Python: http://starship.python.net/crew/theller/ctypes/ I hope the wiki will evolve over time into a useful

Antivirus Notification

2006-11-09 Thread virusalert
InterScan Messaging Security Suite notification--- Begin Message --- The original message was received at Thu, 9 Nov 2006 13:26:55 +0100 from python.org [175.113.10.251] - The following addresses had permanent fatal errors - [EMAIL PROTECTED] - Transcript of the session follows -

newbie class-building question

2006-11-09 Thread jrpfinch
I am constructing a simple class to make sure I understand how classes work in Python (see below this paragraph). It works as expected, except the __add__ redefinition. I get the following in the Python interpreter: >>> a=myListSub() >>> a [] >>> a+[5] Traceback (most recent call last): File "

Re: substring search without using built in utils

2006-11-09 Thread Bernard
do your homework and use regexes! but the find() and in() function works great for normal strings...why don't you want to use them? zeal elite a écrit : > Hi, > > I am looking for substring search python program without using the built in > funtions like find, or 'in'. > > Appreciate it. Thanks i

Multithreaded C API Python questions

2006-11-09 Thread Svein Seldal
Hi A couple of mulithreaded C API python questions: I) The PyGILState_Ensure() simply ensures python api call ability, it doesnt actually lock the GIL, right? PyGILState_STATE gstate; gstate = PyGILState_Ensure(); II) Am I required to lock the GIL prior to running any python fu

Re: Can not download plugins for jEdit (help!!)

2006-11-09 Thread Ant
On Nov 9, 6:52 am, "BillJosephson" <[EMAIL PROTECTED]> wrote: ... > If anyone knows why i can't connect, in info about it would be > a big help. Sounds like the default mirror is down. Go to Utilities -> Global Options -> Plugin Manager and click on "Update mirror list". Choose a new mirror and

Re: assigning values in __init__

2006-11-09 Thread Steven D'Aprano
On Thu, 09 Nov 2006 10:36:07 +, Antoon Pardon wrote: > On 2006-11-09, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> On Thu, 09 Nov 2006 12:27:12 +1100, Ben Finney wrote: >> >>> John Salerno <[EMAIL PROTECTED]> writes: >>> Ben Finney wrote: > If you pass a *mapping* of the > "I-

Re: Can not download plugins for jEdit (help!!)

2006-11-09 Thread Ant
> Vim, it can handle all the things.http://www.vim.org/ I'm not convinced of that quite yet. jEdit's syntax highlighting seems more robust (see SocketServer.py in the standard library for an example - vim gets the highlighting of the first doc-comment wrong). I've also not found anything like jEdi

Re: Multithreaded C API Python questions

2006-11-09 Thread robert
Svein Seldal wrote: > Hi > > A couple of mulithreaded C API python questions: > > I) The PyGILState_Ensure() simply ensures python api call ability, it > doesnt actually lock the GIL, right? > > PyGILState_STATE gstate; > gstate = PyGILState_Ensure(); > > II) Am I required to lock the

Re: substring search without using built in utils

2006-11-09 Thread Steven D'Aprano
On Thu, 09 Nov 2006 03:31:02 -0800, John Machin wrote: > > Bruno Desthuilliers wrote: >> Gabriel Genellina wrote: >> > At Wednesday 8/11/2006 22:29, zeal elite wrote: >> > >> >> I am looking for substring search python program without using the >> >> built in funtions like find, or 'in'. >> > >>

Re: newbie class-building question

2006-11-09 Thread Peter Otten
jrpfinch wrote: > I am constructing a simple class to make sure I understand how classes > work in Python (see below this paragraph). > > It works as expected, except the __add__ redefinition. I get the > following in the Python interpreter: > a=myListSub() a > [] a+[5] > Traceba

Re: newbie class-building question

2006-11-09 Thread Jon Clements
jrpfinch wrote: > I am constructing a simple class to make sure I understand how classes > work in Python (see below this paragraph). > > It works as expected, except the __add__ redefinition. I get the > following in the Python interpreter: > > >>> a=myListSub() > >>> a > [] > >>> a+[5] > Trace

Re: assigning values in __init__

2006-11-09 Thread Steve Holden
Steven D'Aprano wrote: > On Thu, 09 Nov 2006 12:27:12 +1100, Ben Finney wrote: > >> John Salerno <[EMAIL PROTECTED]> writes: >> >>> Ben Finney wrote: If you pass a *mapping* of the "I-might-want-to-add-more-in-the-future" values, then you get both explicit *and* expandable, without

Re: Problem getting a file pathname with tkFileDialog

2006-11-09 Thread Neil Cerutti
On 2006-11-09, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > you could also use encode("iso-8859-1") to nterpret just the > printed name such as: print myfilename.encode("iso-8859-1") > > and by the way if you wanted the file NAME you could have used > openfilename() instead of openfile();-)

Re: IndentationError: expected an indented block

2006-11-09 Thread Steve Holden
Antonios Katsikadamos wrote: > hi all. I am using python 2.4. I have to run an older python code and > when i run it i get the following message > > IndentationError: expected an indented block. > > 1)what does this mean? Just what it did the first time you asked. This is a troll to get your "s

Re: Multithreaded C API Python questions

2006-11-09 Thread Svein Seldal
robert wrote: > PyGILState_Ensure/Release guarantees to establish the GIL - even if it > was already held (useful if you deal with complex call > ordering/dependencies) I understand this to mean that I dont need to explicitly lock the GIL (with PyEval_AcquireLock() or PyEval_AcquireThread()).

Lists of lists and tuples, and finding things within them

2006-11-09 Thread Michael B. Trausch
I have a program that keeps some of its data in a list of tuples.  Sometimes, I want to be able to find that data out of the list.  Here is the list in question: [('password01', 'unk'), ('host', 'dragonstone.org'), ('port', '1234'), ('character01', 'Thessalus')] For a regular list, I could do

Re: newbie class-building question

2006-11-09 Thread jrpfinch
Thank you this is very helpful. The only thing I now don't understand is why it is calling __coerce__. self.wrapped and other are both lists. Thanks Jon -- http://mail.python.org/mailman/listinfo/python-list

Re: Can not download plugins for jEdit (help!!)

2006-11-09 Thread Neil Cerutti
On 2006-11-09, Ant <[EMAIL PROTECTED]> wrote: >> Vim, it can handle all the things.http://www.vim.org/ > > I'm not convinced of that quite yet. jEdit's syntax > highlighting seems more robust (see SocketServer.py in the > standard library for an example - vim gets the highlighting of > the first do

Re: newbie class-building question

2006-11-09 Thread Jon Clements
jrpfinch wrote: > Thank you this is very helpful. The only thing I now don't understand > is why it is calling __coerce__. self.wrapped and other are both > lists. Yes, but in "a + [5]", *a* is a myListSub object -- it's not a list! So __coerce__ is called to try and get a common type... Try

Re: Sorted list - how to change it

2006-11-09 Thread Nick Craig-Wood
Tim Chase <[EMAIL PROTECTED]> wrote: > Just a caveat from past experience...while the OP was talking > about lists, for future reference random.shuffle() chokes on > strings (and possibly tuples). It requires the ability to edit > the target/parameter in place...a functionality that strings

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Nick Craig-Wood
Christophe <[EMAIL PROTECTED]> wrote: > Nick Craig-Wood a écrit : > > There is also PyQT which we wrote off as we wanted to write commercial > > applications too. As it happens we have a commercial QT licence, but > > we decided we didn't want to have to incurr the additional expense of > > renew

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-09 Thread Robin Becker
Paul Boddie wrote: > My impression is that POSH isn't maintained any more and that work was > needed to make it portable, as you have observed. Some discussions did > occur on one of the Python development mailing lists about the > possibility of using shared memory together with serialisation > r

UnboundLocalError

2006-11-09 Thread Camellia
hi all why it generates an "UnboundLocalError" when I do the following: ... def main(): number = number() number_user = user_guess() while number_user != number: check_number(number = number, number_user = number_user) number_user = user_guess() UnboundLocalError: lo

Re: help using smtplib to work ..

2006-11-09 Thread Gabriel Genellina
At Thursday 9/11/2006 00:45, Jordan wrote: Your post was definitely the most helpful for me. For some reason, smtp for gmail seems to require that you call server.ehlo() a second time, after having called server.starttls(), otherwise, the server won't accept authorization. Thanks. That's cle

Re: Can not download plugins for jEdit (help!!)

2006-11-09 Thread Ant
On Nov 9, 2:11 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: ... > """ never are. Then I changed the synchronize declarations in > /syntax/python.vim to the following: > > syn sync match pythonSync grouphere NONE '"""$' > syn sync maxlines=300 > > The above is no good for random Python code, th

Re: pack a three byte int

2006-11-09 Thread Dave Opstad
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Can Python not express the idea of a three-byte int? > > For instance, in the working example below, can we somehow collapse the > three calls of struct.pack into one? > > >>> import struct > >>> > >>> skip = 0x123456 ; count = 0x80 > >

Re: Can not download plugins for jEdit (help!!)

2006-11-09 Thread BillJosephson
Ant wrote: > > Vim, it can handle all the things.http://www.vim.org/ > > I'm not convinced of that quite yet. jEdit's syntax highlighting seems > more robust (see SocketServer.py in the standard library for an example > - vim gets the highlighting of the first doc-comment wrong). I've also > not f

Re: Question regarding lists and regex

2006-11-09 Thread Ant
On Nov 9, 6:29 am, Prabhu Gurumurthy <[EMAIL PROTECTED]> wrote: ... > regex: I presume this is rather a dumb question, anyways here it comes! as you > can see from my program, pattIp = r\d{1,3}\ etc, is there any other easy > way > to group the reptitions, instead of typing the same regex 4

Re: pack a three byte int

2006-11-09 Thread Dave Opstad
Sorry, that should have been: cdb += struct.pack(">L", skip)[1:] Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: UnboundLocalError

2006-11-09 Thread Benjamin Niemann
Hello, Camellia wrote: > why it generates an "UnboundLocalError" when I do the following: > > > ... > def main(): > number = number() > number_user = user_guess() > while number_user != number: > check_number(number = number, number_user = number_user) > number_user

Re: Can not download plugins for jEdit (help!!)

2006-11-09 Thread John Salerno
Ant wrote: > I do use vim more than Python these days What does that mean? Are you referring to all the setup involved with vim? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread John Salerno
Nick Craig-Wood wrote: >>> So, is there another toolkit I should be looking at? >> I highly recommend wxPython. > > I'd second that! > > There is a book also > > "WxPython in Action" Oh yeah, how could I forget "The Book"! :) It's great to read straight through, and also a fantastic refere

Re: is this the right way to do subclasses?

2006-11-09 Thread John Salerno
Bruno Desthuilliers wrote: > John Salerno a écrit : >> Peter Otten wrote: >> >>> You may need a no-op implementation of fix_attributes() in the Character >>> class. >> >> >> What does that mean? Is that in case I use Character directly to >> create an object? > > Most propbably it can be useful f

Re: Can not download plugins for jEdit (help!!)

2006-11-09 Thread BillJosephson
Ant wrote: > On Nov 9, 6:52 am, "BillJosephson" <[EMAIL PROTECTED]> wrote: > ... > > If anyone knows why i can't connect, in info about it would be > > a big help. > > Sounds like the default mirror is down. Go to Utilities -> Global > Options -> Plugin Manager and click on "Update mirror list". C

Re: is this the right way to do subclasses?

2006-11-09 Thread John Salerno
Steve Holden wrote: >> Wait, I just might be an idiot. Is it not even necessary for me to >> call Character's __init__ method? Fighter will inherit it >> automatically and call it when a Fighter object is created, right? >> > By Jove, he's got it! But I was thinking...even though there are bett

Re: ANN: PyQt v4.1 Released

2006-11-09 Thread Tool69
David Boddie a écrit : > Do you mean the example from the PyQt4 distribution? Yes, that was it. > That uses a port of an old syntax highlighting example from Qt 4.0. Someone > needs to > "port" the C++ example from Qt 4.2 to PyQt4. So, we've got no sample to use QScintilla2 ?? Thanks, 6TooL9

extract text from a string

2006-11-09 Thread boris . smirnov
Hallo all, I have tried for a couple of hours to solve my problem with re but I have no success. I have a string containing: "+abc_cde.fgh_jkl\n" and what I need to become is "abc_cde.fgh_jkl". Could anybody be so kind and write me a code of how to extract this text from that string? thank you

Re: extract text from a string

2006-11-09 Thread Jon Clements
[EMAIL PROTECTED] wrote: > Hallo all, > > I have tried for a couple of hours to solve my problem with re but I > have no success. > > I have a string containing: "+abc_cde.fgh_jkl\n" and what I need to > become is "abc_cde.fgh_jkl". Could anybody be so kind and write me a > code of how to extrac

Re: extract text from a string

2006-11-09 Thread Tim Williams
On 9 Nov 2006 07:45:25 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I have a string containing: "+abc_cde.fgh_jkl\n" and what I need to > become is "abc_cde.fgh_jkl". Could anybody be so kind and write me a > code of how to extract this text from that string? > for that particular str

Re: extract text from a string

2006-11-09 Thread Roberto Bonvallet
Jon Clements wrote: >> I have a string containing: "+abc_cde.fgh_jkl\n" and what I need to >> become is "abc_cde.fgh_jkl". Could anybody be so kind and write me a >> code of how to extract this text from that string? > > [...] Going by your example, it's tempting to suggest the best method > woul

Re: ANN: PyQt v4.1 Released

2006-11-09 Thread David Boddie
Tool69 wrote: > > That uses a port of an old syntax highlighting example from Qt 4.0. Someone > needs to "port" the C++ example from Qt 4.2 to PyQt4. > > So, we've got no sample to use QScintilla2 ?? Well, this should get you started: import sys from PyQt4.QtGui import QApplication from PyQt4.Qs

Re: extract text from a string

2006-11-09 Thread Grant Edwards
On 2006-11-09, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hallo all, > > I have tried for a couple of hours to solve my problem with re but I > have no success. > > I have a string containing: "+abc_cde.fgh_jkl\n" and what I need to > become is "abc_cde.fgh_jkl". Could anybody be so kind and w

Py3K idea: why not drop the colon?

2006-11-09 Thread Michael Hobbs
Can anyone find a flaw with this change in syntax? Instead of dividing a compound statement with a colon, why not divide it on a newline? For example, the colon could be dropped from this statement: if self.hungry: self.eat() to if self.hungry self.eat() Python is already

Re: More elegant way to obtain ACLs / permissions for windows directories than using "cacls" dos command?

2006-11-09 Thread dananrg
> There are some examples of using the security descriptor objects in > \Lib\site-packages\win32\Demos\security. > Also, searching the Python-win32 mailing list should turn up some > more code. Thanks again Roger. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can not download plugins for jEdit (help!!)

2006-11-09 Thread Anders Arnholm
Ant <[EMAIL PROTECTED]> skriver: >> Vim, it can handle all the things.http://www.vim.org/ > > I'm not convinced of that quite yet. jEdit's syntax highlighting seems > more robust (see SocketServer.py in the standard library for an example > - vim gets the highlighting of the first doc-comment wrong

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread Paul Boddie
Michael Hobbs wrote: > > I think the colon could be omitted from every type of compound > statement: 'if', 'for', 'def', 'class', whatever. Am I missing anything? The FAQ answer. ;-) http://www.python.org/doc/faq/general/#why-are-colons-required-for-the-if-while-def-class-statements Paul -- ht

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Michael Hobbs wrote: > Python is already sensitive to whitespace and the newline anyway, so why > not put it to good use? For example, Python rejects this statement > because of the newline present: > if self.hungry or > self.depressed: > self.eat() > Yo

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread Michael Hobbs
Paul Boddie wrote: > Michael Hobbs wrote: > >> I think the colon could be omitted from every type of compound >> statement: 'if', 'for', 'def', 'class', whatever. Am I missing anything? >> > > The FAQ answer. ;-) > > http://www.python.org/doc/faq/general/#why-are-colons-required-for-the-if-

Re: assigning values in __init__

2006-11-09 Thread Antoon Pardon
On 2006-11-09, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 09 Nov 2006 10:36:07 +, Antoon Pardon wrote: > >> On 2006-11-09, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >>> On Thu, 09 Nov 2006 12:27:12 +1100, Ben Finney wrote: >>> John Salerno <[EMAIL PROTECTED]> writes: >

Re: Can not download plugins for jEdit (help!!)

2006-11-09 Thread Ant
> May I ask another quetion? I don't want to mess with lots of plugins > at this point. What are the minimum plugins to get a typical looking > IDE with a code window and output window and that lets me set > breakpoints and step through code? The Console plugin is a must (I think it depends on th

Re: extract text from a string

2006-11-09 Thread boris . smirnov
Thank you very much. I needed this kick. :) Rg, Boris Grant Edwards napísal(a): > On 2006-11-09, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hallo all, > > > > I have tried for a couple of hours to solve my problem with re but I > > have no success. > > > > I have a string containing: "+abc_

Re: Can not download plugins for jEdit (help!!)

2006-11-09 Thread Ant
On Nov 9, 3:27 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Ant wrote: > > I do use vim more than Python these daysWhat does that mean? Are you > > referring to all the setup involved with vim? Whoops! I mean I use vim more than jEdit these days! -- http://mail.python.org/mailman/listinfo/py

Re: pack a three byte int

2006-11-09 Thread John Machin
Dave Opstad wrote: > Sorry, that should have been: > > cdb += struct.pack(">L", skip)[1:] > ">L" and ">I" produce exactly the same 4-byte result. The change from [-3:] to [1:] is a minor cosmetic improvement, but obscures the underlying ... a bit like putting mascara on a pig. I got the impressio

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread Steve Holden
Paul Boddie wrote: > Michael Hobbs wrote: >> I think the colon could be omitted from every type of compound >> statement: 'if', 'for', 'def', 'class', whatever. Am I missing anything? > > The FAQ answer. ;-) > > http://www.python.org/doc/faq/general/#why-are-colons-required-for-the-if-while-def-c

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Dan Lenski
Nick Craig-Wood wrote: > John Salerno <[EMAIL PROTECTED]> wrote: > > Dan Lenski wrote: > > > > > So, is there another toolkit I should be looking at? > > > > I highly recommend wxPython. > > I'd second that! > > There is a book also > > "WxPython in Action" Nick and John S., thank you for the

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread Paul Boddie
Steve Holden wrote: > Paul Boddie wrote: > > http://www.python.org/doc/faq/general/#why-are-colons-required-for-the-if-while-def-class-statements > > > I suppose it would be even better if that hyperlink actually took you to > section 1.4.27 rather than 1.4.14 ... I'd suggest a browser upgrade:

directpython application bug

2006-11-09 Thread vedran
Hello, I using directpython for making 3d miniature applications,but I have one problem about directpython. This is my code for example: import d3d import d3dc import d3dx device=d3d.createDevice() groundtexture=d3d.Font(u'my program',30) ...and when I run this code, directpython just open win

Re: Multithreaded C API Python questions

2006-11-09 Thread Farshid Lashkari
Svein Seldal wrote: > I'm unable to get access to python as long as another python call is > executing. The PyEval_AcquireThread() call blocks until the first call > returns. I was hoping that the python system itself would release the > GIL after some execution, but it itsnt. > > I am dependen

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Christophe
Dan Lenski a écrit : > Nick and John S., thank you for the tip on wxPython! I'll look into it > for my next project. I too would avoid Qt, not because of the GPL but > simply because I don't use KDE under Linux and because Qt is not well > supported under Cygwin or on native Windows. Qt is very w

  1   2   3   >