Re: Python's import situation has driven me to the brink of imsanity

2016-02-06 Thread Kevin Conway
> My question is: is this crazy? Please tell me there's a better way and I just wasted my time creating this package. There is a better way and you have wasted your time creating this package. I hear your problem statement as asking two questions. The first is: What is the right way to include ex

Re: Python's import situation has driven me to the brink of imsanity

2016-02-07 Thread Kevin Conway
but how do > you develop it? Say you are working on a change that modifies both email.py > and reports.py. Do you run setup.py every time you make a change in > email.py? > > On Sunday, February 7, 2016 at 1:35:15 AM UTC-5, Kevin Conway wrote: > > > My question is: is thi

Re: asyncio - run coroutine in the background

2016-02-16 Thread Kevin Conway
If you're handling coroutines there is an asyncio facility for "background tasks". The ensure_future [1] will take a coroutine, attach it to a Task, and return a future to you that resolves when the coroutine is complete. The coroutine you schedule with that function will not cause your current cor

Re: asyncio - run coroutine in the background

2016-02-16 Thread Kevin Conway
ly harmful, but using them to achieve async networking when running asyncio is a definite code smell since that is precisely the problem asyncio is supposed to solve for. On Tue, Feb 16, 2016, 08:37 Frank Millman wrote: > "Marko Rauhamaa" wrote in message news:87d1rwpwo2@elek

Re: asyncio - run coroutine in the background

2016-02-20 Thread Kevin Conway
> getaddrinfo is a notorious pain but I think it's just a library issue; an async version should be possible in principle. How does Twisted handle it? Does it have a version? I think we're a little outside the scope of OP's question at this point, but for the sake of answering this: There are a

Re: OS X Menubar in Tkinter

2014-10-23 Thread Kevin Walzer
rly braces than this kind of constant policing of folks who come to us via Google: they greatly increase the noise I have to filter out. -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

Re: GUI toolkit(s) status

2014-11-21 Thread Kevin Walzer
Objective-C for legacy codebases, but that is a smaller hurdle to clear. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

Re: GUI toolkit(s) status

2014-11-21 Thread Kevin Walzer
nding of choice for other scripting languages. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

Re: GUI toolkit(s) status

2014-11-22 Thread Kevin Walzer
runs on Windows and X11/Linux--no native Mac Port. And it hasn't been updated in years, it does not take advantage of recent advances in Tk. -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

Insert variable into text search string

2014-02-19 Thread Kevin Glover
These two lines are from a program that carries out a phrase search of Wikipedia and returns the total number of times that the specific phrase occurs. It is essential that the search contains an apostrophe: results = w.search("\"of the cat's\"", type=ALL, start=1, count=1) print results.total

Re: Insert variable into text search string

2014-02-19 Thread Kevin Glover
Thank you both so much. I had tried % but not successfully. -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: This Swift thing

2014-06-03 Thread Kevin Walzer
On 6/3/14, 4:43 PM, Sturla Molden wrote: Are Python apps still banned from AppStore, even if we bundle an interpreter? Python apps are not banned from the App Store. See https://itunes.apple.com/us/app/quickwho/id419483981?mt=12. -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http

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

2013-08-03 Thread Kevin Walzer
On 8/1/13 10:15 AM, Gilles wrote: I already have a static IP, so the issue is more that remote MTAs might not accept connections from MTAs running on users' PC instead of ISP's. For what it's worth, that hasn't been my experience. -- Kevin Walzer Code by Kevin/Mobil

Re: Minions are Python Powered!

2013-08-04 Thread Kevin MacPhail
This statement might be more true than you realize. I can't speak for the tools Blue Sky uses for their films, but when the studio I worked at created the "Minion Mayem" ride for Universal Orlando we used a number of tools that relied heavily on Python for everything from character rigging to rend

Re: Python GUI?

