Re: How can I find the remainder when dividing 2 integers

2006-02-26 Thread David
> > But i get an invalid syntax error when I execute the script: > print colors[colorIndex++ % colors.length] > ^ > SyntaxError: invalid syntax > The syntax error comes from your use of the ++ operator not the modulo operator. The ++ oper

A new to Python question

2005-05-14 Thread David
. Its just getting it to pass them back thats not working. I put some print statements inside the function just to see how the data gets passed. So any ideas that would help me? If you want to see the fortran code just email me. David -- http://mail.python.org/mailman/listinfo/python-list

Re: A new to Python question

2005-05-14 Thread David
t Product of X and Y:',data[2] print 'Sum of array X:',data[3] print 'Max value of array Y:',data[4] I think its just wonderful now, but if you got any other suggestions, Please do tell. Thanks everyone. David -- http://mail.python.org/mailman/listinfo/python-list

Re: A new to Python question

2005-05-14 Thread David
Hmm don't know what happened. I guess the formatting got all chewed up. -- http://mail.python.org/mailman/listinfo/python-list

libpython2.3.a Linux

2005-05-22 Thread David
ython-2.3.5/Include -L /usr/local/src/Python-2.3.5 - shared -fPIC -l libpython2.3 -o file.so Running on Fedora Core 3 - 1.7.0 made the following steps in compiling and installing Python : ./configure make make install make libpython2.3.so Compiling on windows 2k is fine. Thanks for any input.

Linuz Python Module using PythonC/ API

2005-05-24 Thread David
not define init function (initutm) but the "initutm" function is there. Running on Fedora Core 3. Thanx David P.S Other question is there a command to know what export symbols a .so library has ? Relevant files below. utmmodule.c -- #include #include "utm.h&

VIM editor question

2007-06-08 Thread David
r scheme rather than having to go into the " EDIT "pull down menu and select my preferred Color Scheme every time I open a file. thanks for any wisdom you can share DavidKG2LI -- http://mail.python.org/mailman/listinfo/python-list

ORM layer

2007-06-29 Thread David
documentation a definite plus I do not need: - massively complex joins (I could write these myself if needed) - something engineered for hundreds of tables, I have only a few and   don't need overkill Any recommendations? David -- http://mail.python.org/mailman/listinfo/python-list

malloc error for newbie

2007-07-07 Thread David
Hi, Very new to python. When I uncomment the line #self.im.putpalette(mkpalette()) in the following code, I get the error: python $ ./mandelbrot.py Python(2860) malloc: *** Deallocation of a pointer not malloced: 0xff00; This could be a double free(), or free() called with the middle

Re: malloc error for newbie

2007-07-07 Thread David
On Jul 7, 6:27 am, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 7, 4:59 pm, David <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Very new to python. When I uncomment the line > > #self.im.putpalette(mkpalette()) > > Try to focus in on where

Pretty Printing Like Tidy for HTML

2007-07-07 Thread David
All, Is there a pretty printing utility for Python, something like Tidy for HTML? That will change: xp=self.uleft[0]+percentx*(self.xwidth) To: xp = self.uleft[0] + percentx * (self.xwidth) And other formatting issues. -- http://mail.python.org/mailman/listinfo/python-list

Timing a python program run

2007-07-07 Thread David
Hi, In matlab, I'd calculate the time for a script named test.m to run with: >> tic, run, toc Is there some way to do this in python on a mac os x from the terminal window? Or whatever? -- http://mail.python.org/mailman/listinfo/python-list

Re: SEO - Search Engine Optimization - Seo Consulting

2007-05-01 Thread David
I am not going to join the argument, except to say that as you can see, I top post. In outlook express, you can see the messages as a thread, so you read the initial message, come to the reply and you read the response without having to scroll. Bottom posting would be fine if the previous messa

wxPython before MainLoop

2007-08-08 Thread [david]
ow anyway). I'd like to just make app.Show() finish correctly before running long_slow_init. Is there a wx internal method that I can use to give Windows the opportunity to finish painting the frame before I run long_slow_init()? Or is there a better idea? (david) -- http://mail.python.

