As I understand it python is not a strongly typed language so no declaration
of variables is necessary.  My question is this:

If I use a variable in a program that stores certain numbers and I'm porting
it to say ... java where I must first declare the variables before I use
them how do I find out what type to give that variable, specifically is
there a way to identify the type of a variable used in a python program for
reference?

What I'm saying is if I have used a certain variable to hold literally
dozens of different values and I BELIEVE them all to be integers but I'm not
entirely sure that I have not stumbled into the float realm is there a way
to have python list all variables contained in a program and tell me what
type it has internally stored them as?  I realize I could trudge through the
entire 1000 lines and check all the variables and see what values I have
assigned them one at a time but I'm wondering if there is an easier way to
get that data?


Thanks

Toby

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of [EMAIL PROTECTED]
Sent: Wednesday, February 20, 2008 1:23 AM
To: tutor@python.org
Subject: Tutor Digest, Vol 48, Issue 48

Send Tutor mailing list submissions to
        tutor@python.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.python.org/mailman/listinfo/tutor
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tutor digest..."


Today's Topics:

   1. Re: reading webpage (Kent Johnson)
   2. Re: Change mouse cursor position (bob gailer)
   3. Re: Change mouse cursor position (Flaper87)
   4. Re: Change mouse cursor position (bob gailer)
   5. Re: Change mouse cursor position (Michael Langford)
   6. How to deal with a thread that doesn't terminate (Tony Cappellini)
   7. Re: How to deal with a thread that doesn't terminate (bob gailer)
   8. Re: How to deal with a thread that doesn't terminate
      (Tony Cappellini)
   9. Re: How to deal with a thread that doesn't terminate (bob gailer)
  10. Re: How to deal with a thread that doesn't terminate (John Fouhy)
  11. Re: Putting the Output of Help to a File (Justin Ezequiel)
  12. Re: How to deal with a thread that doesn't terminate
      (Michael Langford)


----------------------------------------------------------------------

Message: 1
Date: Tue, 19 Feb 2008 07:46:48 -0500
From: Kent Johnson <[EMAIL PROTECTED]>
Subject: Re: [Tutor] reading webpage
To: "Guess?!?" <[EMAIL PROTECTED]>
Cc: tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Guess?!? wrote:
> Hi Kent,
>  
> Broken machine gives
>  
> IDLE 1.2.1     
>  >>> import urllib
>  >>> print urllib.getproxies()
> {'http': 'http://proxy-address:port' <http://proxy-address:port'>}
>  >>>
>  
> correct machine gives empty dictionary ... { }

Well that is the problem. Now you have to fix it. The proxy comes either 
from the environment variable HTTP_PROXY or from the Windows registry, I 
think it is the proxyServer value of the key 
Software\Microsoft\Windows\CurrentVersion\Internet Settings
but I'm not on Windows and this is no longer a Python question so that 
is as far as I will take it.

Kent


------------------------------

Message: 2
Date: Tue, 19 Feb 2008 08:56:50 -0500
From: bob gailer <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Change mouse cursor position
To: Flaper87 <[EMAIL PROTECTED]>
Cc: Tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Flaper87 wrote:
> Hey Guys!!!
>
> is it possible to change the mouse position by passing it the coords?
>
> I'm developing an application that needs to be able to change the 
> cursor's possition.
We need more information. Is this a GUI application? If so which GUI 
software? Or are you trying to control the mouse in another application?
>
> O.S. Linux Debian Sid
> Python: 2.4=<
-- 
Bob Gailer
919-636-4239 Chapel Hill, NC



------------------------------

Message: 3
Date: Tue, 19 Feb 2008 16:48:11 +0100
From: Flaper87 <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Change mouse cursor position
To: "bob gailer" <[EMAIL PROTECTED]>
Cc: Tutor@python.org
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

it is not a GUI application, i need to be able to change the cursor position
if an event happens.


2008/2/19, bob gailer <[EMAIL PROTECTED]>:
>
> Flaper87 wrote:
> > Hey Guys!!!
> >
> > is it possible to change the mouse position by passing it the coords?
> >
> > I'm developing an application that needs to be able to change the
> > cursor's possition.
> We need more information. Is this a GUI application? If so which GUI
> software? Or are you trying to control the mouse in another application?
> >
> > O.S. Linux Debian Sid
> > Python: 2.4=<
> --
> Bob Gailer
> 919-636-4239 Chapel Hill, NC
>
>


-- 
Flavio Percoco Premoli, A.K.A. [Flaper87]
http://www.flaper87.org
Usuario Linux registrado #436538
Geek by nature, Linux by choice, Debian of course.
Key Fingerprint: CFC0 C67D FF73 463B 7E55  CF43 25D1 E75B E2DB 15C7
The Solution to everything:
python -c "from struct import pack; print  pack('5b', (41*len('99')),
pow(8,2)+20, 4900**0.5, range(78)[-1], 10)"
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://mail.python.org/pipermail/tutor/attachments/20080219/6b15c4d5/attachm
ent-0001.htm 