2013-09-13 Thread Kevin Walzer
platform-specific solutions but no cross-platform API) and HTML display (a few extensions but no standard widget set). I've stayed with Tkinter because it fits my brain the best. Old complaints about it being ugly or limited no longer hold water. --Kevin -- Kevin Walzer Code by Kevin/M

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-17 Thread Kevin Walzer
culture that pervades so much of tech. A bit off-topic perhaps, for which I apologize, but I've been following the whole "sexism in tech" subject with increasing disgust and dismay, and I wanted to strongly protest against it. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-17 Thread Kevin Walzer
On 10/17/13 6:11 PM, Chris Angelico wrote: On Fri, Oct 18, 2013 at 8:50 AM, Kevin Walzer wrote: I've worked in marketing, editing, technical writing, and development, and at no place I have ever worked would such behavior be greeted with anything but immediate termination. That'

Re: Screenshots in Mac OS X

2013-10-22 Thread Kevin Walzer
On 10/22/13 4:15 PM, Pratik Mehta wrote: Anyone there to help me out??? import os os.system('screencapture', 'foo.png') -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Screenshots in Mac OS X

2013-10-22 Thread Kevin Walzer
On 10/22/13 6:08 PM, Kevin Walzer wrote: On 10/22/13 4:15 PM, Pratik Mehta wrote: Anyone there to help me out??? import os os.system('screencapture', 'foo.png') ...and see 'man screencapture' for options. I leave setting up a Tkinter GUI with proper key bi

Re: Screenshots in Mac OS X

2013-10-22 Thread Kevin Walzer
On 10/22/13 8:19 PM, Pratik Mehta wrote: Hey Kevin, Thanks for reverting. I know about the "screencapture" function and the parameters available. But, how would I take the user input, as in, that is just command-line, as soon as I execute the program, it will take whatever kind of

Re: Will Python 3.x ever become the actual standard?

2013-10-23 Thread Kevin Walzer
upside to it for my apps. As long as 2.7 is supported, I'll probably continue to use it. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

stdout of child process as an input of another thread in Python?

2015-05-29 Thread Kevin Peterson
;],stdout=PIPE) while True: Line = Proc.stdout.readline() print Line Here, Filename.py(Child process) is continuously printing "Hello World!!" in place of reading stdout of child process. Thanks, Kevin Peterson -- https://mail.python.org/mailman/listinfo/python-list

Re: beginners choice: wx or tk?

2015-07-11 Thread Kevin Walzer
were misinformed. Tkinter has worked fine with Tk 8.6 for a long time. The issues with Tk on the Mac, owing to Apple's force migration of GUI libraries to Cocoa, have finally been more or less resolved, and Tk 8.6.4 is now quite stable on OS X. --Kevin -- Kevin Walzer Code by Kevin/Mobile Cod

How we can send mail with attachment in Python?

2015-07-19 Thread Kevin Peterson
Hi, How we can send mail with attachment in Python? Is it any prerequisite for it? Thanks, Kevin Peterson -- https://mail.python.org/mailman/listinfo/python-list

Re: Which GUI?

2015-07-25 Thread Kevin Walzer
someone will chime in with a diatribe against Google groups...wait for it...wait for it... To address the OP's query, I recommend Tkinter. Plays very nicely with C and C++. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftwar

Re: pyinstaller and Python 3.5 on Windows?

2015-11-19 Thread Kevin Walzer
y2exe) haven't yet caught up. Consider filing a bug with the pyinstaller developers. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Event handling for COM object with win32com (pywin32)

2014-06-22 Thread Kevin Walzer
On 6/22/14, 5:15 AM, peter.balazo...@emspin.com wrote: Do I miss something in code or incorrectly handling the events or COM Object? There is a pywin32 mailing list that may be able to offer more help here. -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-06-25 Thread Kevin Walzer
On 6/25/14, 1:49 AM, wxjmfa...@gmail.com wrote: I can also add, tcl or tk or tkinter (8.6) is on Windows quite buggy. In fact, simply*unusable*. How so? Please report bugs at http://core.tcl.tk/tcl/reportlist or http://core.tcl.tk/tk/reportlist, as needed. --Kevin -- Kevin Walzer Code by

