Re: Kind of OT - Books on software development?

2011-05-25 Thread gregarican
On May 25, 11:45 am, Ed Keith e_...@yahoo.com wrote:
 I do not have my library with me, but I remember a book that fits the bill 
 exactly, is was from Microsoft Press, I think it was called Writing Solid 
 Code

 Hope this helps,

    -EdK

 Ed Keith
 e_...@yahoo.com

 Blog: edkeith.blogspot.com

 --- On Wed, 5/25/11, Matty Sarro msa...@gmail.com wrote:



  From: Matty Sarro msa...@gmail.com
  Subject: Kind of OT - Books on software development?
  To: Python list python-l...@python.org
  Date: Wednesday, May 25, 2011, 11:40 AM
  Hey everyone,
  I am looking at some projects coming up, which may or may
  not involve
  python. So I figured I would throw the question out there
  and see what
  everyone thinks.
  I am looking for some books on software
  engineering/development...
  something that discusses techniques from ideation, up
  through testing,
  QA, production, and then maintenance. Is there such a
  book?
  -Matthew
  --
 http://mail.python.org/mailman/listinfo/python-list- Hide quoted text -

 - Show quoted text -

If you are talking about general concepts in efficient, effective OO
programming I'd suggest Smalltalk Best Practice Patterns by Kent
Beck. I've developed in Java, C#, Python, Ruby, Smalltalk, and other
languages and this book is an eye opener!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Networked Broadcast Messaging

2009-08-11 Thread gregarican
On Aug 11, 2:14 pm, squishywaf...@gmail.com
squishywaf...@gmail.com wrote:
 I'm not exactly sure what the term for this would be, but I was
 wondering if there were any Python packages that supported some kind
 of ad-hoc message broadcasting. What I'd like to do is something like
 this:

 * On a number of workhorse machines, a process listens for network
 messages from our broadcast service. It subscribes to a certain sub-
 set of them and will only respond to the messaging events that it is
 subscribed to.
 * Any machine can broadcast a message out to the network of machines
 without specifying an IP address.
 * Machines can come and go. Since messages are not directly sent to a
 specific IP address from our Python script, the messages are simply
 broadcasted to those who are there to listen. If nobody is subscribed
 to the message type being sent, nothing happens.

 I know XML-RPC and other friends are an option, but I'm looking for
 something that doesn't require managing a set of IP addresses or
 hostnames. I'm not sure what to Google for such a package/module, any
 direction would be greatly appreciated.

Offhand I'd suggest binding a specific UDP port on the listening
workstations. Then the broadcasting workstation(s) could just pull a
standard list of IP's based on its own subnet. Then there'd be no hard-
coded machine names or IP addresses to manage. Just send the message
to all hosts on the same subnet as the broadcaster(s). Plus the UDP
connection would be stateless and not care if the receivers actually
got the message or not...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse/PyDev question.

2007-08-03 Thread gregarican
On Aug 3, 10:58 am, king kikapu [EMAIL PROTECTED] wrote:
 Hi,
 this is actually a question to those of us who use Eclipse and Pydev
 as their main Python developing environment. As i use Eclipse (3.3
 Europa) only for Python and i have nothing to do with Java, is there a
 way to disable/uninstall some Java-specific stuff and make the
 environment actually more snappy ??

 thanks for any help

I've used Eclipse for Java, Python, and Ruby development and can say
that AFAIK Eclipse and snappy are contradictions. Like jumbo
shrimp :-/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: i am new to python-Please somebody help

2007-08-02 Thread gregarican
On Aug 2, 8:51 am, Steven D'Aprano
[EMAIL PROTECTED] wrote:
 On Thu, 02 Aug 2007 09:31:43 +, cool.vimalsmail wrote:

 [snip]

 You would be better off actually writing a sensible subject line instead
 of grovelling.

 Subject: How to use gzip in Python? [beginner]

 Then, having written a good subject line, it might have suggested a good
 search string for Google: gzip python

 http://www.google.com.au/search?q=gzip+python

 The first two links found will answer your question.

 --
 Steven.

This link answers my question -- 
http://www.google.com/search?hl=enq=Python+list+rudeness.
Honestly, I have developed in both Ruby and Python for years now and
have consistently found that the Ruby community if more newbie-
friendly than Python's. Your points are well-taken in how to properly
post and how to do your own homework. Message correct. Delivery
lacking...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: i am new to python-Please somebody help

2007-08-02 Thread gregarican
On Aug 2, 12:58 pm, Terry Reedy [EMAIL PROTECTED] wrote:
 gregarican [EMAIL PROTECTED] wrote in message

 news:[EMAIL PROTECTED]
 | friendly than Python's. Your points are well-taken in how to properly
 | post and how to do your own homework. Message correct. Delivery
 | lacking...

 Sorry, I saw nothing rude in Steven's straightforward and indeed polite
 suggestion.  Your post, however, 

 tjr

Maybe it's just me but the word grovelling just doesn't ring of
newbie friendliness. To each their own I guess. Kind of like the
Smalltalk list where a few respondents are really dry. Someone will
post asking something like Can I use Smalltalk to do X so that it
talks to Y? One guy (without pointing to a link or offering a
snippet) just posts Yes. I guess literally they have contributed. Or
someone calls your house and asks, Is so-and-so there? You just say
Yes and hang up on them :-)


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: i am new to python-Please somebody help

2007-08-02 Thread gregarican
On Aug 2, 11:03 am, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
 gregarican a écrit :
 (snip)

  This link answers my question 
  --http://www.google.com/search?hl=enq=Python+list+rudeness.

 I seriously don't think that this newsgroup can be qualified as rude
 (and I'm possibly one of the rudest persons here). Compared to most
 comp.* newsgroup, Python is certainly one of the most tolerant and
 newbie-friendly around - and quite a lot of newcomers say so. FWIW, even
 FAQs, RTFMs or STFWs are usually expressed in a mostly polite way, and
 almost always with links and pointers (and FWIW, it's the case here).

  Honestly, I have developed in both Ruby and Python for years now and
  have consistently found that the Ruby community if more newbie-
  friendly than Python's.

 I spent sometimes lurking on c.l.ruby and didn't find it *that*
 friendly. Not more than c.l.py at least, and certainly less respectful
 of peoples coming from other languages...

 Now if you want some examples of definitively rude newsgroups, I
 suggest you take your chance on other newsgroups in the comp.*
 hierarchy...

Good points. I guess I read a little too much into things. Apology
extended. I do recall when I was learning Python most of my questions
weren't crushed or anything. And I hear you about some of the other
comp.* lists. Browsing them awhile back I was left with my jaw open
thinking, Oh no he diiint.

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Where do they tech Python officialy ?

2007-07-24 Thread gregarican
On Jul 24, 6:57 am, NicolasG [EMAIL PROTECTED] wrote:
  Why would you want to become a programmer?  Programmers smell bad,
  they have no social life, they get treated like crap by everyone.
  They can get paid pretty well but then they spend all the money on
  useless electronic junk so they still live like bums.

 I wouldn't call this person programmer , I would call him a geek ;)

  one reason to be a programmer, which is that the drive to program
  burns in you like a fire.  But in that case don't ask how to become a
  programmer, because you are already one, so welcome to the ranks ;-).

 Yes true , I'm already a programmer.. doing technical support for my
 company products in a call center. I hate my job, I hate the moment I
 have to wake up to go work ! I hate that moment I have to go sleep
 when I think of the next working day morning.
 Python is what I like, I would love to be more creative with this
 language and be able to produce things that I can't right now..
 Why not try to find a work that you would like ? I don't want to work
 as a programmer to became one because I'm already a programmer, I just
 want to work as a programmer ..

You sound like Peter from Office Space. Each day is the worst day of
his life. Hypnotherapy...Python. What's the difference :-)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Regular Expressions

2007-02-10 Thread gregarican
On Feb 10, 6:26 pm, Geoff Hill [EMAIL PROTECTED] wrote:
 What's the way to go about learning Python's regular expressions? I feel
 like such an idiot - being so strong in a programming language but knowing
 nothing about RE.

I highly recommend reading the book Mastering Regular Expressions,
which I believe is published by O'Reilly. It's a great reference and
helps peel the onion in terms of working through RE. They are a
language unto themselves. A fun brain exercise.

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2006-11-30 Thread gregarican
I would recommend learning one language out of each of three potential
groups. Just my $0.02 USD:

1) Larger commercial languages - Java, C++, C#.
2) Fun, productive scripting languages - Python, Ruby
3) Academic languages - C, Lisp, Haskell, Smalltalk

This doesn't mean that Python can't be a larger commercial language, or
that C is only used for teaching purposes. Perhaps these are too broad
of generalizations. But these are three different areas of interest and
having at least one language under your belt in each area would look
good on a resume.

Of course learning _how_ to program in practice is of huge importance.
There are lots of books out there which give examples in several
different languages of how to apply theoretical concepts to your craft.
Although all of these languages aren't inherently object oriented you
can apply such concepts to them to one degree or another to make your
problem solving a little more practical and logical...

Stephen Eilert wrote:

 If you are serious about getting a programming career, you should not
 be afraid to learn both Java and Python, perhaps C, Ruby, Lisp. They
 are tools, and more knowledge never hurts.


-- 
http://mail.python.org/mailman/listinfo/python-list


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

