Re: python GUIs comparison (want)

2006-10-25 Thread Stephen Eilert
BartlebyScrivener wrote: > Well, I am woefully unqualified to speak to the general state of Python > gui frameworks, but I am in a similar situation as the OP, i.e., a > beginner looking to TRY some easy gui programming in Python. Not being > a computer science person, just an amateur scripter, I

Re: What's the best IDE?

2006-10-26 Thread Stephen Eilert
figure. Once you generate a tags file, navigation becomes easy. I never managed to invoke Python inside VIM as a "compiler" tho. The fact that you can create scripts for VIM in Python is also a plus. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: 3d programming without opengl

2006-10-31 Thread Stephen Eilert
library you are looking for. Perhaps there are other requirements that require what you are asking for, but I can't see in your message. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: Is python for me?

2006-11-13 Thread Stephen Eilert
heavy-lifting. The easy integration between Python and C (compared to a couple other popular platforms) is what drove me to Python. Make it work first. Then optimize. And Python helps both. Stephen lennart escreveu: > [EMAIL PROTECTED] schreef: > > > As stated above python is capable

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Stephen Eilert
there's voodoo involved, it had best be sticking out from the text in big, bloody, blinking, red letters. I know, there's noone preventing me from doing otherwise (except for that blasted __init__). I'd like to follow the pack here, tho. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: Will GPL Java eat into Python marketshare?

2006-11-16 Thread Stephen Eilert
ny applications and play around with it in Python. Currently, > my collaborators wrote in Perl and Java, so it is not easy for me to use > their work in my work. > > ML What is wrong with the other way around and Jython? Just curious. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: How to extract 2 integers from a string in python?

2006-06-08 Thread Stephen Prinster
[EMAIL PROTECTED] wrote: > Hi, > > how can I extract 2 integers from a string in python? > > for example, my source string is this: > Total size: 173233 (371587) > > I want to extract the integer 173233 and 371587 from that soource > string, how can I do that? > Use split() to split the string

Re: The Python Papers Edition One

2006-11-22 Thread Stephen Hansen
3.) Can I have an HTML version? A) No, we like it pretty. The interesting thing is, there's nothing in your layout or format that you can't do with some nice standards-compliant HTML and CSS. It could look identical as HTML-- and be significantly more "reachable" by people, easier for them to u

Re: The Python Papers Edition One

2006-11-23 Thread Stephen Hansen
Perhaps people could comment on the following proposition -- if an organisation is Not for Profit, its dealings are therefore Noncommercial? I think the problem is Python has historically been so very free-- It has always been *extremely* Business-Friendly, and totally lacks ... ah, the moral o

Re: why would anyone use python when java is there?

2006-11-29 Thread Stephen Eilert
Score: -1 (Flamebait) gavino escreveu: > wtf -- http://mail.python.org/mailman/listinfo/python-list

Re: Good script editor for Python on Mac OS 10.3

2006-11-29 Thread Stephen Hansen
Hi, I have an old Mac with OS X Panther installed. I also have the Python language download file, but I haven't got a text/script editor to use for it. Does anyone have a recommendation for a good Python text editor in OS 10.3? Thanks, Scott D. -- http://mail.python.org/mailman/listinf

Re: Good script editor for Python on Mac OS 10.3

2006-11-29 Thread Stephen Eilert
a text/script editor to use > > for it. Does anyone have a recommendation for a good Python text > > editor in OS 10.3? > > > > Thanks, > > > > Scott D. > > I didn't see "free" in your post, so why not try TextMate? Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: why would anyone use python when java is there?

2006-11-30 Thread Stephen Eilert
you should not be afraid to learn both Java and Python, perhaps C, Ruby, Lisp. They are tools, and more knowledge never hurts. For now, there are more Java (and .NET) offers. But things might change. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: python vs java & eclipse

2006-12-01 Thread Stephen Eilert
ts early stages. There is a lot of room for improvement, even for a dynamic language. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: About the 79 character line recommendation