Re: Python 3 is killing Python

2014-07-15 Thread Kevin Walzer
to say that Python 3 is killing Python. Python will survive. But the headaches of migration are substantial, and should not be necessary. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 is killing Python

2014-07-15 Thread Kevin Walzer
ettiquette says that it's gauche to do this, because it presents an unacceptable cognitive burden to the user trying to catch the context of the thread by forcing them to read your reply first, before they read the preceding quoted comments. --Kevin -- Kevin Walzer Code by K

Re: Python 3 is killing Python

2014-07-15 Thread Kevin Walzer
On 7/15/14, 6:38 PM, Mark Lawrence wrote: I did see your correction but it gave me an opportunity to mention google groups, something that just can't be missed If the newgroup had a filter to trim out complaints about Google groups, half the traffic would be gone. :-) -- Kevin W

Re: Mac python py2app problem

2014-07-15 Thread Kevin Walzer
for mac with py2exe? It's hard to make sense of what you are asking for. Can you just zip up the app bundle that py2app produces and upload it that way? That works for many developers. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com

Re: .Net Like Gui Builder for Python?

2014-07-27 Thread Kevin Walzer
isual Studio or having features like Visual Studio for Python. Thank You! I'm not sure which GUI framework you use, but Tkinter is so simple to code in directly that you don't really need a UI builder. Give that a try. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http:/

Re: Tcl/Tk alpha channel bug on OSX Mavericks is fixeded, but how/when can I use the fix?

2014-08-03 Thread Kevin Walzer
ctions for upgrading. Hope this helps, Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 is killing Python

2014-08-03 Thread Kevin Walzer
I'm sure you have the skill set to put together some patches that address specific points of pain for you. And despite the disagreement that others may register with you in these threads from time to time, I'm quite confident that useful patches will be gratefully accepted, even i

Re: Tcl/Tk alpha channel bug on OSX Mavericks is fixeded, but how/when can I use the fix?

2014-08-04 Thread Kevin Walzer
On 8/4/14, 5:40 AM, Peter Tomcsanyi wrote: "Kevin Walzer" wrote in message news:lrmc0r$suj$1...@dont-email.me... New releases of Tcl/Tk 8.5 and 8.6 are due out soon; right now they are undergoing final testing as betas/release candidates. Thanks for the promising news. Where sho

Re: Will IronPython / WPF work on Mac OS X?

2014-08-04 Thread Kevin Walzer
, I believe...doesn't it run on top of .NET? I don't see how it would work on the Mac unless it also worked with Mono. -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-10-01 Thread Kevin Walzer
tion here is to build Python and Tcl/Tk yourself, in the versions you want, and then things should work just fine. -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-10-03 Thread Kevin Walzer
stubs? A Tcl library compiled for 8.5 can be loaded into 8.6 with no re-compiling required because of stubs. -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

Python bug in Windows 8--report now, or later?

2011-09-17 Thread Kevin Walzer
I have been testing my Python application on the just-released developer preview of Windows 8 and have noted an error: the application does not create an app folder in the user's "application data" directory. This causes the app to crash on startup. Manually creating the directory solves the pr

Re: Python bug in Windows 8--report now, or later?

2011-09-20 Thread Kevin Walzer
On 9/20/11 8:32 AM, Alec Taylor wrote: I can confirm that os.mkdir('C:\\h') and os.path.exists('C:\\h') work on Windows 8 Dev x64. OK--looks like I will need to do a bit more digging into my own code. Thanks for clarifying. -- Kevin Walzer Code by Kevin http://www.cod

getattr and method name

2011-10-02 Thread Kevin Walzer
m the pipe: /bin/sh: bound: No such file or directory I am not sure what in my application is causing this kind of breakage, as earlier versions of the app ran fine with similar code on earlier versions on the OS. Is this the correct way to structure this kind of functionality, or am I be

Re: getattr and method name

