Re: Tkinter: The good, the bad, and the ugly!

2011-01-21 Thread Michael Torrie
On 01/20/2011 11:17 AM, Emile van Sebille wrote: > The problem with QT is the license. PyQT indeed is licensed poorly for anything that's not GPL. But Qt itself is dual-licensed under GPL and the LGPL, as of version 4.6 I think. The LGPL license would seem to be quite acceptable even for commerc

Re: WxPython versus Tkinter.

2011-01-25 Thread Michael Torrie
On Sun, 23 Jan 2011 09:21:57 -0800, rantingrick wrote: > Wait a minute, i am confused? What language is Python written in? Oh > thats right Lisp! I am so dumb. How did i even get this job? :-) What job is this? Inquiring minds wish to know. -- http://mail.python.org/mailman/listinfo/python-list

Re: WxPython versus Tkinter.

2011-01-25 Thread Michael Torrie
On 01/23/2011 02:11 PM, Littlefield, Tyler wrote: > I hardly think that your tone, attitude and arguments are going to help > you in your battle to prove that WXPython is superior to anything at > all, if you can't manage to provide cross-platform bug-free code. Sadly you're wasting your breath

Re: How to create an entry in the "Program menu" of Windows?

2011-02-01 Thread Michael Torrie
On 02/01/2011 02:43 PM, Diesel wrote: > I'd like to add menu entry in the Program Menu as part of the > installation of an application. Is it possible to do that from Python? > > Any examples or link? I have not been able to find anything with > google... Use an installer program like nsis to cr

Re: IDLE: A cornicopia of mediocrity and obfuscation.

2011-02-01 Thread Michael Torrie
On 02/01/2011 08:26 AM, Noah Hall wrote: > On Tue, Feb 1, 2011 at 3:14 PM, rantingrick wrote: >> #-- Embedded Trolls and Minions --# > These people, including myself, aren't trolls nor minions. They just > don't agree with you. I strongly disagree with rr and find him to be an egotistical troll w

Re: How to use Python well?

2011-02-17 Thread Michael Torrie
On 02/16/2011 04:00 PM, Steven D'Aprano wrote: > You should read about bottom-up and top-down programming. You'll probably > end up doing some of both, but mostly top-down. Most of my development is done by designing top-down and then coding bottom-up. Coding top down is fine, but I'd expect to

Re: Newbie getting desperate with for

2011-02-18 Thread Michael Torrie
On 02/17/2011 04:10 PM, Werner wrote: > It is meant to put load on a CPU, RAM and disk (swap). The code now > looks like this: > #!/usr/bin/python > while True: > i = 0 > for i in range(2000): > break Just for your information, your code is the equivalent of: while True: t

Re: Newbie getting desperate with for

2011-02-18 Thread Michael Torrie
On 02/17/2011 09:15 PM, Larry Hudson wrote: > A true time waster indeed -- it's an infinite loop that will _never_ end. > > Others have already about the need of the shebang line to run as a python > script, but I'm > surprised no one mentioned how truly useless this code is. > > The i = 0 line

Re: Getting Local MAC Address

2010-04-04 Thread Michael Torrie
On 04/02/2010 04:01 PM, Dan McLeran wrote: > which is why my OP stated the solution was for windows: > > "for windows parse > p.stdout.read():" Gotcha. Definitely missed that! -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommend Commercial graphing library

2010-04-06 Thread Michael Torrie
On 04/06/2010 10:05 AM, AlienBaby wrote: > The requirement for a commercial license comes down to being > restricted to not using any open source code. If it's an open source > license it can't be used in our context. Python itself and all its standard libraries are open source, under the PSF lice

Re: python as pen and paper substitute

