Re: Looking for a Python Program/Tool That Will Add Line Numbers to a txt File

2008-02-14 Thread J Peyret
On Feb 14, 8:50 am, "W. Watson" <[EMAIL PROTECTED]> wrote: (snip) > I thought this might be more difficult judging by a long ago experience with > Java. (snip) +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

usage of .encode('utf-8','xmlcharrefreplace')?

2008-02-18 Thread J Peyret
Well, as usual I am confused by unicode encoding errors. I have a string with problematic characters in it which I'd like to put into a postgresql table. That results in a postgresql error so I am trying to fix things with .encode >>> s = 'he Company\xef\xbf\xbds ticker' >>> print s he Company�s

Re: usage of .encode('utf-8','xmlcharrefreplace')?

2008-02-18 Thread J Peyret
OK, txs a lot. I will have to think a bit more about you said, what I am doing and how encode/decode fits in. You are right, I am confused about unicode. Guilty as charged. I've seen the decode+encode chaining invoked in some of the examples, but not the rationale for it. Also doesn't help that

Re: usage of .encode('utf-8','xmlcharrefreplace')?

2008-02-18 Thread J Peyret
On Feb 18, 10:54 pm, 7stud <[EMAIL PROTECTED]> wrote: > One last point: you can't display a unicode string. The very act of > trying to print a unicode string causes it to be converted to a > regular string. If you try to display a unicode string without > explicitly encode()'ing it first, i.e.

how to dynamically create class methods ?

2008-03-25 Thread j vickroy
Hello, Here is some pseudo-code that hopefully illustrates what I want to do: records = list(...) for record in records: new_fcn = define_a function_for(record) instance = my_new_class_instance() setattr(instance, 'myfcn', new_fcn) instance.execute() # instance.execute() calls ins

Re: how to dynamically create class methods ?

2008-03-25 Thread j vickroy
Arnaud Delobelle wrote: > On Mar 25, 6:13 pm, j vickroy <[EMAIL PROTECTED]> wrote: >> Hello, >> >> Here is some pseudo-code that hopefully illustrates what I want to do: >> >> records = list(...) >> for record in records: >> new_

need help

2009-01-28 Thread juvy j
Hi guys, need help on how to read file from other server(linux). thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

Re: need help

2009-01-28 Thread juvy j
Hi Steve, Thanks for you reply. I am newbie in python. Im going to use HTTP. thanks a lot On Wed, Jan 28, 2009 at 9:40 PM, Steve Holden wrote: > juvy j wrote: > > Hi guys, > > > > need help on how to read file from other server(linux). > > > Which service do you

Re: need help

2009-01-28 Thread juvy j
Hi tkc, Thanks so much.. it works! :-) I used the urllib. and thanks also to everybody who replied. jtj On Thu, Jan 29, 2009 at 11:08 AM, Tim Chase wrote: > Thanks for you reply. I am newbie in python. >> Im going to use HTTP. >> > > If all you want is to download a file, you might want to l

Re: newbie - merging xls files using xldt and xlwt

2008-12-08 Thread J Sutar
else: print "NOTE *** No xls files in %s. Nothing to do." % (in_dir) merge_xls(in_dir="C:/temp/test merge xls/") ### Many thanks in advance. Jigs 2008/11/3 J Sutar <[EMAIL PROTECTED]> > Mr Roskam, > > We have interac

Re: Deviation from object-relational mapping (pySQLFace)

2008-10-15 Thread J Peyret
On Oct 12, 8:19 am, [EMAIL PROTECTED] wrote: > I would like to get some opinions on this approach. > Thanks. I realize I will be minority here, but... I've never quite understood why folks want to repeat the database's metadata in XML files. I've gotten much better results just using plain ol'

Re: Sorting a list

2008-10-28 Thread J Sisson
To expand on Tino's response, sort() sorts in place and does not *return* a sorted copy of the list. In other words: unsortedList = list(["XYZ","ABC"]) unsortedList.sort() print sortedList is correct. Since sort() returns None, you lose your list if you do: unsortedList = unsortedList.sort()

Re: newbie - merging xls files using xldt and xlwt