2011-10-02 Thread Kevin Walzer
Turns out the error was a typo in the actual method being called...*faceinhands* Sorry for the noise. -- Kevin Walzer Code by Kevin http://www.codebykevin.com -- http://mail.python.org/mailman/listinfo/python-list

Re: ttk Listbox

2011-10-31 Thread Kevin Walzer
f the themed ttk widgets. The ttk::treview is, and that can be set up as a single-column list display. There may be an example of how to do this in the docs or source code tree (I don't use the widget myself so I don't have any sample code to share). --Kevin -- Kevin Walzer Cod

Re: ttk Listbox

2011-10-31 Thread Kevin Walzer
On 10/31/11 4:03 PM, Ric@rdo wrote: On Mon, 31 Oct 2011 10:00:22 -0400, Kevin Walzer wrote: On 10/31/11 12:37 AM, Ric@rdo wrote: What would be an equivalent widget in ttk like a Listbox and if possible a small example? I tried to look here http://docs.python.org/library/ttk.html but did not

Re: Learning Python 2.4

2011-12-21 Thread Kevin Walzer
On 12/20/11 7:31 PM, Rick Johnson wrote: Anything before Python 3.0 is now obsolete. We are currently at 3.2.2 for a stable release. 2.7 is still a supported production release of Python. It has not been end-of-lifed. -- Kevin Walzer Code by Kevin http://www.codebykevin.com -- http

Re: Is there a graphical GUI builder?

2013-02-20 Thread Kevin Walzer
developer uses anything but a text editor and console to develop a user interface. -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- http://mail.python.org/mailman/listinfo/python-list

Re: simple GUI environment

2013-03-05 Thread Kevin Walzer
ct is dead, especially if it's a simple and mature project that doesn't need a lot of maintenance. If your needs are basic, then I'd say EasyGUI would be a good fit. By contrast, a library undergoing heavy development with a constantly-shifting API can cause tons of headaches. --Ke

Matplotlib Slider Widget and changing colorbar threshold

2013-03-12 Thread kevin . khan27
I am currently trying to work on a program that will allow the user to display their dataset in the form of a colormap and through the use of sliders, it will also allow the user to adjust the threshold of the colormap and thus update the colormap accordingly. The best to describe this would be

Re: Drag and drop in Windows

2013-04-30 Thread Kevin Walzer
/TkinterDnD2-0.zip Hope this helps, Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Drag and drop in Windows

2013-04-30 Thread Kevin Walzer
Official link: http://tkinterdnd.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: ActivePython 3.2.2.3 is now available

2013-05-01 Thread Kevin Walzer
On 5/1/13 8:01 AM, Robert wrote: Will this be the last one? It has been two years. Hard to say. AS has been focusing on cloud-based stuff lately. ActivePerl hasn't been updated for a long time either. ActiveTcl is still maintained. --Kevin -- Kevin Walzer Code by Kevin/Mobile Co

Re: PyQt on Mac OS X

2005-12-13 Thread Kevin Walzer
Michael McGarry wrote: > Hi, > > I am using the default Python installation that comes with Mac OS X > Tiger. I want to use the Qt module. How can I install the Qt module? > > Qt is already installed. > > Michael > See http://sourceforge.net/projects/pyqt-mac -- http://mail.python.org/mailman

Re: Visual Python, really "Visual"?

2005-12-14 Thread Kevin Walzer
probably the one that ships with Komodo Pro from ActiveState. All of the open-source Tk GUI builders that I have tried over the years are difficult to use, unmaintained, or both. It's just simpler to write Tk by hand. -- Cheers, Kevin Walzer, PhD WordTech Software - "Tame the Terminal" http://www.wordtech-software.com sw at wordtech-software.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python packages on OS X vs Windows

2005-12-15 Thread Kevin Walzer
specifically the lack of a really good native IDE (which has been solved with the release of Komodo for OS X) and in trying to choose a GUI toolkit--but getting it installed and configured properly is not among the problems I've encountered. -- Cheers, Kevin Walzer, PhD WordTech Software

Re: Python packages on OS X vs Windows