2006-12-05 Thread Stephen Hansen
On 5 Dec 2006 09:55:20 -0800, Steve Bergman <[EMAIL PROTECTED]> wrote: However, I am finding that the 79 character line prescription is not optimal for readability. For me, 79 characters per line... would basically make my code a LOT harder for me to read and manage. I mean, a basic structur

Internet Gambling Losses Refunded

2006-12-05 Thread Stephen . Egan
Greetings, I came across your ad via Google Search and wanted to inquire about your services. I am hoping to recover my losses from online gaming Please Contact me as soon as possible Regards, Steve Egan Disclaimer "The inf

Re: Looking for a decent HTML parser for Python...

2006-12-06 Thread Stephen Eilert
the easiest parser I've ever worked with. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Common Python Idioms

2006-12-07 Thread Stephen Eilert
t-so-obvious-idioms? I've seen some in this thread (like the replacement for .startswith). I do think that, if it is faster, Python should translate "x.has_key(y)" to "y in x". Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: Common Python Idioms

2006-12-07 Thread Stephen Eilert
s a __contains__ method until it tries to > call it. In particular there may be user-defined dictionary-like objects in > your program which support has_key but not 'in'. e.g. in at least some > versions of Zope HTTPRequest objects support has_key but not __contains__. You're right. Brain fart. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: Common Python Idioms

2006-12-08 Thread Stephen Eilert
Ben Finney escreveu: > "Stephen Eilert" <[EMAIL PROTECTED]> writes: > > > Is there a list somewhere listing those not-so-obvious-idioms? > > They're only not-so-obvious to those who learn one version of Python > and then ignore release notes on fut

Re: merits of Lisp vs Python

2006-12-08 Thread Stephen Eilert
t; + rs.get("?salary") + "" I just want to add that this kind of HTML mixed with code is something that should be avoided, no matter what language is used. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-11 Thread Stephen Eilert
roductions to LISP written for computer science courses. I can't seem to put together all those mnemonics into a working program. LISP is full of primitives with 3-4 characters, chosen for historical reasons. The bottom line is that I didn't have a pleasant learning experience. Perhaps the lispers here could offer some insights? Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-12 Thread Stephen Eilert
Greg Johnston escreveu: > Stephen Eilert wrote: > > So, let's suppose I now want to learn LISP (I did try, on several > > occasions). What I would like to do would be to replace Python and code > > GUI applications. Yes, those boring business-like applications that &g

Re: program deployment

2007-01-05 Thread Stephen Eilert
issions. Do not expect to keep the password secret if you are distributing it, though :) I've cracked C programs, Clipper and Java almost effortlessly. They were all custom programs where the sole developer would put a password for administrative functions, just to be able to charge money long af

Suggestions for workaround in CSV bug

2006-01-23 Thread Simmons, Stephen
hat might screw up the data. Any suggestions for how to proceed are most welcome! Thanks in advance, Stephen Simmons #====== # Bug in Python 2.4.2's csv module # Stephen Simmons, mail at stevesimmons.com, 24 Jan 2006 import csv s = [ ['a

Re: Some thoughts on garbage collection

2006-01-24 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Frank Millman <[EMAIL PROTECTED]> writes >> You could then also categorize this by type, e.g. If you want a nice GUI and no requirement to modify your code Python Memory Validator could be useful. http://www.softwareverify.com Stephen -- Step

Re: Suggestions for workaround in CSV bug

2006-01-24 Thread Stephen Simmons
Simmons, Stephen wrote: > > > > I've come across a bug in CSV where the csv.reader() raises an > > exception if the input line contains '\r'. Example code and output > > below shows a test case where csv.reader() cannot read an array > > written by

Re: Possible memory leak?

2006-01-24 Thread Stephen Kellett
ing Python Memory Validator and Python Performance Validator. http://www.softwareverify.com Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troublesh

Re: Building python 2.4.2 on Cygwin