2006-11-29 Thread gregarican
He trolls other groups as well. Smalltalk for example --
http://groups.google.com/group/comp.lang.smalltalk/browse_thread/thread/1c83e576be824633/927227555661a2cd?lnk=gstq=gavinornum=1#927227555661a2cd.
There are at least a dozen recent posts where he asks some obvious
trollling line of questioning...

Adam Jones wrote:
 gregarican wrote:
  gavino wrote:
   wtf
 
  You have to be trolling I would think.

 Yeah, gavino has been trolling comp.lang.lisp for quite some time. For
 the life of me I can't understand why he would troll comp.lang.python
 when comp.lang.lisp is there.
 
 -Adam

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2006-11-28 Thread gregarican

gavino wrote:
 wtf

You have to be trolling I would think. For most people I think they
would like to code in Python if they had a personal choice. But for
professional reasons they are likely forced to code in Java because of
the sheep mentality of the large corporate drone-dom that's out there.
To me, languages such as Smalltalk, Python, and Ruby allow the problems
to solve themselves in code that's easier to read and requires less
verbiage. Meanwhile all of Java's semicolons, curly braces, and
syntactical hoops leaves my fingers tired and my eyes crossed.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: IDE

2006-10-13 Thread gregarican
For my tastes I like ActiveState's Komodo for a Python IDE. Eclipse is
too bloated, slow, and is like a Tower of Babel. From what I've seen of
SPE it seems good, although the download website seems to throw a lot
of pop-up adware/spyware installs at you...

giuseppe wrote:
 What is the better IDE software for python programming?
 
 many thanks
 
 joe

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python/UNO/OpenOffice?

2006-09-30 Thread gregarican
That's what I would imagine. Kind of like calling some Microsoft Office
COM/OLE methods in a wrapper. As long as the wrapper has most of the
methods you need and the core COM/OLE calls don't change then that's a
great start.

Gary Herron wrote:
 [EMAIL PROTECTED] wrote:
  Are then any currently active and reasonably mature Python plugins/
  apis/whatever for programming/scripting OpenOffice? The page I've
  found is http://udk.openoffice.org/python/python-bridge.html, but
  it was last updated more than a year ago.
 
  Thanks,
  Ken
 
 I don't believe that information is out-of-date. I use the python-bridge
 with the OpenOffice version 2.0.3 quite successfully. In my case I open
 a spread sheet and search around for and extract various values. It
 works just fine for me.
 
 Gary Herron

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Talking to marketing people about Python

2006-09-29 Thread gregarican
Lots of folks have pointed out large scale Python success stories
ranging from NASA to Google to Amazon. Such companies should make for
good PHB fodder in your argument. Most likely if the product manager is
just a drone you can throw in some other acceptable norm. Since
IronPython and Microsoft's .NET CLR are bound you can state that Python
is a language that runs on .NET.

Kind of like another language I work with when I get a chance. I like
Smalltalk and there's a variant that runs in the new Microsoft Vista
WPE environment (http://vistascript.net). If this was a mature option
and if I was to pitch this to a PHB or some other corporate tool I
would classify Smalltalk as an option that sits atop the cutting edge
Microsoft WPE framework.

These in-routes seem to be ways that dynamic/scripting/fringe languages
are gaining traction in larger organizations. Just wrap them up into a
Java VM, .NET CLR, etc. and off you go :-)

Roy Smith wrote:
 I'm working on a product which for a long time has had a Perl binding for
 our remote access API.  A while ago, I wrote a Python binding on my own,
 chatted it up a bit internally, and recently had a (large) customer enquire
 about getting access to it.

 I asked for permission to distribute the Python binding, and after a few
 weeks of winding its way through the corporate bureaucracy I got an email
 from a product manager who wants to meet with me to understand the market
 demand for Python API before we commercialize it.

 Can anybody suggest some good material I can give to him which will help
 explain what Python is and why it's a good thing, in a way that a
 marketing/product management person will understand?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python/UNO/OpenOffice?

2006-09-29 Thread gregarican
Just because the last code update was a little over a year ago doesn't
mean the UNO project is dead. If the OpenOffice API has remained
basically the same since UNO was last updated and the Python wrappers
are relatively comprehensive then it should fit the bill. Googling
around the UNO project was the only thing I found off-hand as well...

[EMAIL PROTECTED] wrote:
 Are then any currently active and reasonably mature Python plugins/
 apis/whatever for programming/scripting OpenOffice? The page I've
 found is http://udk.openoffice.org/python/python-bridge.html, but
 it was last updated more than a year ago.
 
 Thanks,
 Ken

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pros/Cons of Turbogears/Rails?

2006-08-28 Thread gregarican
As I read in another post on this thread, do some initial scoping out
of either framework and pick the one that seems to suit your way of
thinking/coding the best. If you scan over some sample code on the
projects' websites you should get a basic idea of what they will be
like.

