Re: Thank you, Tkinter. (easy to use)

2009-02-12 Thread Eric Brunel
On Thu, 12 Feb 2009 06:06:06 +0100, wrote: [snip] My only (minor) complaint is that Tk doesn't draw text antialiased in the various widgets (menus, labels, buttons, etc.). From version 8.5 of tcl/tk, it's supposed to do it. See this page: http://www.tcl.tk/software/tcltk/8.5.tml under 'Highlig

Re: Tkinter and asyncronous socket

2008-11-27 Thread Eric Brunel
On Fri, 28 Nov 2008 04:20:22 +0100, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: If you are not already doing it, you need to make a "stutter thread" by using the after() call on some gui object to periodically check for input on the queue. You don't need to in fact: from the secondary thread

Re: Structure using whitespace vs logical whitespace

2008-12-16 Thread Eric Brunel
On Tue, 16 Dec 2008 10:00:32 +0100, Gabriel Genellina wrote: En Mon, 15 Dec 2008 14:29:31 -0200, cmdrrickhun...@yaho.com escribió: PS. In my opinion the solution would be to have the option of entering a "whitespace insensitive" mode which uses C style {} and ;. The token to enter it co

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

2009-01-03 Thread Eric Kemp
Tim Roberts wrote: Scott David Daniels wrote: I avoid using single-letter variables except where I know the types from the name (so I use i, j, k, l, m, n as integers, s as string, and w, x, y, and z I am a little looser with (but usually float or complex). It's amazing to me that Fortran con

del behavior

2009-01-07 Thread Eric Snow
I was reading in the documentation about __del__ and have a couple of questions. Here is what I was looking at: http://docs.python.org/reference/datamodel.html#object.__del__ What is globals referring to in the following text from that reference page? "Starting with version 1.5, Python guarante

del behavior 2

2009-01-07 Thread Eric Snow
that need to be cleaned up if __del__ doesn't get a chance? Any ideas? Thanks -eric -- http://mail.python.org/mailman/listinfo/python-list

Re: del behavior

2009-01-07 Thread Eric Snow
On Jan 7, 12:48 pm, "Chris Rebert" wrote: > On Wed, Jan 7, 2009 at 11:39 AM, Eric Snow wrote: > > I was reading in the documentation about __del__ and have a couple of > > questions.  Here is what I was looking at: > > >http://docs.python.org/reference/datamodel

Re: del behavior

2009-01-07 Thread Eric Snow
On Jan 7, 12:55 pm, Eric Snow wrote: > On Jan 7, 12:48 pm, "Chris Rebert" wrote: > > > > > On Wed, Jan 7, 2009 at 11:39 AM, Eric Snow wrote: > > > I was reading in the documentation about __del__ and have a couple of > > > questions.  Here is what I

Re: del behavior 2

2009-01-07 Thread Eric Snow
On Jan 7, 12:57 pm, "Chris Rebert" wrote: > On Wed, Jan 7, 2009 at 11:42 AM, Eric Snow wrote: > > I was reading in the documentation about __del__ and have a couple of > > questions.  Here is what I was looking at: > > >http://docs.python.org/reference/data

Re: del behavior 2

2009-01-07 Thread Eric Snow
On Jan 7, 1:03 pm, Eric Snow wrote: > On Jan 7, 12:57 pm, "Chris Rebert" wrote: > > > > > On Wed, Jan 7, 2009 at 11:42 AM, Eric Snow wrote: > > > I was reading in the documentation about __del__ and have a couple of > > > questions.  Here is what I

os.fork and pty.fork

2009-01-07 Thread Eric Snow
It looks like pty.fork tries to use os.forkpty but I am not sure how an existing tty plays in to getting a new tty for the child process... Any insight into os.fork and pty.fork would be great. Thanks. -eric -- http://mail.python.org/mailman/listinfo/python-list

Re: State of the art: Tkinter, Tk 8.5, Tix?

2009-01-08 Thread Eric Brunel
On Wed, 07 Jan 2009 20:31:23 +0100, excord80 wrote: Does Python work with Tk 8.5? I'm manually installing my own Python 2.6.1 (separate from my system's Python 2.5.2), and am about to install my own Tcl/Tk 8.5 but am unsure how to make them talk to eachother. Should I install Tk first? If I put