2006-02-20 Thread Stephen Gross
> On Mon, Feb 20, 2006 at 12:24:34PM -0800, mrstephengross wrote: >> Ok, I'm working on building python 2.4.2 on cygwin. I *think* it's >> version 3.0 or 3.1 (is there a quick way to find out what version of >> cygwin is running within a shell?) > > Use "uname -r". What version are you running?

Re: Building python 2.4.2 on Cygwin

2006-02-21 Thread Stephen Gross
>Just to be sure, what does the following indicate? $ cygcheck -c cygwin Cygwin Package Information Package VersionStatus cygwin 1.5.18-1 OK >BTW, can you use the pre-built Python 2.4.1 that is part of the standard Cygwin distribution? Nope--I need to

Running PythonNN.DLL as debug or release?

2005-05-24 Thread Stephen Kellett
lease mode? I've tried looking at the C API documentation but couldn't find anything useful there. We are using versions of Python from 2.2 upwards. Cheers Stephen -- Stephen Kellett Object Media Limited Computer Consultancy, Software Development Windows C++, Java, Assembler, Perfo

Re: Running PythonNN.DLL as debug or release?

2005-05-24 Thread Stephen Kellett
d to do. Thank you very much. Stephen -- Stephen Kellett Object Media Limited Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list

Re: vim configuration for python

2005-05-25 Thread Stephen Thorne
characters. A tab character in your file will be rendered as 8 wide. -- Stephen Thorne Development Engineer -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Impact Analysis Tool ?

2005-05-25 Thread Stephen Prinster
Paul McNett wrote: > Terry Hancock wrote: > >> On Wednesday 25 May 2005 08:27 am, [EMAIL PROTECTED] wrote: >> >>> Is there an impact analysis tool out there that can cross reference >>> python -- VB has a couple of these tools (eg. Visual Expert) >> >> >> I could be wrong, but my first impression

Re: Beginner question: Logs?

2005-06-01 Thread Stephen Prinster
Svens wrote: > Hey thanks... > > Still getting an error message though. Here's what i'm doing: > -- > import math > log10(15625) > -- > -It says that log10 is not defined, but it is since the module is > imported, right? > try this: import math math.log10(15625) -- http://mail.python.

Re: scripting browsers from Python

2005-06-01 Thread Stephen Thorne
snetial an assertion, so if anything fails it fails spectacularly with debug messages and non-zero exit codes. You can also load python code up so you can do arbitary stuff. -- Stephen Thorne Development Engineer -- http://mail.python.org/mailman/listinfo/python-list

Problem calling Python methods from C

2005-06-03 Thread Stephen Kellett
ct_GetItemString(dict, "collect"); } } Hopefully someone can shed some light on why this doesn't work, or explain what the correct method should be if I am doing the wrong thing. Answers as descriptions, Python or C most welcome. Cheers Stephen -- Stephen Kellett Objec

Re: Problem calling Python methods from C

2005-06-03 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Stephen Kellett <[EMAIL PROTECTED]> writes Following my posting with the solution for anyone else that wants to know the answer. The solution appears to be not to use: >module = PyImport_AddModule("gc"); But to use module =

Re: Dealing with marketing types...

2005-06-11 Thread Stephen Kellett
to identify such people and steer clear of them (they generally do not infect all companies). All the best. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Ana

Re: Do U have anything to share with this students

2007-06-18 Thread Stephen Cowell
"Josh Hill" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, 16 Jun 2007 13:06:23 -, Milt > <[EMAIL PROTECTED]> wrote: > >>On Jun 15, 1:00?pm, [EMAIL PROTECTED] wrote: >>> This is a network of students. Find the people of your kind there >>> >>> http://tinyurl.com/33uvla

Re: Do U have anything to share with this students

2007-06-18 Thread Stephen Cowell
"Scott en Aztlán" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Stephen Cowell" <[EMAIL PROTECTED]> said in misc.transport.road: > >>> Hope you're protected against malware. >> >>Yes, the link probably did what it w