Although a bit more obscure than the two frameworks you are
considering, have you checked out Seaside (http://seaside.st)? It's a
Smalltalk framework that interests me personally. I've had the
opportunity to check it out briefly, but haven't had a chance to
actually mock up an app using it. If you check it out as well as a neat
AJAX library that can overlay it called Scriptaculous
(http://script.aculo.us) you can do some pretty slick things concisely.
I doubt that something like this will immediately skyrocket to the top
of the commercial developer's hit list, but it is something that I
would play around with since it will only expand my knowledge base. And
I can have fun while doing it :-)

Out of what I've seen working with Rails and checking out TurboGears I
chose Rails since it fit in with my way of thinking the best. Everyone
has their own taste so I wouldn't take any one person's (or one
group's) opinion. Read up on them a bit and see which one looks the
most interesting to you.

[EMAIL PROTECTED] wrote:
 First, I don't intend this to be a flame war, please. Python
 and Ruby are the only two languages I'd willingly work in
 (at least amongst common languages), and TurboGears and
 Rails seem roughly equivalent.

 I'm much more knowledgable about Python, but that's a minor
 issue--I've been intending to learn more Ruby anyway.

 Here are the pros and cons that I'm aware of and consider
 important:

 Turbogears:
 + SqlObject allows working with the DB tables without
 using SQL itself.
 + Likely to be faster because as far as I'm aware, Python
 is significantly faster.
 + Easy access to other libraries (such as the Python
 Imaging Library) that Ruby, being a relatively newer
 language, doesn't have equivalents to.
 + Built-in default SQLite makes it easier to set up?
 (as far as I can tell, Ruby requires MySql by default--don't
 know how easy this is to change.)
 + I find the templating system somewhat cleaner; code in
 py: xml namespace allows pure .html templates, instead
 of equivalent of .rhtml files.

 Ruby:
 + More mature system. More stable? More features?
 + Much better documented. This is a biggie.
 + Built-in Rubydoc system would make documenting the
 system easier. (IMHO, developers almost always
 underestimate the need for good documentation that
 is written along withe the system.) Is there a
 Python doc system that has received Guido's blessing
 yet? D'oxygen would seem an obvious choice.
 + Better coordination with Javascript helper code?

 I was initially leaning towards Rails due to maturity,
 but the most recent version of TurboGears seem to have
 fixed a lot of the ad hoc feeling I got from previous
 versions. But I'm still very much up in the air.

 Thanks,
 Ken

 P.S. If I wanted to provide an image by streaming the
 file data directly over the connection, rather than by
 referring to an image file, how would I do that? I'd
 like to build code that would allow images to be assembled
 into a single-file photo album (zip or bsddb file), and
 so can't refer to them as individual image files.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which KDE IDE for Python?

2006-08-14 Thread gregarican
SPE looks good. I've used Komodo for about a year or so but am
considering giving SPE a try. All of the malware/spyware/adware that
was attempting to load on my system when I visited the SPE website
wasn't so good, however :-/

crystalattice wrote:
 Bart Ogryczak wrote:
  Hi,
  Rigth now I'm using two IDEs for Python, KDevelop and Eric. Both have
  drawbacks. KDevelop is a multilanguage IDE, and doesn't really have
  anything special for Python. There's no Python debugger, no PyDOC
  integration, it's class browser doesn't display attributes. On the
  other side there's Eric, which is made just for Python. But.. it
  doesn't integrate with KDE, doesn't support remote files (fish://,
  ftp:// etc.). Does anyone know a better IDE for Python, that'll
  integrate nicely with KDE?

 You might try SPE (http://stani.be/python/spe/blog/).  I don't know if
 it integrates w/ KDE but it's expressly for Python.  From the site:

 Spe is a free python IDE with auto indentation  completion, call
 tips, syntax coloring  highlighting, UML diagrams, class explorer,
 source index, auto todo list, sticky notes, pycrust shell, file
 browsers, dragdrop, context help, Blender support, ... Spe ships with
 Python debugger (remote  encrypted), wxGlade (gui designer), PyChecker
 (source code doctor) and Kiki (regex console).

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Need a compelling argument to use Django instead of Rails

2006-07-27 Thread gregarican

Bruno Desthuilliers wrote:
 Please define security. I fail to see how language-inforced access
 restriction (and mandatory declarative static typing etc) relates to
 'security'. As far as I'm concerned, security is about protecting a
 system from piracy, not about inflicting useless pain to programmers.

I must agree here. When I am coding I appreciate ease of referencing
things above and beyond a language tying my hands behind my back
supposedly in the name of security. If I am savvy enough and know what
I am doing I can create classes, methods, etc. that implement an
effective security model in terms of encapsulation and hiding. But
there are times that I am creating something that I don't want boxed in
by the language enforcing all of this for me. It's like when people
dismiss PHP as a supposedly insecure language. It's more a problem of
too many newly initiated PHP developers not using techniques they
should be to create secure applications.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread gregarican
I would suggest trying to pick up Ruby. Knowing both Python and Ruby
has helped me in that I can choose whichever tool is the best fit.
There are certain cases where I have to abandon Ruby for a certain
project because the library isn't mature enough or cross platform
enough for my requirements. So coding in Python is my option. Then
again there are other things where I am able to choose Ruby as the best
fit because of other concerns. The languages are different, but not
_that_ different. If you can get past the initial Perlishness (is that
a word?) of Ruby you will find that going from one language to the
other isn't that huge of a jump.

Damjan wrote:
  Nah, we're not interested in Python.

 This is a hard attitude, but I have the same feeling about Ruby, I like
 Python and just don't see a reason to invest any time in Ruby (Rails or
 not).. and from that little I've seen from it.. I didn't like it.
 OTOH Ruby surelly is not that bad either.
 
 -- 
 damjan

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread gregarican

Ray wrote:

 The lack of support for Oracle and SQL Server by Django is also a
 killer that'll prevent Django from being picked up by a LOT of
 companies (sadly, including mine :( ).


Uh, yeah. I was aware of Django but haven't had the time to delve into
it. If it doesn't support these larger scale database server types that
would indeed throw a red flag up in certain environments. What all
types doesn't it support? MySQL, PgSQL, SQL Lite, Pervasive SQL? I
know. I haven't made Google my friend and haven't STFW :-/

-- 
http://mail.python.org/mailman/listinfo/python-list


SOAPy Question

2006-07-20 Thread gregarican
I apologize in advance for not googling in depth enough :-) I am
looking for use Python's SOAP implementation to pull some retail
pricing data for a work project. Our Internet access goes through an
authenticating proxy server. Can I access information in this scenario
using SOAPy? I have seen cases where the SOAP service requires
authentication and various SOAP implementations account for this. But I
am looking to specify the proxy server authentication to even get out
to the external SOAP service. 

Will this be doable?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: SOAPy Question

2006-07-20 Thread gregarican
Please disregard, as I googled my way to the answer. I used SOAPProxy
to specify the information I needed to get out to the external SOAP
service. All is well and away we go :-)

gregarican wrote:
 I apologize in advance for not googling in depth enough :-) I am
 looking for use Python's SOAP implementation to pull some retail
 pricing data for a work project. Our Internet access goes through an
 authenticating proxy server. Can I access information in this scenario
 using SOAPy? I have seen cases where the SOAP service requires
 authentication and various SOAP implementations account for this. But I
 am looking to specify the proxy server authentication to even get out
 to the external SOAP service. 
 
 Will this be doable?

-- 
http://mail.python.org/mailman/listinfo/python-list


Widestudio Users?

2006-07-14 Thread gregarican
Just curious if anyone out there uses Python programming in the
Widestudio (http://www.widestudio.org) GUI IDE toolkit. I have looked
into it when running into some portability limitations trying certain
GUI tookits for Ruby, but couldn't get immersed into Widestudio. Since
I use Python as well I was wondering if Pythonistas have given this a
shot. Off hand the widgets look a bit old and ugly, but from a
portability and language support standpoint it has still been on my
radar.

This GUI IDE toolkit comes with support for Ruby, Python, Perl, and
other languages and looks like an effective catch-all, as its bundled
applications can run on Windows, Linux, Windows Mobile, Embedded Linux,
*BSD, Mac OS, etc. But it's primarily geared for a Japanese audience
from the looks of it. There are some books out there for it, but there
are all on Amazon.Com.Jp and don't have English translations available.

Anyone?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python for Embedded Systems?

2006-07-14 Thread gregarican
Here's an URL to a project that appears to be dated from 2004 --
http://skreak.com/wrt54g/python.php.

Jack wrote:
 Is there a Python packaging that is specifically for
 embedded systems? ie, very small and configurable so the
 user gets to select what modules to install?

 For Linux-based embedded systems in particular?

 I'm thinking of running it on the Linksys's Linux-based open
 source router WRT54G. It has 4MB flash and 16MB RAM. I think
 another model has 16MB flash. Any possibilities of running
 Python on these systems?

 If Python is not the best candidate for embedded systems because
 of the size, what (scripting) language would you recommend?

 PHP may fit but I don't quite like the language. Anything else?
 Loa is small but it does not seem to be powerful enough.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python for Embedded Systems?

2006-07-14 Thread gregarican
Or Python on the Zaurus, which I used to develop a wifi CRM app on a
group of refurb Sharp Zaurus SL-5500 units. Here's a link to the Python
implementation on the Z -- http://starship.python.net/~hinsen/Zaurus/.

Grzegorz Makarewicz wrote:
 Jack wrote:
  Is there a Python packaging that is specifically for
  embedded systems? ie, very small and configurable so the
  user gets to select what modules to install?
 
  For Linux-based embedded systems in particular?
 
  I'm thinking of running it on the Linksys's Linux-based open
  source router WRT54G. It has 4MB flash and 16MB RAM. I think
  another model has 16MB flash. Any possibilities of running
  Python on these systems?
 
  If Python is not the best candidate for embedded systems because
  of the size, what (scripting) language would you recommend?
 
  PHP may fit but I don't quite like the language. Anything else?
  Loa is small but it does not seem to be powerful enough.
 
 
 
 python on palmos - latest version was below 1.5.2 - but is quite interesting
 has small fotoprint, is fast and usefull
 but isn't maintained by years
 
 mak

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: first book about python

2006-07-12 Thread gregarican
Once you are ready to take the plunge another good document is the
Python tutorial written by Guido Von Rossum himself
(http://docs.python.org/tut/). It's not a full fledged 300 page
manifesto but it's covers the basic of the language.

IOANNIS MANOLOUDIS wrote:
 I guess it's better to wait for the for dummies book.
 I should focus instead in taking the LPIC-2 exams in September.
 Ioannis

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: first book about python

2006-07-10 Thread gregarican
Learning Python, Perl, or Ruby would help you create admin scripts that
would save you lots of manual work. For me automated log file alerting,
SQL query parsing, SQL table updates, Internet file
uploading/downloading, etc. has been a huge plus. Perl is likely the
most widely used in terms of existing scripts that you can review,
modify, borrow ideas from, etc.

But from a long term maintainability and readability standpoint I would
recommend Python or Ruby over Perl. Just my $0.02...

IOANNIS MANOLOUDIS wrote:
 I thank everybody for your replies.
 I think I'll get Hertland's book since it's newer than O'reillys.
 I don't want to become a programmer. Neither Python is part of my studies.
 I've finished with my studies. I want to become a Unix/Linux admin and
 knowledge of either Python or Perl is an asset.
 Do you think that this book is the right one for me?
 Ioannis

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: first book about python

2006-07-08 Thread gregarican
Try Learning Python which is part of the O'Reilly series of books
they publish on computer programming. It's a good start. Most public
library systems have copies you can check out, and most larger
bookstores have it. Otherwise there's always Amazon.Com. Welcome to
Python and enjoy!

IOANNIS MANOLOUDIS wrote:
 I want to learn python.
 I plan to buy a book. I always find printed material more convenient than
 reading on-line tutorials.
 I don't know PERL or any other scripting language. I only know some BASH
 programming. I am looking for a book which will help me get started and
 should contain the foundations. I am not looking for the Python bible.
 Any recommendations?
 Ioannis

-- 
http://mail.python.org/mailman/listinfo/python-list


COM Makepy Question

2006-07-07 Thread gregarican
Using Pythonwin's COM Makepy utility I created a COM wrapper around an
OCX file that's used to communicate with a magstripe card reader. The
wrapper was created without incident and I can invoke any get type of
method without a problem. But whenever I attempt to invoke any of the
set type of methods I receive an error message that states:

(-2147352567, 'Exception occurred.', (0, 'ctlUSBHID', 'Client
Site not available', None, 1000398, -2146827890), None)

Googling around I see that this error message indicates an ActiveX
control that's being referenced without residing within a container.
Not sure if this is something that I can fix myself within the Makepy
COM wrapper or if I have to rely on the vendor shipping an updated OCX
file. I did see a Python discussion thread where someone else ran into
a similar problem and had to wait for the vendor to ship a revised OCX
file.

Dolphin Smalltalk has a similar COM wrapper utility and the same exact
error occurs. The OCX file is ideally suited for Visual Basic but I
don't have that compilation environment setup on my workstation to try
out.

Anyone familiar with such matters? I have contacted the vendor to try
to initiate things on that end. But if there's something I can do to
circumvent that route using Python I'd give it a go.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: COM Makepy Question

2006-07-07 Thread gregarican
Gotcha. That makes perfect sense looking at the container references
others made during my Googling adventures. Thanks!

Stefan Schukat wrote:
 It seems that the ocx only works in a GUI environment. Perhaps you could
 try to embed
 the ocx in a pythonwin dialog which you create invisible since the
 dialog is then
 a control container

 see Python24\Lib\site-packages\pythonwin\pywin\Demos\ocx\ocxtest.py

   Stefan

  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On
  Behalf Of gregarican
  Sent: Friday, July 07, 2006 1:37 PM
  To: python-list@python.org
  Subject: COM Makepy Question
 
  Using Pythonwin's COM Makepy utility I created a COM wrapper
  around an OCX file that's used to communicate with a
  magstripe card reader. The wrapper was created without
  incident and I can invoke any get type of method without a
  problem. But whenever I attempt to invoke any of the set
  type of methods I receive an error message that states:
 
  (-2147352567, 'Exception occurred.', (0, 'ctlUSBHID', 'Client
  Site not available', None, 1000398, -2146827890), None)
 
  Googling around I see that this error message indicates an
  ActiveX control that's being referenced without residing
  within a container.
  Not sure if this is something that I can fix myself within
  the Makepy COM wrapper or if I have to rely on the vendor
  shipping an updated OCX file. I did see a Python discussion
  thread where someone else ran into a similar problem and had
  to wait for the vendor to ship a revised OCX file.
 
  Dolphin Smalltalk has a similar COM wrapper utility and the
  same exact error occurs. The OCX file is ideally suited for
  Visual Basic but I don't have that compilation environment
  setup on my workstation to try out.
 
  Anyone familiar with such matters? I have contacted the
  vendor to try to initiate things on that end. But if there's
  something I can do to circumvent that route using Python I'd
  give it a go.
  
  --
  http://mail.python.org/mailman/listinfo/python-list
 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: HTPPD eror on red hot linux

2006-07-03 Thread gregarican
Ever read Flowers for Algernon? Just curious...

donxfabio wrote:
 Help me

 Syntax error on line 189 of /etc/httpd/conf/httpd.conf:
 Cannot load /etc/httpd/modules/mod_unique_id.so into server:
 /etc/httpd/modules/mod_unique_id.so: ELF file's phentsize not the
 expected size
  Whats this?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: what are you using python language for?

2006-06-08 Thread gregarican
Wow that's serious Old School. Reminds me of way-back-when in Data
Processing class we used VisiCalc on the old Trash-80's for spreadsheet
work. Cut a notch in those 5 1/4 floppies and voila, you doubled your
storage capacity :-)

Dennis Lee Bieber wrote:
 On Thu, 08 Jun 2006 13:52:38 GMT, John Salerno
 [EMAIL PROTECTED] declaimed the following in comp.lang.python:

  Jason wrote:
   I've been working on an RPG character generator for consistent (yet
   varied) set of role-playing systems.  Nothing like a pen-and-pencil RPG
   to throw in tons of special cases and strange rulesets.
 
  Sounds interesting. Something I've thought about as a project, but I'm
  not good enough yet! :)

   Many years ago I had the starship design tables from (first edition)
 Traveller incorporated into a Multiplan spreadsheet running on a TRS-80
 Model 4
 --
   WulfraedDennis Lee Bieber   KD6MOG
   [EMAIL PROTECTED]   [EMAIL PROTECTED]
   HTTP://wlfraed.home.netcom.com/
   (Bestiaria Support Staff:   [EMAIL PROTECTED])
   HTTP://www.bestiaria.com/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 10GB XML Blows out Memory, Suggestions?

2006-06-07 Thread gregarican
Am I missing something? I don't read where the poster mentioned the
operation as being CPU intensive. He does mention that the entirety of
a 10 GB file cannot be loaded into memory. If you discount physical
swapfile paging and base this assumption on a normal PC that might
have maybe 1 or 2 GB of RAM is his assumption that out of line?

And I don't doubt that Python is efficient as possible for I/O
operations. But since it is an interpreted scripting language how could
it be just as fast as any language as you claim? C would have to be
faster. Machine language would have to be faster. And even other
interpreted languages *could* be faster, given certain conditions. A
generalization like the claim kind of invalidates the remainder of your
assertion.

fuzzylollipop wrote:
 K.S.Sreeram wrote:
  Diez B. Roggisch wrote:
   What the OP needs is a different approach to XML-documents that won't
   parse the whole file into one giant tree - but I'm pretty sure that
   (c)ElementTree will do the job as well as expat. And I don't recall the
   OP musing about performances woes, btw.
 
 
  There's just NO WAY that the 10gb xml file can be loaded into memory as
  a tree on any normal machine, irrespective of whether we use C or
  Python. So the *only* way is to perform some kind of 'stream' processing
  on the file. Perhaps using a SAX like API. So (c)ElementTree is ruled
  out for this.
 
  Diez B. Roggisch wrote:
   No what exactly makes C grok a 10Gb file where python will fail to do so?
 
  In most typical cases where there's any kind of significant python code,
  its possible to achieve a *minimum* of a 10x speedup by using C. In most
  cases, the speedup is not worth it and we just trade it for the
  increased flexiblity/power of the python language. But in this situation
  using a bit of tight C code could make the difference between the
  process taking just 15mins or taking a few hours!
 
  Ofcourse I'm not asking him to write the entire application in C. It
  makes sense to just write the performance critical sections in C, and
  wrap it in Python, and write the rest of the application in Python.


 you got no idea what you are talking about, anyone knows that something
 like this is IO bound.
 CPU is the least of his worries. And for IO bound applications Python
 is just as fast as any other language.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 10GB XML Blows out Memory, Suggestions?

2006-06-07 Thread gregarican
Point for Fredrik. If someone doesn't recognize the inherent
performance differences between different XML parsers they haven't
experienced the pain (and eventual victory) of trying to optimize their
techniques for working with the albatross that XML can be :-)

Fredrik Lundh wrote:
 fuzzylollipop wrote:

  dependes on the CODE and the SIZE of the file, in this case
  processing 10GB of file, unless that file is heavly encrypted or
  compressed will, the process will be IO bound PERIOD!

 so the fact that

  for token, node in pulldom.parse(file):
  pass

 is 50-200% slower than

  for event, elem in ET.iterparse(file):
   if elem.tag == item:
   elem.clear()

 when reading a gigabyte-sized XML file, is due to an unexpected slowdown
 in the I/O subsystem after importing xml.dom?

  I work with TeraBytes of files, and all our Python code is just as fast
  as equivelent C code for IO bound processes.

 so how large are the things that you're actually *processing* in your
 Python code?  megabyte blobs or 100-1000 byte records?  or even smaller
 things?
 
 /F

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 10GB XML Blows out Memory, Suggestions?

2006-06-06 Thread gregarican
10 gigs? Wow, even using SAX I would imagine that you would be pushing
the limits of reasonable performance. Any way you can depart from the
XML requirement? That's not really what XML was intended for in terms
of passing along information IMHO...

[EMAIL PROTECTED] wrote:
 I wrote a program that takes an XML file into memory using Minidom. I
 found out that the XML document is 10gb.

 I clearly need SAX or something else?

 Any suggestions on what that something else is? Is it hard to convert
 the code from DOM to SAX?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 10GB XML Blows out Memory, Suggestions?

2006-06-06 Thread gregarican
That a good sized Goldmine database. In past lives I have supported
that app and recall that you could match the Goldmine front end against
an SQL backend. If you can get to the underlying data utilizing SQL you
can selectively port over sections of the database and might be able to
attack things more methodically than parsing through a mongo XML file.
Instead you could bulk insert portions of the Goldmine data into
SugarCRM. Know what I mean?

[EMAIL PROTECTED] wrote:
 The file is an XML dump from Goldmine. I have built a document parser
 that allows for the population of data from Goldmine into SugarCRM. The
 clients data se is 10gb.

 Felipe Almeida Lessa wrote:
  Em Ter, 2006-06-06 às 13:56 +, Paul McGuire escreveu:
   (just can't open it up like a text file)
  
  Who'll open a 10 GiB file anyway?
  
  -- 
  Felipe.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: what are you using python language for?

2006-06-06 Thread gregarican
Currently I am using Python for a CRM client application that runs on
Win32, ARM Linux, and WinCE platforms. It pushes and pulls contact data
using XMLRPC calls so that it doesn't lock the client into having to
use CDO for communicating with the Exchange Server and ADO for
communicating with the SQL Server.

hacker1017 wrote:
 im just asking out of curiosity.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: New to Python: Do we have the concept of Hash in Python?

2006-06-02 Thread gregarican
I needed certain Windows specific libraries that were difficult to
impossible to do in Ruby. For example the Qt toolkit, LDAP support, and
a WinCE implementation. Python is more Windows-friendly so I ported
certain apps over to Python since Ruby left me hanging in just those
specifics areas.

As for my preferred language I use Smalltalk, Ruby, and Python each
about a third of the time depending on what I'm looking to accomplish.
For quick admin scripts Ruby is my choice, but perhaps that's just
because I learned it first :-)

Sion Arrowsmith wrote:
 gregarican [EMAIL PROTECTED] wrote:
 I came from using Ruby about a year or so [ ... ]

 That's an interesting way round. Why did you consider Python if
 you already knew Ruby, and which is now your preferred language?
 (I've no interest in learning Ruby, but from what I've seen of it
 I similarly can't imagine what would motivate me to learn Python.)

 --
 \S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/
   ___  |  Frankly I have no feelings towards penguins one way or the other
   \X/  |-- Arthur C. Clarke
her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: New to Python: Do we have the concept of Hash in Python?

2006-06-01 Thread gregarican
Lemme see, starting *and* finishing a project in a language you've
never practically used before within a day's time? Sounds like a clip
from next season's opener of the TV show '24' to me.

I came from using Ruby about a year or so and even then it took a
couple of days of browsing through the Python docs and playing around
until I could consider myself somewhat useful. Coming from Java and C#
might make the departure a little steeper. Good luck!

A.M wrote:
 Fredrik Lundh [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  A.M wrote:
 
  I am new to Python, with C#/Java background
 
  that's not really much of an excuse for not reading *any* Python tutorial
  before
  you jump in...

 Hi Fredrik,

 1st of all, I am really impressed by this Python community. Answers are
 helpful and I am having excellent progress. I appreciate everybody's help.



 This is my 1st day that I am seriously diving into Python and I have to
 finish this application by the end of today. Maybe it wasn't a good idea to
 choose the language that I don't know when I have to deliver my work in such
 short time. I understand that my question might seems very trivial to you,
 but please consider the fact that I am in time pressure and I cannot go
 through a 400 book today. I promises I'll do that this weekend ;) Wish luck
 for me!
 
 
 
 Thank you for your post,
 
 Alan

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: New to Python: Do we have the concept of Hash in Python?

2006-06-01 Thread gregarican
We have sort of a  problem  here  uh  yeah
(http://www.luminomagazine.com/2004.03/spotlight/officespace/images/lumbergh/lumbergh1.jpg)...

Fredrik Lundh wrote:
 A.M wrote:

  This is my 1st day that I am seriously diving into Python and I have to
  finish this application by the end of today. Maybe it wasn't a good idea to
  choose the language that I don't know when I have to deliver my work in such
  short time.
 
 are your boss aware of this ?
 
 /F

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: New to Python: Do we have the concept of Hash in Python?

2006-06-01 Thread gregarican
Dear A.M.,

The day is complete. My TPS reports still aren't on my desk. Either
with or without cover sheets. Not a good time to try to teach yourself
a new language. Please gather your belongings and move down to basement
storage C.

That'd be great,
Bill Lumberg

John Machin wrote:
 A.M wrote:

  The application is not mission critical system. It is just a simple
  reporting tool.
 
 Famous last words.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Programming Books?

2006-05-24 Thread gregarican
I third this opinion. This book gave me a lot of insight and helped me
get comfortable using Python. I also recall looking at a document Guido
published on how to get started with Python as well as reading the
reference docs that come bundled with the language install. Of course I
came from a background of already using Ruby so the departure wasn't
altogether difficult. The languages are different but to me they seem
like cousins :-)

Typically when I try to teach myself a new language, such as Python,
Ruby, Smalltalk, Scheme, Haskell, etc. I check out my online catalog
through my local library system. Usually I can find a couple of books
to peruse. If I don't like them I can just drop them back off. Then I
check out eBay for used books. This route was especially helpful for
teaching myself Smalltalk, since a lot of the books were 10-20 years
old so I picked them up for anywhere between $1.00 to $5.00.

I digress. Learning Python by Mark Lutz is a thorough and complete
introduction to what you need to know to get started. Even if you are
coming into Python with no prior programming language exposure.

John Salerno wrote:
 vbgunz wrote:
  Learning Python by Mark Lutz will be the most perfect book to get you
  started! Perhaps there are others aimed at the non-programmer but after
  getting through that book (2 times) I finally left it with wings... It
  is a great book for the n00b in my humble opinion. After that, you'll
  pretty much start flying higher on your own as long as you always keep
  the python docs handy along with the addresses to comp.lang.python and
  it's IRC channel #python on irc.freenode.net...
 
  Good luck, welcome to Python!
 

 I second this opinion completely. Use this book to start with! It is a
 wonderful intro to the language and will give you a solid foundation.

 As for waiting for a 3rd edition, don't do it! If you're like me, you'll
 want the latest there is, so I was tempted to start with something newer
 too (since this book covers up to 2.2), but honestly it covers
 everything you need to know. There are maybe two or three new additions
 that you can read about elsewhere, but Learning Python is THE book to
 start with, IMO.
 
 Get it now! :)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabs versus Spaces in Source Code

2006-05-15 Thread gregarican
Peter Decker wrote:

 Funny, I was going to say that the problem is when the author prefers
 a font with a differntly-sized space. Some of us got rid of editing in
 fixed-width fonts when we left Fortran.

Don't know what all of the hub-bub here is regarding tab/space
indentation. My punched cards break down such matters as in quite fine
fashion :-/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: basic python programing

2006-04-30 Thread gregarican
Ravi Teja wrote:

 How To Ask Questions The Smart Way
 http://www.catb.org/~esr/faqs/smart-questions.html

Actual the parent post on the thread wasn't asking a question. They
were making a somewhat puzzling dangling statement.

here we discuss the most basic concepts about python

Where is _here__? The comp.lang.python newsgroup? In the poster's head?
These are but a sampling of my own stoopid questions.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tkinter vs PyGTK

2006-04-12 Thread gregarican
JyotiC wrote:

 Thanx for the help.

 Does all gui's take time to load.
 is there a way to dec this time.

Have you tried loading a Java GUI app through launching the Java
Virtual Machine? That's pretty slow too. And that's a bytecode compiled
medium. Unfortunately most interpreted programming languages like Perl,
Ruby, Python, etc. are pretty slow loading initial GUI environments.
That's the performance penalty that is offset by the benefits and
efficiency of coding in a very high level language. Less than a second
of load time doesn't seem to be too much of a detraction in my book,
however. If you want pure speed you would need to code in a true
compiled programming language such as C (e.g. - GTK GUI toolkit), C++
(e.g. - Qt GUI toolkit), etc. But what fun is that :-)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how relevant is C today?

2006-04-11 Thread gregarican
bruno wrote:

 Err...

 And ?

It's the snide, curt replies such as your recent ones in this thread
that reinforce the generalization that the Python community can be
rude.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how relevant is C today?

2006-04-10 Thread gregarican
bruno wrote:

 Err... Even if Lisp is the father of functional programming, it is
 definitively not a 'pure' FPL.

True. I couldn't referred to something like Haskell as being pure FP.
My bad :-)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how relevant is C today?

2006-04-10 Thread gregarican
Rune wrote:

 No. Simula is the original object oriented programming language.

Thanks for pointing this out. I had read about references to Simula but
never looked beyond the term itself. Interesting stuff. Especially
since it was developed so long ago. Very interesting...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how relevant is C today?

2006-04-09 Thread gregarican
Here are a few languages I recommend most programmers should at least
have a peek at:

1) Smalltalk - The original object oriented programming language.
Influenced anything from Mac/Windows GUI to Java language. Terse, clean
syntax. IDE rolled into an operating system rolled into a set of core
libraries.
2) Lisp - Along with FORTRAN, one of the oldest programming languages
still in use. Pure functional programming model that is extensible and
has many derivatives. Great for mathematical purposes. Easy to learn if
you can get past all of the nested parenthesis :-)
3) C - The Latin of modern programming languages. Used in low level
tasks (e.g. - hardware drivers) as well as larger projects (e.g. -
operating systems and other programming languages). Logcal, explicit
flow albeit a bit wordy.