------------------------------

Message: 4
Date: Tue, 19 Feb 2008 11:12:19 -0500
From: bob gailer <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Change mouse cursor position
To: Flaper87 <[EMAIL PROTECTED]>
Cc: Tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Flaper87 wrote:
> it is not a GUI application, i need to be able to change the cursor 
> position if an event happens.
Sorry but that does not help at all. I guess you want a character-based 
console window and ability to respond to user keystrokes. If that is the 
case use the curses module.

If not please explain your situation in more detail.

And in future questions please give the relevant details in the original 
posting. Discovery processes like this are costly to everyone involved.

-- 
Bob Gailer
919-636-4239 Chapel Hill, NC



------------------------------

Message: 5
Date: Tue, 19 Feb 2008 15:02:44 -0500
From: "Michael Langford" <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Change mouse cursor position
To: Flaper87 <[EMAIL PROTECTED]>
Cc: Tutor@python.org
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1

I do not know of a python library to do this.

Therefore, I'd use a popen call to
http://www.hoopajoo.net/projects/xautomation.html.

         --Michael

PS: If we you were on windows, I'd use  http://pywinauto.openqa.org/

On Feb 19, 2008 4:34 AM, Flaper87 <[EMAIL PROTECTED]> wrote:
> Hey Guys!!!
>
> is it possible to change the mouse position by passing it the coords?
>
> I'm developing an application that needs to be able to change the cursor's
> possition.
>
> O.S. Linux Debian Sid
>  Python: 2.4=<
>
> Thanks
>
> --
> Flavio Percoco Premoli, A.K.A. [Flaper87]
> http://www.flaper87.org
> Usuario Linux registrado #436538
> Geek by nature, Linux by choice, Debian of course.
>  Key Fingerprint: CFC0 C67D FF73 463B 7E55  CF43 25D1 E75B E2DB 15C7
> The Solution to everything:
> python -c "from struct import pack; print  pack('5b', (41*len('99')),
> pow(8,2)+20, 4900**0.5, range(78)[-1], 10)"
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>



-- 
Michael Langford
Phone: 404-386-0495
Consulting: http://www.RowdyLabs.com


------------------------------

Message: 6
Date: Tue, 19 Feb 2008 13:53:06 -0800
From: "Tony Cappellini" <[EMAIL PROTECTED]>
Subject: [Tutor] How to deal with a thread that doesn't terminate
To: "Tutor Python" <tutor@python.org>
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1

When I executing a program external to the main program in a thread,
and that thread hangs, can the thread be terminated?
How does one handle this situation?


------------------------------

Message: 7
Date: Tue, 19 Feb 2008 17:02:16 -0500
From: bob gailer <[EMAIL PROTECTED]>
Subject: Re: [Tutor] How to deal with a thread that doesn't terminate
To: [EMAIL PROTECTED]
Cc: Tutor Python <tutor@python.org>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Tony Cappellini wrote:
> When I executing a program external to the main program in a thread,
> and that thread hangs, can the thread be terminated?
>   
Please define "hangs".

AFAIK that could mean waiting on an external event / signal / 
communication that never happens, or running in an "infinite loop". So 
which is it or is it something else?

-- 
Bob Gailer
919-636-4239 Chapel Hill, NC



------------------------------

Message: 8
Date: Tue, 19 Feb 2008 14:03:59 -0800
From: "Tony Cappellini" <[EMAIL PROTECTED]>
Subject: Re: [Tutor] How to deal with a thread that doesn't terminate
To: "bob gailer" <[EMAIL PROTECTED]>
Cc: Tutor Python <tutor@python.org>
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1