Re: wxPython, threads, and search engine

2007-07-17 Thread Stephen Hansen
I'm assuming you're accessing this Queue in an idle loop maybe? How many items do you get out of it before you pass and wait for a re-invocation? Either way, you can try calling 'wx.Yield()' after each add to the GUI or every few or such, so the GUI can process events. On 7/17/07, Benjamin <[EMAI

Re: Newbie question regarding string.split()

2007-04-20 Thread Stephen Lewitowski
kevinliu23 wrote: > Hey guys, > > So I have a question regarding the split() function in the string > module. Let's say I have an string... > > input = "2b 3 4bx 5b 2c 4a 5a 6" > projectOptions = (input.replace(" ", "")).split('2') > print projectOptions > > ['', 'b34bx5b', 'c4a5a6'] > > My que

Testing GUI's

2007-04-20 Thread Stephen Lewitowski
Can any of you guy's out there point me to information on automating GUI's that use Tkinter. I would like to find out more and possibly get involved if there are any projects under development. Thanks in advance. Steve -- http://mail.python.org/mailman/listinfo/python-list

gmail.py (WAS: Re: [ANN] libgmail 0.0.1 -- Gmail access via Python)

2007-04-27 Thread Stephen Levitus
the gmail archive to a specific windows xp folder. Can you help? Stephen I. Levitus Mobile Telephone 612.751.3200 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Newbie Suggestions

2007-05-15 Thread Stephen Lewitowski
[EMAIL PROTECTED] wrote: > I'm a mechanical engineer with little experience programming. I've > used C++ and machine language for getting micro-controllers to work > and thats about it. I work allot with software developers at my job > and can read C++ code pretty good (ie. I understand whats going

Re: Python Newbie Suggestions

2007-05-17 Thread Stephen Lewitowski
Michael Tobis wrote: > I think > > http://www.diveintopython.org/ > > would be very suitable for you. > > mt > > > > I disagree here. The site was last updated in 2004; its out of date. For a newbie any material referenced should be current and include what is available in Python 2.5. --

Strange set of errors

2007-08-03 Thread Stephen Webb
ave no idea what the second thing means. Every time I run the plot([1,2,3]) I get a different ending number that seems to vary randomly. Could anybody please help me out with these problems? Thanks, Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython before MainLoop

2007-08-09 Thread Stephen Hansen
On 8/9/07, [david] <[EMAIL PROTECTED]> wrote: > > I'm disappointed that I didn't get a wxPython solution. > > If the only way to get wxPython to correctly handle > this simple task is to code around it, I don't think > wxPython is really ready for Windows. A thread *is* basically the right answer

try/finally exceptions dying

2007-08-14 Thread stephen . y4ng
up the stack until it was handled. Any thoughts are appreciated. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython in C++ app using wxWidgets

2007-08-17 Thread Stephen Hansen
On 8/17/07, Marcin Kalicinski <[EMAIL PROTECTED]> wrote: > > I have an application written in C++ that uses wxWidgets for GUI. I use > embedded Python for scripting inside of this application. I want to use > wxPython to add GUI to my scripts - because my C++ App uses wxWidgets I > thought it to be

Re: wxpython thread exception crash

2007-08-20 Thread Stephen Hansen
On 8/20/07, [david] <[EMAIL PROTECTED]> wrote: > > What am I doing wrong? > I'm trying to capture stdErr in a multi-threaded program. You can't reliably access the GUI anywhere except in the main thread; you're printing to stderr from the worker thread, and thus its writing to the GUI control, an

Re: Generating a unique identifier

2007-09-10 Thread stephen . lewitowski
On Sep 7, 1:03 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > I have an application that will be producing many instances, using them > for a while, then tossing them away, and I want each one to have a unique > identifier that won't be re-used for the lifetime of the Python se

Re: merits of Lisp vs Python

2007-03-08 Thread Stephen Eilert
On Mar 8, 5:23 am, John Nagle <[EMAIL PROTECTED]> wrote: > Brian Adkins wrote: > > Ken Tilton wrote: > > >> John Nagle wrote: > > Turns out John is having quite a tough time with Python web hosting (the > > thread has split off to a c.l.p only fork), so I'm going to cut him some > > slack. Maybe wi

Re: problem at installing phyton on windows

2007-03-25 Thread Stephen Eilert
i open command line of phyton.But when i write phyton these view below: Traceback: File ""; line 1 in NameError: name phyton is not defined " ^^^ Obviously, "Phyton" will never be defined. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: python on mac os 10.4.x

2007-04-02 Thread Stephen Hansen
any idea how to install a python framework build Thanks. -- http://mail.python.org/mailman/listinfo/python-list -- Stephen Hansen Development Advanced Prepress Technology [EMAIL PROTECTED] (818) 748-9282 -- http://mail.python.org/mailman/listinfo/python-list

Re: what version python and wxPython comes with Mac OS X Leopard

2007-10-29 Thread Stephen Hansen
Python 2.5.1, and wxPython 2.8.4.0. On 10/29/07, chewie54 <[EMAIL PROTECTED]> wrote: > > Hello, > > Anyone using Leopard know which versions of Python and wxPython and > any other Python related modules are default with the new OS? > > Thanks, > > -- > http://mail.python.org/mailman/listinfo/pytho

RotatingFileHandler + subprocess module problems

2007-01-11 Thread Stephen Hansen
p out at anyone, I'll write up a mockup. I'm hoping I just did something of a goof that will be obvious though, since the apps are a bit complicated and distilling them down to a testcase will be mildly annoying. :) Thanks in advance. --Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: RotatingFileHandler + subprocess module problems

2007-01-15 Thread Stephen Hansen
That was perfect-- it now all behaves as it should. Thanks! On 1/11/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: At Thursday 11/1/2007 15:59, Stephen Hansen wrote: >If I run app1, and then app2, it all works fine. Specifically, the >apps are logging correctly and I can see

Re: Decimating Excel files

2007-02-06 Thread Stephen Eilert
y evidence > that it's an Excel file? Did you *succeed* in opening the file "with > Kate"? In the sense that Kate is not a girl, but a text editor. I assume he opened the file and got only "gibberish", instead of text, CSV, or whatever. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: (question) How to use python get access to google search without query quota limit

2006-05-05 Thread Stephen Prinster
Per wrote: > I am doing a Natural Language processing project for academic use, > > I think google's rich retrieval information and query-segment might be > of help, I downloaded google api, but there is query limit(1000/day), > How can I write python code to simulate the browser-like-activity to

Re: Memory leak in Python

2006-05-12 Thread Stephen Kellett
of that type that >didn't exist on iteration N-1 but exist on iteration N And this, but for garbage collection generations. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Jav

106 EXTREMELY UNIQUE NUMERICAL EQUASIONS!

2007-12-27 Thread Stephen Sparkman
These equasions require all ten numerals (attachment). Stephen Sparkman. In MULTIPLICATION/DIVISION, there are 22 equations, 13 NUMERAL {3, 7, 4 & 6} X 4-digit numbers & 9 2-digit numbers X 3-digit numbers.3 X 5,694 = 17,082, 3 X 6,819 = 20,457, 3 X 6,918 = 20,754, 3 X 8,169 = 24,

Re: Choosing a new language

2007-12-29 Thread Stephen Leake
George Neuner writes: > On Fri, 28 Dec 2007 12:54:57 -0800, John Nagle <[EMAIL PROTECTED]> > wrote: > >>Actually, the ability to "fix a running program" [in Lisp] isn't >>that useful in real life. It's more cool than useful. Editing a >>program from a break was more important back when com

Re: dictionary/hash and '1' versus 1

2008-01-03 Thread Stephen Hansen
re such a thing to happen automagically, you could get some weird situations, such as "assert (key in dict) == (key in dict.keys())" failing. Also, do 'if key in dict' instead of 'if dict.has_key(key)'. :) --Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary/hash and '1' versus 1