I have worked in C and Smalltalk for awhile now and just starting to
pickup Lisp. Knowing different languages can help you approach problems
with a fresh perspective. I prefer to code in Ruby and Python but can
use these languages a certain way given the angles I have picked up
elsewhere...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is pwm Python MegaWidgets viable?

2006-04-02 Thread gregarican
Paul Watson wrote:

 Does pwm run well on Python 2.4?  The last release appears to be in
 2003.  The Manning discussion forum is dead.

 Is there a better path to learning and producing tkInter apps?


 Has there been any discussion of wxPython becoming part of the base
 Python distro?  A requirement here is to not require download/install of
 anything other than the Python release.

I can't vouch for Python 2.4, but I used the PMW library pretty
extensively for an app that is based on Python 2.3. Tkinker itself
offers most of the basic widgets that any Tk implementation does, and
there's an online guide (can't recall the URL right now) to Tkinter
that is great for an introduction tutorial. PMW is an add-on to Tkinter
that is useful if there are specific widgets that you need that basic
Tkinter doesn't provide and you don't feel like creating them from
scratch. Just because it doesn't have a new release in the past couple
of years doesn't mean that it's truly a dead project. Perhaps it's
stabilized and there haven't been overwhelming requests for adding any
new items to it. Using PMW won't help you learn Tkinter any quicker in
any event. Just icing on the cake :-)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is pwm Python MegaWidgets viable?