Re: del behavior 2

2009-01-08 Thread Eric Snow
starting addition child > processes which inherit the master socket? > > Regards, > Martin Thanks. I'll look into that. -eric -- http://mail.python.org/mailman/listinfo/python-list

Re: del behavior 2

2009-01-08 Thread Eric Snow
On Jan 7, 12:42 pm, Eric Snow wrote: > I was reading in the documentation about __del__ and have a couple of > questions.  Here is what I was looking at: > > http://docs.python.org/reference/datamodel.html#object.__del__ > > My second question is about the following: > &g

Re: If an OS was to be written in Python, how'w it look?

2008-10-06 Thread Eric Wertman
Or is that crap too? Again, I'm no expert. Eric -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with Iteration

2008-10-19 Thread Eric Wertman
>> Aaron Brady wrote: >> >>> while 1: >>>calculate_stuff( ) >>>if stuff < 0.5: >>>break >> >> The thought police will come and get you. Based on Aaron's previous posting history, I suspect this was a joke. -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-19 Thread Eric Wertman
>> I (again) wonder what's the perfect way to store, OS-independent, >> filepaths ? I'm in agreement that perfect probably isn't applicable. If I were doing this myself, I might store the information in a tuple: base = 'some root structure ('/' or 'C') path = ['some','set','of','path','names'] f

Re: Python certification

2008-10-20 Thread Eric Wertman
ield to work in if there were some industry standard certifications that were required. More like the medical and legal fields than the vendor specific ones we see today from Microsoft, IBM, etc. Eric -- http://mail.python.org/mailman/listinfo/python-list

Re: pymssql - execute loads all results into memory!

2008-10-20 Thread Eric Wertman
't remember if that worked. I definitely tried making a generator with it, that did not help. Eric -- http://mail.python.org/mailman/listinfo/python-list

Re: Python certification

2008-10-20 Thread Eric Wertman
> Given the way that medical/legal licensing is used to stifle competition, > prevent innovation, and keep people from earning a living delivering simple > services that people need at prices they can afford, 'more like' would have > to be done very carefully. To draw an analogy... imagine, if you

Re: Python certification

2008-10-20 Thread Eric Wertman
> I would hate to live in a world where you had to have three years of > graduate professional training to write a for-loop for pay, or where > scientists and mathematicians were prohibited from writing code (practicing > software) without a license. Or where someone who just wanted to practice >

Re: subprocess.Popen on Windows

