Re: multiple inheritance of a dynamic list of classes?

2007-02-13 Thread massimo s.
On 13 Feb, 12:46, Peter Otten <[EMAIL PROTECTED]> wrote: > Well, what problems ocurring with > > class A: pass > class B: pass > class C(A, B): pass > > could be avoided by writing > > class A: pass > class B(A): pass > class C(B): pass > > instead? Classes have to be designed for subclassing, so e

Re: searching a list of lists as a two-dimensional array?

2007-02-13 Thread agent-s
Thanks for the help guys but I'm a newbie at this and from what I understand from the code, it looks like you guys are using a two dimensional array. I am not using a two dimensional array. Basically, it looks like this: [ [' ',' ',' ',' ',' ',' ',' ',' '], [' ',' ',' ',' ',' ',' ',' ',' '], [' ',

Re: searching a list of lists as a two-dimensional array?

2007-02-13 Thread agent-s
OK I just realized that a list of lists can be accessed in the same way a 2d array would be accessed. Thanks anyways guys. -- http://mail.python.org/mailman/listinfo/python-list

python not returning true

2007-02-13 Thread agent-s
I have a function, generally described as so: def function(args): if condition: if condition2: function(args+1) elif condition3: print "text" return True else: return False which is used in: if function(args):

Re: python not returning true

2007-02-13 Thread agent-s
On Feb 13, 9:37 pm, "John Machin" <[EMAIL PROTECTED]> wrote: > On Feb 14, 4:15 pm, "agent-s" <[EMAIL PROTECTED]> wrote: > > > I have a function, generally described as so: > > > def function(args): > > if condition:

Re: Pep 3105: the end of print?

2007-02-15 Thread massimo s.
Isn't the very concept of major releases (1.x, 2.x, 3.x) that they *can* be not backwards-compatible with previous releases? m. -- http://mail.python.org/mailman/listinfo/python-list

Re: python not returning true

2007-02-22 Thread agent-s
Wow. I didn't realize you guys took this so seriously. -- http://mail.python.org/mailman/listinfo/python-list

Re: database without installation again