2008-01-04 Thread Stephen Hansen
__getitem__(self, key): return dict.__getitem__(self, key.lower()) def __setitem__(self, key, value): return dict.__setitem__(self, key.lower(), value) >>> cid = caseinsensitivedict() >>> cid['This'] = 5 >>> cid {'this': 5} >>> cid.keys() ['this'] >>> print 'THIS' in cid: True I could do a case-preserving one, but it wasn't needed for the solution. --Stephen -- http://mail.python.org/mailman/listinfo/python-list

pyExcelerator - Can I read and modify an existing Excel-WorkBook?

2008-01-31 Thread Stephen Brown
Yes indeed, pyExcelerator does support reading data from excel spreadsheets. An example of how to do this is included in the file xls2csv-gerry.py under the directory ... pyExcelerator/examples/tools Syntax is pretty straight forward. extract_all = parse_xls(filename, CP = None) where CP i

Is there a way to "link" a python program from several files?

2008-02-17 Thread Stephen Brown
Take a look at Fred Lundh's Squeeze programme. quote ... " If all you need is to wrap up a couple of Python scripts and modules into a single file, Squeeze might be what you need. The squeeze utility can be used to distribute a complete Python application as one or two files, and run it using

Re: Is crawling the stack "bad"? Why?

2008-02-29 Thread Stephen Hansen
ecific implementation, in one specific version-- if it works later, its pure chance you can't rely on, and it could break at any point. Relying on API's have unit tests, deprecation warnings, documentation, and behavior reversions being classified all as bugs, all providing you w