2010-04-07 Thread Michael Torrie
On 04/06/2010 12:40 PM, Manuel Graune wrote: > Hello everyone, > > I am looking for ways to use a python file as a substitute for simple > pen and paper calculations. At the moment I mainly use a combination > of triple-quoted strings, exec and print (Yes, I know it's not exactly > elegant). Thi

Re: python as pen and paper substitute

2010-04-09 Thread Michael Torrie
On 04/08/2010 02:54 PM, Manuel Graune wrote: > > Well, the subject does say python and not elisp, but I'm a vim-user > anyways. Did you look at the link to Owen Taylor's reinteract program? I think it's closer to what you want than any other thing mentioned here, with the exception that it's a

Re: Add a method to a gtk class?

2010-04-29 Thread Michael Torrie
On 04/29/2010 10:03 AM, Wolfnoliir wrote: > On 29/04/2010 17:03, Joe Riopel wrote: >> On Thu, Apr 29, 2010 at 11:43 AM, Wolfnoliir wrote: >>> I would like to add a method to the gtk.TextBuffer class to save a text >>> buffer to a file, but I get an error: >> >> I don't know gtk, but can you inheri

Re: Python vs. Fedora and CentOS

2010-06-01 Thread Michael Torrie
On 05/31/2010 05:13 AM, Jason D wrote: > There is however never been an issue to locate different version of python > in your system as you deem fit without problems. > So I dont understand why your concern. Actually, replacing python on RHEL is a major endeavor. Almost all Red Hat utilities ar

Re: Python vs. Fedora and CentOS

2010-06-01 Thread Michael Torrie
On 06/01/2010 05:01 AM, Adam Tauno Williams wrote: > Yes, we install Python 2.6 on CentOS and run a production app on it - no > problems. > > rpm -Uvh > http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1-4.ius.el5.noarch.rpm > > yum -y install python26 python26-setuptools Than

Re: Python Forum

2010-06-04 Thread Michael Torrie
On 06/03/2010 04:15 AM, Adam Tauno Williams wrote: > The best solution I've seen is what is used by the Mono project; > which provides both a "web forum" and a mail list interface. > > > I just checked the archives

Re: GUIs - A Modest Proposal

2010-06-05 Thread Michael Torrie
On 06/05/2010 08:22 PM, ant wrote: > WxPython and PyGtk are both powerful, but quirky in different ways. > PyQt is tied to one platform. And there are dozens more. In what way is PyQt (or the new PySide bindings) tied to one platform? PyQt is "native" on Win32, Mac, and Linux. Would your univers

Re: GUIs - A Modest Proposal

2010-06-07 Thread Michael Torrie
On 06/06/2010 02:13 AM, Gabriele Lanaro wrote: > I'd really like to s/tkinter/WxWidgets/g, the multiplatformness is (almost) > the same but wx looks infinitely better. IMHO a good intention is to best > the API of wx. Does WX still do weird things like use event message maps instead of a sane sign

Re: GUIs - A Modest Proposal

2010-06-07 Thread Michael Torrie
On 06/06/2010 04:55 PM, ant wrote: > What an interesting set of responses I got! > And - even more interesting - how few of them actually seem to think > there is a problem, let > alone make any attempt to move the situation forward. You simply haven't made a case that there is a problem to be sol

Re: GUIs - A Modest Proposal

2010-06-07 Thread Michael Torrie
On 06/07/2010 09:19 PM, rantingrick wrote: > On Jun 7, 5:05 pm, Michael Torrie wrote: > >> Thus for Python to really be successful in a broader sense, we need >> good, solid, bindings for Cocoa, or Windows forms (whatever they are >> using these days), as well as

Re: GUIs - A Modest Proposal

2010-06-13 Thread Michael Torrie
On 06/13/2010 05:29 AM, lkcl wrote: > really? drat. i could have done with knowing that at the time. > hmmm, perhaps i will return to the pyqt4 port after all. We're now wandering well off-topic here, but then again this thread was never really on any particular topic. I have to say I'm really

Re: Community (A Modest Proposal)

2010-06-15 Thread Michael Torrie
On 06/15/2010 01:30 AM, Steven D'Aprano wrote: > I know that lots of people swear by IDEs, and back in Ancient Days I used > to use the THINK Pascal IDE on a Macintosh so I'm not hostile to the > idea. But in those days you could only run one app at a time, so you > needed an IDE or you'd go ins

Re: basic doubt

2010-06-16 Thread Michael Torrie
On 06/16/2010 11:06 PM, madhuri vio wrote: > def h(self,event): > handle = open("myco.fasta","r") > for seq_record in SeqIO.parse(handle, "fasta"): > messenger_rna = coding_myco.fasta.transcribe() > han1 = open("mycorna.fasta","wU") > han1.close() > retur

Re: Python 2.4.4 Tkinter GUI Example for Modeless Dialog with Menu, Edit, List, Buttons, File Save etc.

2010-06-16 Thread Michael Torrie
On 06/16/2010 04:05 PM, My Python wrote: > I would like to see some substantial example of an App written for a > Modeless Dialog (fixed size, non resizable window) (If you have used > WIndows MFC or Visual Basic you all know how elegant it is) What is elegant about a fixed-size, non-re-sizable w

Re: Python 2.4.4 Tkinter GUI Example for Modeless Dialog with Menu, Edit, List, Buttons, File Save etc.

2010-06-16 Thread Michael Torrie
On 06/17/2010 12:50 AM, Michael Torrie wrote: > On 06/16/2010 04:05 PM, My Python wrote: >> I would like to see some substantial example of an App written for a >> Modeless Dialog (fixed size, non resizable window) > > Tk? PyQt? PyGTK? wxPython? Nevermind that question. Yo

Re: scraping from bundes-telefonbuch.de with python

2010-06-19 Thread Michael Torrie
On 06/19/2010 04:23 AM, davidgp wrote: > opener = urllib2.build_opener() > opener.addheaders = [('User-Agent', 'Mozilla/5.0 (compatible; > Konqueror/3.5; Linux) KHTML/3.5.4 (like Gecko)')] > urllib2.install_opener(opener) > > data = urllib.urlencode({'F0': 'mySearchKeyword','B': 'T','F8': 'A || >

Re: How to send a non-standard IMAP command?

2010-06-24 Thread Michael Torrie
On 06/24/2010 03:47 AM, Xianwen Chen wrote: > . This is what I'm now working for. I tried: > > IMAP4.xatom('','ID ("GUID" "1")','',) > > and > > dest_srv.xatom('ID ("GUID" "1")') > > , but I got error messages. Any hint please? What error messages? -- http://mail.python.org/mailman/listinfo/p

Re: How to send a non-standard IMAP command?

2010-06-24 Thread Michael Torrie
On 06/24/2010 03:47 AM, Xianwen Chen wrote: > , but I got error messages. Any hint please? Why not just use a proxy server: http://sourceforge.net/projects/imapidproxy/ -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-26 Thread Michael Torrie
On 06/25/2010 04:15 PM, Emile van Sebille wrote: > Idle is dead -- long live idlefork! > > http://osdir.com/ml/python.idle/2002-09/msg00105.html Actually idlefork is dead. It was merged back into Idle sometime around Python 2.3. At least that's what its homepage claims. -- http://mail.python.o

Re: Python as a scripting language. Alternative to bash script?

2010-06-28 Thread Michael Torrie
On 06/28/2010 05:48 AM, Dave Pawson wrote: > Main queries are: Ease of calling out to bash to use something like > imageMagick or Java? Ease of grabbing return parameters? E.g. convert > can return both height and width of an image. Can this be returned to > the Python program? Can Python access th

Re: Python as a scripting language. Alternative to bash script?

2010-06-28 Thread Michael Torrie
On 06/28/2010 12:05 PM, Dave Pawson wrote: > On 28 June 2010 18:39, Michael Torrie wrote: > >> Sure. I've created a module called runcmd that does 90% of what I >> want (easy access to stdout, stderr, error code). I've attached >> it to this e-mail. Feel

Re: Python dynamic attribute creation

2010-06-28 Thread Michael Torrie
On 06/25/2010 09:39 PM, WANG Cong wrote: > Thanks, I have to admit that I know nothing about Smalltalk. If you know nothing about Smalltalk then you really aren't in a position to talk about what is and is not OOP. Smalltalk is one of the original OOP languages and purists define OOP as the model

Re: Python dynamic attribute creation

2010-06-28 Thread Michael Torrie
On 06/27/2010 11:58 PM, Stephen Hansen wrote: > To say you can't really know "much about" OOP without knowing "much > about" Smalltalk seems basically, well, wrong. True. But you can't really criticize a language's implementation of OOP without a good understanding of the "pure" OO language. Fo

Re: Python dynamic attribute creation

2010-06-28 Thread Michael Torrie
On 06/28/2010 02:31 PM, Aahz wrote: > In article , > Michael Torrie wrote: >> True. But you can't really criticize a language's implementation of OOP >> without a good understanding of the "pure" OO language. For example, in >> Smalltalk If/The

Re: Python as a scripting language. Alternative to bash script?

2010-06-28 Thread Michael Torrie
On 06/28/2010 02:06 PM, Mithrandir wrote: > I can't see Python as an alt. to bash. (As I recall) Python is much more > object-oriented than bash, but also there are many commands (such as apt- > get, etc.) that would need Python equivs. However, I can see Python being > used as a scripting alt. t

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 06:25 PM, Lawrence D'Oliveiro wrote: > I have yet to find an architecture or C compiler where it DOESN’T work. > > Feel free to try and prove me wrong. Okay, I will. Your code passes a char** when a char* is expected. Every compiler I know of will give you a *warning*. Mistaking c

Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 06:26 PM, Lawrence D'Oliveiro wrote: >> I'm not sure you understood me correctly, because I advocate >> *not* doing input sanitization. Hard or not -- I don't want to know, >> because I don't want to do it. > > But no-one has yet managed to come up with an alternative that involves l

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 10:05 PM, Michael Torrie wrote: > #include > > int main(int argc, char ** argv) > { > char *buf = malloc(512 * sizeof(char)); > const int a = 2, b = 3; > snprintf(&buf, sizeof buf, "%d + %d = %d\n", a, b, a + b);

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 10:17 PM, Michael Torrie wrote: > On 06/29/2010 10:05 PM, Michael Torrie wrote: >> #include >> >> int main(int argc, char ** argv) >> { >> char *buf = malloc(512 * sizeof(char)); >> const int a = 2, b = 3; >> snprintf(&a

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-30 Thread Michael Torrie
On 06/30/2010 03:00 AM, Jorgen Grahn wrote: > On Wed, 2010-06-30, Michael Torrie wrote: >> On 06/29/2010 10:17 PM, Michael Torrie wrote: >>> On 06/29/2010 10:05 PM, Michael Torrie wrote: >>>> #include >>>> >>>> int main(int argc, char ** arg

Re: [farther OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-30 Thread Michael Torrie
On 06/30/2010 06:36 PM, Lawrence D'Oliveiro wrote: > In message , > Michael Torrie wrote: > >> Okay, I will. Your code passes a char** when a char* is expected. > > No it doesn’t. You're right; it doesn't. Your code passes char (*)[512]. warning: p

Re: [farther OT] Re: Why Is Escaping Data Considered So Magical?

2010-07-01 Thread Michael Torrie
On 07/01/2010 01:24 AM, Nobody wrote: > No, the type of "buf" is "char [512]", i.e. "array of 512 chars". If you > use "buf" as an rvalue (rather than an lvalue), it will be implicitly > converted to char*. Yes this is true. I misstated. I meant that most text books I've seen say to just use the

Re: drag & drop in a python GUI application

2010-07-02 Thread Michael Torrie
On 07/01/2010 08:57 AM, Alan wrote: > I know drag & drop is not possible with TK. Is this a Python Tk limitation or a Tk limitation in general? Google suggests that Tk itself supports some form of dnd. > Which widget could I use for my > python application to be able to work with drag & drop?

Re: Getting the name of the file that imported current module

2010-07-04 Thread Michael Torrie
On 07/04/2010 03:17 PM, Mark Lawrence wrote: > On 04/07/2010 22:05, Tobiah wrote: >> foo.py: >> >> import bar >> bar.show_importer() >> >> output: >> >> 'foo' or 'foo.py' or 'path/to/foo' etc. >> >> Possible? >> >> Thanks, >> >> Tobiah > > >>> import re > >>> re.__file__ > 'C:\\Python26\\lib\\re

Re: Python as a scripting language. Alternative to bash script?

2010-07-06 Thread Michael Torrie
On 07/06/2010 04:12 AM, sturlamolden wrote: > On 28 Jun, 19:39, Michael Torrie wrote: > >> In python I could simply take the output of "ps ax" and use python's >> own, superior, cutting routines (using my module): >> >> (err, stdout, stder

Re: Python as a scripting language. Alternative to bash script?

2010-07-07 Thread Michael Torrie
On 07/06/2010 09:34 PM, Chris Rebert wrote: > On Tue, Jul 6, 2010 at 6:40 AM, Michael Torrie wrote: >> While it's possible to set up pipes and spawn programs in parallel to >> operate on the pipes, in practice it's simpler to tell subprocess.Popen >> to use a she

Re: any issues with long running python apps?

2010-07-09 Thread Michael Torrie
On 07/09/2010 01:13 PM, Les Schaffer wrote: > or need we only concern ourselves with the nuts behind the wheel:that > is, we the developers? It never hurts to separate the data collection and visualization/analysis parts into separate programs. That way you can keep the critical, long-running da

Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-11 Thread Michael Torrie
On 07/11/2010 12:50 AM, rantingrick wrote: > Ah yes, when nothing else seems to work fall back to you default > programming... FUD and ad hominem attacks Please stop calling things what they are not. Stephen's post was not an ad hominem attack, nor was it FUD. Someone who is countering your pre

Re: Easy questions from a python beginner

2010-07-11 Thread Michael Torrie
On 07/11/2010 11:48 AM, wheres pythonmonks wrote: > I'm an old Perl-hacker, and am trying to Dive in Python. I have some > easy issues (Python 2.6) > which probably can be answered in two seconds: > > 1. Why is it that I cannot use print in booleans?? e.g.: True and print "It is true!" Th

Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-12 Thread Michael Torrie
On 07/12/2010 06:18 PM, Steven D'Aprano wrote: > Early versions of BASIC used -1 as true and 0 as false. They did this for good reason. BASIC had no logical operators. AND, OR, and NOT were all actually bitwise operators. By making the True value -1, the bitwise operations yielded the result on

Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-12 Thread Michael Torrie
On 07/12/2010 06:36 PM, Paul Rubin wrote: > I'd personally prefer > > if not bool(myValue): > > which would call the myValue's __bool__ method if it chose to implement > one. Explicit is better than implicit. That's just ugly. Probably a more explicit way would be to have an is_true() and

Re: detect endianness of a binary with python

2010-07-21 Thread Michael Torrie
On 07/21/2010 08:02 AM, Grant Edwards wrote: > On 2010-07-21, Holger brunck wrote: > >> I use python 2.5 and I am looking for a possibility to determine a >> file type. Especially the endianness of a file is needed for me. Is >> there a way to detect this easily in python? > > Only if you alread

Re: Why is python not written in C++ ?

2010-08-01 Thread Michael Torrie
On 08/01/2010 07:09 PM, John Bokma wrote: >> One thing that comes to mind is that it's much easier to distribute C >> libraries than C++ libraries. > > In the beginning of C++ there were programs that just converted C++ to C > (frontends). At least that is how the C++ compiler Acorn sold worked.

Re: constructing and using large lexicon in a program

2010-08-02 Thread Michael Torrie
On 08/02/2010 11:46 AM, Majdi Sawalha wrote: > I am developing a morphological analyzer that depends on a large lexicon. i > construct a Lexicon class that reades a text file and construct a dictionary > of > the lexicon entries. > the other class will use the lexicon class to chech if the word

Re: Why is python not written in C++ ?

2010-08-02 Thread Michael Torrie
On 08/02/2010 03:42 PM, Mark Lawrence wrote: > I can't understand why any serious programmer mentions C++. As soon as I > read it, I have to rush either to the kitchen to find a bowl to throw up > in, or head for the toilet so I can talk to the great white telephone. Sometimes, C++ is just the r

Re: Is there any way to minimize str()/unicode() objects memory usage [Python 2.6.4] ?

2010-08-06 Thread Michael Torrie
On 08/06/2010 07:56 PM, dmtr wrote: > Ultimately a dict that can store ~20,000,000 entries: (u'short > string' : (int, int, int, int, int, int, int)). I think you really need a real database engine. With the proper indexes, MySQL could be very fast storing and retrieving this information for you.

Re: new to python - trouble calling a function from another function

2010-08-06 Thread Michael Torrie
On 08/05/2010 01:25 AM, Brandon McCombs wrote: > How can that be? I don't get any errors when the script > executes. Surely this isn't some limitation I'm encountering? > > > yield (p.destination - self.currenteFloor) * TRAVELTIME, self ^ To be succinct, goUp(

Re: Python Portability

2010-08-07 Thread Michael Torrie
On 08/07/2010 01:17 PM, W. eWatson wrote: > Presumably I have him somehow delete the numpy site-package, the numpy > 1.2.0 package? Just drill his way dow from the .../lib/site_packages? > Then install 1.2.0. He's missed the boat on that before by not following > instructions. Wait. I'm confus

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread Michael Torrie
On 08/08/2010 10:16 AM, W. eWatson wrote: > See Subject. I use matplotlib, scipy, numpy and possibly one other > module. If I go to the control panel, I only see numpy listed. Why? I > use a search and find only numpy and Python itself. How can matplotlib > and scipy be uninstalled? The best wa

Re: Circular imports (again)

2010-08-09 Thread Michael Torrie
On Aug 9, 6:19 am, "Frank Millman" wrote: > It has just happened again. I have organised my code into three modules, > each representing a fairly cohesive functional area of the overall > application. However, there really are times when Module A wants to invoke > something from Module B, ditto fo

Re: easy question on parsing python: "is not None"

2010-08-09 Thread Michael Torrie
On 08/09/2010 06:11 AM, saeed.gnu wrote: > On Aug 9, 3:41 pm, "saeed.gnu" wrote: >> "x is y" means "id(y) == id(y)" >> "x is not y" means "id(x) != id(x)" >> "x is not None" means "id(x) != id(None)" >> >> "x is not None" is a really silly statement!! because id(None) and id

Re: Microsoft lessening commitment to IronPython and IronRuby

2010-08-10 Thread Michael Torrie
On 08/10/2010 02:07 AM, Gregory Ewing wrote: > Tim Roberts wrote: > >> I'm not sure that's really fair. The .NET Common Language Runtime is a >> vast and very useful class library, including two complete GUI systems. The >> thought was that IronPython and IronRuby would let people who were >> com

Re: How to swallow traceback message

2010-08-11 Thread Michael Torrie
On 08/11/2010 09:32 AM, Back9 wrote: > I should have mentioned that I already use try/except > KeyboardInterrupt statement. > But it does not seem to work as I expected. If you want anyone to help further, you will need to say a) what you are expecting it to do and b) what it is actually doing. --

Re: Confused: Newbie Function Calls

2010-08-11 Thread Michael Torrie
On 08/11/2010 10:07 AM, fuglyducky wrote: > I am a complete newbie to Python (and programming in general) and I > have no idea what I'm missing. Below is a script that I am trying to > work with and I cannot get it to work. When I call the final print > function, nothing prints. However, if I print

Re: 79 chars or more?

2010-08-16 Thread Michael Torrie
On 08/16/2010 08:59 PM, AK wrote: > But.. why horizontal scrolling, isn't autowrap much better than that? Wouldn't it really make a visual mess of Python code if lines wrapped? Maybe if they wrapped smartly. In general, the only time I find my lines longer than 75 characters are strings or somet

Re: 79 chars or more?

2010-08-16 Thread Michael Torrie
On 08/16/2010 10:50 PM, AK wrote: > I stay away from ugly cramped one-liners; I mostly run over 79 when I > have a few `and` and `or` clauses or long strings. I've also noticed > something interesting: going from 79 to 99 affects a relatively large > number of lines, but going over 99 (i.e. 99 to 1

Re: Iterative vs. Recursive coding

2010-08-21 Thread Michael Torrie
On 08/21/2010 03:03 AM, Steven D'Aprano wrote: >> - there must be a condition where the recursion has to stop otherwise >> the routine will continue to call itself infinitely. >> This is called the Base Case > > I agree with this, although I've never heard the name "Base Case" before. "Base Cas

Re: Exotic Logics

2009-06-18 Thread Michael Torrie
William Clifford wrote: > I've read one can do all of the 16 binary operations with clever uses > of NAND or NOR. That is correct. In fact semiconductor logic is done using these two principle gates. See http://en.wikipedia.org/wiki/NAND_logic . Quite interesting really. -- http://mail.python

Re: [Mac] file copy

2009-06-23 Thread Michael Torrie
Tobias Weber wrote: >> Apple's version of cp is aware of extended attributes. > > Yes, but the manual doesn't say to what extent, nor anything about ACLs mv, cp, etc (but not rsync) are completely aware of resource forks from Tiger on. This is well documented and known on the Mac forums. So shu

Re: C-extension 2 times slower than exe

2009-06-23 Thread Michael Torrie
Rolf Wester wrote: > The runtime is about 2.5 sec and 5.0 sec respectively. I not only use > the time command to measure the time consumed but I also measure the > time within the C-code using clock() and get similar result. So the > Python startup time is not the reason for the runtime difference

Re: [Mac] file copy

2009-06-23 Thread Michael Torrie
Tobias Weber wrote: > Why "so"? shutil does not use bin/cp! That's good to know. I had always thought that that was what shutils did, but you're right; it does not. That said, since cp indeed *can* copy resource forks on Tiger and up, you could use subprocess to call it. Just as an aside, your

Re: A superclass using a child classes' methods

2009-06-24 Thread Michael Torrie
Kurt Schwehr wrote: > I'm trying to build an OO system for encoding and decoding > datapackets. I'd like the parent class to have an encode function > that uses each of the child classes' packing methods. It appears that > this works for attributes of children accessed by the parent, but not > fo

Re: 3.2*2 is 9.6 ... or maybe it isn't?

2009-06-25 Thread Michael Torrie
Bojan Sudarevic wrote: > The first thing I typed into it was 3.2*3 (don't ask why I typed *that*, > I don*t know, I just did). And the answer wasn't 9.6. > > Here it is: > 3.2*3 > 9.6014 I'm surprised how often people encounter this and wonder about it. As I began programming

Re: 3.2*2 is 9.6 ... or maybe it isn't?

2009-06-26 Thread Michael Torrie
Robert Kern wrote: > In the former case, you can claim that decimal floating point is more > accurate > *for those problems*. But as soon as you have a division operation, decimal > floating point has the same accuracy problems as binary floating point. True. Poor choice of words on my part.

Re: Advantages of Python (for web/desktop apps)?

2009-06-29 Thread Michael Torrie
iceangel89 wrote: > i am mainly a PHP (mainly using Zend Framework MVC now) Web Developer. used > .NET (VB & C#) for Desktop apps. i nv used Python and am looking at Python > now (for desktop apps since its open source and just want to try what it > offers, but will like to know what good it has fo

Re: Wrapping comments

2009-07-05 Thread Michael Torrie
Lawrence D'Oliveiro wrote: > I tried using Emacs via SSH from a Mac once. Made me run screaming for the > nearest Windows box > . Interesting rant, but the problem is with the key bindings they chose to use in Terminal.

Re: Examples of Python driven Microsoft UI Automation wanted

2009-07-09 Thread Michael Torrie
DuaneKaufman wrote: > With MS utilities like UISpy and the like, I can 'see' the controls in > the application, but I > do not seem to be able to manipulate them programatically, and I > believe it us simply due > to my not understanding of the UI Automation API. You're probably better off using a

Re: Examples of Python driven Microsoft UI Automation wanted

2009-07-09 Thread Michael Torrie
TheSeeker wrote: > Alternatives to Microsoft's UI Automation are welcome too, but I have > tried using winguiauto and watsup (along with AutoIt), and there seems > to be severe limitations when using these tools with WinForm > applications. http://www.autoitscript.com/forum/index.php?showtopic=967

Re: getopt code NameError exception on logTail.py

2009-07-17 Thread Michael Torrie
LoD MoD wrote: > In this instance the trackback was somewhat unhelpful.There problem was > here: > >file = open(filename, 'r') > > should be > >file = open(a, 'r') > > args should be passed within the getopt riff Well given the code you posted, this little "problem" you

Re: Question regarding style/design..

2009-07-17 Thread Michael Torrie
Wells Oliver wrote: > Sometimes I see relatively small application, generally task scripts, > written as essentially a list of statements. Other times, I see them neatly > divided into functions and then the "if __name__ == '__main__':" convention. > Is there a preference? Is there an... applicatio

Re: GTK+ ques

2009-07-22 Thread Michael Torrie
nipun batra wrote: > I need to develop a GUI preferably in GTK using c or PYGTK.I have little > idea about Python. > Following are requiremnts of the application: > should be GUI > Sould be real time > Should interface serial port > should display moving maps,like google earth > It is basically for

Re: Does python have the capability for driver development ?

2009-07-30 Thread Michael Torrie
MalC0de wrote: > please introduce me some resource for system programming, I know that > python is very well at system programming level. > thanks Although it is possible (as others have said) to embed Python the interpreter into a driver, no one has done that that I know of. You'd have to write

Re: Queryable Daemon

2009-08-03 Thread Michael Torrie
Justin DeCell wrote: > I was hoping for a little help with a project I'm working on. I'm > writing a daemon in python that I want to be queryable (i.e. I should > be able to run foo -s and it will report some internal information > about the foo daemon if it's running) but I can't figure out

Re: What python can NOT do?

2009-08-29 Thread Michael Torrie
qwe rty wrote: > On Aug 29, 5:11 am, Nobody wrote: >> On Fri, 28 Aug 2009 17:26:06 -0700, qwe rty wrote: >>> if you don't know the answer please don't reply >> If you don't understand the question, don't post it in the first place. > > don't be so angry ,not good for your health You forgot your

Re: Compare source code

2010-11-03 Thread Michael Torrie
On 11/03/2010 02:39 PM, Seebs wrote: > Furthermore, I don't WANT to skip closing braces. EXPLICIT IS BETTER > THAN IMPLICIT. I *WANT* to have the beginnings and ends marked. I suggest, then that Pascal or Ruby would suit your needs better than Python. > I want end braces or "end" or something a

Re: Compare source code

2010-11-08 Thread Michael Torrie
On 11/06/2010 02:27 AM, Seebs wrote: > On 2010-11-06, Steve Holden wrote: >> If someone were to use a text editor which had always historically >> mangled whitespace I would find myself wondering why they found it >> necessary to restrict themselves to such stone-age tools. > > I have yet to find

Re: search for a data in my browser via script

2017-02-06 Thread Michael Torrie
On 02/06/2017 07:43 AM, Meeran Rizvi wrote: > Hello guys, > Here i am writing a script which will open my chrome browser and opens the > URL www.google.com. > But how to search for a data via script. > for example i need to search for 'Rose' in google.com via script. > how to do that? > > > impo

What's with all the messages from @f38.n261.z1

2017-02-07 Thread Michael Torrie
Seems like we're getting a bunch of messages on the mailing list that appear to be copies of real member posts that are saying they are from @f38.n261.z1? They don't appear to be deliberate impersonations. Some misconfigured server reflecting messages back to the list perhaps? -- https://mail.py

Re: How to store properties

2017-02-08 Thread Michael Torrie
On 02/08/2017 04:26 AM, Cecil Westerhof wrote: > In Java you (can) use a properties file store configuration. What is > the best way to do something like that in Python? > I saw ConfigParser, but have the feeling that it is not really used. > Would a JSON file be a good idea? I've used ConfigParse

Re: Problems with scp script in Python

2017-02-13 Thread Michael Torrie
On 2017-02-13 05:17 AM, jhlo...@gmail.com wrote: I have an SCP script that auto completes just fine from the terminal window in Pi. When I use either subprocess or os to try and have it run under Python it does not do the file transfer from Pi to my Ubuntu machine. What am I doing wrong? He

Re: Python application launcher (for Python code)

2017-02-23 Thread Michael Torrie
On 2017-02-22 09:49 PM, Deborah Swanson wrote: Didn't even look. Visual Studio has always been pricey, and it never occurred to me that they might have a free or cheap version now. You can get the full edition of Visual Studio, called Visual Studio Community Edition for free. They still offer

Re: Using re to perform grep functionality in Python

2017-03-01 Thread Michael Torrie
On 03/01/2017 02:55 PM, rob...@forzasilicon.com wrote: > Obviously, not what I want. Can anyone feed some input? You've already got some good answers, but I just wanted to point you at this good resource: http://www.dabeaz.com/generators/ Pretty much anything you do in a shell script that involv

Re: What's the neatest way of getting dictionary entries in a specified order?

2017-03-08 Thread Michael Torrie
On 03/08/2017 12:27 PM, Chris Green wrote: > I have a fairly simple application that populates a GUI window with > fields from a database table. The fields are defined/configured by a > dictionary as follows:- Instead of ordering the data in Python, why not rely on the GUI to do the sort? Most G

Re: Where to find python GTK+ 3 reference documentation?

2017-03-10 Thread Michael Torrie
On 03/10/2017 01:26 PM, Chris Green wrote: > Wildman wrote: >> On Fri, 10 Mar 2017 18:51:35 +, Chris Green wrote: >> >>> I'm using the excellent tutorial at >>> https://python-gtk-3-tutorial.readthedocs.io >>> and occasionally want reference documentation, is there reference >>> documentation

Re: What's the neatest way of getting dictionary entries in a specified order?

2017-03-11 Thread Michael Torrie
On 03/11/2017 03:07 AM, Chris Green wrote: > The order I was asking about was the order of the *fields* of the > heading (i.e. the column names) *not* the data. It won't get updated > when new data is added. What I was after (and got) was a way that > would allow me to extract the data for one en

Re: Does one create an event to notify parent window/GUI of something?

2017-03-12 Thread Michael Torrie
On 03/12/2017 06:14 AM, Chris Green wrote: > There are (of course) event handlers for the 'Save' and 'Cancel' > button click events in abookeditgui, what I need is hooks from these > to run some code in abookgui after the abookeditgui has completed. How > should one do this, is there a way for a cl

Re: Compiling new Pythons on old Windows compilers

2017-03-12 Thread Michael Torrie
On 03/12/2017 02:45 PM, eryk sun wrote: > On Sun, Mar 12, 2017 at 5:02 PM, Eric Frederich > wrote: >> Any idea why compatibility was dropped recently? There used to be a PC >> directory with different VS directories in the source tree, now it isn't >> there any more. > > CPython 3.5+ uses the Un

Re: Compiling new Pythons on old Windows compilers

2017-03-12 Thread Michael Torrie
On 03/12/2017 09:26 PM, Michael Torrie wrote: > On 03/12/2017 02:45 PM, eryk sun wrote: >> On Sun, Mar 12, 2017 at 5:02 PM, Eric Frederich >> wrote: >>> Any idea why compatibility was dropped recently? There used to be a PC >>> directory with different VS direc

Re: Does one create an event to notify parent window/GUI of something?

2017-03-13 Thread Michael Torrie
On 03/13/2017 02:37 AM, Chris Green wrote: > Michael Torrie wrote: >> On 03/12/2017 06:14 AM, Chris Green wrote: >>> There are (of course) event handlers for the 'Save' and 'Cancel' >>> button click events in abookeditgui, what I need is hooks from t

Re: python and databases

2017-03-14 Thread Michael Torrie
On 03/14/2017 01:59 PM, Xristos Xristoou wrote: > I have a database in microsoft ACCESS with about 150 records.. if I > want to get some data from this database using a query in python and > i want to store in some variables in python that will do this ? to > avoid the 150 if ...: Using the stand

<    12   13   14   15   16   17   18   19   >