2007-02-28 Thread Andrzej S.
erface in based on >> standard Python library, but is there anything like that?? > > SQLite ? Gadfly ? How can I install them? Is it so simple as uploading module files to cgi-bin directory? Metakit (http://www.equi4.com/metakit/python.html) database works this way, but i haven't te

Refreshing GridBagSizer

2007-11-23 Thread Steve S
Hey guys, I'm stuck with using a GridBagSizer (wxPython) in a GUI Dialog and am having a frustrating time with refreshing it properly. Essentially, I've got to refresh the contents of the GridBagSizer on occasion with new values. The way I'm doing it works 4 times out of 5 but on the 5th, *all*

Is anyone happy with csv module?

2007-12-11 Thread massimo s.
Hi, I'm struggling to use the python in-built csv module, and I must say I'm less than satisfied. Apart from being rather poorly documented, I find it especially cumbersome to use, and also rather limited. What I dislike more is that it seems working by *rows* instead than by *columns*. So I have

Re: Is anyone happy with csv module?

2007-12-11 Thread massimo s.
On 11 Dic, 22:37, John Machin <[EMAIL PROTECTED]> wrote: > On Dec 12, 6:14 am, "massimo s." <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm struggling to use the python in-built csv module, and I must say > > I'm less than satisfied.

Re: Is anyone happy with csv module?

2007-12-11 Thread massimo s.
On 11 Dic, 20:24, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > Post your actual problem so you can get more accurate help. Hi Guilhermo, I have not an actual problem. I'm just trying to use the CSV module and I mostly can get it working. I just think its interface is much less than perfect. I'

Re: Is anyone happy with csv module?

2007-12-11 Thread massimo s.
On 12 Dic, 00:08, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Note that all the above (as any operation involving a whole *column*) > requires reading the whole file in memory. Working by rows, on the other > hand, only requires holding ONE row at a time. For big files this is > significant. >

Re: Is anyone happy with csv module?

2007-12-12 Thread massimo s.
Thanks to everyone in this thread. As always on this newsgroup, I learned very much. I'm also quite embarrassed of my ignorance. Only excuse I have is that I learned programming and Python by myself, with no formal (or informal) education in programming. So, I am often clumsy. On Dec 12, 1:29 am,

Re: Is anyone happy with csv module?

2007-12-12 Thread massimo s.
On Dec 12, 2:58 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-12-11, massimo s. <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm struggling to use the python in-built csv module, and I > > must say I'm less than satisfied. Apart from being r

distutils

2006-05-09 Thread David S.
other documentation or guides to using distutils. Peace, David S. -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils

2006-05-09 Thread David S.
not found a way to similarly rename these. Finally, it seems odd that I should have so many XXXsetup.py scripts in my package root directory. Thanks again, David S. -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils

2006-05-10 Thread David S.
er that a script lived and somehow indicate the root of my source so that distutils could find other modules that the scripts use. Perhaps, I have not organized things appropriately--I do not know. I will try to read the doco again and see if I can infer some best practices. Peace, David S.

No Module Named pstats

2008-02-13 Thread Juha S.
Hi, I'm trying to use the Python profilers to test my code, but I get the following output for cProfile.run() at the interpreter: Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/cProfile.py", line 36, in run result = prof.print_stats(sort) File "/usr/li

Re: No Module Named pstats

2008-02-13 Thread Juha S.
2008/2/13, Juha S. <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>: > > Hi, > > I'm trying to use the Python profilers to test my code, but I get the > following output for cProfile.run() at the interpreter: > > Traceback (most recent c

Re: Coverage.py reporting and UML tools - what exists already?

2008-02-14 Thread Juha S.
Ricardo Aráoz wrote: > J Peyret wrote: > >> I got coverage.py to work after somewhat of a difficult start... >> >> Hint: if moving your code from Windows to Linux and if running >> 'coverage.py -r mymodule.py' causes SyntaxError/SyntaxException, the >> 'flip' utility is your friend to deal with

Problems Generating HTML With pydoc

2008-02-26 Thread Juha S.
Hi, I'm trying to generate HTML docs for a Python package (directory) currently containing an empty __init__.py and a Module.py file with some classes and docstrings. I tried using the command "F:\path\to\project\pydoc.py -w myPackage" at the Vista command prompt, and I get "wrote myPackage.ht

Re: Problems Generating HTML With pydoc

2008-02-28 Thread Juha S.
Ron DuPlain wrote: > I also expected "pydoc -w mypackage" to recursively generate html for > the whole package, but it only wrote the top-level file for me as well > (on Linux, for the record) > > I use the workaround: > pydoc -w ./ > > This runs "pydoc -w" on all Python files in the current dir

Handling global variables (Newbie)

2008-03-12 Thread David S
Hi, I have an error occurring at self.build_root = os.path.abspath(os.path.split(__file__)[0]) The error states 'NameError: global name '__file__' is not defined' In Python 2.5 I ran my script as a module in IDLE gui. How does _file_ get defined? Yours, David -- http://mail.python.

Spaces in path name

2008-03-13 Thread David S
Hi, I have some code in which I have to change some path names to get it to work. The original code seems to have assumed that path names would not have any embedded spaces. I am not sure how to write the following line so when used in my script the path will be found. ANT_CMD = r'C:\Program

Re: Spaces in path name

2008-03-13 Thread David S
Hi, I get ERROR: ""C:\Program Files\apache-ant-1.7.0\bin\ant"" does not exist If I cut the path statement here and paste it next to a windows XP command prompt ant is invoked. The python code here is if not os.path.isfile(ANT_CMD): error('"%s"

Re: Spaces in path name

2008-03-14 Thread David S
Hi, Using "C:\Program Files\apache-ant-1.7.0\bin\ant.bat" just gives me the same result. David "Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Fri, 14 Mar 2008 04:37:12 GMT, "David S" <[EMAIL PROTECTED]>

Re: Spaces in path name

2008-03-14 Thread David S
ot;installer.py", line 132, in main() File "installer.py", line 128, in main builder.build() File "installer.py", line 70, in build self.compile(self.ant_cmd, os.path.join(red5_root, 'build.xml'), '1.5', 'cle an', 'i

Re: Spaces in path name

2008-03-14 Thread David S
By mapping network drives in windows I can get past these issues with path names. Thanks, David "Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > David S wrote: >> Gets me further but still seems to be issue with space after 'Progra

Breaking the barrier of a broken paradigm... part 1

2008-03-24 Thread john s.
Hi Everyone, I hope not to offend you with too many question.. I've been lurking a long time. I'm not keen on keeping e-mails or data stored in the public space so this is my first post to the group. That being said, I'm keen on refining my skills, I hope that I can prove that I've move on beyond

Re: Breaking the barrier of a broken paradigm... part 1

2008-03-25 Thread john s.
On Mar 24, 9:39 pm, "Ryan Ginstrom" <[EMAIL PROTECTED]> wrote: > > On Behalf Of john s. > > import os, sys, string, copy, getopt, linecache > > from traceback import format_exception > > > #The file we read in... > > fileHandle = "/etc/

Re: Breaking the barrier of a broken paradigm... part 1

2008-03-25 Thread john s.
On Mar 25, 6:34 am, Bryan Olson <[EMAIL PROTECTED]> wrote: > john s. wrote: > > #/usr/bin/enviro python > > > #Purpose - a dropped in useracct/pass file is on a new server to build > > #a cluster... Alas there are no home directories.. Let me rip through > > #

Can't load smtplib

2009-02-12 Thread S-boy
I can't seem to import smtplib in either a script or the command line interpreter. When I try to import smtp, there seems to be some kind of collision with urllib2. I get a weird error about Web server authorization, even though I'm not calling urllib2. Any ideas on what might be causing this? H

Re: Can't load smtplib

2009-02-12 Thread S-boy
Thanks. Turns out I had a script I wrote called email.py in my Python path that was screwing things up. On Feb 12, 2:50 pm, Jean-Paul Calderone wrote: > On Thu, 12 Feb 2009 11:40:57 -0800 (PST), S-boy wrote: > >I can't seem to import smtplib in either a script or the command line

Building from source -- zlib/binascii problems 2.5.2/2.6.1

2008-12-14 Thread peter s.
I am trying to build Python from source on a RHEL system where I do not have root access. There are two modules that I am having trouble with: zlib & binascii. zlib -- This seems like a make configuration issue. I have noticed that 'gcc -v' returns '--with-system-zlib': $ gcc -v Using built-in s

Re: Building from source -- zlib/binascii problems 2.5.2/2.6.1

2008-12-14 Thread peter s.
On Dec 14, 4:54 pm, "Martin v. Löwis" wrote: > > Target: x86_64-redhat-linux > > gcc -pthread -shared build/temp.linux-x86_64-2.5/location/of/ > > Python-2.5.2/Modules/zlibmodule.o -L/usr/local/lib -lz -o build/ > > lib.linux-x86_64-2.5/zlib.so > > /usr/bin/ld: skipping incompatible /usr/lib/libz.

Re: Building from source -- zlib/binascii problems 2.5.2/2.6.1

2008-12-14 Thread peter s.
On Dec 14, 5:03 pm, "peter s." wrote: > On Dec 14, 4:54 pm, "Martin v. Löwis" wrote: > > > > > > Target: x86_64-redhat-linux > > > gcc -pthread -shared build/temp.linux-x86_64-2.5/location/of/ > > > Python-2.5.2/Modules/zlibmodule.

Re: Building from source -- zlib/binascii problems 2.5.2/2.6.1

2008-12-14 Thread peter s.
On Dec 14, 5:20 pm, "Martin v. Löwis" wrote: > > So.. it seems as though I need to get it to point to the 64 bit > > version (or compile the zlib that comes with Python source).  I'm not > > sure how to override that. > > The easiest solution would be to invoke the linker line manually, > and repl

Re: count secton of data in list

2009-02-23 Thread S Arrowsmith
tertools.groupby(rows, operator.itemgetter(3): print len(list(g)) -- \S under construction -- http://mail.python.org/mailman/listinfo/python-list

Re: String Identity Test

2009-03-04 Thread S Arrowsmith
b = 256 >>> a is b True >>> a = 257 >>> b = 257 >>> a is b False But as as hopefully been made clear, all this is completely an implementation detail. (Indeed, the range of "interned" integers changed from 0--99 to -5--2356 a few versions ago.) So don't, under any circumstances, rely on it, even when you understand what's going on. -- \S under construction -- http://mail.python.org/mailman/listinfo/python-list

Re: speeding up reading files (possibly with cython)

2009-03-09 Thread S Arrowsmith
contextmanager def no_gc(): gc.disable() yield gc.enable() with no_gc(): for line in file: # ... etc. be worth considering? -- \S under construction -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is lambda allowed as a key in a dict?

2009-03-10 Thread S Arrowsmith
Iain King wrote: >Sort of tangenitally; is there any real difference between the outcome >of the two following pieces of code? > >a = lambda x: x+2 > >def a(x): >return x+2 a.__name__ As for why that matters, try a(None) and see which gives the more informative traceba

Re: String to sequence

2009-03-16 Thread S Arrowsmith
Peter Otten <__pete...@web.de> wrote: >assert s.startswith("[") >assert s.endswith("]") >s = s[1:-1] s.strip('[]') (I suppose it all depends on how much you can trust the consistency of the input.) -- \S under construction -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating 50K text files in python

2009-03-18 Thread S Arrowsmith
% (c, d, p) f = open(fname, 'a') for l in range(10): f.write(fname) f.close() Also: 3. All the logging with m.write is likely to be slowing things down. It might be useful to see just how much of an impact that's having. 4. Lose the globals and pass them as function arguments. -- \S under construction -- http://mail.python.org/mailman/listinfo/python-list

Re: How to do this in Python? - A "gotcha"

2009-03-18 Thread S Arrowsmith
s >it worthy of a PEP? class sentinel: def __eq__(self, other): return termination_test() for x in iter(callable, sentinel()): ... Writing a sensible sentinel.__init__ is left as an exercise -- \S under construction -- http://mail.python.org/mailman/listinfo/python-list

reading arguments in python script when passed from URL

2009-04-14 Thread phaneendra s
hi alll.. iam invoking a python script from a standalone client which looks lik this String command="ln -s /usr/lib /tmp/lin"; //creating a soft link URL url = new URL("http://server-name/cgi-bin/finalexec1.py?command= "+command); but iam not able to read this command

how to give focus to another application

2008-06-25 Thread massimo s.
Hi, I would like to know if 1)there is a Python way to tell under which terminal process a Python command-line application is running 2)there is a Python way to tell the OS to give focus to another window. Solutions for Windows, Linux and OS X are welcome, even if OS-specific (of course general s

Re: how to match whole word

2008-07-16 Thread John S
match a word, for example, "abc" in ":abc:". But the current one > > > would not match "abc" in ":abc:". I tried to modify it myself. Would > > > you please let me know what is the corrected way to do it? > > > > Thanks, >

Re: trying to match a string

2008-07-18 Thread John S
t;>> On Jul 18, 11:33 am, [EMAIL PROTECTED] wrote: > > >>>>> Hi, > >>>>> Hi, > >>>>> I am taking a string as an input from the user and it > >>>>> should only > >>>>> contain the chars:L , M or

simple program

2008-04-11 Thread shawn s
Hi, Here is a simple prog that I can run from the Python shell and it runs fine but when I double click the 'filename.py' , it does not execute the ping statement, and seems like it is stuck at the following output: Fri Apr 11 12:16:09 2008 Testing 192.168.0.1 The prog is as follows: impo

program to Ping ip addresses

2008-04-15 Thread shawn s
Hi I am trying to modify a small program i found off the internet as follows... I can get the 'tracert' to work and it gives me all the info back. However, when i replace the tracert with 'ping', the commamd prompt shows 'testing' and the script freezes... any suggestions as why it is doing t

Re: finding out the number of rows in a CSV file [Resolved]

2008-08-27 Thread John S
[OP] Jon Clements wrote: > On Aug 27, 12:54 pm, SimonPalmer <[EMAIL PROTECTED]> wrote: >> after reading the file throughthe csv.reader for the length I cannot >> iterate over the rows. How do I reset the row iterator? A CSV file is just a text file. Don't use csv.reader for counting rows -- it's

"For" loop and list comprehension similarity

2006-03-26 Thread s . lipnevich
Hi All, I apologize if this was brought up before, I couldn't find any "prior art" :-). On more than one occasion, I found myself wanting to use a "conditional loop" like this (with "Invalid syntax" error, of course): for i in c if : print i*2 ...because it's similar to t

Re: "For" loop and list comprehension similarity

2006-03-26 Thread s . lipnevich
Thank you for replying, Mitja! That *is* a nice alternative. Do you think it's a good idea to ask on comp.python.devel if they would be interested in a PEP about this (provided there is none)? Cheers, Sergey. -- http://mail.python.org/mailman/listinfo/python-list

Re: "For" loop and list comprehension similarity

2006-03-26 Thread s . lipnevich
> Why not combine the two: I guess because (at least in source code) you're doing a loop twice :-). I don't know what a compiler would do. I think though that the "for i in c if test:" construct is more readable and maybe can even be better optimized. Thanks! Sergey. -- http://mail.python.org/m

Re: "For" loop and list comprehension similarity

2006-03-27 Thread s . lipnevich
I think I like generator comprehension in this case better than either list comprehension or a filter because both of the latter create a new full "result list" before the loop even begins. At least I suppose they do. Also, I think Mitja's suggestion "if not : continue" and Terry's filter function

Quick Question regarding Frames

2006-03-28 Thread Chris S
Hello All, Just starting out with Python and wxPython. I have two Frames, FrameA and FrameB. FrameA opens FrameB when a button on FrameA is clicked. I can get this. Now I want a button on FrameB to update a control on FrameA. I am having an issue with this. Can anyone point me in the right di

Re: Quick Question regarding Frames

2006-03-28 Thread Chris S
A little further clarification. FrameA and FrameB are in different modules. Thanks. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Quick Question regarding Frames

2006-03-28 Thread Chris S
HI Dave, Thanks for the reply. I am a bit confused by this piece of code: class FrameB(wx.Frame): def __init__(self, frameA, ...): self.frameA = frameA What is frameA in the __init__ definition? Do I need to create something called frameA in order to pass it to that __init__ func

Python decorator syntax limitations

2010-01-18 Thread Jonathan S
Hi all, The following is what I want to do, but this results in a syntax error: @news_page('template.html').lookup(News, 'news_id', 'news') def view(request, group, news): pass What does work is the equivalent old way of doing decorating: def view(request, group, news): pass view = ne

Re: Python decorator syntax limitations

2010-01-18 Thread Jonathan S
Thanks a lot, all of you! This was really helpful. (or at least give me the inspiration I needed to finish it.) I'm sure this is a use case where most other options are less readable than the chain of methods in the decorator. In this use case, I had a lot of Django views to which access permissio

Replacing globals in exec by custom class

2010-12-08 Thread Jonathan S
Hi all, I wonder if anyone can explain some weird behaviour in Python. What I'm trying to do is to execute a string of python code through the 'exec' statement. I pass an instance of my Global class, which acts like a dict. By overriding the __getitem__ method, the Global should pretend that a glo

Re: Replacing globals in exec by custom class

2010-12-09 Thread Jonathan S
Thanks for your response! (And sorry about the syntax error, I forgot to test my code after cleaning up some debug statements before posting, the else should have been elif indeed.) It's very interesing, how Python works internally. According to a thread on the Python mailing list in 2002, it seem

Embedding a Python IDE on Windows based Application

2010-12-30 Thread Sathish S
Hi Ppl, I'm trying to use python for a macro recorder. In short I have a windows based application, which has a macro recorder. The macros are captured as a python script and when the script is executed they accomplish the user action done on my application. I've written python scripts that can in

Python Path registry Key

2011-02-17 Thread Sathish S
Hi Ppl, I'm trying to launch IDLE from another application. For this I need the python directory path. I have been trying to get the Active Python versions path from the Windows registry. However, these registry entries seem not be consistent across various stations, that i checked. I'm reading th

Re: Python Path registry Key

2011-02-18 Thread Sathish S
; On Fri, 2011-02-18 at 11:56 +0530, Sathish S wrote: > > Hi Ppl, > > > > > > I'm trying to launch IDLE from another application. For this I need > > the python directory path. I have been trying to get the Active Python > > versions path from the Windows regis

Tkinter Text Widget Background Color

2011-02-22 Thread Sathish S
Hi Ppl, I'm using the Tkinter Text Widget in my user interface. I'm trying to create a blinking effect for this Text Widget. I saw from the documentation I can set the color if the widget when I create it. x=Text(root,bg='#CFF') However, I couldn't find any property or function that set's the ba

Re: Tkinter Text Widget Background Color

2011-02-22 Thread Sathish S
Jeff, Thanks a lot. It worked great for me as well. Thanks, Sathish On Tue, Feb 22, 2011 at 10:28 PM, Jeff Hobbs wrote: > On Feb 22, 8:48 am, Terry Reedy wrote: > > On 2/22/2011 6:50 AM, Peter Otten wrote: > > > > > import Tkinter as tk > > > from itertools import cycle > > > > > root = tk.T

Re: Tkinter Text Widget Background Color

2011-02-22 Thread Sathish S
Oops, i got the wrong person. Thanks Peter. I was able to achieve the blinking functionality. Thanks, Sathish On Tue, Feb 22, 2011 at 10:44 PM, Peter Otten <__pete...@web.de> wrote: > Terry Reedy wrote: > > > On 2/22/2011 6:50 AM, Peter Otten wrote: > >> import Tkinter as tk > >> from itertool

CentOS 5.5 x86_64 rpmbuild from source

2011-02-23 Thread William S .
When I run I'm attempting to run "rpmbuild -ba SPECS/python-2.7.spec" I get the following error: ERROR 0001: file '/usr/lib/python2.7/lib-dynload/_bsddb.so' contains a standard rpath '/usr/lib64' in [/usr/lib64] ERROR 0001: file '/usr/lib/python2.7/lib-dynload/_sqlite3.so' contains a s

Python 2.4.2 Installation error

2010-07-01 Thread Dhilip S
Hello Everyone.. I'm using Ubuntu 10.04, i try to install Python 2.4.2 & Python 2.4.3 got error message while doing make command. anybody can tell tell, How to overcome this error -- with regards, Dhilip.S -- http://mail.python.org/mailman/listinfo/python-list

Python 2.4.2 Installation error

2010-07-02 Thread Dhilip S
Hello Everyone.. I'm using Ubuntu 10.04, i try to install Python 2.4.2 & Python 2.4.3 got error message while doing make command. anybody can tell tell, How to overcome this error Finally i got message like this ... 4036e000-403ad000 r--p 08:08 156978 /usr/lib/locale/en_IN/LC_CTYPE b

Calling LabVIEW VI from Python

2010-07-13 Thread Sathish S
Hi ppl, I'm trying to call the LabVIEW VI's from python. I'm trying to use the Call method exposed in the LabVIEW activex. this method expects the input values to be passed as an array of reference. I'm passing a list to it, and I find that the list is unchanged. Here is my code: import win32com.

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-07 Thread John S
On Aug 7, 8:20 pm, Νίκος wrote: > Hello dear Pythoneers, > > I have over 500 .php web pages in various subfolders under 'data' > folder that i have to rename to .html and and ditch the '' > tages from within and also insert a very first line of > where id must be an identification unique number o

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-07 Thread John S
Even though I just replied above, in reading over the OP's message, I think the OP might be asking: "How can I use RE string replacement to find PHP tags and convert them to Django template tags?" Instead of saying source_contents = source_contents.replace(...) say this instead: import re de

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-08 Thread John S
irs in os.walk('varsa'): > > >     for f in files: > > >         if f.endswith('php'): > > >             # get abs path to filename > >             src_f = join(currdir, f) > > >             # open php src file > >        

install older Python version parallel

2009-06-11 Thread S. Dornseifer
Hi everybody, The situation: I wrote a GUI, based on Python, TkInter and Pmw. It runs perfectly fine with Python 2.4 (providing, TkInter and Pmw are installed). But it crashes with Python 2.6. I tried this on MacOSX11.4 and various Linux Distributions. Crashes occurs when I activate a Pmw.Diaog

Re: Need help in Python regular expression

2009-06-11 Thread John S
hange my reg exp so that I can support > all 3 cases: > RenderTable {TABLE} > RenderBlock (CENTER) > RenderBlock {CENTER} > > Thank you. Short answer: r = re.compile(r"Render(?:Block|Table)\s+[({](?:TABLE|CENTER)[})]") s = """ blah blah blah blah

Re: Lexical scope: converting Perl to Python

2009-06-13 Thread John S
On Jun 13, 8:29 am, Nick Craig-Wood wrote: > Andrew Savige wrote: > > >  I'd like to convert the following Perl code to Python: > > >   use strict; > >   { > >     my %private_hash = ( A=>42, B=>69 ); > >     sub public_fn { > >   my $param = shift; > >   return $private_hash{$param}; > >

Re: How to insert string in each match using RegEx iterator

2009-06-13 Thread John S
56 def INSERT 789 ghi' > > Here's the code I started with: > > >>> rePatt = re.compile('\d+\s') > >>> iterator = rePatt.finditer(string) > >>> count = 0 > >>> for match in iterator: > >         if coun

Re: install Python-2.4.4 from source (parallel to existing Python-2.6)

2009-06-15 Thread S. Dornseifer
Simon wrote: Christian Heimes wrote: Simon schrieb: Christian Heimes wrote: Simon wrote: I installed Python-2.4.4.tar.bz2 from python.org, using gcc-4.3 (within openSUSE 11.1 x86_64) via 'make altinstall'. First, I tried to configure with the following flags: --prefix=/opt/python-24 --enabl

compiling python 2.6.2 on uclibc

2009-06-25 Thread Jeseem S
hi, am looking for patched to compile python 2.6.2 on uclibc. any help is greatly appreciated thanks jeseem -- http://mail.python.org/mailman/listinfo/python-list

Re: Parse xml file

2009-08-27 Thread Balamurugan S
On Thu, Aug 27, 2009 at 2:26 PM, loial wrote: > Is there a quick way to retrieve data from an xml file in python 2.4, > rather than read the whole file? Universal Feed parser can do the job for you. This can be imported and used in your python programs. For more information, http://www.feedparser

Python Editor or IDE ActiveX control

2010-08-26 Thread Sathish S
Hi Ppl, Is there any python IDE or editor that has an ActiveX control which could be embed in other Windows applications. I'm basically looking to write a application that can show the indentations of python, change the color of keywords etc on a application, which will save this python script and

pyserial and end-of-line specification

2017-07-14 Thread F S
I just started using Python and I am writing code to access my serial port using pyserial. I have no problem with unix based text coming in the stream using a LF (0x0A) record separator. I also am using unblocked IO. However I have some sensor devices that use the windows CRLF (0x0A,0x0D) record

Why won't Python 2/3 compile when I have valgrind installed?

2013-05-24 Thread Yves S. Garret
This isn't a huge issue, but I'm wondering. I'm running Mac OS X, I tried to configure with --with-valgrind and this is the error that I got: configure: error: Valgrind support requested but headers not available Now, I have valgrind installed, so it should work, yes? If someone has any extra in

Having a hard time to 'get' bing api search results

2013-06-13 Thread Yves S. Garret
Hello all, This is my dilemma, I'm trying to get the generated JSON file using the bing api search. This is the code that I'm executing from inside the shell: http://bin.cakephp.org/view/460660617 The port doesn't matter to me. Thoughts? -- http://mail.python.org/mailman/listinfo/python-list

Re: Having a hard time to 'get' bing api search results

2013-06-13 Thread Yves S. Garret
7 PM, Yves S. Garret wrote: > Hello all, > > This is my dilemma, I'm trying to get the generated JSON file using the > bing api > search. > > This is the code that I'm executing from inside the shell: > http://bin.cakephp.org/view/460660617 > > Th

Re: Having a hard time to 'get' bing api search results

2013-06-13 Thread Yves S. Garret
, 401, 'The authorization type you provided is not > supported. Only Basic and OAuth are supported', > > > > > > On Jun 13, 2013, at 2:31 PM, Yves S. Garret > wrote: > > This is the format that I've been following: > > http://gavinmhackeling.com/blog/2012/0

Re: Having a hard time to 'get' bing api search results

2013-06-13 Thread Yves S. Garret
r welcome. > > > To be honest I am not 100% on the differences between. > > I could be off, but I recall urllib2 was a more refined version of urllib. > > Yet it seems like urllib works better for me, when I need to do a simple > call like this. > > > -Kevin > >

Re: Having a hard time to 'get' bing api search results

2013-06-14 Thread Yves S. Garret
; so maybe it got messed up moving it around? > > > > > > On Jun 14, 2013, at 10:53 AM, "Yves S. Garret" > wrote: > > Hi Kevin, still more of the same: > http://bin.cakephp.org/view/1358843680 > > The file _is_ there. I did check the JSON file,

n00b question on spacing

2013-06-21 Thread Yves S. Garret
Hi, I have a question about breaking up really long lines of code in Python. I have the following line of code: log.msg("Item wrote to MongoDB database %s/%s" %(settings['MONGODB_DB'], settings['MONGODB_COLLECTION']), level=log.DEBUG, spider=spider) Given the fac

Re: n00b question on spacing

2013-06-21 Thread Yves S. Garret
On Fri, Jun 21, 2013 at 5:48 PM, Ray Cote wrote: > > -- > > *From: *"Yves S. Garret" > *To: *python-list@python.org > *Sent: *Friday, June 21, 2013 5:17:28 PM > *Subject: *n00b question on spacing > > > Hi, I have a question abo

Re: Important features for editors

2013-07-06 Thread Eric S. Johansson
On Fri, 05 Jul 2013 23:13:24 -0400, Rustom Mody wrote:Yes...The fact that rms has crippling RSI should indicate that emacs' ergonomics is not right. As someone crippled by Emacs ( actual cause not known), I should also point out that RMS, instead of doing the responsible thing and using speech re

Re: Editor Ergonomics [was: Important features for editors]

2013-07-11 Thread Eric S. Johansson
On Fri, 12 Jul 2013 00:24:26 -0400, Steven D'Aprano wrote: Frankly, nothing comes even close to a real mouse for feedback and ease of use. Maybe a stylus. But that's it. before tremors, I would agree with you. Stylus is amazingly good tool for user interaction in a GUI. After tremors, not

Re: Understanding other people's code

2013-07-12 Thread Eric S. Johansson
On Fri, 12 Jul 2013 10:22:59 -0400, L O'Shea wrote: Literally any idea will help, pen and paper, printing off all the code and doing some sort of highlighting session - anything! I keep reading bits of code and thinking "well where the hell has that been defined and what does it mean" to

Re: Editor Ergonomics [was: Important features for editors]

2013-07-12 Thread Eric S. Johansson
On Fri, 12 Jul 2013 18:34:30 -0400, Dennis Lee Bieber wrote: Sounds like you might have liked an accessory I had on my Amiga. Basically a proportional joystick feeding an interface box which converted the position value into a sequence of mouse movements -- sounds very cool. Alt

Re: What does it take to implement a chat system in Python (Not asking for code just advice before I start my little project)

2013-07-17 Thread Eric S. Johansson
On Thu, 18 Jul 2013 00:36:17 -0400, Aseem Bansal wrote: I wanted to do a little project for learning Python. I thought a chat system will be good as it isn't something that I have ever done. I wanted to know what will I need? I think that would require me these 1 learn network/socket progr

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-22 Thread Eric S. Johansson
On Mon, 22 Jul 2013 08:11:25 -0400, Gilles wrote: On Sun, 21 Jul 2013 18:28:27 -0600, Michael Torrie wrote: The Sendmail MTA has been ported to many platforms including windows. But... Thanks for the tip. Since I couldn't find a good, basic, native Windows app, I was indeed about to look at

Re: [Savoynet] G&S Opera Co: Pirates of Penzance

2013-07-29 Thread Eric S. Johansson
On Sun, 28 Jul 2013 19:49:07 -0400, Ethan Furman wrote: On 07/28/2013 10:57 AM, Chris Angelico wrote: . . . Okay, how did you get confused that this was a Python List question? ;) got_a_little_list["victim must be found"] = http://www.youtube.com/watch?v=1NLV24qTnlg -- http

<    1   2   3   4   5   6   7   8   >