2005-12-15 Thread Kevin Walzer
Re: package installers: I misspoke. The address for them is http://pythonmac.org/packages/ -- Cheers, Kevin Walzer, PhD WordTech Software - "Tame the Terminal" http://www.wordtech-software.com sw at wordtech-software.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Swig-Mingw-DistUtil Extension - Entry Point Not Found?

2005-12-15 Thread kevin . dahlhausen
I was able to build a working extension module under 2.4 / cygwin-mingw by declaring the following: short ** _imp___ctype = 0; ( I put it at the top of my swig .i file ). This potentially dangerous tip is from: http://www.nabble.com/msvcr71-t336430.html -- http://mail.python.org/mailman/listin

how to remove duplicated elements in a list?

2005-12-18 Thread Kevin Yuan
How to remove duplicated elements in a list? eg. [1,2,3,1,2,3,1,2,1,2,1,3] -> [1,2,3]?Thanks!! -- http://mail.python.org/mailman/listinfo/python-list

Re: i need your help

2005-12-19 Thread Kevin Yuan
You may use IDLE in the Start menu2005/12/19, Steve Holden <[EMAIL PROTECTED]>: emrah gün wrote:>> hi.i dont know it is true or not to write you about that.I ve problem to> run phyton in my personal computer.I install it and there is no error> when installing but when i want to run pythonw.exe, no

Re: how to remove duplicated elements in a list?

2005-12-19 Thread Kevin Yuan
2005/12/19, Brian van den Broek <[EMAIL PROTECTED]>: [EMAIL PROTECTED] said unto the world upon 2005-12-19 02:27:> Steve Holden wrote:>>>Kevin Yuan wrote:>>>>>How to remove duplicated elements in a list? eg. >>>[1,2,3,1,2,3,1,2,1,2,1,3] -

Re: Testing the availability of a module

2005-12-19 Thread Kevin Yuan
2005/12/19, Bo Peng <[EMAIL PROTECTED]>: Dear list,Is there a better way than doingtry:   import aModuleexcept:   has_aModule = Falseelse:   has_aModule = TrueThe main concern here is that loading aModule is unnecessary (and may take time).If loading aModule is unnecessary, the best way is not load

Re: modify a long-running python script while it is running?

2005-12-19 Thread Kevin Yuan
2005/12/20, Mike Meyer <[EMAIL PROTECTED]>: Benjamin Rutt <[EMAIL PROTECTED]> writes:> I suppose this question could be reformatted as "does CPython read the> entire script file into memory and then close the file before > executing the script, making it safe for me to modify the script after> I kn

Re: What is unique about Python?

2005-12-19 Thread Kevin Yuan
2005/12/20, Murtog (sent by Nabble.com) <[EMAIL PROTECTED]>: I would say to your teacher that Python is one of the few languagens that are fun to program with. It realy is! I have to say it although I have used it for only 3 days!  -- http://mail.python.org/mailman/listinfo/python-list

Re: How to call function which is in one program ...

2005-12-20 Thread Kevin Yuan
19 Dec 2005 23:56:04 -0800, Shahriar Shamil Uulu <[EMAIL PROTECTED]>: Dear All,i got another questions. For example i have two programs in pythonlike: first.py, second.py.In first.py i have a function test() like:# first.py...def test(name):  print name so other functions==

Re: How to call function which is in one program ...

2005-12-20 Thread Kevin Yuan
Another thing to remeber: Make sure the first.py and second.py are locateed in the same directory OR the path of first.py is in *sys.path*. Otherwise you'll get an exception. 2005/12/20, Fredrik Lundh < [EMAIL PROTECTED]>:"Shahriar Shamil Uulu" wrote: > i got another questions. For example i have t

How to get the path of current running python script?

2005-12-20 Thread Kevin Yuan
I tried the following  getFilePath = lambda name: os.path.normpath('%s\\%s' % (sys.modules[name].prefix, sys.modules[name].__name__)) getFilePath('__main__')Traceback (most recent call last):   File "", line 1, in ?  File "", line 1, in AttributeError: 'module' object has no attribute 'pr