Re: wxPython before MainLoop

2007-08-09 Thread [david]
plication is busy. 7Stud, that's a solution. Unless anyone comes up with a direct solution, I guess I'll have to do that. [david] [david] wrote: > I'd like to refresh the display before I start the main loop. > > I have code like this: > > app = App() > app.Show(

Re: wxPython before MainLoop

2007-08-13 Thread [david]
r wxPython: It's supposed to already be a framework :~) (david) Bjoern Schliessmann wrote: > [david] wrote: > >> I'm disappointed that I didn't get a wxPython solution. >> >> If the only way to get wxPython to correctly handle >> this simple task is

pyserial win32 port numbering

2007-08-13 Thread [david]
t 2 or 4. It's already a problem on PC's that have PCI serial port cards (not ISA serial port cards). The pySerial logical port numbering typically goes something like 0, 4,5, mapping the Windows serial ports 1,5,6 (david) -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython before MainLoop

2007-08-13 Thread [david]
ng. But you don't have that excuse. (david) Steve Holden wrote: > [david] wrote: >> Well yes, I have tried this app with native windows, >> and I know how to do it. >> >> But if all wxPython can offer is a poor imitation >> of MFC, I'm better off using

wxpython thread exception crash

2007-08-20 Thread [david]
ve difficulty seeing stdErr in some environments. Python 2.5, wxPython 2.7.2.0, Windows XP. (david) import wx import sys import threading class ExceptionThread(threading.Thread): def __init__(self,initvar): threading.Thread.__init__(self); def run(self): ra

Re: wxPython before MainLoop

2007-08-21 Thread [david]
Thanks for that suggestion, and sorry I took so long to get back to you. That worked. Because I don't want the splash screen, just self.Update regards, [david] Heikki Toivonen wrote: > [david] wrote: >> I'd like to refresh the display before I start the main loop

Re: wxPython before MainLoop

2007-08-21 Thread [david]
> Looking at the Chandler code suggests a solution > ... he may need to call Update to finish painting > the display. Yes, and thank you to Chandler for pointing that out. Without the splash screen there was no need to call Yield or use a generator. (david) samwyse wrote: >

Re: wxpython thread exception crash

2007-08-26 Thread [david]
class RedirectText: def __init__(self,aWxTextCtrl): self.out=aWxTextCtrl def write(self,string): wx.CallAfter(self.out.WriteText,string) #CallAfter def flush(self): pass [david] [david] wrote: > What am I doing wrong? > I'm trying

Re: Getting subprocesses to be hidden on Windows

2007-09-02 Thread [david]
irtual_desktop Alternatively, run the process in a separate gui. Terminal Server client is one way to do that. [david] -- http://mail.python.org/mailman/listinfo/python-list

Re: How to insert in a string @ a index

2007-09-08 Thread David
> The python doesn't supports t1[keyword_index]="XYZhello" (string > object assignment is not supported). How do I get to this problem? Any > sugguestions? Build a new string var using slicing. eg: t1 = t1[:keyword_index] + "XYZhello" + [keyword_index] Or use string formatting: t1 = "your text

Re: How to insert in a string @ a index

2007-09-08 Thread David
On 9/8/07, David <[EMAIL PROTECTED]> wrote: > > The python doesn't supports t1[keyword_index]="XYZhello" (string > > object assignment is not supported). How do I get to this problem? Any > > sugguestions? > > Build a new string var using slicing

Re: Using struct timeval in python

2007-09-08 Thread David
On 9/8/07, sapsi <[EMAIL PROTECTED]> wrote: > Hi, > I am using a library (pcapy) that returns a timeval object T= > (seconds,microseconds) where microseconds is always < 1e6. > Is there a Python class that can handle timeval structs? Specifically, > I wish to subtract two T (defined above) objects,

Re: Organizing Code - Packages

2007-09-08 Thread David
> > How do import statements that are declared at the top of a python > module work? > > for instance > > from MyModule.Objects import * > > class Class: > def function: >#here i cannot access the things that should have been > imported from the above statement >#i

Re: Organizing Code - Packages