2006-04-02 Thread gregarican
Paul Watson wrote:

 Many thanks for your reply.  I was setting out to make use of the
 Manning book by Grayson.  Perhaps I should just use online tutorial and
 such for learning plain-old tk first.  However, I have heard good things
 about the book.  Just trying to use what was already at hand.

Here's the online tutorial that provides a basic introduction to
Tkinter -- http://www.pythonware.com/library/tkinter/introduction/. I
found it handy. I had used Tk implementations in other languages such
as Ruby so I had already become familiar with the overall Tk toolkit,
but nevertheless the online Tkinter tutorial was refreshing. Wasn't
aware of the Manning book but it sounds like a great resource as well!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can XML-RPC performance be improved?

2006-03-21 Thread gregarican
Sion Arrowsmith wrote:

 shovel huge amounts of data

That right there basically takes XML-RPC off the table as a viable
solution. No matter how much fine tuning you try large amounts of data
don't bode well using XML-RPC. The other posted alternatives are
certainly worth a shot. From CORBA to cPickle to even a basic TCP
socket connection would be more efficient. I have used XML-RPC for very
small recordset transfers but I wouldn't use it for anything large.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can XML-RPC performance be improved?

2006-03-21 Thread gregarican
Skip wrote:

 I don't know about the OP, but in my case it was a drop-dead simple
 cross-language RPC protocol.

