Re: Executable standalone *.pyc after inserting "#!/usr/bin/python" or other options

2010-01-14 Thread Martin v. Loewis
> This works great! Do you or anyone else have information on how to do > the same thing for Windows and/or Solaris. On Windows, just associate the .pyc extension with Python - the standard installation will already do that. On Solaris, I don't think something like this is supported. Regards, Ma

Re: parsing an Excel formula with the re module

2010-01-14 Thread John Machin
On Jan 15, 3:41 pm, Paul McGuire wrote: > I never represented that this parser would handle any and all Excel > formulas! >  But I should hope the basic structure of a pyparsing > solution might help the OP add some of the other features you cited, > if necessary. It's actually pretty common to ta

Windows drag & drop with win32com and IDropTarget

2010-01-14 Thread Greg K
I'm trying to create a program that will process files dragged into its window, however I can't seem to get the cursor to change correctly when something is dragged over the window. I've created an object that implements the IDropTarget interface, but it seems the value returned by its DragEnter me

Re: ctypes error

2010-01-14 Thread Gib Bogle
It has occurred to me that the error may have nothing to do with ctypes. The DLL was built on one machine and copied to the other (which doesn't have the compiler installed). Although both machines are running Windows XP, there might be some subtle differences. I see that the build machine h

ctypes error

2010-01-14 Thread Gib Bogle
I have a simple demo program (on Windows XP) that uses the ctypes module to load a DLL. This program works as expected with Python 2.5.4, but fails with Python 2.6.4 (on a different machine, each machine has only one Python version installed), with these messages: File "demo.py", line 37, in

python mechanize.browser proxy handdling question

2010-01-14 Thread elca
Hello All, i was encoutered some problem while im using mechanize.Browser() with proxy handling function. i have working snippet of script about mechanize.urlopen, but i don't know how to implement with mechanize.Brower module. if anyone can show me some sample? if anyone help me much appreciat

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: [...] Perhaps you'd also admit to being wrong, and retract your innuoendo etc.? Disregarding any matters of right or wrong (for this post, at least), I herebe retract anything I have said about you that you consider innuendo. OK. Feel free to remind

which data structure should I use?

2010-01-14 Thread Eknath Venkataramani
I have a txt file in the following format: [code] "confident" => { count => 4, trans => { "ashahvasahta" => 0.74918568, "atahmavaishahvaasa" => 0.09095465, "pahraaram\.nbha" => 0.06990729, "mailatae" => 0.02856427, "utanai" => 0.01929341, "anaa" =>

Re: parsing an Excel formula with the re module

2010-01-14 Thread Paul McGuire
I never represented that this parser would handle any and all Excel formulas! But I should hope the basic structure of a pyparsing solution might help the OP add some of the other features you cited, if necessary. It's actually pretty common to take an incremental approach in making such a parser,

Re: A simple-to-use sound file writer

2010-01-14 Thread Steve Holden
Alf P. Steinbach wrote: [...] > Perhaps you'd also admit to being wrong, and retract your innuoendo etc.? > Disregarding any matters of right or wrong (for this post, at least), I herebe retract anything I have said about you that you consider innuendo. Feel free to remind me what that was. regar

Re: A simple-to-use sound file writer

2010-01-14 Thread Steve Holden
Alf P. Steinbach wrote: > * Steve Holden: >> Alf P. Steinbach wrote: >>> * Lie Ryan: On 01/15/10 05:42, Alf P. Steinbach wrote: > I'm beginning to believe that you maybe didn't grok that simple > procedure. > > It's very very very trivial, so maybe you were looking for somethin

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Lie Ryan: On 01/15/10 05:42, Alf P. Steinbach wrote: I'm beginning to believe that you maybe didn't grok that simple procedure. It's very very very trivial, so maybe you were looking for something more intricate -- they used to say, in the old days,

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Steve Holden
Paul Rubin wrote: > Novocastrian_Nomad writes: >> I know whereof I speak, I have been fortunate enough to work remotely >> (across the country) for the last ten years, for two different employers. > > Some like working remotely, others don't. I had to work remotely for my > last couple of jobs.

Re: Simple distributed example for learning purposes?

2010-01-14 Thread Steve Holden
Ethan Furman wrote: > CM wrote: >> On Dec 26 2009, 3:46 pm, Shawn Milochik wrote: >>> The special features of the Shrek DVD showed how the rendering took >>> so much processing power that everyone's workstation was used >>> overnight as a rendering farm. Some kind of video rendering would >>> make

Re: A simple-to-use sound file writer

2010-01-14 Thread Steve Holden
Alf P. Steinbach wrote: > * Lie Ryan: >> On 01/15/10 05:42, Alf P. Steinbach wrote: >>> I'm beginning to believe that you maybe didn't grok that simple >>> procedure. >>> >>> It's very very very trivial, so maybe you were looking for something >>> more intricate -- they used to say, in the old da

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Steve Holden
Paul Boddie wrote: > On 28 Des 2009, 08:32, Andrew Jonathan Fine > wrote: >> As a hobby to keep me sane, I am attempting to retrain >> part time at home as a jeweler and silversmith, and I sometimes used >> Python for generating and manipulating code for CNC machines. > > It occurs

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Steve Holden
Paul Rubin wrote: > a...@pythoncraft.com (Aahz) writes: >> Incidentally, my company has had a fair amount of difficulty finding >> Python programmers -- anyone in the SF area looking for a job near >> Mountain View? > > I'm surprised there aren't a ton of Python programmers there, given > that's w

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Lie Ryan: On 01/15/10 05:42, Alf P. Steinbach wrote: I'm beginning to believe that you maybe didn't grok that simple procedure. It's very very very trivial, so maybe you were looking for something more intricate -- they used to say, in the old days, "hold on, this proof goes by so fast you

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Paul Rubin
Novocastrian_Nomad writes: > I know whereof I speak, I have been fortunate enough to work remotely > (across the country) for the last ten years, for two different employers. Some like working remotely, others don't. I had to work remotely for my last couple of jobs. I hated it. I want to actu

Re: QDoubleValidator

2010-01-14 Thread Helvin
Zabin, The QDoubleValidator class works, but it allows 'intermediate' values to show in the widget. This problem has been addressed here: http://qt.nokia.com/developer/faqs/faq.2006-05-15.0450651751, I just tried to implement this in PyQt again, and it worked! =P I've posted the working code here

Re: Dynamic HTML controls

2010-01-14 Thread Alan Harris-Reid
Pierre Quentel wrote: On 12 jan, 04:26, Alan Harris-Reid wrote: Hi, Does anyone know where I can find any decent dynamically-constructed HTML control classes (dropdown list, table, input field, checkbox, etc.) written in Python. For example, for a HTML table I would like something like...

Re: Writing a string.ishex function

2010-01-14 Thread MRAB
Wolfram Hinderer wrote: On 14 Jan., 19:48, MRAB wrote: Arnaud Delobelle wrote: "D'Arcy J.M. Cain" writes: On Thu, 14 Jan 2010 09:07:47 -0800 Chris Rebert wrote: Even more succinctly: def ishex(s): return all(c in string.hexdigits for c in s) I'll see your two-liner and raise you. :-)

Re: Writing a string.ishex function

2010-01-14 Thread Wolfram Hinderer
On 14 Jan., 19:48, MRAB wrote: > Arnaud Delobelle wrote: > > "D'Arcy J.M. Cain" writes: > > >> On Thu, 14 Jan 2010 09:07:47 -0800 > >> Chris Rebert wrote: > >>> Even more succinctly: > > >>> def ishex(s): > >>>     return all(c in string.hexdigits for c in s) > >> I'll see your two-liner and rai

Re: Writing a string.ishex function

2010-01-14 Thread Steven D'Aprano
On Thu, 14 Jan 2010 18:36:12 +, MRAB wrote: >> And here are your unit tests. Every line should print "True". >> >> print ishex('123') is True >> print ishex('abc') is True >> print ishex('xyz') is False >> print ishex('0123456789abcdefABCDEF') is True >> print ishex('0123456789abcdefABCDEFG

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Lie Ryan: On 01/15/10 05:42, Alf P. Steinbach wrote: I'm beginning to believe that you maybe didn't grok that simple procedure. It's very very very trivial, so maybe you were looking for something more intricate -- they used to say, in the old days, "hold on, this proof goes by so fast you

Re: parsing an Excel formula with the re module

2010-01-14 Thread John Machin
On Jan 14, 2:05 pm, "Gabriel Genellina" wrote: > En Wed, 13 Jan 2010 05:15:52 -0300, Paul McGuire   > escribió: > > >> vsoler wrote: > >> > Hence, I need toparseExcel formulas. Can I do it by means only of re > >> > (regular expressions)? > > > This might give the OP a running start: > > > from p

Re: parsing an Excel formula with the re module

2010-01-14 Thread John Machin
On Jan 13, 7:15 pm, Paul McGuire wrote: > On Jan 5, 1:49 pm, Tim Chase wrote: > > > > > vsoler wrote: > > > Hence, I need toparseExcel formulas. Can I do it by means only of re > > > (regular expressions)? > > > > I know that for simple formulas such as "=3*A7+5" it is indeed > > > possible. What

Re: Executable standalone *.pyc after inserting "#!/usr/bin/python"or other options

2010-01-14 Thread Lie Ryan
On 01/15/10 09:33, Martin v. Loewis wrote: > > P.S. The approach you present for Lua indeed does not work for > Python. Actually the approach should work, though with a little workaround; you can write your wrapper (e.g. #!/usr/bin/mypython) that simply strips the first line and pass the file to

Re: Writing a string.ishex function

2010-01-14 Thread Aahz
In article , D'Arcy J.M. Cain wrote: > >try: x = isinstance(s, int) and s or int(s, 0) >except ValueError: [handle invalid input] Why aren't you using the ternary? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professiona

Re: Executable standalone *.pyc after inserting "#!/usr/bin/python" or other options

2010-01-14 Thread epsilon
On Jan 14, 5:33 pm, "Martin v. Loewis" wrote: > > I've been playing with "Lua" and found something really cool that I'm > > unable to do in "Python". With "Lua", a script can be compiled to byte > > code using "luac" and by adding "#!/usr/bin/lua" at the top of the > > binary, the byte code become

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Phlip
Aahz wrote: In article <6a12ed15-e7f9-43ab-9b90-984525808...@o28g2000yqh.googlegroups.com>, Novocastrian_Nomad wrote: Why is it so many, so called high tech companies, insist on the 19th century practice of demanding an employee's physical presence in a specific geographic location. Because

Re: Bare Excepts

2010-01-14 Thread sjdevn...@yahoo.com
On Jan 2, 9:35 pm, Dave Angel wrote: > Steven D'Aprano wrote: > > On Sat, 02 Jan 2010 09:40:44 -0800, Aahz wrote: > > >> OTOH, if you want to do something different depending on whether the > >> file exists, you need to use both approaches: > > >> if os.path.exists(fname): > >>     try: > >>      

Re: Simple distributed example for learning purposes?

2010-01-14 Thread Ethan Furman
CM wrote: On Dec 26 2009, 3:46 pm, Shawn Milochik wrote: The special features of the Shrek DVD showed how the rendering took so much processing power that everyone's workstation was used overnight as a rendering farm. Some kind of video rendering would make a great example. However, it might

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Paul Boddie
On 28 Des 2009, 08:32, Andrew Jonathan Fine wrote: > >   As a hobby to keep me sane, I am attempting to retrain > part time at home as a jeweler and silversmith, and I sometimes used > Python for generating and manipulating code for CNC machines. It occurs to me that in some domains,

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Aahz
In article <6a12ed15-e7f9-43ab-9b90-984525808...@o28g2000yqh.googlegroups.com>, Novocastrian_Nomad wrote: > >Why is it so many, so called high tech companies, insist on the 19th >century practice of demanding an employee's physical presence in a >specific geographic location. Because it works be

Re: maintain 2 versions of python on my computer

2010-01-14 Thread Lie Ryan
On 01/14/10 22:21, luis wrote: > > Hi > > I am not an expert in programming and using Python for its simplicity > > I have 2 versions of python installed on my computer (windos xp) to > begin the transition from version 2.4 to 2.6 or 3. maintaining the > operability of my old scripts > > Is the

Re: Executable standalone *.pyc after inserting "#!/usr/bin/python" or other options

2010-01-14 Thread Martin v. Loewis
> I've been playing with "Lua" and found something really cool that I'm > unable to do in "Python". With "Lua", a script can be compiled to byte > code using "luac" and by adding "#!/usr/bin/lua" at the top of the > binary, the byte code becomes a single file executable. After I found > this trick,

Re: Simple distributed example for learning purposes?

2010-01-14 Thread CM
On Dec 26 2009, 3:46 pm, Shawn Milochik wrote: > The special features of the Shrek DVD showed how the rendering took so much > processing power that everyone's workstation was used overnight as a > rendering farm. Some kind of video rendering would make a great example. > However, it might be a

[ANN] Python 2.5.5 Release Candidate 1.

2010-01-14 Thread Martin v. Löwis
On behalf of the Python development team and the Python community, I'm happy to announce the release candidate 1 of Python 2.5.5. This is a source-only release that only includes security fixes. The last full bug-fix release of Python 2.5 was Python 2.5.4. Users are encouraged to upgrade to the la

Re: Writing a string.ishex function

2010-01-14 Thread MRAB
Arnaud Delobelle wrote: MRAB writes: Arnaud Delobelle wrote: "D'Arcy J.M. Cain" writes: On Thu, 14 Jan 2010 09:07:47 -0800 Chris Rebert wrote: Even more succinctly: def ishex(s): return all(c in string.hexdigits for c in s) I'll see your two-liner and raise you. :-) ishex = lambd

Re: Ignore leading '>>>' and ellipsis?

2010-01-14 Thread Rhodri James
On Thu, 14 Jan 2010 17:13:54 -, Reckoner wrote: I am studying some examples in a tutorial where there are a lot of leading >>> characters and ellipsis in the text. This makes it hard to cut and paste into the IPython interpreter since it doesn't like these strings. Is there another interpr

Re: A simple-to-use sound file writer

2010-01-14 Thread Lie Ryan
On 01/15/10 05:42, Alf P. Steinbach wrote: > I'm beginning to believe that you maybe didn't grok that simple procedure. > > It's very very very trivial, so maybe you were looking for something > more intricate -- they used to say, in the old days, "hold on, this > proof goes by so fast you may n

SAGE help & support?

2010-01-14 Thread Lou Pecora
Does anyone know of any SAGE support or help newsgroups or email lists? I know this is not a SAGE group and there is at least one support group for SAGE (http://groups.google.com/group/sage-support/), but I have gone there and asked similar questions twice and gotten zero replies (it's been abo

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Novocastrian_Nomad
Why is it so many, so called high tech companies, insist on the 19th century practice of demanding an employee's physical presence in a specific geographic location. This is the 21st century with climate change, carbon footprints, broadband internet, telecommuting, tele-presence, telephones, fax m

Re: Python and Tkinter Programming by John Grayson

2010-01-14 Thread Kevin Walzer
On 1/14/10 3:39 PM, Peter wrote: On Jan 15, 6:24 am, Mark Roseman wrote: Peter wrote: Besides, the book is mainly about using Python with Tkinter - and Tkinter hasn't changed that much since 2000, so I believe it is just as relevant today as it was back then. I'd say that Tkinter has subs

Re: Writing a string.ishex function

2010-01-14 Thread Terry Reedy
On 1/14/2010 12:44 PM, D'Arcy J.M. Cain wrote: On Thu, 14 Jan 2010 09:07:47 -0800 Chris Rebert wrote: Even more succinctly: def ishex(s): return all(c in string.hexdigits for c in s) I'll see your two-liner and raise you. :-) ishex = lambda s: all(c in string.hexdigits for c in s) T

Executable standalone *.pyc after inserting "#!/usr/bin/python" or other options

2010-01-14 Thread epsilon
All: I've been playing with "Lua" and found something really cool that I'm unable to do in "Python". With "Lua", a script can be compiled to byte code using "luac" and by adding "#!/usr/bin/lua" at the top of the binary, the byte code becomes a single file executable. After I found this trick, I r

Re: Bare Excepts

2010-01-14 Thread Aahz
In article <034fd208$0$1277$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: >On Sat, 02 Jan 2010 09:40:44 -0800, Aahz wrote: >> >> OTOH, if you want to do something different depending on whether the >> file exists, you need to use both approaches: >> >> if os.path.exists(fname): >> try:

Re: PyQT 4.6.2 question about radiobuttons

2010-01-14 Thread Phil Thompson
On Thu, 14 Jan 2010 22:09:20 +0100, News123 wrote: > Hi, > > As you wll notice: I don't have a lot of GUI and only very litte > PyQT-experience. > > > I have a UI created with qt designer. > > The UI contains a few named radio buttons in a button group. > ( for example radioButton_one to radio

PyQT 4.6.2 question about radiobuttons

2010-01-14 Thread News123
Hi, As you wll notice: I don't have a lot of GUI and only very litte PyQT-experience. I have a UI created with qt designer. The UI contains a few named radio buttons in a button group. ( for example radioButton_one to radioButton_four ) I am unable locate a signal, that is fired whenever one

Re: Python and Tkinter Programming by John Grayson

2010-01-14 Thread Peter
On Jan 15, 6:24 am, Mark Roseman wrote: >  Peter wrote: > > Besides, the book is mainly about using Python with Tkinter - and > > Tkinter hasn't changed that much since 2000, so I believe it is just > > as relevant today as it was back then. > > I'd say that Tkinter has substantially changed - wi

Re: Writing a string.ishex function

2010-01-14 Thread Arnaud Delobelle
MRAB writes: > Arnaud Delobelle wrote: >> "D'Arcy J.M. Cain" writes: >> >>> On Thu, 14 Jan 2010 09:07:47 -0800 >>> Chris Rebert wrote: Even more succinctly: def ishex(s): return all(c in string.hexdigits for c in s) >>> I'll see your two-liner and raise you. :-) >>> >>>

Re: Writing a string.ishex function

2010-01-14 Thread exarkun
On 08:15 pm, da...@druid.net wrote: On 14 Jan 2010 19:19:53 GMT Duncan Booth wrote: > ishex2 = lambda s: not(set(s)-set(string.hexdigits)) # Yours > ishex3 = lambda s: not set(s)-set(string.hexdigits) # Mine > > I could actually go three better: > > ishex3=lambda s:not set(s)-set(strin

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Aahz
In article <7x4omosdly@ruckus.brouhaha.com>, Paul Rubin wrote: >a...@pythoncraft.com (Aahz) writes: >> >> Incidentally, my company has had a fair amount of difficulty finding >> Python programmers -- anyone in the SF area looking for a job near >> Mountain View? > >I'm surprised there aren't

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Aahz
In article , Robert Kern wrote: >On 2010-01-14 13:14 PM, Paul Rubin wrote: >> a...@pythoncraft.com (Aahz) writes: >>> >>> Incidentally, my company has had a fair amount of difficulty finding >>> Python programmers -- anyone in the SF area looking for a job near >>> Mountain View? >> >> I'm surpri

Re: Writing a string.ishex function

2010-01-14 Thread D'Arcy J.M. Cain
On Thu, 14 Jan 2010 18:36:12 + MRAB wrote: > > print ishex('123') is True > > print ishex('abc') is True > > print ishex('xyz') is False > > print ishex('0123456789abcdefABCDEF') is True > > print ishex('0123456789abcdefABCDEFG') is False > > > Don't use 'is', use '=='. Why? There is only o

Re: Writing a string.ishex function

2010-01-14 Thread D'Arcy J.M. Cain
On 14 Jan 2010 19:19:53 GMT Duncan Booth wrote: > > ishex2 = lambda s: not(set(s)-set(string.hexdigits)) # Yours > > ishex3 = lambda s: not set(s)-set(string.hexdigits) # Mine > > > > I could actually go three better: > > > > ishex3=lambda s:not set(s)-set(string.hexdigits) > > But non

Re: Invalid Syntax Error

2010-01-14 Thread Benjamin Kaplan
How about you just isolate the first few lines On Thu, Jan 14, 2010 at 2:43 PM, Ray Holt wrote: > try: >     #open file stream >     file = open(file_name, "w" > except IOError: >     print "There was an error writing to", file_name >     sys.exit() Notice anything now? Something missing perhaps

Re: Invalid Syntax Error

2010-01-14 Thread MRAB
Ray Holt wrote: Why am I getting an invalid systax on the first except in the following code. It was copid from the python tutorial for beginners. Thanks, Ray import sys try: #open file stream file = open(file_name, "w" [snip] Missing ")". -- http://mail.python.org/mailman/listinfo/py

Re: unittest help needed!

2010-01-14 Thread Phlip
Oltmans wrote: def test_first(self): print 'first test' process(123) All test cases use the pattern "Assemble Activate Assert". You are assembling a 123, and activating process(), but where is your assert? If it is inside process() (if process is a test-side method), then

Re: Writing a string.ishex function

2010-01-14 Thread MRAB
Duncan Booth wrote: MRAB wrote: I raise you one character: ishex2 = lambda s: not(set(s)-set(string.hexdigits)) # Yours ishex3 = lambda s: not set(s)-set(string.hexdigits) # Mine I could actually go three better: ishex3=lambda s:not set(s)-set(string.hexdigits) But none of those

Invalid Syntax Error

2010-01-14 Thread Ray Holt
Why am I getting an invalid systax on the first except in the following code. It was copid from the python tutorial for beginners. Thanks, Ray import sys try: #open file stream file = open(file_name, "w" except IOError: print "There was an error writing to", file_name sys.exit() pri

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Jean-Michel Pichavant
Paul Rubin wrote: a...@pythoncraft.com (Aahz) writes: Incidentally, my company has had a fair amount of difficulty finding Python programmers -- anyone in the SF area looking for a job near Mountain View? I'm surprised there aren't a ton of Python programmers there, given that's where

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Robert Kern
On 2010-01-14 13:14 PM, Paul Rubin wrote: a...@pythoncraft.com (Aahz) writes: Incidentally, my company has had a fair amount of difficulty finding Python programmers -- anyone in the SF area looking for a job near Mountain View? I'm surprised there aren't a ton of Python programmers there, giv

Re: Writing a string.ishex function

2010-01-14 Thread Jean-Michel Pichavant
Phlip wrote: MRAB wrote: BTW, ishex('') should return False. So should int('')! Did you mean isint('') ? JM -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Tkinter Programming by John Grayson

2010-01-14 Thread Mark Roseman
Peter wrote: > Besides, the book is mainly about using Python with Tkinter - and > Tkinter hasn't changed that much since 2000, so I believe it is just > as relevant today as it was back then. I'd say that Tkinter has substantially changed - with the introduction of the 'ttk' themed widgets.

Re: Writing a string.ishex function

2010-01-14 Thread Duncan Booth
MRAB wrote: > I raise you one character: > > ishex2 = lambda s: not(set(s)-set(string.hexdigits)) # Yours > ishex3 = lambda s: not set(s)-set(string.hexdigits) # Mine > > I could actually go three better: > > ishex3=lambda s:not set(s)-set(string.hexdigits) But none of those pass you

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Paul Rubin
a...@pythoncraft.com (Aahz) writes: > Incidentally, my company has had a fair amount of difficulty finding > Python programmers -- anyone in the SF area looking for a job near > Mountain View? I'm surprised there aren't a ton of Python programmers there, given that's where Brand G is and so forth.

Re: interactive terminal in Ubuntu Linux : libreadline5-dev works only in Python 2.6 not 3.1

2010-01-14 Thread Dave WB3DWE
>The python 3 version in the 9.10 repo is 3.1.1 > >Actually, if I/O is important, I'd recommend a full install of 9.10 so that >you can get the ext4 file system. I have found it offers some very >impressive speedups with the disk -- especially for deleting files. Thanks casevh and Lee. I intend to

Re: unittest help needed!

2010-01-14 Thread Oltmans
On Jan 14, 11:46 pm, exar...@twistedmatrix.com wrote: > When you run test.py, it gets to the loadTestsFromName line.  There, it > imports the module named "test" in order to load tests from it.  To > import > that module, it runs test.py again.  By the time it finishes running the > contents of t

Re: Writing a string.ishex function

2010-01-14 Thread MRAB
Phlip wrote: MRAB wrote: BTW, ishex('') should return False. So should int('')! Why? -- http://mail.python.org/mailman/listinfo/python-list

Re: thanks casevh and Lee

2010-01-14 Thread Dave WB3DWE
Thanks Lee & casevh. I'm going to remove all python 3 versions, update to Ubuntu 9.10 and then do a clean installation of python 3.1.1 via Synaptic. Dave WB3DWE -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing a string.ishex function

2010-01-14 Thread MRAB
Arnaud Delobelle wrote: "D'Arcy J.M. Cain" writes: On Thu, 14 Jan 2010 09:07:47 -0800 Chris Rebert wrote: Even more succinctly: def ishex(s): return all(c in string.hexdigits for c in s) I'll see your two-liner and raise you. :-) ishex = lambda s: all(c in string.hexdigits for c in s

Re: unittest help needed!

2010-01-14 Thread exarkun
On 06:33 pm, rolf.oltm...@gmail.com wrote: Hi Python gurus, I'm quite new to Python and have a problem. Following code resides in a file named test.py --- import unittest class result(unittest.TestResult): pass class tee(unittest.TestCase): def test_first(self): print 'first te

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Steve Holden: Grant Edwards wrote: On 2010-01-14, Alf P. Steinbach wrote: [bogus hand-waving] After all, it's the basis of digital representation of sound! Huh? I've only studied basic DSP, but I've never heard/seen that as the basis of digital re

Re: Writing a string.ishex function

2010-01-14 Thread Phlip
MRAB wrote: BTW, ishex('') should return False. So should int('')! -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing a string.ishex function

2010-01-14 Thread MRAB
D'Arcy J.M. Cain wrote: On Thu, 14 Jan 2010 07:52:58 -0800 (PST) chandra wrote: Folks, I am new to Python and could not find a function along the lines of Welcome. string.ishex in Python. There is however, a string.hexdigits constant in the string module. I thought I would enhance the exis

unittest help needed!

2010-01-14 Thread Oltmans
Hi Python gurus, I'm quite new to Python and have a problem. Following code resides in a file named test.py --- import unittest class result(unittest.TestResult): pass class tee(unittest.TestCase): def test_first(self): print 'first test' print '-' def

Re: Writing a string.ishex function

2010-01-14 Thread Arnaud Delobelle
"D'Arcy J.M. Cain" writes: > On Thu, 14 Jan 2010 09:07:47 -0800 > Chris Rebert wrote: >> Even more succinctly: >> >> def ishex(s): >> return all(c in string.hexdigits for c in s) > > I'll see your two-liner and raise you. :-) > > ishex = lambda s: all(c in string.hexdigits for c in s) I's

Re: Simple distributed example for learning purposes?

2010-01-14 Thread Mike Driscoll
On Dec 26 2009, 2:06 pm, Tim Golden wrote: > I'm trying to work up a programming course using Python, > aimed at secondary school students [*] here in London. One > of my aims is to have a series of compact but functional > examples, each demonstrating a particular field in which > Python (and pro

Re: A simple-to-use sound file writer

2010-01-14 Thread Steve Holden
Alf P. Steinbach wrote: > * Steve Holden: >> Grant Edwards wrote: >>> On 2010-01-14, Alf P. Steinbach wrote: >> [bogus hand-waving] After all, it's the basis of digital representation of sound! >>> Huh? I've only studied basic DSP, but I've never heard/seen >>> that as the basis of digital r

Re: Difference Between Two datetimes

2010-01-14 Thread Steve Ferg
> I'd like to start with two dates as strings, as > "1961/06/16 04:35:25" and "1973/01/18 03:45:50" > How do I get the strings into a shape that will accommodate a difference? Pyfdate http://www.ferg.org/pyfdate/index.html has a numsplit function that should do the trick: http://www.ferg.org/pyf

Re: Writing a string.ishex function

2010-01-14 Thread Christian Heimes
Iain King wrote: > better would be: > def ishex(s): > for c in s: > if c not in string.hexdigits: > return False > return True Even more elegant and probably a faster solutions: --- from string import hexdigits hexdigits = frozenset(hexdigits) def ishex(s): return

Re: maintain 2 versions of python on my computer

2010-01-14 Thread r0g
luis wrote: > Hi > > I am not an expert in programming and using Python for its simplicity > > I have 2 versions of python installed on my computer (windos xp) to > begin the transition from version 2.4 to 2.6 or 3. maintaining the > operability of my old scripts > > Is there any way to indicate

Re: force URLencoding script

2010-01-14 Thread r0g
João wrote: > On Jan 12, 10:07 pm, r0g wrote: >> João wrote: > > for the following data, > authentication = "UID=somestring&" > message = 'PROBLEM severity High: OperatorX Plat1(locationY) global > Succ. : 94.47%' > dest_number = 'XXX' > > url_values = urlencode({'M':message}) > enc_

Re: Writing a string.ishex function

2010-01-14 Thread D'Arcy J.M. Cain
On Thu, 14 Jan 2010 09:07:47 -0800 Chris Rebert wrote: > Even more succinctly: > > def ishex(s): > return all(c in string.hexdigits for c in s) I'll see your two-liner and raise you. :-) ishex = lambda s: all(c in string.hexdigits for c in s) -- D'Arcy J.M. Cain | Democracy is

Re: Ignore leading '>>>' and ellipsis?

2010-01-14 Thread Javier Collado
Hello, I think that's exactly what the cpaste magic function does. Type 'cpaste?' in your IPython session for more information. Best regards, Javier 2010/1/14 Reckoner : > > Hi, > > I am studying some examples in a tutorial where there are a lot of > leading >>> characters and ellipsis in th

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Steve Holden: Grant Edwards wrote: On 2010-01-14, Alf P. Steinbach wrote: [bogus hand-waving] After all, it's the basis of digital representation of sound! Huh? I've only studied basic DSP, but I've never heard/seen that as the basis of digital represention of sound. I've also never seen

Drawing a surface with matplotlib

2010-01-14 Thread Monnin
Hello, I have a newbie question about using matplotlib I would like to draw the surface defined by the lists X, Y and the matrix Z. I get to a nice graphical output with the following code. My problem is that the labels on the axes indicate values corresponding to the indices in Tables X and Y. I w

Ignore leading '>>>' and ellipsis?

2010-01-14 Thread Reckoner
Hi, I am studying some examples in a tutorial where there are a lot of leading >>> characters and ellipsis in the text. This makes it hard to cut and paste into the IPython interpreter since it doesn't like these strings. Is there another interpreter I could use that will appropriately ignore an

Re: Writing a string.ishex function

2010-01-14 Thread Steve Holden
chandra wrote: > On Jan 15, 12:22 am, "D'Arcy J.M. Cain" wrote: > >> Just return False once you find a non-hex digit. >> >> def ishex(s): >> for c in s: >> if not c in string.hexdigits: return False >> >> return True >> >> And here are your unit tests. Every line should print "True". >>

Re: A simple-to-use sound file writer

2010-01-14 Thread Steve Holden
Grant Edwards wrote: > On 2010-01-14, Alf P. Steinbach wrote: [bogus hand-waving] >> After all, it's the basis of digital representation of sound! > > Huh? I've only studied basic DSP, but I've never heard/seen > that as the basis of digital represention of sound. I've also > never seen that re

Re: Writing a string.ishex function

2010-01-14 Thread Chris Rebert
On Thu, Jan 14, 2010 at 8:14 AM, Iain King wrote: > On Jan 14, 3:52 pm, chandra wrote: >> Folks, >> >> I am new to Python and could not find a function along the lines of >> string.ishex in Python. There is however, a string.hexdigits constant >> in the string module. I thought I would enhance th

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Grant Edwards: On 2010-01-14, Alf P. Steinbach wrote: It's not clear to me that you can approximate any waveform with a suitable combination of square waves, Oh. It's simple to prove. At least conceptually! :-) [...] With the goal of just a rough approximation you can go about it like t

Re: Code Generator written in python

2010-01-14 Thread Arnaud Delobelle
trzewiczek writes: > On 01/13/2010 05:09 PM, Arnaud Delobelle wrote: [...] >> Sure, here are some example of self-evaluating python objects, >> i.e. for each v below, >> >> v == eval(v) >> >> I'm quite proud of the last one. [...] >> v = "\"%s\" %% ((r\"%s\",)*2)" % ((r"\"%s\" %% ((r\"%s\

Re: A simple-to-use sound file writer

2010-01-14 Thread Grant Edwards
On 2010-01-14, Alf P. Steinbach wrote: >> It's not clear to me that you can approximate any waveform >> with a suitable combination of square waves, > > Oh. It's simple to prove. At least conceptually! :-) [...] > With the goal of just a rough approximation you can go about > it like this: > >

SMTPException: No suitable authentication method found (Server: Microsoft ESMTP MAIL Service)

2010-01-14 Thread Thomas Guettler
Hi, I try to login, but I get this exception: File "/home/foo/django/core/mail.py", line 137, in open self.connection.login(self.username, self.password) File "/home/foo/smtplib.py", line 587, in login raise SMTPException("No suitable authentication method found.") Trace from tcpdum

Re: Writing a string.ishex function

2010-01-14 Thread chandra
On Jan 15, 12:22 am, "D'Arcy J.M. Cain" wrote: > Just return False once you find a non-hex digit. > > def ishex(s): >   for c in s: >     if not c in string.hexdigits: return False > >   return True > > And here are your unit tests.  Every line should print "True". > > print ishex('123') is True

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Peter Otten: Alf P. Steinbach wrote: Just as a contribution, since someone hinted that I haven't really contributed much to the Python community. The [simple_sound] code will probably go into my ch 3 at http://tinyurl.com/programmingbookP3>, but sans sine wave generation since I haven't yet

Re: Writing a string.ishex function

2010-01-14 Thread D'Arcy J.M. Cain
On Thu, 14 Jan 2010 07:52:58 -0800 (PST) chandra wrote: > Folks, > > I am new to Python and could not find a function along the lines of Welcome. > string.ishex in Python. There is however, a string.hexdigits constant > in the string module. I thought I would enhance the existing modlue > but a

  1   2   >