2008-11-03 Thread J Sutar
Mr Roskam, We have interacted before on the SPSS listserve, you have helped me out fair few times! I need a helping hand again, do you have the final solution to this problem, mergin xls from a given directory? Also where do I download the relevant modules from? Cheers Jigs 2008/10/15 Albert-j

Creating Linked Lists in Python

2009-03-21 Thread J-Burns
Hey thr, I need some help here actually. So i thought i could get it easily from here. I need to make a linked list that can do the following: 1) Point to multiple nodes at one time 2) Should have 2 values: a) The node no. b) The value of that node in reference to the next node that it i

Python code-bloat tool-- warning n00b stuff...

2009-05-16 Thread anand j
archives and index using whoosh and try searching it. Thanks == Anand J Center for Behaviour and Cognitive Sciences University of Allahabad Allahabad-211002 http://sites.google.com/a/cbcs.ac.in/students/anand == The

Re: Newbie Question: How to use a .pth file on a Macintosh

2008-05-24 Thread J Peyret
Hmmm, for lack of a better response, here are some suggestions, based on what I've seen on Windows+Linux. #1 put the .pth in the site-packages directory (this is what I do on Linux). I think Python considers it special and looks for pth. you can probably get that directory from doing import sys

Mapping a series of Dates to an array of Numbers

2008-06-17 Thread J-Burns
Hello. Got a problem here. Ive got a set of points tht id be plotting. Those points would contain the date on which the work was done against its frequency. Supposedly if i did something on the 28th of March one of the points would be (28, respective freq). The next time i did my work on the 1st o

Re: Mapping a series of Dates to an array of Numbers

2008-06-17 Thread J-Burns
Btw dnt forget the solution should also cater to this problem: Supposedly there is a day on which i did not do anything. Than that particular spot in my graph should be left empty. Meaning that if i did something on the 1st March and after it i did something on the 7th March. Then essentially 1st m

Doc tests in Python

2008-06-18 Thread J-Burns
Hello. Im new to using doctests in python. Could some1 tel me how to use doctests if i have a constructor in my code? -- http://mail.python.org/mailman/listinfo/python-list

Wierd Test Failure

2008-06-20 Thread J-Burns
Hello. Im using doctests to check the functions that ive made. Wat i dnt understand is that it gives me a fialure even though the expected and got values are the same. Check this out: ** File "C:\Python25\Lib\idlelib\idle.pyw", li

Using Gnuplot and making an exe file outv the prog

2008-07-02 Thread J-Burns
Hello. Been using the gnuplot lately. Program runs fine. And its plots as well. Now i want to make an exe file out of this program using py2exe. Cud some1 help me in telling me how this is done. Thnks -- http://mail.python.org/mailman/listinfo/python-list

Rotating a cube

2008-07-16 Thread J-Burns
Hello. Need some help here. I have a 4*4 cube. So the equation of the cube becoming: x + 4*y + 16*z Now i want to rotate this cube 90 degrees anticlockwise( a right rotation). How can i do that? The rotation must take place with the axis of rotation b

Re: Rotating a cube

2008-07-17 Thread J-Burns
On Jul 17, 12:53 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > J-Burns wrote: > > Is there a built in Python function for this? > > for answering questions that have nothing to do with programming, and > looks quite a bit like homework? don't think they've

py.test and test coverage analysis ?