Exactly. RPC implementations. Typically these are a quick do this with
this sent from the client, with a brief okay, I did that, here's the
result back from the server. Shovelling huge amounts of data using any
XML encapsulation leads to a certain code smell at the very least.

-- 
http://mail.python.org/mailman/listinfo/python-list


Python on an old NEC MobilePro 780

2006-03-21 Thread gregarican
I have Python 2.3 with Tkinter working on a Dell Axim x50 (ARM Windows
Mobile 5.0) and Python 2.3 with PyQt working on a Sharp Zaurus SL-5500
(ARM Linux Embedded). Now I purchased an NEC MobilePro 780 (MIPS
Windows CE 2.11 Handheld PC 3.01). Any suggestions on the most recent
Python and Tkinter implementations I can install on it? I tried an old
Python 1.5 install for MIPS Windows CE and it seems to work okay. But
finding a Tkinter implementation seems to be a little more difficult...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Getting .NET SDK to work with Python 2.4.2

2006-03-19 Thread gregarican
Dave wrote:

 yea i have .net 1.1, but not the sdk. do i need the 1.1 SDK too?

I think so. The .Net 1.1 runtime (i.e. - not the SDK) is missing the
support files necessary for compiling programs. Gotta love those huge
downloads. I thought the Java SDK's were big :-)~

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to deal with socket.error: (10060, 'Operation timed out')

2006-03-18 Thread gregarican
JuHui wrote:

I wrote a script to get 100 pages from a server.
like below:

 1:import httplib
 2:conns = httplib.HTTPConnection(www.mytest.com)
 3:conn.request(GET, /)


 sometimes a socket error was raised.


   File D:\usr\bin\lib\httplib.py, line 627, in connect
 raise socket.error, msg
 socket.error: (10060, 'Operation timed out')


 how to catch this kind of error then retry the GET operation?

You can use this below if you only want one retry ---

import httplib
conns = httplib.HTTPConnection(www.mytest.com)

try:
conn.request(GET, /)
except:
try:
conns.request(GET, /)
except:
print I bombed out!

# blah blah blah

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Love :)

2006-03-13 Thread gregarican
Paul Rubin wrote:

 reversed(a_string) (python)

Which version of Python offers this function? It doesn't seem to be
available in the 2.3 version I have installed...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Love :)

2006-03-13 Thread gregarican
Paul Rubin wrote:

 Darn, yes, that's the second time in the past couple weeks I've made
 that exact same error in a clpy post.  So what's the most concise way
 of turning it back into a string?  ''.join(list(reversed(a_string))) ?
 Bleccch. 

Use Ruby:

print A String.reverse

Just kidding :-)~

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python IDE: great headache....

2006-03-11 Thread gregarican
Sullivan wrote:

 IDLE is no longer satisfactory for me. Other IDEs make me very
 confused. Really do not know which one to use.

 I use WinXP sp2 for current development.

Personally I have gotten used to coding using ActiveState's Komodo. It
doesn't get in my way and offers the basic features I am looking for.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Evangelism

2006-03-09 Thread gregarican
rtilley wrote:

 It would be a smashing success.

And I have an idea for a party game. It's called Jump to Conclusions.
There would be a mat with all of these conclusions written down and...

-- 
http://mail.python.org/mailman/listinfo/python-list


Timeout in xmlrpclib client call?

2006-03-09 Thread gregarican
Looking at the docs for xmlrpclib I didn't see a way to pass a client
call with an expressed timeout value. What is the easiest way to
accomplish this? Do I have to tap into the underlying HTTP requests
being sent? I want to build more try:except: error checking into my
application and the app currently is blocking for the xmlrpclib client
call. I could capture an HTTP connection timeout message or the like
but was wondering if I could build something into the xmlrpclib call
itself with a shorter timeout threshold.

-- 
http://mail.python.org/mailman/listinfo/python-list


PyQt - multiple window instances?

2006-02-24 Thread gregarican
I have an PyQt app were I need one of the windows to be able to be
opened more than one at a time. When I try to open it I only get one
instance at the same time. The main class is the QWidget() class with a
QGridLayout() displaying the various window components.

Is there a certain flag I need to set or different constructor I need
to use to allow the window to be opened more than one at a time?

Here's a brief snippet of the code that displays the window:

def new_showing(self):
 This method creates a new contact showing record. 

if self.flag == 'KNOWN':
try:
test_contact = self.entry_id
except:
QMessageBox.warning(self, Qt CRAM, There is no
contact record loaded.\nPlease select a contact record first.)
return

self.new_show_widget=QWidget()
self.new_show_widget.resize(240, 280)
self.new_show_widget.setCaption('Qt CRAM - Contact Showings')

# Define the Qt layout to be used for the window.
self.new_show_grid=QGridLayout(self.new_show_widget, 8, 2)

# bunch of widgets displaying stuff

self.new_show_widget.show()

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt - multiple window instances?

2006-02-24 Thread gregarican
The window isn't being created as a new class instance or anything. The
main class is the application main window as a whole and this
particular window is just part of that class. I have typed data into
the window, then tried to open up a new window. But when I do the
window where I have typed data disappears and is replaced by a new
window that's blank. What's the easiest way to keep a reference to the
old window?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt - multiple window instances?

2006-02-24 Thread gregarican
Diez B. Roggisch wrote:

  The window isn't being created as a new class instance or anything.


 Yes it is. QWidget() creates a new instance of QWidget.

   The



  main class is the application main window as a whole and this
  particular window is just part of that class. I have typed data into
  the window, then tried to open up a new window. But when I do the
  window where I have typed data disappears and is replaced by a new
  window that's blank. What's the easiest way to keep a reference to the
  old window?


 By putting it into a list for example?
 
 Diez 

Perfect! Thanks for the tip. That worked perfectly.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jython on the Palm OS?

2006-01-31 Thread gregarican
Khalid Zuberi wrote:

 While someone has recently done some work to get Jython working with  J2ME
 (reference below), I think its targetted at Pocket PC class devices (CDC spec)
 as opposed to palm (CLDC as far as i know).

   http://thread.gmane.org/gmane.comp.lang.jython.devel/1826

Thanks for the link. Since my app isn't too complex I am going to try
to deploy it using SuperWaba on the Palm OS. I downloaded an Eclipse
plug-in for in and see there's an XMLRPC extension available for
SuperWaba as well. This the communications method I use for my app so
we'll see how it goes!

-- 
http://mail.python.org/mailman/listinfo/python-list


Jython on the Palm OS?

2006-01-30 Thread gregarican
I have completed recoding my CRM app into Python so that it will run on
Win32, ARM Linux, and ARM Windows Mobile platforms. Now I am looking to
try to roll it into the Palm OS platform. Since Pippy is based on an
older version of Python than I am using for my other implementations I
was thinking about using Jython. Would this be a viable option for the
Palm OS platform? I installed IBM Websphere Everywhere Micro
Environment on a test Palm Tungsten C I have, but didn't see this JVM
listed on the Jython compatibility list. So I am heading down a blind
alley I suppose?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tkinter listener thread?

2006-01-27 Thread gregarican
Eric Brunel wrote:

 There's in fact no need to check regularly if there's something in the
 Queue: the secondary thread can post a tk custom event to trigger the
 treatment automatically from within the main GUI loop. See here:
 http://minilien.fr/a0k273

Appreciate the suggestion. This further helps simplify things. So far
so good getting the UDP listener to work well within Tkinter. This
listener takes an incoming CTI screen pop of the caller ID and queries
it against a CRM database to bring up the appropriate contact record if
applicable. One of these days I need to port the CTI library over from
Ruby into Python so I don't have to rely on a UDP socket connection and
can just pass the data natively within Python. But this is a workaround
until that day comes.

Thanks again. I am very impressed with the Python community in terms of
knowledge and helpfulness. It's made matters a lot easier for this
particular Python newbie...

-- 
http://mail.python.org/mailman/listinfo/python-list


Tkinter listener thread?

2006-01-26 Thread gregarican
I have a Python UDP listener socket that waits for incoming data. The
socket runs as an endless loop. I would like to pop the incoming data
into an existing Tkinter app that I have created. What's the
easiest/most efficient way of handling this? Would I create a separate
thread that has the listener set a certain Tkinter variable if there is
incoming data? Any suggestions would be tremendously appreciated :-)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tkinter listener thread?

2006-01-26 Thread gregarican
Grant Edwards wrote:

 Unless tk.createfilehandler isn't supported no Wni32
 platforms??

 Unfortunately that's the case. As of Python 2.3.4 under Windows XP the