QT4

2009-01-14 Thread Stephen Chapman
Hey, looks like Nokia bought Qt and solved the Open Source/Commercial license issue: http://rss.slashdot.org/~r/Slashdot/slashdot/~3/A4br-rQA460/article.pl I wonder if pyqt will follow suit... -- http://mail.python.or

Re: PyQt4 on Windows ?

2009-01-19 Thread Stephen Chapman
I have one running. actually use freezer to create an exe for it in windows. http://www.riverbankcomputing.co.uk/software/pyqt/download That will tell you how to get started. The app I wrote uses Pryro(with middleware server on a linux machine). And I use the standard widgets that qt has gri

Re: Byte oriented data types in python

2009-01-24 Thread Stephen Hansen
l defined. Check out the struct module. You want something like: data = struct.pack("BB4s", 1, 4, "this") It returns a string of bytes according to the specification -- B is unsigned byte, and "4s" is a string of 4 characters. The 1 feeds into the first byte

Re: Pythonic list/tuple/dict layout?

2009-01-25 Thread Stephen Hansen
> and pasted them below. > My vote would go to d1. How about yours? > > Whatever reads best within the context of the specific code is Pythonic. -- http://mail.python.org/mailman/listinfo/python-list

Re: Byte oriented data types in python

2009-01-25 Thread Stephen Hansen
On Sun, Jan 25, 2009 at 7:27 AM, Ravi wrote: > > > Take a look at the struct and ctypes modules. > > struct is really not the choice. it returns an expanded string of the > data and this means larger latency over bluetooth. Noo... struct really IS the choice; that is the explicit purpose of the

Re: Byte oriented data types in python