On Feb 19, 2008 2:02 PM, bob gailer <[EMAIL PROTECTED]> wrote:
> Tony Cappellini wrote:
> > When I executing a program external to the main program in a thread,
> > and that thread hangs, can the thread be terminated?
> >
> Please define "hangs".

> AFAIK that could mean waiting on an external event / signal /
> communication that never happens, or running in an "infinite loop". So
> which is it or is it something else?

Never happens.


------------------------------

Message: 9
Date: Tue, 19 Feb 2008 18:27:16 -0500
From: bob gailer <[EMAIL PROTECTED]>
Subject: Re: [Tutor] How to deal with a thread that doesn't terminate
To: [EMAIL PROTECTED]
Cc: Tutor Python <tutor@python.org>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Tony Cappellini wrote:
> On Feb 19, 2008 2:02 PM, bob gailer <[EMAIL PROTECTED]> wrote:
>   
>> Tony Cappellini wrote:
>>     
>>> When I executing a program external to the main program in a thread,
>>> and that thread hangs, can the thread be terminated?
>>>
>>>       
>> Please define "hangs".
>>     
>
>   
>> AFAIK that could mean waiting on an external event / signal /
>> communication that never happens, or running in an "infinite loop". So
>> which is it or is it something else?
>>     
>
> Never happens.
>   

Sorry. I don't understand that, so I can't help. Perhaps someone else can.


-- 
Bob Gailer
919-636-4239 Chapel Hill, NC



------------------------------

Message: 10
Date: Wed, 20 Feb 2008 12:57:54 +1300
From: "John Fouhy" <[EMAIL PROTECTED]>
Subject: Re: [Tutor] How to deal with a thread that doesn't terminate
To: "bob gailer" <[EMAIL PROTECTED]>
Cc: Tutor Python <tutor@python.org>, [EMAIL PROTECTED]
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1

On 20/02/2008, bob gailer <[EMAIL PROTECTED]> wrote:
> Tony Cappellini wrote:
> > On Feb 19, 2008 2:02 PM, bob gailer <[EMAIL PROTECTED]> wrote:
> >
> >> Tony Cappellini wrote:
> >>
> >>> When I executing a program external to the main program in a thread,
> >>> and that thread hangs, can the thread be terminated?
> >>>
> >>>
> >> Please define "hangs".
> >>
> >
> >
> >> AFAIK that could mean waiting on an external event / signal /
> >> communication that never happens, or running in an "infinite loop". So
> >> which is it or is it something else?
> >>
> >
> > Never happens.
> >
>
> Sorry. I don't understand that, so I can't help. Perhaps someone else can.

I presume he means he defines "hangs" as "waiting on an external event
/ signal / communicaiton that never happens".

AFAIK, there's no good way to kill a thread (google for 'python kill
thread' for lots of hits).  IME most blocking operations have optional
timeout parameters, so you could restructure your main thread loop to
wait->work/timeout->repeat, which should make it easier to end the
thread.

-- 
John.


------------------------------

Message: 11
Date: Wed, 20 Feb 2008 09:33:35 +0800
From: "Justin Ezequiel" <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Putting the Output of Help to a File
To: tutor@python.org
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1

> From: Wayne Watson <[EMAIL PROTECTED]>
>
> See Subject. Is it possible?
>

python -m pydoc sys > sys.txt
more < sys.txt


------------------------------

Message: 12
Date: Wed, 20 Feb 2008 02:23:11 -0500
From: "Michael Langford" <[EMAIL PROTECTED]>
Subject: Re: [Tutor] How to deal with a thread that doesn't terminate
To: [EMAIL PROTECTED]
Cc: Tutor Python <tutor@python.org>
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1

Instead of using a thread, you could see if you could use a second
process. For instance, the following would work on windows (and is
killable).

import subprocess
import win32api

class SpawnController(object):
    def __init__(self,cmd):
        self.cmdline = cmd

    def start(self):
        self.process = subprocess.Popen([self.cmdline])

    def stop(self):
        win32api.TerminateProcess(int(self.process._handle), -1

       --michael

On Feb 19, 2008 4:53 PM, Tony Cappellini <[EMAIL PROTECTED]> wrote:
> When I executing a program external to the main program in a thread,
> and that thread hangs, can the thread be terminated?
> How does one handle this situation?
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>



-- 
Michael Langford
Phone: 404-386-0495
Consulting: http://www.RowdyLabs.com


------------------------------

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


End of Tutor Digest, Vol 48, Issue 48
*************************************

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to