createfilehandler method isn't available. It's only for UNIX as Mac
platforms AFAIK. Shame, as it would be relatively easy to implement.
Instead I'll look to set/check some global flags to hopefully get
things working smoothly. Using Qt it's so much easier. Some apps I used
the QThread class, while others I just set as QTimer instance to run a
regular background process :-(

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tkinter listener thread?

2006-01-26 Thread gregarican
Steve Holden wrote:

 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82965

Thanks. I tried a variation of this Queue posting/Flag checking method
and it worked to a tee. The problem was that my UDP socket query was
blocking things so that thread was hanging everything up. So I used a
socket timeout value along with a try: except: construction to query
the socket for data. Now it's fine.

-- 
http://mail.python.org/mailman/listinfo/python-list


CTI library interest?

2006-01-24 Thread gregarican
As part of a project I'm trying to port to Python I am planning on
moving a CTI library it relies on into Python code. Previously the
overall project as well as the associated library were written in Ruby.
Specifically the CTI library utilizes TSAPI/CSTA for linking telephone
equipment with IP computer endpoints. For a glimpse into the Ruby
version of the CTI library check out http://tsapi.rubyforge.org.

Is anyone interested in assisting with the Python implementation of
this CTI library? If you have access to a TSAPI/CSTA-compliant PBX
system or can compile a CSTA simulator on a Linux box that's all you
need to try out your code.

Anyone want to pitch in?

-- 
http://mail.python.org/mailman/listinfo/python-list


Tkinter Mouse Cursor

2006-01-22 Thread gregarican
Checking a couple of examples I tried changing the Tkinter mouse cursor
to indicate a busy state while my app is pushing/pulling xmlrpc data.
It doesn't seem to make a difference as I don't notice the cursor
actually change in the span of the 3-5 second transaction. I tried
changing the cursor of the root widget, the toplevel widget, etc. all
to no avail. Is there something really basic I'm overlooking?  Is it
enough to just change the state and that's it, or do I have to
explictly refresh things?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tkinter Mouse Cursor

2006-01-22 Thread gregarican
Please disregard. I just issued an update() method call to refresh the
GUI. This in turn displayed the proper mouse cursor that was being set
with the config(cursor=xxx) method.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MSSQL LIKE and IN statements in ADO problem

2006-01-19 Thread gregarican
Thanks. Please keep us posted. For some of my potentially exposed areas
I was just doing regex lookups against the input parameter to filter
out possible SQL injection keywords. Obviously not as elegant and
efficient as using ADO parameters to strictly define the data that
should be coming into the SQL statement. Playing around with the code
you provided yesterday I had problems using an ADO parameter as a
condition of the SQL LIKE statement. Not sure if that's an ADO
limitation, a Python ADO limitation, or my relative ignorance :-)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MSSQL LIKE and IN statements in ADO problem

2006-01-19 Thread gregarican
The IN statement logic is a good mind exercise if there are multiple
parameters that needed to be brought in. Below is the code that fixed
the LIKE statement logic where you needed an ADO parameterized query
used. Apparently the percent signs don't have to be referenced anywhere
in the code, as my tests ran successfully without them:

-
import win32com.client
from adoconstants import *


conn = win32com.client.Dispatch(r'ADODB.Connection')
conn.ConnectionString = Driver={SQL
Server};Server=(local);Database=myDB;Trusted_Connection=yes;
conn.Open()
if conn.state == adStateOpen:
print Connected to database...
else:
print Not connected!
exit
cmd=win32com.client.Dispatch(r'ADODB.Command')
cmd.ActiveConnection=conn

name = '@fname'
value = 'raj'
param=cmd.CreateParameter(name, adVarChar, adParamInput, 200, value)
cmd.Parameters.Append(param)
cmd.CommandText = SELECT first, last FROM myTable WHERE first like ?
cmd.CommandType = adCmdText
(rs, dummy)  = cmd.Execute()
rowCount = 0
while not rs.EOF:
print rs.Fields('first').Value, rs.Fields('last').Value
rowCount=rowCount+1
rs.MoveNext() 
print %s records returned. % rowCount
rs.Close()

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MSSQL LIKE and IN statements in ADO problem

2006-01-19 Thread gregarican
Raja Raman wrote:

 Hi Gregarican,
 Thanks for sharing your code. One needs to add the % signs if one
 wants to do wildcard searches using LIKE in the SQL server.
 Do as Roger and Steve suggested '%raj%', now you can find the names
 containing the word raj anywhere in the column.
 just value = 'raj' is only going to fetch you fnames that == 'raj'
 Originally my problem was using the LIKE statement itself. But I guess
 you already know.




Duhhh on my part. A little behind the curve as I'm recouping from adult
chicken pox. Coding from the sickbed isn't ideal I suppose :-)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MSSQL LIKE and IN statements in ADO problem

2006-01-18 Thread gregarican
Can't you get rid of the Create Parameter part and directly pass along
the value you are looking for? Something like...

name = 'raj'
cmd.CommandText= \
SELECT * FROM tb_name WHERE firstname LIKE %%%s % name

This way the value of the name variable gets passed along when the
CommandText method is invoked. BTW, this looks too painfully much like
Visual Basic than Python :-) Just kidding (kind of)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MSSQL LIKE and IN statements in ADO problem

2006-01-18 Thread gregarican
Sorry forgot to explain that with the string substitution stuff you can
escape the percent sign by doubling it up. In my example I wanted to
retain the leading percent sign before the value, in this case I wanted
LIKE %raj to appear. So I doubled it up. That's why there are three
percent signs in a row. The last one is the one associated with the
string substitution for the name variable. Make sense?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MSSQL LIKE and IN statements in ADO problem

2006-01-18 Thread gregarican
Steve Holden wrote:

 Now Google for sql injection vulnerability and tell us why this is a
 bad idea.

The original poster didn't specify if they were writing
production-level code on in Internet-facing server so I didn't exactly
infer a context. You are correct in your statement. I was just pointing
out how substitutions operate if they were indeed an option.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PDA Implementations

2006-01-17 Thread gregarican
Mike Meyer wrote:

 On an unrelated topic, you might take a look at Symbian
 devices. They've released a version of Python 2.3 for it.

  mike

Thanks for the information. That might be worth checking out for sure.
My project might be slightly delayed. I'm 37 yo and am recovering from
chicken pox. Having this at this age is a little more severe it seems
:-(

-- 
http://mail.python.org/mailman/listinfo/python-list


PDA Implementations

2006-01-13 Thread gregarican
I am in the process of creating an app that runs on various PDA
platforms. Currently I have it running on ARM Linux (Sharp Zaurus) and
am starting to port it over to ARM Windows Mobile (Dell Axim). Using
Python has made the task particularly easier and (dare I say it?) kind
of fun. What about porting it over to Palm OS (Palm Tungsten)? Is it
worth it in your collective opinion long-term?

Checking Python releases targeted for Palm OS I see most of these are a
little long in the tooth. For example Pippy uses Python v1.5 I believe.
All of the projects targeted for Palm OS are great and extend Python's
usefulness for sure. But what about their functionality on newer Palm
OS releases such as the Tungsten's? I am mainly looking for xmlrpc
calls being passed to an external server using wif-fi and using a
widget set. Figuring I am locked into Palm's own widget set. Is it
worth it to go to all of this trouble if Palm OS appears to be losing
market share and new Palm hardware devices are running Windows Mobile?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt calling an external app?

2006-01-10 Thread gregarican
Giovanni Bajo wrote:

 You can also go the Qt way and use QProcess. This also gives you 
 cross-platform
 communication and process killing capabilities which are pretty hard to obtain
 (see the mess in Python with popen[1234]/subprocess). You also get nice 
 signals
 from the process which interact well in a Qt environment.
 --
 Giovanni Bajo

Good point. I don't think that this particular class is available with
Qt 2.3.0, which is what I am using for my Sharp Zaurus and Win32
implementations of this app. Once I move up to the world of Qt 4 I will
definitely look into this as an option for certain things. My next
quest will be rewriting this app (again) so that it will run on Windows
Mobile PDA's using Python and Tkinter for the GUI. Since all of the
data pushes/pulls relies on XMLRPC it shouldn't be too daunting. Just
need to present the data nicely :-)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: (Fucking) Unicode: console print statement and PythonWin: replacement for off-table chars HOWTO?

2006-01-10 Thread gregarican
Robert wrote:

 (windows or linux console)



  print u'\u034a'


 Traceback (most recent call last):
   File stdin, line 1, in ?
   File C:\PYTHON23\lib\encodings\cp850.py, line 18, in encode
 return codecs.charmap_encode(input,errors,encoding_map)
 UnicodeEncodeError: 'charmap' codec can't encode character u'\u034a' in
 position
  0: character maps to undefined


Are you certain that this is a valid unicode character? Checking other
values (like \u0020 which is a blank space) seems to work okay. What
does \u034A represent?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt Access Violations

2006-01-09 Thread gregarican
Phil Thompson wrote:

 What version of Qt?

 Phil

It's version 2.3.0 non-commerical for Windows. My OS is Windows 2000
Professional SP4. Using this same version of Qt for a Ruby-based
implementation of a similar app I didn't experience the access
violation crashes when invoking the setCentralWidget() method. It's
sporadic, as the crashes sometimes take 2-3 widget opens/closes to
happen. Other times it takes more. Trying to debug the crashes the
script never makes it past this method. Here's an excerpt from the Dr.
Watson error log:

function: QGList::findRef
39d2dd42 807c240800   cmp byte ptr [esp+0x8],0x0
ss:00c09513=00
39d2dd47 7407 jz  QString::fromUtf8+0x8a
(39d36850)
FAULT -39d2dd49 8b4108   mov eax,[ecx+0x8]
ds:00cd9f51=48001500
39d2dd4c 33d2 xor edx,edx
39d2dd4e eb06 jmp QString::fromUtf8+0x90
(39d36856)
39d2dd50 8b4110   mov eax,[ecx+0x10]
ds:00cd9f51=48001500
39d2dd53 8b5114   mov edx,[ecx+0x14]
ds:00cd9f51=48001500
39d2dd56 56   pushesi
39d2dd57 85c0 testeax,eax
39d2dd59 740e jz  QString::fromLatin1+0xb
(39d36869)
39d2dd5b 8b30 mov esi,[eax]
ds:007ad4d8=00858340
39d2dd5d 3b742408 cmp esi,[esp+0x8]
ss:00c09513=
39d2dd61 7406 jz  QString::fromLatin1+0xb
(39d36869)
39d2dd63 8b4008   mov eax,[eax+0x8]
ds:012873be=