2008-04-02 Thread j vickroy
Hello all, I am using py.test (http://codespeak.net/py/dist/test.html) to perform unit testing. I would like to include test coverage analysis using coverage.py (http://nedbatchelder.com/code/modules/coverage.html), but I do not know how to simultaneously apply the two tools in a single run.

Re: ANN: pry unit testing framework

2008-04-02 Thread j vickroy
Aldo Cortesi wrote: > We are happy to announce the first release of Pry, a unit testing framework. > > Features > > > * Built-in coverage analysis, profiling, and quick-and-dirty benchmarking > * Assertion-based tests - no ugly failUnless*, failIf*, etc. methods > * Tree-base

How to get the version of a file

2008-04-14 Thread J Wilson
Does anyone know how to get the version of an application on OS X (i.e. the version string that appears in the "Version" field in the "Get Info" window for an application)? I'm running OS 10.4.11, python 2.5. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the version of a file

2008-04-14 Thread J Wilson
I'm not clear on how to use this to read the version resource. Specially, I need to get the version of Palm Conduit, which is, I guess, a "carbonized" shared library... or something. ? [EMAIL PROTECTED] wrote: > you need appscript "that allows you to control scriptable Mac OS X > applications

Re: How to make python run faster

2008-04-14 Thread J Sisson
2008/4/14 <[EMAIL PROTECTED]>: > On Apr 14, 8:48 am, 一首诗 <[EMAIL PROTECTED]> wrote: > > > But, it is still not as fast as 1. > > > So if speed is the #1 design goal, use pure C. If not, develop in > pure Python and, if the application is too slow, profile the code and > look for bottlenecks that

Re: Does Python 2.5 include or not include SQLite engine?

2008-04-22 Thread J Sisson
On Gentoo, SQLite can be turned on or off via the sqlite USE flag for Python 2.5+ during installation. There's also a separate pysqlite package, and the python-updater script doesn't seem to take Python2.5's build into account when (re)building all of the Python2.4 modules for Python2.5...it break

Curious relation

2008-04-23 Thread Greg J
I was reading the programming Reddit tonight and came across this (http://reddit.com/info/6gwk1/comments/): >>> ([1]>2)==True True >>> [1]>(2==True) True >>> [1]>2==True False Odd, no? So, can anyone here shed light on this one? -- http://mail.python.org/mailman/listinfo/python-list

Re: Curious relation

2008-04-24 Thread Greg J
On Apr 24, 12:08 am, Dan Bishop <[EMAIL PROTECTED]> wrote: > On Apr 23, 11:51 pm, Greg J <[EMAIL PROTECTED]> wrote: > > > I was reading the programming Reddit tonight and came across this > > (http://reddit.com/info/6gwk1/comments/): > > > >>> ([1]&

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-01 Thread J Sisson
The first method allows python to be installed in an alternate location (i.e. /usr/local/bin). "env" in this case is being used to launch python from whatever location python is installed to. I like to think of it as an "abstraction" of the python location to make it "multiplatform-friendly" sinc

Using Tkinter

2008-08-22 Thread J-Burns
Hello. Im a bit new to using Tkinter and im not a real pro in programming itself... :P. Need some help here. Problem 1: How do I make something appear on 2 separate windows using Tkinter? By this I mean that the format would be something like this: You have Page1 : This has 2-3 buttons on it. Cl

Re: Python is slow?

2008-09-23 Thread J Peyret
On Sep 23, 8:31 am, [EMAIL PROTECTED] wrote: Guys, this looks like a great data structure/algo for something I am working on. But... where do I find some definitions of the original BK-tree idea? I looked through Amazon and only a few books mention something like BK-Tree and these are mostly conf

Re: PEP Proposal

2008-09-25 Thread J Peyret
On Sep 25, 12:24 pm, [EMAIL PROTECTED] wrote: > def whoisthethief("List" x): > return iknowit(x) > > def whoisthethief("String" x, "String" y): > return iknowit([x,y]) > I dunno if this is very Pythonic in nature, but I've done things like rebinding methods dynamically. ex: >>> def test(a):

Bidirectional communication over unix socket (named pipe)

2006-03-08 Thread J Rice
Hi, I feel like I should apologize in advance because I must be missing something fairly basic and fundamental here. I don't have a book on Python network programming (yet) and I haven't been able to find an answer on the net so far. I am trying to create a pair of programs, one (the client) will

Re: Bidirectional communication over unix socket (named pipe)

2006-03-08 Thread J Rice
OK, never fails that I find a solution once I post a problem. If I use a stream rather than a datagram, it seems to work fine. So... for my education, how would I make this work with a datagram, if I insisted on doing it that way? -- http://mail.python.org/mailman/listinfo/python-list

Re: Bidirectional communication over unix socket (named pipe)

2006-03-08 Thread J Rice
Hi Donn, Not sure I fully understand your suggestion. bind() only works once -- I can't bind again in the client. Same thing with connect() -- once I issue a connect in the server, it rejects it in the client. Doing this as a stream works for what I want, but I would like to understand why it d

Re: Bidirectional communication over unix socket (named pipe)

2006-03-10 Thread J Rice
Thank you, that answers my question! And it works fine with stream, so I can do what I want as well. -- http://mail.python.org/mailman/listinfo/python-list

Threads modify "global" variable -- asking for trouble?

2006-03-16 Thread J Rice
I have been experimenting with some thread programming, but as I'm doing this on my own I am worried I might be making a major mistake. Here's a brief rundown of what I am working on. Multiple threads, via Queue, are used to perform RBL checks on an IP. The threads are passed a defined class (Co

Re: Threads modify "global" variable -- asking for trouble?

2006-03-16 Thread J Rice
My apologizes, I missed the newish FAQ entry on this. The addrbl() method looks like this: def addRBL(self, testname, result, info=""): self.testresultsRBL[testname] = result, info So according to the FAQ, D[x] = y, where D is a dictionary, is atomic and therefore thread-safe. Right?

Re: Need design advice. What's my best approach for storing this data?

2006-03-17 Thread J Correia
"Mudcat" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I am trying to build a tool that analyzes stock data. Therefore I am > going to download and store quite a vast amount of it. Just for a > general number - assuming there are about 7000 listed stocks on the two > major

Re: Threads modify "global" variable -- asking for trouble?

2006-03-18 Thread J Rice
Thank you. Implementing a results queue was much simpler than I expected, and I think as I add this into the rest of the program it will avoid a lot of potential problems later too. -- http://mail.python.org/mailman/listinfo/python-list

Function params with **? what do these mean?

2006-03-20 Thread J Rice
I'm sorry for such a basic question, but I haven't been able to phrase a search that gets me an answer and my books are totally silent on this. I have seen a number of python function defs that take parameters of the form (**param1). Looks like a pointer... but my books on python (basic as they a

Re: Function params with **? what do these mean?

2006-03-20 Thread J Rice
Wow, this is incredibly useful! I can understand why an introductory book wouldn't make use of them, but I am really glad to know about them. I can think of a bunch of ways to simply some code I have using this. -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner's question: executing scripts under Win XP pro

2006-03-25 Thread J Correia
"Scott Souva" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Your script may be working properly, but XP simply removes the window > after the script runs. Here is a simple fix that will stop at the end > of the script and leave the Command window open: > > print "Hello World" > r

Re: Python and microsoft outlook-using com, can I interact with msoutlook?

2006-04-04 Thread J Correia
><[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >Hi All, > know that Microsoft Exchange has a com interface, CDO, but I can't seem to >find one for Microsoft outlook. >does anyone have code snippets for using msoutlook and python, or >suggestions? Check out: http://aspn.activestat

Re: trying to grasp OO : newbie Q?

2006-04-13 Thread J Rice
Someone should correct me if I'm wrong but: If you add "print myVar" to __init__, you will see that myVar is assigned to "2" in that function. It doesn't change the assignment of "1" in the class because myVar in __init__ is local to __init__. If you want to change myVar for the whole class, yo

Re: Best strategy for overcoming excessive gethostbyname timeout.

2009-11-27 Thread J Sisson
On Fri, Nov 27, 2009 at 9:20 PM, r0g wrote: > Ahh so close. I set the alarm for 3 seconds and it raises the exception, > but only after spending 25 seconds seemingly blocked in gethostbyname. > > Here's a snippet, just in case I'm doing it wrong!... > > If you're doing many lookups prior to conne

frames in toplevel Tkinter

2009-12-16 Thread J Wolfe
Probably a stupid question, but can you have a frames in a toplevel widget? Anything I try to put in a frame goes back to the main or root widget and not the toplevel or pop-up widget. Thanks for the help! Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: frames in toplevel Tkinter

2009-12-17 Thread J Wolfe
On Dec 16, 11:09 pm, J Wolfe wrote: > Probably a stupid question, but can you have a frames in a toplevel > widget? Anything I try to put in a frame goes back to the main or root > widget and not the toplevel or pop-up widget. > > Thanks for the help! > Jonathan Thank you J

ScrolledText get xy index of rowheader component?

2009-12-21 Thread J Wolfe
Hi, I tried to get the xycoordinate of a click of the rowheader column of Pmw's ScrolledText...and it returns the xycoordinate of the text portion...even though I supplied it with the rowheader component. self.scrolledtext.component('rowheader').index("@%d,%d" % (event.x,event.y)) What am I doin

Re: ScrolledText get xy index of rowheader component?

2009-12-22 Thread J Wolfe
Nevermind I figured it out... I set self.dummyvar = self.scrolledtext.component('rowheader') and then did something like so self.dummyvar.index("@%d,%d" % (event.x,event.y)) not sure why it worked like that...but it did :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: twenty years ago Guido created Python

2010-01-01 Thread J Peyret
On Dec 31 2009, 2:06 pm, Steve Howell wrote: > FYI: > > http://twitter.com/gvanrossum > > Python is a truly awesome programming language.  Not only is Guido a > genius language designer, but he is also a great project leader.  What > an accomplishment.  Congratulations to everybody who has contrib

Re: Any Swisses here?

2010-01-02 Thread J Sisson
On Sat, Jan 2, 2010 at 9:38 PM, n00m wrote: > What you achieved in the life? English mastery, for starters... -- http://mail.python.org/mailman/listinfo/python-list

Re: re.sub do not replace portion of match

2009-10-02 Thread J Wolfe
Thanks Duncan, I did look at that, but it was kinda greek to me. Thanks for pulling out the part I was looking for that should do the trick. Jonathan > http://www.python.org/doc/current/library/re.html#re.sub > > > Backreferences, such as \6, are replaced with the substring matched by > > group

re.sub do not replace portion of match

2009-10-03 Thread J Wolfe
Hi, Is there a way to flag re.sub not to replace a portion of the string? I have a very long string that I want to add two new line's to rather than one, but keep the value X: string = "testX.\n.today" <-- note X is a value string = re.sub("testX.\n.","testX.\n\n.", stri

Tkinter -- the best way to make a realtime loop

2009-10-07 Thread J Wolfe
What's the best way to make a realtime loop in Tkinter? I know in perl you can use "repeat" and it will call a function every x seconds, in python it seems like "after" may be the equivalent though it doesn't seem to behave like the perl repeat function. Any ideas? Thanks, Jonathan -- http://mai

Re: Tkinter -- the best way to make a realtime loop

2009-10-08 Thread J Wolfe
Thank you both for your replies. I had something similar to this: def incr(): var.set(1 + var.get()) root.after(1000, incr) except I had an extra set of parenthesis... def incr(): var.set(1 + var.get()) root.after(1000, incr()) on the function which was screwing it up. Also needed to ha

slightly OT - newbie Objective-C resources for experienced Python users

2009-10-24 Thread J Peyret
I'm starting to look at the iPhone SDK and I'd like to know of resources on the Net that approach that language with a Pythonic mindset. Mind you, I want to code Objective-C, not pine about Python not being on the iPhone either. The kind of elegant simple code that a good Python coder who also kn

distutils.core.setup --install-script option in Python 2.6 ?

2009-11-05 Thread j vickroy
Hello, I have just upgraded from Python 2.5 to 2.6 and am unable to locate any trace of the --install-script option, in release 2.6.4 (MS Windows XP), for distutils.core.setup. I also have been unable to locate any mention of it on-line. My v2.5 setup.py scripts are failing with the falling

Re: sort values from dictionary of dictionaries python 2.4

2009-11-20 Thread J Wolfe
On Nov 9, 2:27 pm, Peter Otten <__pete...@web.de> wrote: > J Wolfe wrote: > > I would like to sort this dictionary by the values of the inner > > dictionary ‘ob’ key. > > Python's built-in dictionary is unsorted by design. > > > > > mydict = > >

Print to Printer Tkinter Text

2009-11-23 Thread J Wolfe
Hi, Is there a way to print the format of a Tkinter text box to a color printer with its tags, e.g. a blue text at font size 18 and bold will like it displays? Thanks, Jonathan -- http://mail.python.org/mailman/listinfo/python-list

How do you implement a Progress Bar

2010-02-12 Thread J Wolfe
I would really appreciate some help with this. I'm fairly new to using classes...What am I doing wrong? All I get is a blank window. I can't seem to figure out how to initialize this Progress Bar. Thanks, Jonathan ##file Meter.py from Tkinter imp

Re: hashlib in one line

2010-11-29 Thread J. Gerlach
Am 29.11.2010 14:50, schrieb Thomas Guettler: > Hi, > > I think it would be nice if you could use the hashlib in one line: > > hashlib.sha256().update('abc').hexdigest() > > Unfortunately update() returns None. > > Is there a way to convert a string to the hexdigest of sha256 in one line? > >

Re: group 0 in the re module

2010-12-08 Thread J. Gerlach
Am 08.12.2010 03:23, schrieb Yingjie Lan: > Hi, > > According to the doc, group(0) is the entire match. > m = re.match(r"(\w+) (\w+)", "Isaac Newton, physicist") m.group(0) # The entire match 'Isaac Newton' > > But if you do this: import re re.sub(r'(\d{3})(\d{3})', r'\0 t

Re: O'Reilly Python Certification

2010-12-28 Thread J. Altman
On 2010-12-16, Steve Holden wrote: > Each lesson required you to complete a practical assignment. You submit > these assignments for evaluation, and do not proceed to the next lesson > until your assignment reaches a satisfactory standard. Thus, less > experienced students will tend to have more i

FW: Entry of Non-European (Unicode or UTF-8) characters

2011-01-17 Thread J Smithfield
em, I get ""; pastinf is OK though, but who wants to paste all the time? I use Python 3 on Windows XP and Vista. The same problem was experienced on other developement systems, but most have since corrected the problem: Python should not be the las

Re: "ImportError: No module named gobject"

2011-02-22 Thread J. Gerlach
Am 21.02.2011 16:04, schrieb Luther: > I've tried installing pygtk, pygobject, and gobject-introspection from > source, but none of them will compile, and nothing I install through > synaptic has any effect. > > I've tried too many things to post all the details here, but I'll post > any details o

Re: Help running Windows programs from Python

2010-05-07 Thread j vickroy
Scott wrote: I want to write a script to automate log archiving/compressing on a Win2003 server. I have Python 2.6 installed. I am planning to use 7- zip for compression (because I have been using it manually for a while now). For now all operations will be local in the C: drive. As a total begi

Re: unable to get Hudson to run unit tests

2010-05-10 Thread j vickroy
Stefan Behnel wrote: j vickroy, 07.05.2010 20:44: I apologize if this is not the appropriate forum for a question about Hudson (http://hudson-ci.org/), but I did not know where else to ask and my web searches have not been fruitful. Certainly nice to read something about Hudson in this forum

Re: unable to get Hudson to run unit tests

2010-05-10 Thread j vickroy
Jean-Michel Pichavant wrote: Stefan Behnel wrote: j vickroy, 07.05.2010 20:44: I apologize if this is not the appropriate forum for a question about Hudson (http://hudson-ci.org/), but I did not know where else to ask and my web searches have not been fruitful. Certainly nice to read

Re: unable to get Hudson to run unit tests

2010-05-10 Thread j vickroy
Jean-Michel Pichavant wrote: j vickroy wrote: Stefan Behnel wrote: j vickroy, 07.05.2010 20:44: I apologize if this is not the appropriate forum for a question about Hudson (http://hudson-ci.org/), but I did not know where else to ask and my web searches have not been fruitful. Certainly

Re: unable to get Hudson to run unit tests

2010-05-11 Thread j vickroy
Thanks again, Stefan. My comments are below. Stefan Behnel wrote: j vickroy, 10.05.2010 17:39: Unfortunately, when "Hudson Build now" is performed, the Hudson Console output, for this job, is: Started by user anonymous Up

Re: unable to get Hudson to run unit tests

2010-05-11 Thread j vickroy
Stefan Behnel wrote: j vickroy, 11.05.2010 16:46: > Stefan Behnel wrote: No, what Hudson actually does, is, it writes your command(s) into a text file and runs it with the system's shell interpreter (which, unless otherwise configured, is "cmd.exe" on Windows). This is not

Re: unable to get Hudson to run unit tests

2010-05-11 Thread j vickroy
Stefan Behnel wrote: j vickroy, 11.05.2010 16:46: > Stefan Behnel wrote: No, what Hudson actually does, is, it writes your command(s) into a text file and runs it with the system's shell interpreter (which, unless otherwise configured, is "cmd.exe" on Windows). This is not

Re: default argument

2010-05-11 Thread j vickroy
Back9 wrote: Hi, Is this grammer working in Python? class test: self._value = 10 def func(self, self._value) When i try it, it complains about undefined self. i don't know why. TIA ... not exactly; try: class Test: _value = 10 def func(self): print id(self._value), self._v

Re: Jewish Pirates of the Caribbean

2010-06-16 Thread J. Clarke
On 6/16/2010 4:42 PM, George Neuner wrote: On Wed, 16 Jun 2010 17:23:35 +0200, p...@informatimago.com (Pascal J. Bourguignon) wrote: Kryno Bosman writes: Would you, please, be so nice to share *your* truth somewhere else? He has been long time ago kill-filed by everybody. Your quoting of

passing menu label to function

2009-08-07 Thread J Wolfe
Hi, I would like to pass the label name of a menu to the command it is calling, is that possible? self.menuitem.menu.add_command(label="pass this",command = lambda i = self.self.menuitem.menu.cget("label"): self.function(i)) def function(self, i) print i # print the label name Any help

Re: passing menu label to function

2009-08-07 Thread J Wolfe
Thanks Peter, I figured out an alternative just as you posted your response, I just looped through the buttons I wanted to add and used the loop variable to label the item and then passed it to the function, though your way seems much more robust. Thanks a lot! -- http://mail.python.org/mailman

Pmw optionmenu color

2009-08-24 Thread J Wolfe
Hello, It seems like this should be easy to do... change the background color of the Pmw optionmenu. I have not been able to find this. Anyone have a hint or know how to do this? Thanks, Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: IDE for python similar to visual basic

2009-09-24 Thread J Sisson
On Sun, Sep 13, 2009 at 6:25 AM, Nobody wrote: > On Fri, 11 Sep 2009 05:27:59 -0700, r wrote: > > > Sounds like "somebody" failed to get input > > from their users at design time. Or "somebody" has the inability to > > relate to their end users. > > You're assuming that there is some "right" an

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-12 Thread J. Gerlach
Am 12.10.2010 17:10, schrieb Roy Smith: > [A]re there any plans to update the api to allow an iterable instead of > a sequence? sqlite3 (standard library, python 2.6.6., Windows 32Bit) does that already:: import sqlite3 as sql connection = sql.connect(":memory:") cursor = connection.execute(""

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-13 Thread J. Gerlach
Am 13.10.2010 14:26, schrieb Jon Clements: > On 12 Oct, 20:21, "J. Gerlach" wrote: >> Am 12.10.2010 17:10, schrieb Roy Smith: >> >>> [A]re there any plans to update the api to allow an iterable instead of >>> a sequence? >> >> [sqlite3 exampl

Re: Why "flat is better than nested"?

2010-11-05 Thread J. Gerlach
Am 28.10.2010 03:40, schrieb Steven D'Aprano: > [ snip a lot of wise words ] Can I put this (translated) in the german python wiki? I guess it might help more people to understand some decisions taken during python's development - and I'm to lazy to do something similar myself ;) Greetings from B

Re: Why "flat is better than nested"?

2010-11-06 Thread J. Gerlach
Am 06.11.2010 02:36, schrieb Steven D'Aprano: > On Fri, 05 Nov 2010 14:19:47 +0100, J. Gerlach wrote: > >> Am 28.10.2010 03:40, schrieb Steven D'Aprano: >>> [ snip a lot of wise words ] >> >> Can I put this (translated) in the german python wiki? I guess

Re: In Python and Windows environment how to supress certain key press and send some other key event for it

2017-04-23 Thread J. Clarke
In article , i.am.song...@gmail.com says... > > Hi All, > > I was trying to build a VIM like shortcuts in windows. For example, > > IF i press CAPSLOCK & h: It should "{Left}" move one to left. If CAPSLOCK & > b: It should "{Ctrl Down}{Left}{Ctrl Up}" move one word left etc. > > I was successf

Re: New to Python - Career question

2017-06-24 Thread J. Clarke
In article , larry.mart...@gmail.com says... > > On Tue, Jun 6, 2017 at 6:37 PM, Marko Rauhamaa wrote: > > pta...@gmail.com: > > > >> New to Python and have been at it for about a month now. I'm doing > >> well and like it very much. Considering a career change down the road > >> and have been w

Re: Where is python and idle?

2017-07-30 Thread J. Clarke
In article , br...@brianlcase.com says... > > Thank you, That is where it is. Would not have found it without your > help. Now, to find IDLE. > > rgrds, > > Brian > > > On 7/21/2017 10:19 AM, Nathan Ernst wrote: > > Check your user folder. For me, on my PC, python is installed > > at C:\Us

Re: Recent Spam problem

2017-08-12 Thread J. Clarke
In article , skybuck2...@hotmail.com says... > > I see two solutions: > > 1. We build new architecture or adept current one so it's more like a > blockchain, have to calculate some hash before being able to post and upload > and such. > > or > > 2. We counter-attack by installing a special t

Re: multiple versions of python

2013-05-07 Thread Colin J. Williams
On 07/05/2013 6:26 PM, sokovic.anamar...@gmail.com wrote: Hi, what is the generally recommended structure when we have into play this type of problem: multiple versions of python (both in the sense of main versions and sub versions, e.g., 2.7 : 2.7.1 2.7.3 3: 3.3 3.3.1 Different

Re: Style question -- plural of class name?

2013-05-08 Thread Colin J. Williams
On 08/05/2013 4:20 PM, Roy Smith wrote: FooEntry is a class. How would you describe a list of these in a docstring? "A list of FooEntries" 0 "A list of FooEntrys" -1 "A list of FooEntry's" +1 "A list of FooEntry instances" No FooEntry is specified as a class. The first one certainly so

Re: Determine actually given command line arguments

2013-05-15 Thread Colin J. Williams
On 15/05/2013 2:34 AM, Henry Leyh wrote: Hello, I am writing a program that gets its parameters from a combination of config file (using configparser) and command line arguments (using argparse). Now I would also like the program to be able to _write_ a configparser config file that contains onl

Re: Fractal

2013-05-15 Thread Colin J. Williams
On 13/05/2013 11:41 AM, Sharon COUKA wrote: Hello, I'm new to python and i have to make a Mandelbrot fractal image for school but I don't know how to zoom in my image. Thank you for helping me. Envoyé de mon iPad Google is your friend. Try "Mandelbrot Python" Colin W. -- http://mail.py

Re: Unicode humor

2013-05-15 Thread Colin J. Williams
On 15/05/2013 1:21 PM, MRAB wrote: On 15/05/2013 18:04, Jean-Michel Pichavant wrote: - Original Message - On 15/05/2013 14:19, Jean-Michel Pichavant wrote: This reflects a lack of understanding of Unicode. jmf And this reflects a lack of a sense of humor. :) Isn't that a crime

Re: grimace: a fluent regular expression generator in Python

2013-07-16 Thread Anders J. Munch
Ben Last wrote: north_american_number_re = (RE().start .literal('(').followed_by.exactly(3).digits.then.literal(')') .then.one.literal("-").then.exactly(3).digits .then.one.dash.followed_by.exactly(4).digits.then.end .as

Re: Generator vs functools.partial?

2012-06-21 Thread J. Cliff Dyer
On Thu, 2012-06-21 at 21:25 +1000, John O'Hagan wrote: > Sometimes a function gets called repeatedly with the same expensive argument: > > def some_func(arg, i): > (do_something with arg and i) > > same_old_arg = big_calculation() > for i in lots_of_items: > some_func(same_old_arg, i) >

Re: Which way is best to execute a Python script in Excel?

2012-07-06 Thread Colin J. Williams
On 06/07/2012 1:09 AM, Terry Reedy wrote: On 7/5/2012 10:30 PM, Karim wrote: An excellent link to derived all code example to python: http://www.pitonyak.org/AndrewMacro.sxw. Even though he only writes in OOBasic, you are right that he explains the basic concepts needed for accessing the api

Re: lambda in list comprehension acting funny

2012-07-11 Thread Colin J. Williams
On 11/07/2012 2:41 AM, Daniel Fetchinson wrote: funcs = [ lambda x: x**i for i in range( 5 ) ] print funcs[0]( 2 ) print funcs[1]( 2 ) print funcs[2]( 2 ) This gives me 16 16 16 When I was excepting 1 2 4 Does anyone know why? Cheers, Daniel I don't understand why you would expect 1, 2,

Re: Sudden doubling of nearly all messages

2012-07-21 Thread Colin J. Williams
On 21/07/2012 6:48 AM, Dave Angel wrote: Has anybody else noticed the sudden double-posting of nearly all messages in the python mailing list? No. Colin W. -- http://mail.python.org/mailman/listinfo/python-list

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