2008-10-20 Thread Eric Carlson
Werner F. Bruhin wrote: I am trying to use subprocess - it basically works but. command = 'ping ' + '-n '+ str(count) + ' -l ' + str(size) + ' ' + str(node) print command p = subprocess.Popen(command, stdin=subprocess.PIPE,

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-20 Thread Eric Wertman
> Do you really think there are Linux or Mac systems with a C: drive? > > This whole question is based on the ludicrous assumption that general > file system paths can be platform-independent. That's a bit like trying > to write code that is programming language-independent. That's sort of where

Re: CAD.py

2008-11-03 Thread Eric Carlson
nd to any of this until late next year, but I would be happy to assist if you want to take a shot at it... Cheers, Eric Carlson -- http://mail.python.org/mailman/listinfo/python-list

Re: Workflow engine?

2008-11-08 Thread Eric Wertman
riginal question.. someone could have just as easily said that you should consider Sharepoint and not bother writing any code. Eric -- http://mail.python.org/mailman/listinfo/python-list

Possible bug in Tkinter for Python 2.6

2008-11-19 Thread Eric Brunel
Hello all, I'm trying out Python 2.6 and I found what might be a bug in the Tkinter module. How can I report it? The possible bug is a traceback when trying to delete a menu item in a menu where no items have associated commands. For example: -- from Tkinter im

Re: Possible bug in Tkinter for Python 2.6

2008-11-20 Thread Eric Brunel
On Wed, 19 Nov 2008 18:51:03 +0100, Terry Reedy <[EMAIL PROTECTED]> wrote: Anton Vredegoor wrote: On Wed, 19 Nov 2008 10:57:53 +0100 "Eric Brunel" <[EMAIL PROTECTED]> wrote: I'm trying out Python 2.6 and I found what might be a bug in the Tkinter module. How ca

Build of extension module depending on external lib fails on Solaris 10

2008-11-21 Thread Eric Brunel
Hello all, I've got a brand new Solaris 10 computer and I'm trying to build Python and extension modules for it. The Python build didn't have any problem and I have a working Python interpreter. But I can't succeed to build extension modules depending on external libraries: The compilation

Re: tkinter icons as bytestrings, not files?

2009-02-24 Thread Eric Brunel
On Tue, 24 Feb 2009 05:56:12 +0100, Peter Billam wrote: Greetings, As a newbie, starting with Python3, I'm working my way through Mark Summerfield's tkinter examples. In the toolbar, there's lines like: for image, command in ( ('images/filenew.gif', self.fileNew), ('ima

Re: tkinter: loading file before entering mainloop

2009-03-16 Thread Eric Brunel
have a module or a set of modules containing the part that actually does something, and doesn't know anything about from where it is called, and another module or set of modules for the GUI and/or the CLI, which display things nicely and call the first part when it has to actually do something. This would avoid problems like the one you have. > Thanks for your help, Regards, Peter HTH - Eric - -- http://mail.python.org/mailman/listinfo/python-list

Re: Emulate a printf() C-statement in Python???

2009-03-19 Thread Eric Brunel
e traditional self as first parameter. - In your function myprintf, the format string seems to be a required argument. If it is, you might want to define as such too: def myprintf(format_string, *args): print format_string % args So now, as you can see, redefining printf in Python is not really interesting... HTH anyway. - Eric - -- http://mail.python.org/mailman/listinfo/python-list

Re: Threading and tkinter

2009-03-27 Thread Eric Brunel
(Sorry: replying to the wrong message here, but my newsreader somehow managed to miss the former post...) > On Mar 7, 9:40 am, Jani Hakala wrote: >> > After reading the docs and seeing a few examples i think this should >> > work ? >> > Am I forgetting something here or am I doing something stupi

Re: tkinter questions: behavior of StringVar, etc

2009-03-30 Thread Eric Brunel
f the objects you handle, but pass them through str and insert the result directly in the command. HTH - Eric - -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter questions: behavior of StringVar, etc

2009-03-30 Thread Eric Brunel
cate between the Python layer and the tcl one. They are not intended to be used as actual strings in your application. Don't forget anything you do on a StringVar is actually done by tcl, not Python. So I guess there is also a performance penalty to use StringVar's instead of Python strings. > Thanks for any insights, > Alan Isaac HTH - Eric - -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter questions: behavior of StringVar, etc

2009-03-30 Thread Eric Brunel
Alan G Isaac wrote: [snip] > On 3/30/2009 3:37 AM Eric Brunel apparently wrote: >> The Tk instance is registered in a hidden variable in the Tkinter module. When >> you don't specify a master, it'll use the latest created Tk instance one by >> default. BTW, the lates

Matrix operations on character matrix element?

2009-04-01 Thread olusina eric
I hope somebody will be able to help me here. I am trying to solve some physical problems that will require the generation of some function in terms of some parameters. These functions are derived from matrix operation on “characters”. Are there ways numpy/scipy perform matrix operations on cha

Re: Help for Toplevel

2009-04-02 Thread Eric Brunel
*args, **options) The only thing I (rarely...) allow myself to do is to pass custom options and getting/removing them with options.pop('my_option') before calling the super-class's constructor. Otherwise, I just add specific methods; it's far less confusing. HTH - Eric - -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-06 Thread Eric Smith
> -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On Apr 6, 2009, at 9:21 AM, Jesse Noller wrote: > >> On Thu, Apr 2, 2009 at 4:33 PM, M.-A. Lemburg wrote: >>> On 2009-04-02 17:32, Martin v. Löwis wrote: I propose the following PEP for inclusion to Python 3.1. >>> >>> Thanks for picking t