2007-09-08 Thread David
> How do import statements that are declared at the top of a python > module work? http://docs.python.org/tut/node8.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing nested constructs

2007-09-08 Thread David
On 9/8/07, tool69 <[EMAIL PROTECTED]> wrote: > Hi, > > I need to parse some source with nested parenthesis, like this : > If this is exactly how your data looks, then how about a loop which searches for "{item" and the following "}"? You can use the "find" string method for that. Otherwise, if th

Re: Spell-checking Python source code

2007-09-08 Thread David
> > > > (I know that the better practice is to isolate user-displayed strings > > from the code, but in this case that just didn't happen.) > > > > Use the re module, identify the strings and write them to another file, > then open the file with your spell checker. Program shouldn't be more > than

Re: How to insert in a string @ a index

2007-09-08 Thread David
On 9/8/07, Zentrader <[EMAIL PROTECTED]> wrote: > Same solution as above, but if you just want "Hello" and to not > include words containing "Hello", i.e. "Helloing" or "Unhello", then > you want to include a leading and/or trailing space. You can also use the re (regular expression) module to sea

Re: Spell-checking Python source code

2007-09-09 Thread David
> tokenize.tokenize( > file.readline, > processStrings > ) > > How would you go about writing the output to a file? I mean, I would > like to open the file at main level and pass a handle to the file to > processStrings to write to it, finally close output file at main level. > Probably

Re: Spell-checking Python source code

2007-09-09 Thread David
On 9/9/07, David <[EMAIL PROTECTED]> wrote: > > tokenize.tokenize( > > file.readline, > > processStrings > > ) > > > > How would you go about writing the output to a file? I mean, I would > > like to open the file at main level and pa

Re: Enum class with ToString functionality

2007-09-10 Thread David
On 9/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I have the following class - > > class TestOutcomes: > PASSED = 0 > FAILED = 1 > ABORTED = 2 > > plus the following code - > > testResult = TestOutcomes.PASSED > > testResultAsString > if testResult == TestOutcomes.PASS

cpython list __str__ method for floats

2007-09-11 Thread [david]
returns poorly formatted values: >>>str(13.3) '13.3' >>>str([13.3]) '[13.301]' [david] -- http://mail.python.org/mailman/listinfo/python-list

Re: /dev/null as a file-like object, or logging to nothing

2007-09-11 Thread [david]
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Sion Arrowsmith wrote: > >> Torsten Bronger <[EMAIL PROTECTED]> wrote: >>> Marc 'BlackJack' Rintsch writes: `os.devnull`? >>> Yes, but I wasn't really sure how portable it is, in particular, on >>> Windows. >> Windows has a NUL: de

Re: Python Database Apps

2007-09-11 Thread David
> What is your favorite python - database combination? I'm looking to > make an app that has a local DB and a server side DB. I'm looking at > python and sqlite local side and sql server side. > > Any suggestions I like to use elixir [1] on top of sqlalchemy [2] [1] http://elixir.ematia.de/

Re: customizing a logging logger

2007-09-11 Thread David
On 9/11/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I think the following question is clearer. > > I want to make it so that method1 below can be transformed: > > logger = logging.getLogger("somelogger") > class SomeOp: > def __init__(self, ctx): > self.ctx = ctx > def method

Re: Help With PyParsing of output from win32pdhutil.ShowAllProcesses()

2007-09-11 Thread David
On 9/11/07, Steve <[EMAIL PROTECTED]> wrote: > Hi All (especially Paul McGuire!) > > Could you lend a hand in the grammar and paring of the output from the > function win32pdhutil.ShowAllProcesses()? > > This is the code that I have so far (it is very clumsy at the > moment) : Any particular reaso

Re: Python Database Apps

2007-09-11 Thread David
> It would help to get a feel of what is the most popular combination > for people to develop their apps. It's gonna be a desktop app. The > database engine is going to be the critical component. I like sqlite > so that I don't need a database server on the client side. It would > help though i

Re: cpython list __str__ method for floats

2007-09-11 Thread [david]
Bjoern Schliessmann wrote: > [david] wrote: >> returns poorly formatted values: > > Please explain. > >> >>>str(13.3) >> '13.3' >> >>>str([13.3]) >> '[13.301]' > > This is quite a FAQ. > >

Re: setattr vs readonly property

2007-09-12 Thread David
> My main purpose for using setattr(object, attr, value) for assign > values from a dict that has some keys that may not be present on some > object's attibute, which makes it work for me. My problem is dealing > with read only attribute like sample_attribute = > property(f_get=_get_sample_attribut

Re: MemoryError on reading mbox file

2007-09-12 Thread David
> > My system has 512M RAM and 768M swap, which seems to run out at an > early stage of this. Is there a way to clean up memory for messages > already processed? It may be that Python's garbage collection isn't keeping up with your app. You could try periodically forcing it to run. eg: import gc

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread David
> Please help if I am missing something -- this looks like a great > language but I am going to mad trying to read numerical code full of > 'self.'s breaking up the equations. You could try this in your functions: s = self Then you can use code like this: s.a_dot = s.k(s.a-s.u) Another option,

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread David
On 9/12/07, David <[EMAIL PROTECTED]> wrote: > > Please help if I am missing something -- this looks like a great > > language but I am going to mad trying to read numerical code full of > > 'self.'s breaking up the equations. > > You could try this in your

Re: Removing objects in a list via a wild card

2007-09-19 Thread David
On 9/19/07, James Matthews <[EMAIL PROTECTED]> wrote: > Hi List > > I have a list of files from my current directory: > > import os > > files = os.listdir(os.getcwd()) > > Now this list also includes some files that i don't want like my python > files... How would i remove them You can use regular

Re: Saving parameters between Python applications?

2007-09-20 Thread David
On 9/16/07, Stodge <[EMAIL PROTECTED]> wrote: > I'm trying to do the following. I have a Python application that is > run: > > python app1.py --location=c:\test1 > > What I want to do is save the location parameter, so I can then do (in > the same window): > > python app2.py > > And have app2.py au

Re: Tapping into the access of an int instance

2007-09-20 Thread David
On 9/20/07, Tor Erik Sønvisen <[EMAIL PROTECTED]> wrote: > Hi, > > Does anyone know how to interrupt the lookup of an integer value? I > know I need to subclass int, since builtin types can't be altered > directly... > > Below is how far I've come... What I want is to tap into the access of > insta

Re: cannot create my own dict

2007-09-20 Thread David
> The reason for this problem is that we are busy re-structuring a large Python > program, and we want to ensure nobody is messing up our data structures (at > least not until we are finished). python-egenix-mxproxy (Debian package name) may be useful. http://www.egenix.com/products/python/mxBase

Re: subprocess: returncode v. poll()

2007-09-20 Thread David
On 9/20/07, 7stud <[EMAIL PROTECTED]> wrote: > On Sep 20, 1:25 pm, 7stud <[EMAIL PROTECTED]> wrote: > > On Sep 20, 1:17 pm, 7stud <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hi, > > > > > What is the difference between: > > > > > 1) getting the returncode directly from the subprocess object > > >

