opening a connection to quickbooks

2009-12-07 Thread jfabiani
Hi,

Has anyone ever attempted to work with quickbooks in a real time fashion? I
need some advise. I'm trying to work out a way to have real time
updates/inserts/and queries.  I'd also like not to use all the user
licenses. But...

I have discovered that opening a connection to quickbooks takes a long time
(as much as 11 seconds).  Is there a way I can open/create the connection
in a thread (so the rest of the prog can continue) and then use the
connection in the rest of the program to make queries? Or does someone have
a suggestion as how to get around this problem.

I'm using QB's Simple Start Edition - would the enterprise edition have
better performance?

Thanks in advance,

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


RE: Convert month name to month number faster

2010-01-06 Thread jfabiani
VYAS ASHISH M-NTB837 wrote:

>  
> How about using list.index() and storing month names in a list? You may
> want to measure performance your self and conclude.
> 
> Regards,
> Ashish Vyas
> 
> -Original Message-
> From: [email protected]
> [mailto:[email protected]] On Behalf Of
> wiso
> Sent: Wednesday, January 06, 2010 4:34 PM
> To: [email protected]
> Subject: Convert month name to month number faster
> 
> I'm optimizing the inner most loop of my script. I need to convert month
> name to month number. I'm using python 2.6 on linux x64.
> 
> 
> month_dict = {"Jan":1,"Feb":2,"Mar":3,"Apr":4, "May":5, "Jun":6,
> "Jul":7,"Aug":8,"Sep":9,"Oct":10,"Nov":11,"Dec":12}
> 
> def to_dict(name):
>   return month_dict[name]
> 
> def to_if(name):
> if name == "Jan": return 1
> elif name == "Feb": return 2
> elif name == "Mar": return 3
> elif name == "Apr": return 4
> elif name == "May": return 5
> elif name == "Jun": return 6
> elif name == "Jul": return 7
> elif name == "Aug": return 8
> elif name == "Sep": return 9
> elif name == "Oct": return 10
> elif name == "Nov": return 11
> elif name == "Dec": return 12
> else: raise ValueError
> 
> import random
> l = [random.choice(month_dict.keys()) for _ in range(100)]
> 
> from time import time
> t = time(); xxx=map(to_dict,l); print time() - t # 0.5
> t = time(); xxx=map(to_if,l); print time() - t   # 1.0
> 
> 
> is there a faster solution? Maybe something with str.translate?
> 
> The problem is a little different because I don't read random data, but
> sorted data. For example:
> 
> l = [x for x in
> ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"
> )
> for _ in range(1000)] # ["Jan","Jan", ..., "Feb", "Feb", ...]
> 
> so maybe the to_if approach will be faster if I write the case in the
> best
> order. Look:
> 
> l = ["Jan"] * 100 # to_if is in the best order for "Jan"
> t = time(); xxx=map(to_dict,l); print time() - t # 0.5
> t = time(); xxx=map(to_if,l); print time() - t # 0.5
> 
> 
what just using 
get(key[, default])¶
Return the value for key if key is in the dictionary, else default. If
default is not given, it defaults to None, so that this method never raises
a KeyError.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python & OpenOffice Spreadsheets

2009-11-23 Thread jfabiani
Krishnakant wrote:

> On Mon, 2009-11-23 at 11:12 +, Paul Rudin wrote:
>> Gerhard Häring  writes:
>> 
>> > Is there a *simple* way to read OpenOffice spreadsheets?
>> >
>> > Bonus: write them, too?
>> >
>> > I mean something like:
>> >
>> > doc.cells[0][0] = "foo"
>> > doc.save("xyz.ods")
>> >
>> >>From a quick look, pyodf offers little more than just using a XML
>> >>parser
>> > directly.
>> 
>> 
>> Depends on exactly what you mean by "simple" - but pyuno allows you to
>> read and write openoffice spreadsheets.
> 
> 
> Odfpy is a good module and is easy too.
> http://kk.hipatia.net/public/gnukhata/gnukhata-client/ has a deb package
> I built for ubuntu 9.04.
> I can even provide you the distutils tarball off the list (because I
> can't recall the url from I downloaded it, may be sourceforge ).
> Happy hacking.
> Krishnakant

Would you including me in your response.  I'd really like to find a py
module to allow simple use of openoffice.

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


Re: Calendar GUI

2010-02-08 Thread jfabiani
Jean-Michel Pichavant wrote:

> Michael Torrie wrote:
>> Gabriel wrote:
>>   
>>> On Fri, Feb 5, 2010 at 9:08 PM, William Gaggioli 
>>> wrote:
>>> 
 I'm working on setting up some software for a Peruvian non-profit to
 help them organize their incoming volunteers. One of the features I'd
 like to add is a calendar-like view of the different volunteers arrival
 dates and staying time, with potentially some other info through some
 double-click action. Rather than writing a calendar gui myself, is
 there some open-source calendar program you guys could recommend that I
 could plug into? It has to be run locally, as the internet isn't so
 reliable down here, but other than that something simple and clean is
 ideal.
   

Take a look at wxscheduler, and chandler.

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


Re: Printing forms and labels in Python

2010-06-13 Thread jfabiani
Monte Milanuk wrote:

> Hello,
> 
> I'm still a relative newbie to python, so I apologize if this is covered
> in detail somewhere and I missed it.
> 
> I have a program or two that I want to work on once I get more
> proficient with python and sqlite and tkinter/wxpython.  One of the big
> 'features' of those programs I want to make is going to be printing out
> match results (scores) from a competition along with competitor names
> and other pertinent information.  Currently most people are doing this
> in Excel, though there is one (old) DOS program written in BASIC that
> not only prints the match results and the reports for the sanctioning
> body, but also prints labels via a Dymo Label maker.
> 
> I realized today that one thing I have never seen covered in any Python
> tutorial is how to format and print things to a physical printer.  I did
> a little bit of searching and didn't come up with much... either I'm
> really not using the right search terms, or physical printing is a black
> hole/art...?
> 
> TIA,
> 
> Monte
It's still possible to send esc char's to the printer (just like the dos
program).  So in days of DOS programs there were routines that matched
epsons, HP, and a few other printers that the dos programs used to print to
(http://webpages.charter.net/dperr/links/esc_p2.htm).  

Idea was simple send the printer the esc codes and the text you wanted
printed.  Just insure you have the right port (BTW not as easy as it used
to be). 

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


Re: why python got less developers ?

2009-08-28 Thread jfabiani
Chris Rebert wrote:

> On Thu, Aug 27, 2009 at 5:34 PM, Deep_Feelings
> wrote:
>> python got relatively fewer numbers of developers than other high
>> level languages like .NET , java .. etc  why ?
> 
> We lack Sun and Microsoft's massive marketing departments. :)

I'm inclined to agreed.  But in recent years we lost a number of developers
to Ruby.  I don't know but I doubt Ruby has a marketing budget.  So in my
mind it is difficult for me to blame just the lack of marketing dollars for
the lost.  

I do take heart in a recent article (on Linux today). that less than 5% of
open source is using C#.  Which tells me that .Net in the open source world
is not doing well. So in my opinion the OP is wrong when he includes .Net
in his assessment of developers.

As far as what the OP is suggesting I'm not to sure it matters how many
total developers are using Python.  Python is always in the top ten of the
languages in use.  And therefore is very popular.  I use it daily. But it
does not mean I don't use other languages too.

Johnf

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