2009-01-25 Thread Stephen Hansen
gh. Yeah, strings are exactly how he can and should store the byte oriented data in Python 2.x. Using concatination and slicing + conversion to read and parse a byte stream coming off a line protocol... if you want to. But there's tools that are there that make it all alot easier too. The struct module for example. --Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Stephen Hansen
ode really... ISTM that having cross-platform apps which output unicode (really UTF8 probably) to stdout are just not really doable. But if you really want to you can always rebind sys.stdout with an error mode of "backslashreplace" or "xmlcharrefreplace" (which I do in one s

Re: Exec woes

2009-01-27 Thread Stephen Hansen
at "unqualified" means in the above message, and > what one must do to "qualify" the statement, if that is what is needed. > by doing: exec code in , In your situation: >>> def Somefunc(): def excrescence(): exe

Quickbooks

2009-01-28 Thread Stephen Chapman
Has anyone Implemented the Quickbooks COM object in Python. If so can you give me an Idea of where to begin. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-01-29 Thread Stephen Hansen
On Thu, Jan 29, 2009 at 5:58 AM, M Kumar wrote: > but still I am not clear of the execution of the code, when we write or > execute a piece of python code without defining class, predefined class > attributes are available (not all but __name__ and __doc__ are available). > does it mean anything

Re: is there a shorter way to write this

2009-01-29 Thread Stephen Hansen
ple(list, 5) ['g', 'y', 'i', 'n', 'x'] If the list isn't unique: >>> import random >>> random.sample(set(list), 5) ['r', 'e', 'b', 'k', 'i'] If you want to

Re: is there a shorter way to write this

2009-01-29 Thread Stephen Hansen
If the list is unique of 26 elements is guaranteed to be unique, simply: > Wow, 6am copy editing of my own posts is terribly ineffective. "If the list of 26 elements is guaranteed to be unique" -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-01-29 Thread Stephen Hansen
> I'm new to Python and also wondering about OOP in Python. > > I want to justify the above question (is Python Object-Oriented?). > Does Python follow the concepts/practices of Encapsulation, > Polymorphism and Interface, which are quite familiar to Java > programmers? Python does not enforce En

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-30 Thread Stephen Hansen
t like those tools, and people are fine to share those reasons. But that's a different thing then flinging bile and ranting about how horrible Language-X is or how Perfect-For-All-Things Python is. --Stephen P.S. Sorry for waxing verbosely. -- http://mail.python.org/mailman/listinfo/python-list

Re: A replacement to closures in python?

2009-01-30 Thread Stephen Hansen
', 'graham']funcs = []for name in arr:    def func(name=name):    print 'Hi', name    funcs.append(func)for f in funcs:    f()--Stephen signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Empty string is False right?

2009-01-31 Thread Stephen Hansen
., that can be rewritten to:>>> test = True>>> "Apples" if test else "Oranges"'Apples'>>> test = False>>> "Apples" if test else "Oranges"'Oranges'Its part of why you aren't supposed to compare bo

Re: is python Object oriented??

2009-01-31 Thread Stephen Hansen
ng my constants as SOME_CONSTANT instead of some_constantto be more then sufficient usually. In the case where I do want to let someoneread a piece of data and not write it, I find a getter accessing a private membervariable without a corresponding setter perfectly fine.If the users of the code choose to dig inside my class and fiddle with thatprivate member -- woe on them! I wash my hands of any trouble theyhave.--Stephen signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Doc 2.6 vs 2.5--A Matter of Format?

2009-01-31 Thread Stephen Hansen
On Sat, Jan 31, 2009 at 9:14 AM, W. eWatson wrote:I see for 2.5 and for 2.6. I'm guessing these two pages differ somewhat in formats simply because someone decided to do so, and not that I'm in the wrong place for each of the two versions,

Re: persistent TCP connection in python using socketserver

2009-01-31 Thread Stephen Hansen
Cheers mate I had a look into twisted but was put off by the FAQ stating 1.0+ modules may or may not be stable, and only the 'core' is. I don't wanna be messing around with a potentially buggy server, so im gonna roll my own using the sockets module. You didn't read that FAQ right: its addres

Re: what IDE is the best to write python?

2009-02-01 Thread Stephen Hansen
On Sat, Jan 31, 2009 at 11:42 PM, mcheun...@hotmail.com wrote:Hi all   what IDE is the best to write python? thanks from Peter (mcheun...@hotmail.com)What OS? And define "IDE"? Do you just want an editing environment with say class browsing capabilities or do you want an integrated debugger an

Re: is python Object oriented??

2009-02-01 Thread Stephen Hansen
Anyway, it doesn't matter. We're losing the point here. The point is that language support for private access, by disallowing user access to private data, provides an unambiguous information hiding mechanism which encourages encapsulation. Python's approach, however, which is only a naming co

Re: getting values from a text file (newby)

2009-02-01 Thread Stephen Hansen
On Sun, Feb 1, 2009 at 9:24 AM, vsoler wrote:Hi, My foo.txt file contains the following: 1,"house","2,5" 2,"table","6,7" 3,"chair","-4,5" ... as seen with notepad. This file was created with the OpenOffice Calc spreadsheet, but since I use comma as the decimal separator for numbers,

Re: Membership of multiple items to a list

2009-02-01 Thread Stephen Hansen
t(b)set([3])>>> set(a).intersection(b)set([3]) That's two spellings of the same thing. As for testing: an empty set like an empty list will return false, so "if set(a) & set(b):" will be true or false based on if there's any commonalities between the two lists.-

Re: database wrapper ?

2009-02-01 Thread Stephen Hansen
Googling, I found SQLalchemy, which looks quit good. SQLAlchemy is very good. I'm very slowly migrating our entire codebase to it.   But as I only want to choose once, I googled for  "SQLalchemy alternatives", but it didn't find many answers. (Storm / Grok are of no interest, because manipu

Re: Membership of multiple items to a list

2009-02-01 Thread Stephen Hansen
> Stephen, do you see the utter mess your posts look like to some others? Whoops, I was experimenting with a new Firefox add-on that fiddled with Gmail, and hadn't noticed it changed my output format to HTML out from under me. Sorry! --S -- http://mail.python.org/mailman/listinfo/python-list

Re: Auto Logon to site and get page

2009-02-01 Thread Stephen Hansen
> This doesn't however, it just sends me back to the main login page, doenst > say invalid password or anything. I've checked, yes the python hmac hash > function produces the same results (encrypted password) as the md5.js file. > Does anyone know what I am doing wrong?? My guess? After you succe

Re: Import without executing module

2009-02-01 Thread Stephen Hansen
On Sun, Feb 1, 2009 at 11:05 PM, Ray wrote: > Basically, someone has created a python script and I would like to > make use of his functions. I would prefer to not modify his file so > what I would like to do is just write my script and import parts that > are needed. i.e., I would like to separ

Re: Import without executing module

2009-02-01 Thread Stephen Hansen
> Maybe he can wrap the things he dont need inside > if __name__ == '__main__': > check. > -- > http://mail.python.org/mailman/listinfo/python-list > Yeah but he said he doesn't want to modify the file itself-- if he can modify the file this can all go away readily, yes. --S -- http://mail.python

Re: Python package Management GUI - New Project on Sourceforge

2009-02-01 Thread Stephen Hansen
> Well, isn't tkinter being removed? > (http://www.python.org/dev/peps/pep-3108/) PEP3108 isn't only about removals, but some renaming and reorganizations of certain packages / modules to be consistent within the standard library. In that section of PEP3108 they're talking about grouping tkinter m

Re: Import without executing module

2009-02-01 Thread Stephen Hansen
s nothing really special about a function vs any other value. They are all objects that are assigned to a name in a given namespace. You can do dynamic things at the top level to result in different things being bound to the modules namespace based upon the statements and expressions evaluated. Does tha

Re: Membership of multiple items to a list

2009-02-02 Thread Stephen Hansen
On Sun, Feb 1, 2009 at 7:47 PM, Ben Finney wrote: rdmur...@bitdance.com writes: I don't even see Stephen Hansen's posts. My newsreader just shows the header and says "[HTML part not displayed]". Likewise. Yeah, I know HTML is bad on newsgroups. I didn't real

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