Re: How can I change size of GUI?

2009-04-07 Thread Eric Brunel
ist, then run it with your option width=120, then without, and I can guarantee you'll see a difference (I do anyway...). So I guess this code is part of a much bigger one, and that the problem lies in the other part... HTH anyway... - Eric - -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL\Tkinter and Transparencies, Rubber Lines, and Dragging Image Objects

2009-04-07 Thread Eric Brunel
^^^ > would see if I pasted the telescope and white background onto the green > canvas. I have neither PIL, nor the image you're using so I can just guess. But if you want to use a white background, maybe you should use a mask defined with: mask = im.point(lambda i: 255 if i >= 255 else 0) (if I understood the mask construction correctly...). HTH - Eric - -- http://mail.python.org/mailman/listinfo/python-list

Re: 3D plotting in a GUI

2009-04-07 Thread Eric Carlson
rties. Cheers, Eric """ This example show how to embedded Mayavi in a wx aui notebook, and also shows how to embed a generic vtk window This is a slightly more complex example than the wx_embedding.py one, and can be used to see how a large wx application can use different Mayavi vi

Re: Where to find options for add_command?

2009-04-16 Thread Eric Brunel
e the tk manual pages, that you can find here: http://www.tcl.tk/man/tcl8.5/TkCmd/contents.htm It requires a little adaptation to understand how to convert tcl syntax to Python syntax, but it's quite straightforward and doesn't take long. You'll find the answer to your question

Unable to build libpython2.5.so on OS X 10.4

2009-05-07 Thread Eric Winter
README file and configure script comments are not getting me very far. TIA, Eric Winter NASA GSFC Fermi Gamma-Ray Space Telescope Science Support Center -- http://mail.python.org/mailman/listinfo/python-list

Popen File I/O

2009-05-27 Thread Eric Pruitt
Hello, I am creating a file-like interface for Popen. Do I need to return True or False for "isatty()"? I am thinking True but I am not familiar with the semantics of what defines a tty. Thanks, Eric -- http://mail.python.org/mailman/listinfo/python-list

Creating a Google Code project for GSoC

2009-06-01 Thread Eric Pruitt
under an MIT license. Python's license is not GPL but is GPL compatible. What license should the Google Code project fall under? MIT, GPL or something else? Eric -- http://mail.python.org/mailman/listinfo/python-list

Purpose of operator package

2008-05-13 Thread Eric Anderson
I mainly work in other languages (mostly Ruby lately) but my text editor (Scribes) is python. With python being everywhere for dynamic scripting I thought I would read the source to learn the language better (I've gone through some basic tutorials but I always prefer to learn from real source). So

time module question - time zones

2008-05-21 Thread Eric Wertman
C, and my TZ is currently -4. Does that make sense? I didn't even think I needed to do any business with time.localtime() and time.gmtime(). I expected time.strftime() to return the locale appropriate time, but it didn't. TIA Eric -- http://mail.python.org/mailman/listinfo/python-list

Re: time module question - time zones

2008-05-21 Thread Eric Wertman
at 12:23 PM, Eric Wertman <[EMAIL PROTECTED]> wrote: > I tend to deal with dates a lot in different formats and places... > typically I'll convert them to a time tuple with strptime(), and pass > them around like that before I need to write them back out. > > One set of ti

Re: Python is slow

2008-05-23 Thread Eric Brunel
On Fri, 23 May 2008 12:48:56 +0200, > wrote: "inhahe" <[EMAIL PROTECTED]> writes: planets are spherical (all implementations of Python are not natively compiled (and you said for whatever definition)), and b) It's a far cry to imagine a planet coming into being that's not spherical (a langua

Re: Python is slow

2008-05-24 Thread Eric Wertman
> if python is such a good programming/scripting language, why can't they > build a faster interpreter/compiler engine? and beat php and zend. > to the python team, rebuild your interpreter! while this is just a boring troll.. it does bring me to a more interesting point... it would be cool if the

Re: unittest: Calling tests in liner number order

2008-05-24 Thread Eric Wertman
>I can't relate to anyone that want to oppose a change that would give >more freedom to a programmer. While in general I agree with this.. I think in the case of python part of it's base philosophy seems to be a tendency to encourage a single way of doing things, and create a path of least resista

Re: php vs python

2008-05-28 Thread Eric Wertman
Flaming Thunder is teh awesome! :P -- http://mail.python.org/mailman/listinfo/python-list

Code execution in imported modules

2008-05-29 Thread Eric Wertman
So I'm working on some file parsing and building up a stack of regular expressions that I need to use. I was thinking of dropping them in an external module. I was wondering.. if I put them in a file called regex.py like so : import re re1 = ".. re2 = ".. and then do: rgx1 = re.compile(re1) r

cPickle asymptotic performance?

2008-06-12 Thread Eric Jonas
up cPickle? Thanks, ...Eric -- http://mail.python.org/mailman/listinfo/python-list

Re: cPickle asymptotic performance?

2008-06-12 Thread Eric Jonas
On Thu, 2008-06-12 at 20:57 +0200, Hrvoje Niksic wrote: > Eric Jonas <[EMAIL PROTECTED]> writes: > > > I've done some benchmarking while attempting to serialize my (large) > > graph data structure with cPickle; I'm seeing superlinear performance > > (plo

Re: inheritance question...

2008-06-23 Thread Eric Brunel
Preamble: when posting a brand new question, you'd better not replying to an existing completely unrelated message. In most viewers, this will cause your message to appear in the thread for the original question and far less people will see it. So better create a brand new thread. On Fri, 2

Re: Python 3000 vs Perl 6

2008-06-24 Thread Eric Wertman
Flaming Thunder FTW!!! thank you, I'm here all week. -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter, loading image error, TclError: couldn't recognize data in image file "C:/users/me/desktop/images/blob4.jpg"

2008-06-30 Thread Eric Brunel
On Sun, 29 Jun 2008 13:34:37 +0200, defn noob <[EMAIL PROTECTED]> wrote: from Tkinter import * import os master = Tk() w = Canvas(master, width=800, height=600) print os.path.exists('C:/me/saftarn/desktop/images/blob4.jpg') im = PhotoImage(file = 'C:/users/saftarn/desktop/images/blob4.jpg')

Wrapping std::set in Boost::Python

2008-07-23 Thread Eric First
All: Has anybody had success at wrapping std::set using Boost::Python? Any ideas, snippets of code, etc... would be very helpful. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Wrapping std::set in boost::python

2008-07-24 Thread Eric First
Has anybody wrapped std::set using boost::python? I'm trying to find the best way to do this. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Execution speed question

2008-07-26 Thread Eric Wertman
> The number of nodes is very large: millions for sure, maybe tens > of millions. If considering (2), take note of my BOLD text above, which > means I can't remove nodes as I iterate through them in the main loop. Since your use of 'node' is pretty vague and I don't have a good sense of what test

Re: os.walk question

2008-07-26 Thread Eric Wertman
I do this, mabye a no-no? import os for root,dirs,files in os.walk(dir) : break -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter Entry widgets 'font' property (API ?) changed in Python 2.5.2 ?

2008-08-06 Thread Eric Brunel
On Wed, 06 Aug 2008 06:01:59 +0200, Atul <[EMAIL PROTECTED]> wrote: Hi, The snippet : entryFontDescr = Entry()["font"] print self.entryFontDescr On Windows XP it displays {MS Sans Serif} 8 On Suse Linux 10.2 it used to display TkTextFont 10 I upgraded to OpenSuse 11 and now it shows TkTe

Re: os.system question

2008-08-07 Thread Eric Wertman
In your case you could also use the os.environ dictionary: import os print os.environ['USER'] -- http://mail.python.org/mailman/listinfo/python-list

Re: Second python program: classes, sorting

2008-08-11 Thread Eric Brunel
Others have replied to your original question. As an aside, just a few stylistic notes: class Score: def __init__(self, name_, score_): self.name = name_ self.score = score_ These trailing underscores look like a habit from another language. They are unneeded in Pyth

Re: Replace Several Items

2008-08-13 Thread Eric Wertman
I tend to use the re module like so : import re my_string = re.sub('[\-,./]','',my_string) > I wish to replace several characters in my string to only one. > Example, "-", "." and "/" to nothing "" > I did like that: > my_string = my_string.replace("-", "").replace(".", "").replace("/", > "").rep

Re: Tkinter updates - Easiest way to install/use Tile?

2008-08-14 Thread Eric Brunel
On Wed, 13 Aug 2008 19:10:47 +0200, Mudcat <[EMAIL PROTECTED]> wrote: [snip] I was reading about Tile, and it sounds like I should be able to wrap a style around my current code to give it a different look. However it doesn't sound like it's quite ready for prime time yet. I downloaded the latest

Re: Tkinter tab focus traversal causes listbox selection to clear, ie, lose the selected item

2008-08-14 Thread Eric Brunel
On Thu, 14 Aug 2008 04:49:51 +0200, Gerardo ARnaez <[EMAIL PROTECTED]> wrote: Hi. I am writing a program to help determine coumadin regimens to look at the code: http://sourceforge.net/projects/coumadinregimen/ The issue is that I have a variable that I want the use to select if they don't li

Re: 答复: how to remove \n in the list

2008-04-14 Thread Eric Brunel
(please avoid top-posting... corrected) On Mon, 14 Apr 2008 09:08:06 +0200, Penny Y. <[EMAIL PROTECTED]> wrote: > -邮件原件- > 发件人: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] 代表 Gabriel > Genellina > 发送时间: 2008年4月14日 12:59 > 收件人: python-list@python.org > 主题: Re: how to remove \n in the list

Re: Learning Tkinter

2008-04-17 Thread Eric Brunel
On Wed, 16 Apr 2008 14:46:13 +0200, Doran, Harold <[EMAIL PROTECTED]> wrote: [snip] > Second, I am trying to work through a couple of the examples and make > some small tweaks as I go to see how new things can work. In the first > case, I have copied the code in the book to see how the menu works a

Alternate indent proposal for python 3000

2008-04-20 Thread Eric Wertman
I was considering putting together a proposal for an alternate block syntax for python, and I figured I'd post it here and see what the general reactions are. I did some searching, and while I found a lot of tab vs space debates, I didn't see anything like what I'm thinking of, so forgive me if th

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Eric Wertman
> Look into any of the dozen Python-based template engines that are > typically used for such tasks; they offer many more features than a > way to indent blocks. > > George I definitely will.. could you throw out some examples though? Thanks! Eric -- http://mail.python.org/m

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Eric Wertman
On Apr 20, 1:29 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 20 Apr 2008 13:42:05 -0300, Matthew Woodcraft <[EMAIL PROTECTED]> > escribió: > > > An alternative scheme for describing the block structure could be > > useful in other cases, though. For example, if you wanted to suppor

Ideas for parsing this text?

2008-04-23 Thread Eric Wertman
I have a set of files with this kind of content (it's dumped from WebSphere): [propertySet "[[resourceProperties "[[[description "This is a required property. This is an actual database name, and its not the locally catalogued database name. The Universal JDBC Driver does not rely on information c

Re: Ideas for parsing this text?

2008-04-24 Thread Eric Wertman
r printable characters. I'm not sure if I can just use that, without worrying about it? At any rate, thumbs up on the parser! Definitely going to add to my toolbox. On Thu, Apr 24, 2008 at 8:19 AM, Mark Wooding <[EMAIL PROTECTED]> wrote: > > Eric Wertman <[EMAIL PROTECTED]>

Re: Ideas for parsing this text?

2008-04-24 Thread Eric Wertman
> I would discourage you from using printables, since it also includes > '[', ']', and '"', which are significant to other elements of the > parser (but you could create your own variable initialized with > printables, and then use replace("[","") etc. to strip out the > offending characters).

Re: Calling Python code from inside php

2008-04-25 Thread Eric Wertman
> > A simple yet dangerous and rather rubbish solution (possibly more of a > > hack than a real implementation) could be achieved by using a > > technique described above: > > > > > echo exec('python foo.py'); > > This will spawn a Python interpreter, and not be particularly > effi

Re: learning with python question (HtTLaPP)

2008-04-26 Thread Eric Wertman
> Python Programmer" and have been trying to write a script that checks > 'words.txt' for parameters (letters) given. The problem that is the i > can only get results for the exact sequence of parameter 'letters'. The "re" module comes to mind: text = open('words.txt','r').read() letters = 's

Re: learning with python question (HtTLaPP)

2008-04-26 Thread Eric Wertman
> Is the way I wrote the function inherently wrong? What I wrote I would not say that. I think a lot of people probably start off like that with python. You'll find in most cases that manually keeping counters isn't necessary. If you really want to learn python though, I would suggest using b

Re: learning with python question (HtTLaPP)

2008-04-26 Thread Eric Wertman
On Sat, Apr 26, 2008 at 7:50 PM, <[EMAIL PROTECTED]> wrote: > ok.. I finally made something that works.. Please let me know what you > think: > > >>> def lines(letters): > fin = open('words.txt') > count = 0 > rescount = 0 # count the number of results > results

Re: design choice: multi-threaded / asynchronous wxpython client?

2008-04-27 Thread Eric Wertman
HI, that does look like a lot of fun... You might consider breaking that into 2 separate programs. Write one that's threaded to keep a db updated properly, and write a completely separate one to handle displaying data from your db. This would allow you to later change or add a web interface witho

Re: Mapping and Filtering Help for Lists

2008-04-27 Thread Eric Wertman
You should check out the sets module: http://docs.python.org/lib/module-sets.html > > The problem asks to create a "compareandremove" so that you can use it on a > string, to remove the words from the string that are contained in un_words. > > The remaining words then need to be compared to

Re: File IO Issues, help :(

2008-04-28 Thread Eric Wertman
chuck in a jsfile.close(). The buffer isn't flushing with what you are doing now. jsfile.flush() might work... not sure. Closing and re-opening the file for sure will help though. On Tue, Apr 29, 2008 at 1:26 AM, Kevin K <[EMAIL PROTECTED]> wrote: > Hey everyone, I'm new to python and am trying

Re: python script as executable

2008-04-28 Thread Eric Wertman
Try to ftp it in ascii mode, or find a dos2unix utility .. the file has probably got \r\n (windows) line terminators in it.. causes problems. I guess it's also possible that /usr/bin/env doesn't exist... not likely though. On Tue, Apr 29, 2008 at 1:36 AM, sandipm <[EMAIL PROTECTED]> wrote: > Hi

Re: Simple TK Question - refreshing the canvas when not in focus

2008-04-29 Thread Eric Brunel
On Tue, 29 Apr 2008 15:22:12 +0200, blaine <[EMAIL PROTECTED]> wrote: Hey everyone! I'm not very good with Tk, and I am using a very simple canvas to draw some pictures (this relates to that nokia screen emulator I had a post about a few days ago). Anyway, all is well, except one thing. When

Re: ssh

2008-04-29 Thread Eric Wertman
e function above could theoretically block if the error pipe gets full before I get to reading it. I can't recall ever getting that much back on stderr though.. so I'm taking the chance. Eric On Tue, Apr 29, 2008 at 9:29 PM, gert <[EMAIL PROTECTED]> wrote: > Is this

Re: Simple TK Question - refreshing the canvas when not in focus

2008-04-30 Thread Eric Brunel
On Tue, 29 Apr 2008 17:09:18 +0200, blaine <[EMAIL PROTECTED]> wrote: [snip] I'll try the update() again. I would want to use that on the canvas itself right? Not the root window? Well, in fact, there is no difference at all... In tcl/tk, update is a function, and isn't applied to a particul

Re: Simple TK Question - refreshing the canvas when not in focus

2008-04-30 Thread Eric Brunel
On Wed, 30 Apr 2008 10:58:06 +0200, Robert.Spilleboudt <[EMAIL PROTECTED]> wrote: blaine wrote: Hey everyone! I'm not very good with Tk, and I am using a very simple canvas to draw some pictures (this relates to that nokia screen emulator I had a post about a few days ago). Anyway, all is

Re: Simple TK Question - refreshing the canvas when not in focus

2008-05-02 Thread Eric Brunel
On Wed, 30 Apr 2008 20:19:32 +0200, blaine <[EMAIL PROTECTED]> wrote: On Apr 30, 10:41 am, Peter Otten <[EMAIL PROTECTED]> wrote: blaine wrote: > Still doesn't work. I'm looking into using wx instead... > This is the full code - does it work for anyone else? Just do a echo > 'line 0 0 10 10'

Surprising difference in behavior between "import blah" and "from blah import thing"

2008-05-08 Thread Eric Hanchrow
(This is with Python 2.5.2, on Ubuntu Hardy, if it matters.) This seems so basic that I'm surprised that I didn't find anything about it in the FAQ. (Yes, I am fairly new to Python.) Here are three tiny files: mut.py import system from system import thing def doit():

Re: How can I add spaces where ever I have capital letters?

2008-05-08 Thread Eric Wertman
Something like this. I'm sure there are other ways to do it. import re def addspace(m) : return ' ' + m.group(0) strng = "ModeCommand" newstr = re.sub('[A-Z]',addspace,strng) print newstr.strip() On Thu, May 8, 2008 at 9:12 PM, John Schroeder <[EMAIL PROTECTED]> wrote: > I have a

Re: Fixed-length text file to database script

2008-08-14 Thread Eric Wertman
I have a machine (PLC) that is dumping its test results into a fixed- length text file. While it has nothing to do with python, I found that creating a MySQL table with the proper fixed length char() fields and using 'load data infile' was the easiest way to deal with that sort of scenario. T

Re: Fixed-length text file to database script

2008-08-14 Thread Eric Wertman
Sorry, didn't get to finish my script. Have to figure out the deal with gmail and the tab key someday. myfile = '/somewhere/somefile.txt' sizes = [16,4,8,8,8] fd = open(myfile,r) data = [] for line in fd.readlines() : a = [] idx1 = 0 for l in sizes : idx2 = idx1 + l

Re: a question about mysqldb

2008-08-14 Thread Eric Wertman
I also like to use escaped identifiers in cases like this: sql = "select tID,tNote from %s where %s = %%s" % ("tmp","tID") cursor.execute(sql,1) should work fine. -- http://mail.python.org/mailman/listinfo/python-list

Re: a question about mysqldb

2008-08-14 Thread Eric Wertman
Just to make sure I understand what you are showing me here: > columns = ('tID', 'tNote') > table_name = 'tmp' > sql = 'select %s from %s where tID=:1' % ( ', '.join(columns), table_name) > cursor.execute(sql, (1,)) > > # sql is now 'select tID, tNote from tmp where tID=:1' > # note the comma in a

Re: Vmware api

2008-08-17 Thread Eric Wertman
ng the ESX servers to get configuration and performance data, from external hosts. Thanks! Eric -- http://mail.python.org/mailman/listinfo/python-list

Re: like a "for loop" for a string

2008-08-17 Thread Eric Wertman
So what exactly does that do? Returns a generator, instead of a list? > I'm waiting for a str.xsplit still :-) > If I write and submit a C implementation of xsplit how many chances do > I have to see it included into Python? :-) > > Bye, > bearophile > -- > http://mail.python.org/mailman/listinf

Re: Python does not get environment variable when using cron.

2008-08-17 Thread Eric Wertman
I'm not sure about the environment variable, but os.uname() should give you what you need otherwise. -- http://mail.python.org/mailman/listinfo/python-list

Re: Vmware api

2008-08-18 Thread Eric Wertman
On Mon, Aug 18, 2008 at 8:50 AM, <[EMAIL PROTECTED]> wrote: > do the ESX server provide any api's or an interactive session may ? Yes, there's a seemingly very full-featured API, that's documented here: http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/index.html They ha

Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-19 Thread Eric Brunel
On Fri, 15 Aug 2008 20:02:36 +0200, Rafe <[EMAIL PROTECTED]> wrote: [snip] 1) 'Declaring' attributes - I always felt it was good code practice to declare attributes in a section of the class namespace. I set anything that is constant but anything variable is set again in __init__(): Class A(obj

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