* Stack Back Trace *

FramePtr ReturnAd Param#1  Param#2  Param#3  Param#4  Function Name
0012F664 1E057D56 089FE908 00857948 0001 088FAAD0 !QGList::findRef
0012F6C8 0001   007A5234 00779288 !PyCFunction_Call

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt Access Violations

2006-01-09 Thread gregarican
Phil Thompson wrote:

 What version of Qt?

 Phil

It's version 2.3.0 non-commerical for Windows. My OS is Windows 2000
Professional SP4. Using this same version of Qt for a Ruby-based
implementation of a similar app I didn't experience the access
violation crashes when invoking the setCentralWidget() method. It's
sporadic, as the crashes sometimes take 2-3 widget opens/closes to
happen. Other times it takes more. Trying to debug the crashes the
script never makes it past this method. Here's an excerpt from the Dr.
Watson error log:

function: QGList::findRef
39d2dd42 807c240800   cmp byte ptr [esp+0x8],0x0
ss:00c09513=00
39d2dd47 7407 jz  QString::fromUtf8+0x8a
(39d36850)
FAULT -39d2dd49 8b4108   mov eax,[ecx+0x8]
ds:00cd9f51=48001500
39d2dd4c 33d2 xor edx,edx
39d2dd4e eb06 jmp QString::fromUtf8+0x90
(39d36856)
39d2dd50 8b4110   mov eax,[ecx+0x10]
ds:00cd9f51=48001500
39d2dd53 8b5114   mov edx,[ecx+0x14]
ds:00cd9f51=48001500
39d2dd56 56   pushesi
39d2dd57 85c0 testeax,eax
39d2dd59 740e jz  QString::fromLatin1+0xb
(39d36869)
39d2dd5b 8b30 mov esi,[eax]
ds:007ad4d8=00858340
39d2dd5d 3b742408 cmp esi,[esp+0x8]
ss:00c09513=
39d2dd61 7406 jz  QString::fromLatin1+0xb
(39d36869)
39d2dd63 8b4008   mov eax,[eax+0x8]
ds:012873be=

* Stack Back Trace *

FramePtr ReturnAd Param#1  Param#2  Param#3  Param#4  Function Name
0012F664 1E057D56 089FE908 00857948 0001 088FAAD0 !QGList::findRef
0012F6C8 0001   007A5234 00779288 !PyCFunction_Call

-- 
http://mail.python.org/mailman/listinfo/python-list


PyQt calling an external app?

2006-01-09 Thread gregarican
What's the easiest and cleanest way of having PyQt bring up an external
application? In this case I am looking to launch Internet Explorer and
bring up a specific URL. I don't care about tracking the IE process'
activity and don't want PyQt to wait until the browser is closed. I
tried the following code from within a PyQt app:

import os

url = 'http://server.domain.com/page.html'
os.system('start %s' % url)

When I use this the PyQt app freezes up and only when I forcefully
close it does the browser window pop up. Then I looked into QThreads
and some other choices. Here's my latest attempt, using win32process:

import win32process

url='http://server.domain.com/page.html'
cmd_line = 'start %s' % url
win32process.CreateProcess(None, cmd_line, None, None,
1,win32process.CREATE_NEW_CONSOLE, None, None,
win32process.STARTUPINFO())

When I try this I get a message stating 'The system cannot find the
file specified' when the cmd_line is being interpreted. I am using
Python 2.3.5 on Windows 2000 Professional, with Qt 2.3.0 and PyQt 3.13.
Do I have to go to the lengths of implementing a QThread just to spawn
an external program I don't care about tracking?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt calling an external app?

2006-01-09 Thread gregarican
Paul Boddie wrote:

 What does os.startfile do when invoked with the URL? My impression was
 that the startfile function - available only on Windows - doesn't wait
 for the command to finish, but I don't run Windows and can't test this.
 Any feedback would be appreciated, though, since it's part of the
 desktop module I proposed a while back:

 http://www.python.org/pypi/desktop


 Paul

Thanks! That worked perfectly. Sorry for all of the n00b questions, as
I'm only about a week or two into learning Python. I had about 1+ year
of experience coding in Ruby and am trying to translate a Qt app I
wrote in Ruby into Python. So there are some differences in each
language's Qt implementation. So far I am very impressed with Python's
maturity in terms of language consistency and available libraries. Plus
everyone is very responsive within the community.

Thanks again!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt Access Violations

2006-01-08 Thread gregarican
Hope this post doesn't duplicate, as a Google Groups error happened
last attempt...

Phil Thompson wrote:

 What version of Qt?

 Phil

It's version 2.3.0 non-commerical for Windows. My OS is Windows 2000
Professional SP4. Using this same version of Qt for a Ruby-based
implementation of a similar app I didn't experience the access
violation crashes when invoking the setCentralWidget() method. It's
sporadic, as the crashes sometimes take 2-3 widget opens/closes to
happen. Other times it takes more. Trying to debug the crashes the
script never makes it past this method. Here's an excerpt from the Dr.
Watson error log:

function: QGList::findRef
39d2dd42 807c240800   cmp byte ptr [esp+0x8],0x0
ss:00c09513=00
39d2dd47 7407 jz  QString::fromUtf8+0x8a
(39d36850)
FAULT -39d2dd49 8b4108   mov eax,[ecx+0x8]
ds:00cd9f51=48001500
39d2dd4c 33d2 xor edx,edx
39d2dd4e eb06 jmp QString::fromUtf8+0x90
(39d36856)
39d2dd50 8b4110   mov eax,[ecx+0x10]
ds:00cd9f51=48001500
39d2dd53 8b5114   mov edx,[ecx+0x14]
ds:00cd9f51=48001500
39d2dd56 56   pushesi
39d2dd57 85c0 testeax,eax
39d2dd59 740e jz  QString::fromLatin1+0xb
(39d36869)
39d2dd5b 8b30 mov esi,[eax]
ds:007ad4d8=00858340
39d2dd5d 3b742408 cmp esi,[esp+0x8]
ss:00c09513=
39d2dd61 7406 jz  QString::fromLatin1+0xb
(39d36869)
39d2dd63 8b4008   mov eax,[eax+0x8]
ds:012873be=

* Stack Back Trace *

FramePtr ReturnAd Param#1  Param#2  Param#3  Param#4  Function Name
0012F664 1E057D56 089FE908 00857948 0001 088FAAD0 !QGList::findRef
0012F6C8 0001   007A5234 00779288 !PyCFunction_Call

-- 
http://mail.python.org/mailman/listinfo/python-list


PyQt Access Violations

2006-01-07 Thread gregarican
I noticed that when I invoked the setCentralWidget() method using PyQt
3.13 on Python 2.3.5 opening and closing a widget associated with a
main window would result in a Win32 access violation crash after a
couple of times. Here's a generic snippet:

class Application_Window(QMainWindow):
 def __init__(self):
  QMainWindow.__init__(self,None,'application main
window',Qt.WDestructiveClose)

 def other_widget(self):
  self.this_widget=QWidget()
  self.setCentralWidget(self.this_widget)


The only way I could avoid the crashes was to replace the
setCentralWidget() method with:

  self.this_widget.show()

Is there some fundamental error I was making in this, or is this a
known bug?

-- 
http://mail.python.org/mailman/listinfo/python-list


PyQt Variables

2006-01-05 Thread gregarican
I have an application I'm writing using PyQt. I'm trying to create the
various windows by subclassing Qt objects. I have a subclassed
QMainWindow as the parent, and then a series of subclassed QWidgets as
other child windows that get used. How can I pass variables back and
forth between the parent and child windows? For example, if I have a
child window that processes a customer lookup I want the retrieved
values to be passed back to the QMainWindow. I have tried using global
variables, but these variables seem to be global only in the sense of
each subclassed object. Not between the subclassed objects.

Here's a generic sample:

parent_window.py
=
my_value = 'main'
from child_window import *

class Parent_Window(QMainWindow):
def __init__(self):
QMainWindow.__init__(self,None,'application main
window',Qt.WDestructiveClose)
print my_value
child_window= Child_Window()
self.setCentralWidget(child_window)
self.catchEvent()

child_window.py

class Child_Window(QWidget):
def __init__(self):
QWidget.__init__(self)
print my_value

This doesn' t seem to work, as the Child_Window class doesn't recognize
the my_value global variable that appears in the Parent_Window class.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt Variables

2006-01-05 Thread gregarican
Diez B. Roggisch wrote:

 Looks (or better smells) like a design smell to me. In Qt,and especially
 PyQt, you rarely subclass widgets, as that makes you lose the
 possibility to use the fabulous designer. The only thing I subclass in
 PyQt are the designer-generetaed top-level-classes.  Can be a widget, or
 sometimes dialogs.

 QObjects usually communicate using signals/slots. That ensures a nice
 weak coupling of components and enforces good MVC design. If you
 absolutely must share state by means of instances of widgets,
 explicietly introduce them to each other. No globals needed!


 Additionally, what you experience is the fact that python only knows
 module-global variables. See


 http://www.faqs.org/docs/diveintopython/dialect_locals.html


 for an introduction.


 Regards,


 Diez

Thanks for the reply. Makes perfect sense now that you point this out!

-- 
http://mail.python.org/mailman/listinfo/python-list