Re: validating parser

2007-09-20 Thread David
On 9/20/07, Robert Schweikert <[EMAIL PROTECTED]> wrote: > Is there a Python module which will do XSD validation? http://mail.python.org/pipermail/xml-sig/2006-June/011527.html -- http://mail.python.org/mailman/listinfo/python-list

Re: re question

2007-09-20 Thread David
On 9/19/07, Dan Bar Dov <[EMAIL PROTECTED]> wrote: > I'm trying to construct a regular expression to match valid IP address, > without leading zeroes (i.e > 1.2.3.4, 254.10.0.0, but not 324.1.1.1, nor 010.10.10.1) > > This is what I come up with, and it does not work. > > r'(^[12]?\d{0,2}\.){3,3}[1

Re: Parameterize formatting string

2007-09-21 Thread David
On 9/21/07, cyril giraudon <[EMAIL PROTECTED]> wrote: > Hello, > > I 'd like to know if a std::setw() equivalent function exists in > python ? > > i thought of something like : > > a = 16 > "%ai" % 12 > > But it is not correct. > > Any Idea ? ("%i" % 12).rjust(a) Or, more ugly: "%%%di" % a % 12

Re: RE Help

2007-09-21 Thread David
> data = "asdfasgSTARTpruyerfghdfjENDhfawrgbqfgsfgsdfg" > x = re.compile('START.END', re.DOTALL) This should work: x = re.compile('START(.*)END', re.DOTALL) -- http://mail.python.org/mailman/listinfo/python-list

Re: Google and Python

2007-09-21 Thread David
> OK, thanks. Would you know what technique the custom web server uses > to invoke a C++ app (ditto for Java and Python) CGI is supposed to be > too slow for large sites. For large sites you would have modules loaded into your web server so that executables don't have to be shelled for each reques

Re: Python Regex Question

2007-09-21 Thread David
> re.search(expr, string) compiles and searches every time. This can > potentially be more expensive in calculating power. especially if you > have to use the expression a lot of times. The re module-level helper functions cache expressions and their compiled form in a dict. They are only compiled

Re: executing list of methods (and collecting results)

2007-09-21 Thread David
> I wondering if is this a good pattern to apply, i like the way it looks > like, at least to me it looks `natural', but...im calling every method > twice here? One in v_dict and again on the dict iteration? > > Any suggestion will be great! Another suggestion is to use a naming convention for you

Re: Factory function with keyword arguments

2007-09-23 Thread David
On 9/23/07, Ron Adam <[EMAIL PROTECTED]> wrote: > > > Steven D'Aprano wrote: > > I'm writing a factory function that needs to use keywords in the produced > > function, not the factory. Here's a toy example: > http://docs.python.org/whatsnew/pep-309.html -- http://mail.python.org/mailman/listinfo

Re: Writing Object Data to Disk

2007-09-23 Thread David
> I would like to know if "Pickling" the class object is the only way of > writing it to disk for persistent storage. Also, do we have a concept > similar to "array of objects" in Python? The number of objects is only > known at "run-time". Have a look at YAML. http://freshmeat.net/projects/syck/

Re: Getting rid of bitwise operators in Python 3?

2007-09-23 Thread [david]
uses it? It was a common cryptographic operation. The two-argument version is used by the same person who wrote the semi-colon at the end of every line of the code I'm working with. Personally, I'm sorry that 'and' and 'or' weren't chosen for the bitwise operators: I'd happily give up 'and' and 'or' for logic operations. [david] -- http://mail.python.org/mailman/listinfo/python-list

PIL GIF transparency

2007-09-24 Thread David
except IOError, ex: pass sprites = sprites.crop((0,0,MAXWIDTH, row)).point(lambda pt: pt == (253, 253, 253, 0) and 0 or pt) return sprites So this code is obviously littered with the detritus of failed attempts to get transparency to work. Has anyone out there had any expe

Re: Google and Python

2007-09-27 Thread David
> > It is trivial to pass a socket to a new thread or a forked child - you > > don't need this mechanism for that. It doesn't work on different > > machines though - it has to be on the same machine. > > 8< - nice explanation by Nick--- > > How does a very large vol

Re: GUI for viewing/editing python data structures?

2007-09-27 Thread David
On 9/27/07, Joshua J. Kugler <[EMAIL PROTECTED]> wrote: > A while back, I seem to remember coming across a small program that could > view and edit python data structures via a nice expanding tree view. I'm > now in need of something like that (to verify data is imported correctly > into a shelve

Re: marshal bug?

2007-09-28 Thread David
On 9/28/07, Anurag <[EMAIL PROTECTED]> wrote: > I have been chasing a problem in my code since hours and it bolis down > to this > import marshal > marshal.dumps(str(123)) != marshal.dumps(str("123")) > I'm not sure why, but marshal does dump the 2 differently. ie: >>> marshal.dumps(str(123)) 's\

Re: marshal bug?

2007-09-28 Thread David
> I'm not sure why, but marshal does dump the 2 differently. ie: > > >>> marshal.dumps(str(123)) > 's\x03\x00\x00\x00123' > > >>> marshal.dumps(str("123")) > 't\x03\x00\x00\x00123' > I've just checked the source [1]. 's' refers to a regular string, 't' refers to an interned[2] string. In other w

Re: s.split() on multiple separators

2007-10-02 Thread [david]
> The only thing I agreed with was his conclusion. Clever man. [david] -- http://mail.python.org/mailman/listinfo/python-list

Re: HELP me Am very new one To python

2007-10-04 Thread David
> > how to configure apache where i want to configure . > if any files want to copy in to apache folder, wahts the procedure to > start the coding pls help me am very very beginner pls spend some time > to teach how to do that.please plaes > Unlike PHP, Python is not primarily a web programming la

Re: Starting a thread before wxPython bootup ... interesting.

2007-10-04 Thread [david]
() Since you are talking about a bug in your screen display while using a screen library, it would also be interesting it you described the environment: Which operating system? Which windowing system? Which wx library? Which Python? Which IDE? What code? [david] Shafik wrote: > Hello fo

Re: Adding behaviour for managing "task" dependencies

2007-10-05 Thread David
tever approach you use, you should also look into implementing "topological sort" logic. This lets you resolve programatically which order the inter-dependent tasks should be handled in to satisfy their dependencies. You may find this module interesting in this regard: http://pypi.python.org/pypi/topsort David. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python "implements " equivalent?

2007-10-05 Thread David
ar in Python? > Python will probably be getting Abstract Base Classes at some point. http://www.python.org/dev/peps/pep-3119/ For ABC in current versions of Python, see the "Can you implement abstract classes in Python in 0 lines of code? Or 4?" question on this page: http://norvig.

Re: Boolean parser..

2007-10-05 Thread David
On 10/4/07, Abandoned <[EMAIL PROTECTED]> wrote: > Hi.. > I try a boolean parser in python since 1 weak.. But i can't do this > because this is very complicated :( > Do you know any blooean parser script in python or how do i write a > boolean parser ? > example query: ((google or yahoo) or (live m

Re: supplying password to subprocess.call('rsync ...'), os.system('rsync ...')

2007-10-07 Thread David
On 10/5/07, timw.google <[EMAIL PROTECTED]> wrote: > Hi > > I want to write a python script that runs rsync on a given directory > and host. I build the command line string, but when I try to run > subprocess.call(cmd), or p=subprocess.Popen(cmd, shell=True),or > os.system(cmd), I get prompted for

Re: supplying password to subprocess.call('rsync ...'), os.system('rsync ...')

2007-10-07 Thread David
Typo. > Another method is to setup an ssh service on the server (perhaps in Should be: > Another method is to setup an rsync service on the server (perhaps in -- http://mail.python.org/mailman/listinfo/python-list

Re: howto add a sub-directory to the searchpath / namespace ?

2007-10-10 Thread [david]
ndows directory notation as long as you don't need to end a path with a \ sys.path.append("c:\\code\\newcode") sys.path.append(r"c:\code\newcode") The os.path module contains additional path handling methods. [david] stef mientki wrote: > Larry Bates wrote: >&g

Re: why doesn't have this list a "reply-to" ?

2007-10-17 Thread [david]
atch, has either enigmail or > mhengy installed and has the reply-to-list addon installed. Otherwise, no, > Thunderbird still, years later, lacks that feature. Part of the reason why I > am test driving gmane in slrn right now. :) > I'm using Thunderbird 2.0.0.0: I use the

Re: why doesn't have this list a "reply-to" ?

2007-10-18 Thread [david]
Robert Kern wrote: > [david] wrote: >> Steve Lamb wrote: >>> On 2007-10-17, Byung-Hee HWANG <[EMAIL PROTECTED]> wrote: >>>> Just click "Ctrl-L", then you can reply to lists directly if you use >>>> good mailer like mutt or thunderbird or

Re: basic threading question

2007-10-31 Thread [david]
[EMAIL PROTECTED] wrote: > On Oct 30, 7:58 pm, "bambam" <[EMAIL PROTECTED]> wrote: >> Are function variables thread safe? >> >> def f(a): >> # whatever >> return float(a) >> >> Is that OK? >> >> def f(a): >> #whatever >> b=a: >> #whatever: >> return float(b) >> >> Is that OK

Re: basic threading question

2007-10-31 Thread [david]
thanx :~) -- http://mail.python.org/mailman/listinfo/python-list

Re: python at command prompt

2007-11-04 Thread [david]
for > which I have forgotten whether they are batch files, small executables, or > Python scripts. And that's how it should be. That is, "Executables (.exe) are always available," ... provided that the PATHEXT environment variable has not been set incorrectly... and "Executables ... do not need to be registered" [david] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is pyparsing really a recursive descent parser?

2007-11-08 Thread [david]
can't be polite, just go back to your own room. (david) -- http://mail.python.org/mailman/listinfo/python-list

Re: templatetaizing exceptions

2007-11-13 Thread david
On Tue, 13 Nov 2007 06:17:26 -0300, Gabriel Genellina wrote: > > A function? > > try: > code_block > except A: > handle_exception() maybe >>> def handle(f, *args, **kw): ... try: ... return f(*args, **kw) ... except A: ...

Mac os x 10.4.11: Error installing Python 2.5.1

2007-11-17 Thread David
errors installing the software. Please try installing again. Is there a log file somewhere I can examine? Anyone else experience this? Workaround? Thanks. David. -- http://mail.python.org/mailman/listinfo/python-list

Re: Mac os x 10.4.11: Error installing Python 2.5.1

2007-11-17 Thread David
On Nov 17, 7:27 pm, James Stroud <[EMAIL PROTECTED]> wrote: > David wrote: > > Running OS X 10.4.11 PPC. No Intel. > > > I downloaded: > > >http://www.python.org/ftp/python/2.5.1/python-2.5.1-macosx.dmg > > > I started the install, accepted the licens

Re: Mac os x 10.4.11: Error installing Python 2.5.1

2007-11-17 Thread David
On Nov 17, 8:36 pm, James Stroud <[EMAIL PROTECTED]> wrote: > David wrote: > > On Nov 17, 7:27 pm, James Stroud <[EMAIL PROTECTED]> wrote: > >> David wrote: > >>> Running OS X 10.4.11 PPC. No Intel. > >>> I downloaded: > >>>http

Re: File to dict

2007-12-07 Thread david
On Fri, 07 Dec 2007 16:46:56 +0100, Glauco wrote: > [EMAIL PROTECTED] ha scritto: >> Hello everyone, >> >> I have written this small utility function for transforming legacy file >> to Python dict: >> >> >> def lookupdmo(domain): >> lines = open('/etc/virtual/domainowners','r').readline

Re: pySerial

2007-12-19 Thread [david]
__zip__ wrote: > Hi, > > I am using pySerial for communication with modem. > > Does anyone knows which values are for what in these variables? > > xonxoff=0 > rtscts=0 > dsrdtr=0 > > if xonxoff=0 is it hardware control on or of (logic says it would be off > , but who knows). > > > Second que

Re: How do I get my python program to get the root password ?

2009-01-23 Thread David
://mail.python.org/mailman/listinfo/python-list I am new to Python, in my process of learning I did put together an example of pexpect that may help. http://asterisklinks.com/wiki/doku.php?id=wiki:pexpect -david -- Powered by Gentoo GNU/LINUX http://www.linuxcrazy.com pgp.mit.edu -- http://mail.python.org

Re: Rounding to the nearest 5

2009-01-30 Thread David
Benjamin J. Racine wrote: Doesn't this work? round_by_5.py import sys def round_by_5(x= sys.argv[0]): x = x/5. x = round(x) x = x*5 print(x) return x Ben R. I am learning, I got this to work fine; #!/usr/bin/python import sys def round_by_5(x = sys.argv[1]): x =

Re: Ipython - Do they have a separate mailing list or newsgroup?

2009-02-12 Thread David
Chris Jones wrote: > Just wondering if ipython is supported elsewhere. Indeed, indeed: IPython-user mailing list ipython-u...@scipy.org http://lists.ipython.scipy.org/mailman/listinfo/ipython-user David -- http://mail.python.org/mailman/listinfo/python-list

*nix tail -f multiple log files with Thread

2009-02-13 Thread David
b 13 08:58:48 2009] [error] [client 127.0.0.1] File does not exist: /var/www/localhost/htdocs/moodle/favicon.ico [Fri Feb 13 08:58:51 2009] [error] [client 127.0.0.1] File does not exist: /var/www/localhost/htdocs/moodle/favicon.ico Feb 13 09:02:26 opteron sudo:david : TTY=pts/4 ; PWD=/hom

Re: *nix tail -f multiple log files with Thread

2009-02-13 Thread David
Joe Riopel wrote: On Fri, Feb 13, 2009 at 12:03 PM, David wrote: Hi everyone, I copied a program from C to track multiple log files. I would like to be able to print a label when a log file is updated. Here is the program; Since you're calling tail itself, why not just use tail's

Re: How Can I run some Python Scripts in VS C++?

2009-02-20 Thread david
> > No: please explain in more detail what you want to do. > > -- > Gabriel Genellina Thanks for the fast reply Gabriel, Basically I have some python scripts to do some document processing, all in command line tho. I want to have an C++ application so that my scripts can run in dialogs (API). I sa

Re: How Can I run some Python Scripts in VS C++?

2009-02-20 Thread david
On Feb 20, 11:12 am, "Gabriel Genellina" wrote: > En Fri, 20 Feb 2009 15:47:06 -0200, david escribió: > > > Basically I have some python scripts to do some document processing, > > all in command line tho. > > I want to have an C++ application so that my s

Re: Running a Python script from crontab

2008-12-02 Thread David
Astley Le Jasper wrote: >> my crontab is: 30 15 * * * cd /home/myusername/src && python myscript.py I create a file runmyscript.sh and put it in /usr/bin #!/bin/bash cd /home/myusername.src python /path/to/myscript then chmod a+x /usr/bin/runmyscript.sh test it ./runmyscript add it to the

Re: python book for non technical absolute beginner

2008-12-07 Thread David
I like this one: http://www.freenetpages.co.uk/hp/alan.gauld/ -- Powered by Gentoo GNU/LINUX http://www.linuxcrazy.com pgp.mit.edu -- http://mail.python.org/mailman/listinfo/python-list

strange behavior of math.sqrt() in new 3.0 version

2008-12-26 Thread David
I'm a newbee trying 3.0 Please help with math.sqrt() At the command line this function works correctly >>> import math n = input("enter a number > ") s = math.sqrt(n) An entry of 9 or 9.0 will yield 3.0 Yet the same code in a script gives an error mess

Re: math.sqrt() in new 3.0 version : solution in input()

2008-12-26 Thread David
On Fri, 26 Dec 2008 15:52:24 -0600, David Lemper wrote: >At the command line this function works correctly > >>> import math > n = input("enter a number > ") > s = math.sqrt(n) > An entry of 9 or 9.0 will yield 3.0 >

Of console I/O, characters, strings & dogs

2008-12-29 Thread David
I am trying getch() from msvcrt. The following module has been run with 3 different concatination statements and none yield a satisfactory result.Python 3.0 # script12 import msvcrt shortstr1 = 'd' + 'o' + 'g' print(shortstr1) char1 = msvcrt.getch() char2 = msvcrt.getch() char3 = msvcrt.getch

How to initialize an array with a large number of members ?

2008-12-31 Thread David
Thanks to those who have helped a beginner in Python. Using version 3.0 # script23 from array import array < see failed initialization attempts below > tally = array('H',for i in range(75) : [0]) tally = array('H',[for i in range(75) : 0]) tally = array('H',range(75) : [0])

Re: Videocapture in python

2009-01-01 Thread David
Marc 'BlackJack' Rintsch wrote: On Thu, 01 Jan 2009 04:28:21 -0800, koranthala wrote: Please let me know if you need any more information. Where does `videocapture.py` coming from? It's not part of the standard library. And which operating system are we talking about? Ciao, Marc

<    1   2   3   4   5   6   7   8   9   10   >