Re: How to get the path of current running python script?

2005-12-20 Thread Kevin Yuan
Oh, my god! I forgot that python is written in C!int main(int argc, char* argv[]){     printf(argv[0]);    return 0; }*argv[0]* also woks here!!:) :) :)Thank you very much!!2005/12/20, Tim Williams (gmail) <[EMAIL PROTECTED]>: On 20/12/05, Kevin Yuan <[EMAIL PROTECTED]> wrote:

Re: modify a long-running python script while it is running?

2005-12-20 Thread Kevin Yuan
2005/12/20, Peter Hansen <[EMAIL PROTECTED]>: Kevin Yuan wrote:> I have a silly question: Can  *VERY*  large script cause memory overflow> if python load all the entire script file into memory?If you have a script that is literally larger than memory, then what else would happen but

Re: Please enlighten me about PyPy

2005-12-21 Thread Kevin Yuan
21 Dec 2005 19:33:20 -0800, Luis M. González <[EMAIL PROTECTED]>: ... ...This implementation requires a minimal core, writen in a restrictedsubset of python called "rpython". This subset avoids many of the mostdynamic aspects of python, making it easier to authomatically translate it to C through a

Re: Please enlighten me about PyPy

2005-12-22 Thread Kevin Yuan
2005/12/22, Steve Holden <[EMAIL PROTECTED]>: Fairly standard bootstrapping technique..Thanks, I get it.BTW I like the word "bootstrapping", very vivid, isn't it?:) -- http://mail.python.org/mailman/listinfo/python-list

Re: print UTF-8 file with BOM

2005-12-22 Thread Kevin Yuan
import codecsdef read_utf8_txt_file (filename):    fileObj = codecs.open( filename, "r", "utf-8" )    content = fileObj.read()    content = content[1:] #exclude BOM     print content     fileObj.close()    read_utf8_txt_file("e:\\u.txt")22 Dec 2005 18:12:28 -0800, [EMAIL PROTECTED] < [EMAIL PROTECT

Re: print UTF-8 file with BOM

2005-12-23 Thread Kevin Yuan
system, and try read a UTF-8 filethat save chinese. Regards, David2005/12/23, Kevin Yuan <[EMAIL PROTECTED]>:> import codecs> def read_utf8_txt_file (filename):> fileObj = codecs.open ( filename, "r", "utf-8" )> content = fileObj.read()

Re: Redirecting both stdout and stderr to the same file

2005-12-27 Thread Kevin Yuan
You should redirecte sys.stderr if you want to log error message.   saveout = sys.stdout   saveerr = sys.stderr   fsock = open('runtime.log', 'w')   sys.stdout = sys.stderr = fsock2005/12/28, Randy Kreuziger <[EMAIL PROTECTED]>: Can stdout and stderr be redirected to the same file?  I would li

ANN: OSCON 2006 Call for Proposals

2005-12-28 Thread Kevin Altis
OSCON 2006: Opening Innovation http://conferences.oreillynet.com/os2006/ Save the date for the 8th annual O'Reilly Open Source Convention, happening July 24-28, 2006 at the Oregon Convention Center in beautiful Portland, Oregon. Call For Participation -- Submit a proposal-f

Re: zip unzip?

2005-12-28 Thread Kevin Yuan
:)He/She certainly knows. Just reminds us of zip! :);):)2005/12/29, Fredrik Lundh <[EMAIL PROTECTED]>: KraftDiner wrote:> I have two lists...>> a=[1,2,3]> b=[4,5,6]>> n=0> for i in a:>print i, b[n]>n=n+1>> how can i have two iterators on my for loop? > rather than have to use the counter n?

Re: Python+tkinter errors on OSX

2006-01-11 Thread Kevin Walzer
Anyone here know how to diagnose and/or fix this? What's it trying > to tell me? I have a feeling that it's there somewhere, but the proverbial > ducks aren't lined up quite right. > > (Or maybe this isn't the right NG for such questions. If so, what might >

ANNOUNCE: OSCON 2006 (Python 14 Conference) Call for Proposals

2006-01-12 Thread Kevin Altis
OSCON 2006: Opening Innovation http://conferences.oreillynet.com/os2006/ Save the date for the 8th annual O'Reilly Open Source Convention, happening July 24-28, 2006 at the Oregon Convention Center in beautiful Portland, Oregon. Call For Participation -- Submit a proposal-f

pyKML: where to get it?

2006-07-17 Thread Bell, Kevin
When trying to download pyKML at sourceForge, it says "No File Packages Defined" ;( Does anyone know where I can get pyKML? TIA Kev. -- http://mail.python.org/mailman/listinfo/python-list

Google Earth contact? (OT, sort of...)

2006-07-17 Thread Bell, Kevin
Sorry if this is an off topic shot in the dark, but... Does anyone know a contact for anyone that works for Google Earth? I wanted to shoot 'em an email about a possible enhancement, but they're smart enough to not leave contact info ANYWHERE on their websites. -- http://mail.python.org/mailma

Re: No need to close file?

2006-07-18 Thread Kevin Watters
There's always the new 'with' statement in Python 2.5. So instead of > f = open('foo', 'r') > try: >for line in f: > print line > finally: >f.close() > ...you do: with open('foo','r') as f: for line in f: print line It's at least a little bit cleaner, and it will clos

Re: Number combinations

2006-07-19 Thread Kevin Watters
How about print ["%04d" % x for x in xrange(1)] -- http://mail.python.org/mailman/listinfo/python-list

Problem with cx_freeze / FreezePython

2006-07-20 Thread Kevin Walzer
I am trying to build a simple "hello.py" script with cx_freeze, but am not having any luck. Every time I run the FreezePython utility I get this error message: Traceback (most recent call last): File "/Users/kevin/Desktop/cx_Freeze-3.0.2/initscripts/ConsoleKeepPath.py", li

Re: Newbie Q: Class Privacy (or lack of)

2006-07-24 Thread Kevin Watters
See: http://redhanded.hobix.com/inspect/monkeypytching.html Shouldn't be done unless you have a really cool reason for doing so. -- http://mail.python.org/mailman/listinfo/python-list

Tkinter questions

2006-07-28 Thread Kevin Walzer
tree widget, as well as wrappers for BWidgets and tktreectrl. Rather than wade through every one of these different widgets, I'd like to get a sense of which ones are actually used in applications and why. Thanks for any advice. -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -- ht

Re: Class data being zapped by method

2006-08-08 Thread Kevin M
Figures. I'll try to complicate it sufficiently ;) [edit] I was going to try to sum up what goes on, but I realized that I was retyping what I already programmed in an effort to better illustrate exactly what I'm doing. Pastebin it is. Don't fear, it's only around 200 lines total. Class file --

Re: Class data being zapped by method

2006-08-08 Thread Kevin M
Inline > 1.) Why are you removing the .pyc file? After I had run the script once and subsequently changed the class file, I would run the script again, and it would use the pyc file from the older revision of the script. I got frustrated with having to manually delete the pyc file before rerunnin

Re: Class data being zapped by method

2006-08-09 Thread Kevin M
Good news. I've fixed it up and all seems to be well. Thanks, all. I've learned a lot from this :) John Machin wrote: > Kevin M wrote: > > Inline > > > > > 1.) Why are you removing the .pyc file? > > > > After I had run the script once and subseq

seeking the "Hello World" of Packages

2006-08-11 Thread Bell, Kevin
I'm trying to get an idea of how packages work and I've read about it in the Py Tutorial and Nutshell, but I'm still craving a concrete example that I can poke through. Does anyone have a really basic package that does very little that I could look at? What I've gathered thus far is that a packag

Re: trying to reach kevin smith, author of plastex

2006-08-16 Thread Kevin Smith
On 2006-08-15 15:28:36 -0400, "metaperl" <[EMAIL PROTECTED]> said: > Email to Kevin Smith regarding his plastex package failed. I hope he > read this group. The tarball that he needs to reproduce the error is > here: > http://arc.livingcosmos.org/wolfram-fruit2/wolfra

Re: SPE for 2.5?

2006-10-13 Thread Kevin Walzer
es last fall, the developer announced that he was forming some kind of unified IDE project that would bridge platforms and GUI toolkits, and then the releases stopped. February is the last month anything new appeared, as far as I know. -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -- htt

Newbie: datetime conversion question

2006-10-17 Thread kevin evans
Hi, I'm trying to convert some code from Ruby to Python, specifically.. timestamp = "%08x" % Time.now.to_i Make a hex version of the current timestamp. Any ideas how best to do this in python gratefully received.. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: datetime conversion question

2006-10-17 Thread kevin evans
Great stuff - many thanks hg wrote: > Carsten Haese wrote: > > On Tue, 2006-10-17 at 08:49, hg wrote: > >> import time > >> "%08X"% (int)(time.mktime(time.localtime())) > > > > Have you not had your coffee yet or are you trying to win an obfuscated > > python programming competition? ;) > > > >

Tkinter--does anyone use it for sophisticated GUI development?

2006-10-19 Thread Kevin Walzer
I'm a Tcl/Tk developer who has been working, slowly, at learning Python, in part because Python has better support for certain kinds of applications that I want to develop than Tcl/Tk does. Naturally, I thought that I would use Tkinter as the GUI for these programs. However, in doing research into

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-20 Thread Kevin Walzer
James Stroud wrote: > Also, look at my modest program at passerby.sf.net. > Not so sophisticated, but not completely simple either. > I did look at passerby--a nice app, and in a native Mac OS X version also! (I'm a Mac developer.) Thanks for the pointer. -- Kevin Walzer Po

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-20 Thread Kevin Walzer
page is focused on Tcl/Tk apps using the Tile extension, but many of these apps also use extensions like Tablelist and Tktreectrl. I haven't seen any shiny screenshots of Python apps using these extensions yet. Another example, that doesn't use Tile, is PgAccess: http://www.pgaccess.org/

Re: pywin32 COM sort in Excel (late binding fails, early binding works) (+py2exe)

2006-10-20 Thread Kevin Grover
On Oct 19, 10:09 am, Thomas Heller <[EMAIL PROTECTED]> wrote: > Thomas- Hide quoted text -- Show quoted text - That's it thanks. A quick google search lead me to: http://www.py2exe.org/index.cgi/IncludingTypelibs Cheers - Kevin -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-21 Thread Kevin Walzer
sturlamolden wrote: > Christophe wrote: > >> Nobody mentionned it, but I think you should try PyQT and PyGTK before >> wxPython. Myself, I do not like wx : it looks too much like the MFC. >> >> PyGTK is good, but GTK doesn't work that well on windows. > > GTK and PyGTK works well on Windows now.

Re: python GUIs comparison (want)

2006-10-24 Thread Kevin Walzer
yment is expensive; free deployment must be GPL; smaller development and user community than wxPython PyGtk: Pro: Sophisticated GUI's, cross-platform (Linux and Win32); very popular on some platforms; active development community Con: Not native on OS X -- Kevin Walzer Code by Kevin http://ww

Re: python GUIs comparison (want)

2006-10-24 Thread Kevin Walzer
Christophe wrote: > Since when is "based on C++ toolkit" a con? > If you don't know C++ (as is the case with me), then it's difficult to do a C++-to-Python translation in looking at code examples. -- Kevin Walzer Code by Kevin http://www.codebykevin.com -- http

Re: python GUIs comparison (want)

2006-10-24 Thread Kevin Walzer
Christophe wrote: > Kevin Walzer a écrit : >> Christophe wrote: >> >>> Since when is "based on C++ toolkit" a con? >>> >> >> If you don't know C++ (as is the case with me), then it's difficult to >> do a C++-to-Python transla

<    1   2   3   4   5   6   7   8   >