how to automate java application in window using python

2016-09-15 Thread meInvent bbird
how to automate java application in window using python

1. scroll up or down of scroll bar
2. click button
3. type text in textbox
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to automate java application in window using python

2016-09-15 Thread Lawrence D’Oliveiro
On Thursday, September 15, 2016 at 7:13:05 PM UTC+12, meInvent bbird wrote:
> how to automate java application in window using python
> 
> 1. scroll up or down of scroll bar
> 2. click button
> 3. type text in textbox

Well, don’t leave us in suspense! Give us the link to your blog post!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ‘pip2 install cryptography’ does not work

2016-09-15 Thread dieter
Cecil Westerhof  writes:

> I try to do a:
> pip2 install cryptography
>
> But this give:
> gcc -pthread -shared 
> build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o 
> -L/usr/lib64 -lssl -lcrypto -lpython2.7 -o 
> build/lib.linux-x86_64-2.7/cryptography/hazmat/bindings/_openssl.so
> 
> /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: 
> /usr/lib64/libpython2.7.a(abstract.o): relocation R_X86_64_32S against 
> `_Py_NotImplementedStruct' can not be used when making a shared object; 
> recompile with -fPIC
> /usr/lib64/libpython2.7.a: error adding symbols: Bad value
> collect2: error: ld returned 1 exit status
> error: command 'gcc' failed with exit status 1

Apparently, the linker requires use of the "-fPIC" option
("PIC" stands for "position independent code") for linking a shared
library.

The problem might come from your system's Python installation
(apparently, that one is used). Usually, you would have
a "libpython*.so" (i.e. a shared object) and it would contain
modules compiled with "-fPIC". In your case, the
static library "libpython*.a" seems to be used and (apparently)
contains not position idependent modules.

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


Re: Why don't we call the for loop what it really is, a foreach loop?

2016-09-15 Thread alister
On Wed, 14 Sep 2016 22:01:34 -0700, Paul Rubin wrote:

> Travis Griggs  writes:
>> for each in ['cake'] + ['eat', 'it'] * 2:
>> print(each)
> 
> https://pbs.twimg.com/media/Cr-edT2VUAArpVL.jpg

the "Cowboy Song"
buy Furrokh Bulsara



-- 
Olmstead's Law:
After all is said and done, a hell of a lot more is said than 
done.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-15 Thread alister
On Wed, 14 Sep 2016 18:04:26 -0700, Chris Kaynor wrote:

> On Wed, Sep 14, 2016 at 1:19 PM,  wrote:
> 
>> It is so blantantly obvious that the world is not flat I find this
>> discussion flabbergasting.  Anybody who has tried to take any form of
>> vehicle up, or probably more dangerously down, any form of hill knows
>> that.  As for the raving lunatics who make their living by riding up
>> and down these http://www.bbc.co.uk/news/in-pictures-37348004, well
>> need I say more?
>>
>>
> Going up or down a mountain does not prove the world is round by itself,

No but it does demonstrate that it is not flat (@ a bare minimum it 
undulates)

Not flat != round





-- 
A gift of a flower will soon be made to you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ‘pip2 install cryptography’ does not work

2016-09-15 Thread Cecil Westerhof
On Thursday 15 Sep 2016 10:19 CEST, [email protected] wrote:

> Cecil Westerhof  writes:
>
>> I try to do a:
>> pip2 install cryptography
>>
>> But this give: gcc -pthread -shared
>> build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o
>> -L/usr/lib64 -lssl -lcrypto -lpython2.7 -o
>> build/lib.linux-x86_64-2.7/cryptography/hazmat/bindings/_openssl.so
>> /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
>> /usr/lib64/libpython2.7.a(abstract.o): relocation R_X86_64_32S
>> against _Py_NotImplementedStruct' can not be used when making a
>> shared object; recompile with -fPIC /usr/lib64/libpython2.7.a:
>> error adding symbols: Bad value collect2: error: ld returned 1 exit
>> status error: command 'gcc' failed with exit status 1
>
> Apparently, the linker requires use of the "-fPIC" option
> ("PIC" stands for "position independent code") for linking a shared
> library.
>
> The problem might come from your system's Python installation
> (apparently, that one is used). Usually, you would have
> a "libpython*.so" (i.e. a shared object) and it would contain
> modules compiled with "-fPIC". In your case, the
> static library "libpython*.a" seems to be used and (apparently)
> contains not position idependent modules.

I installed python-devel and the problems went away.

What I find a kind of strange that I did not have python3-devel
installed and I do not have a problem with:
pip3 install cryptography

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-15 Thread Gregory Ewing

Dennis Lee Bieber wrote:


And then there is Pratchett's Discworld... which is both flat and round
(just not spherical)


And it has a horizon -- if you go far enough you fall
off the edge.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-15 Thread Grant Edwards
On 2016-09-15, Steve D'Aprano  wrote:
> On Thu, 15 Sep 2016 06:19 am, [email protected] wrote:
>
>> It is so blantantly obvious that the world is not flat I find this
>> discussion flabbergasting.
>
> You wouldn't say that if you lived in Kanvas, or the west coast of Ireland.
>
> I'm told that a few years ago somebody accidentally dumped a trailer load of
> soil by the side of the road in Kanvas, and within a day some enterprising
> entrepreneur had set up a thriving roadside business offering
> mountain-climbing tours to the locals.

Kanvas?

-- 
Grant Edwards   grant.b.edwardsYow! Why don't you ever
  at   enter any CONTESTS,
  gmail.comMarvin??  Don't you know
   your own ZIPCODE?

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


logging TypeError: not all arguments converted during string formatting

2016-09-15 Thread Daiyue Weng
Hi, I am trying to record memory and CPU usages and load a logger from an
external config file (logging.conf),

[loggers]
keys=root,hardware_log

[handlers]
keys=consoleHandler,hardwareFileHandler

[formatters]
keys=hardwareFormatter

[logger_root]
level=DEBUG
handlers=consoleHandler

[logger_hardware_log]
level=DEBUG
handlers=hardwareFileHandler
qualname=hardware_log
propagate=0

[handler_consoleHandler]
class=StreamHandler
level=DEBUG
formatter=hardwareFormatter
args=(sys.stdout,)

[handler_hardwareFileHandler]
class=handlers.RotatingFileHandler
maxBytes=51200
level=DEBUG
formatter=hardwareFormatter
args=("log/hardware.log",)

[formatter_hardwareFormatter]
format=pathname~%(pathname)s||timestamp~%(asctime)s||level~%(levelname)s||name~%(name)s||function_name~%(funcName)s||line_no~%(lineno)s||debug_CPU~%(message)s||debug_Mem~%(message)s
datefmt=%m/%d/%Y %H:%M:%S
class=logging.Formatter


import logging

import psutil

logging.config.fileConfig('logging.conf')

hardware_log = logging.getLogger(HARDWARELOGNAME)

free_mem_gb_pre = psutil.virtual_memory().available / 10.
cpu_util_pct_pre = psutil.cpu_percent()

hardware_log.info(cpu_util_pct_pre, free_mem_gb_pre)


I got the following errors,

--- Logging error ---
Traceback (most recent call last):
  File "C:\Continuum\Anaconda3\lib\logging\__init__.py", line 980, in emit
msg = self.format(record)
  File "C:\Continuum\Anaconda3\lib\logging\__init__.py", line 830, in format
return fmt.format(record)
  File "C:\Continuum\Anaconda3\lib\logging\__init__.py", line 567, in format
record.message = record.getMessage()
  File "C:\Continuum\Anaconda3\lib\logging\__init__.py", line 330, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "C:\Program Files (x86)\JetBrains\PyCharm
2016.2.1\helpers\pycharm\pytestrunner.py", line 60, in 
main()
  File "C:\Program Files (x86)\JetBrains\PyCharm
2016.2.1\helpers\pycharm\pytestrunner.py", line 35, in main
exitstatus = hook.pytest_cmdline_main(config=config)
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 724, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 338, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 333, in 
_MultiCall(methods, kwargs, hook.spec_opts).execute()
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 596, in execute
res = hook_impl.function(*args)
  File "C:\Continuum\Anaconda3\lib\site-packages\_pytest\main.py",
line 115, in pytest_cmdline_main
return wrap_session(config, _main)
  File "C:\Continuum\Anaconda3\lib\site-packages\_pytest\main.py",
line 90, in wrap_session
session.exitstatus = doit(config, session) or 0
  File "C:\Continuum\Anaconda3\lib\site-packages\_pytest\main.py",
line 121, in _main
config.hook.pytest_runtestloop(session=session)
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 724, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 338, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 333, in 
_MultiCall(methods, kwargs, hook.spec_opts).execute()
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 596, in execute
res = hook_impl.function(*args)
  File "C:\Continuum\Anaconda3\lib\site-packages\_pytest\main.py",
line 146, in pytest_runtestloop
item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 724, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 338, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 333, in 
_MultiCall(methods, kwargs, hook.spec_opts).execute()
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 595, in execute
return _wrapped_call(hook_impl.function(*args), self.execute)
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 247, in _wrapped_call
call_outcome = _CallOutcome(func)
  File 
"C:\Continuum\Anaconda3\lib\site-packages\_pytest\vendored_packages\pluggy.py",
line 264, in __init__
self.result = func()
  File 
"C:\Continuum\Anaconda3\lib\site-packa

Re: logging TypeError: not all arguments converted during string formatting

2016-09-15 Thread MRAB

On 2016-09-15 15:57, Daiyue Weng wrote:

Hi, I am trying to record memory and CPU usages and load a logger from an
external config file (logging.conf),


[snip]


import logging

import psutil

logging.config.fileConfig('logging.conf')

hardware_log = logging.getLogger(HARDWARELOGNAME)

free_mem_gb_pre = psutil.virtual_memory().available / 10.
cpu_util_pct_pre = psutil.cpu_percent()

hardware_log.info(cpu_util_pct_pre, free_mem_gb_pre)


I got the following errors,

--- Logging error ---
Traceback (most recent call last):
  File "C:\Continuum\Anaconda3\lib\logging\__init__.py", line 980, in emit
msg = self.format(record)
  File "C:\Continuum\Anaconda3\lib\logging\__init__.py", line 830, in format
return fmt.format(record)
  File "C:\Continuum\Anaconda3\lib\logging\__init__.py", line 567, in format
record.message = record.getMessage()
  File "C:\Continuum\Anaconda3\lib\logging\__init__.py", line 330, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting


[snip]


  File 
"C:\Users\dweng\PycharmProjects\lumar_ingestion\ingestion_workflow_modules\import_to_dataframe.py",
line 61, in execute
hardware_log.info(cpu_util_pct_pre, free_mem_gb_pre)
Message: 38.5
Arguments: (8.87662592,)


How to fix the problem?


The doc for logging.info says:

logging.info(msg, *args, **kwargs)

In this line of your code:

hardware_log.info(cpu_util_pct_pre, free_mem_gb_pre)

you're passing in 2 values.

The first (38.5) is being treated as the message template (a format 
string) and the second (8.87662592) as the value to be put into the 
template.


What you should be doing is something like:

logging.info('cpu_util_pct_pre is %s, free_mem_gb_pre is %s', 
cpu_util_pct_pre, free_mem_gb_pre)


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


Re: logging TypeError: not all arguments converted during string formatting

2016-09-15 Thread Peter Otten
Daiyue Weng wrote:

> Hi, I am trying to record memory and CPU usages and load a logger from an
> external config file (logging.conf),

[snip]

One important debugging strategy is to try and find the minimal example that 
produces a problem. In this case you can provoke the the behaviour you are 
seeing with two lines of Python:

>>> import logging
>>> logging.warn(1, 2)
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.4/logging/__init__.py", line 978, in emit
msg = self.format(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 828, in format
return fmt.format(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 565, in format
record.message = record.getMessage()
  File "/usr/lib/python3.4/logging/__init__.py", line 328, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "", line 1, in 
Message: 1
Arguments: (2,)

Please make an effort to remove the irrelevant stuff before you come here to 
ask for help next time. Thank you.

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


Playing an audio file, but not waiting for it to finish?

2016-09-15 Thread kerbingamer376
Hi,
I have a library that allows me to play sound files. However, the play function 
waits for the sound to finish before it returns, and I'd like to be able to 
start the sound playing, and then have it return immediately so my program can 
continue, but also be able to know when the sound finishes. Is this possible, 
without modifying the library?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to automate java application in window using python

2016-09-15 Thread kerbingamer376
On Thursday, September 15, 2016 at 8:13:05 AM UTC+1, meInvent bbird wrote:
> how to automate java application in window using python
> 
> 1. scroll up or down of scroll bar
> 2. click button
> 3. type text in textbox

wtf?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Playing an audio file, but not waiting for it to finish?

2016-09-15 Thread Chris Angelico
On Fri, Sep 16, 2016 at 4:06 AM, kerbingamer376  wrote:
> I have a library that allows me to play sound files. However, the play 
> function waits for the sound to finish before it returns, and I'd like to be 
> able to start the sound playing, and then have it return immediately so my 
> program can continue, but also be able to know when the sound finishes. Is 
> this possible, without modifying the library?
>

It depends on the library. What you want is often called "asynchronous
playing", and it's usually possible, one way or another. As a very
simple example, creating a subprocess ['vlc', '--play-and-exit',
'some/audio/file'] will let you start something playing, and then have
the options to wait for the process to exit (equivalent to what you
have), be notified when it exits (what you're asking for), or kill the
process (another important feature, esp if you want to start a
different sound playing). But it's all up to the library.

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


Re: Playing an audio file, but not waiting for it to finish?

2016-09-15 Thread Steve D'Aprano
On Fri, 16 Sep 2016 04:06 am, kerbingamer376 wrote:

> Hi,
> I have a library that allows me to play sound files. However, the play
> function waits for the sound to finish before it returns, and I'd like to
> be able to start the sound playing, and then have it return immediately so
> my program can continue, but also be able to know when the sound finishes.
> Is this possible, without modifying the library?


Call the library function from a separate thread. See the threading module
for details.

You may have to be careful that no more than one thread ever calls the
library, since it is unlikely to be thread-safe. If it is thread-safe, it
would probably already offer an option to play in the background. And
performance may suffer: depending on how the library is written, you may
find that sound stutters or pauses as control passes back and forth between
your main thread and the thread playing the sound. I guess you'll have to
try it and see.

If threading doesn't work for you, try the multiprocessing library instead.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

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


Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-15 Thread Steve D'Aprano
On Thu, 15 Sep 2016 11:45 pm, Grant Edwards wrote:

> On 2016-09-15, Steve D'Aprano  wrote:
>> On Thu, 15 Sep 2016 06:19 am, [email protected] wrote:
>>
>>> It is so blantantly obvious that the world is not flat I find this
>>> discussion flabbergasting.
>>
>> You wouldn't say that if you lived in Kanvas, or the west coast of
>> Ireland.
>>
>> I'm told that a few years ago somebody accidentally dumped a trailer load
>> of soil by the side of the road in Kanvas, and within a day some
>> enterprising entrepreneur had set up a thriving roadside business
>> offering mountain-climbing tours to the locals.
> 
> Kanvas?

Oh vorry about that, that'v a villy mivtake. I obsiouvly meant to type
Kansav.



-- 
Vteve

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


Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-15 Thread Chris Angelico
On Fri, Sep 16, 2016 at 4:41 AM, Steve D'Aprano
 wrote:
>> Kanvas?
>
> Oh vorry about that, that'v a villy mivtake. I obsiouvly meant to type
> Kansav.

We're not in Kanvas any more, Toto!

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


Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-15 Thread Steve D'Aprano
On Thu, 15 Sep 2016 04:02 pm, Random832 wrote:

> On Wed, Sep 14, 2016, at 23:12, Steve D'Aprano wrote:
>> Yes it does. Even an infinitely large flat plane has a horizon almost
>> identical to the actual horizon.
> 
> Your link actually doesn't support the latter claim, it goes into some
> detail on why it wouldn't if it were infinitely large due to
> gravitational effects on light.

No, the horizon would still be horizontal. It merely wouldn't *look*
horizontal, an optical illusion.

And even there, I have my doubts. In a universe where at least one
infinitely large flat planet existed, gravity would clearly have to be
significantly different from our universe's gravity, lest the universe be
destroyed.

In the scenario given by the article, the flat earth is acting as a
Newtonian black hole: light cannot escape the planet. In addition, anything
that came into range of the flat earth's gravity -- which would be
*everything* in the universe -- would experience a 1 gee force[1] towards
the earth, no matter how far away it was. There would be a steady rain of
meteors, comets and even stars onto the planet.

The planet would also be gravitationally unstable in the horizontal
direction. Consider a single atom somewhere in the flat plane. It is
gravitationally pulled by an infinite number of other atoms in one
direction, say to the left, balanced by an infinite number in the opposite
direction, to the right. But those infinite forces will only be in balance
if the body of the planet is utterly, perfectly, 100% uniform. Any tiny
variation in density will lead to an inbalance in one direction or another,
which will increase the variations in density and hence increasing the
preferential gravitational force.

For a normal planet, the gravitational forces are typically smaller than the
electromagnet repulsion of atoms to each other, and so there's a limit to
how densely packed the planet will be. But in an infinitely large planet,
the forces can increase without limit, leading to the planet either
collapsing into a relativistic black hole (it's already a Newtonian black
hole!) or being torn apart. Or both.

In any case, even if the earth is flat, it's not infinitely big. We know
that because some stars dip below the horizon. Unless there are convenient
tunnels for them to travel through...


Personally, I'm more fond of the Hollow Earth theory. The earth is a sphere,
but it's a hollow sphere, and we're on the inside...

:-)




[1] Yes I know gee is a unit of acceleration, not force. Someone else can do
the dimensional analysis, there's a limit to how much care I'm going to put
into counter-factual physics like infinitely large flat planets.


-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

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


Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-15 Thread Random832
On Thu, Sep 15, 2016, at 15:06, Steve D'Aprano wrote:
> No, the horizon would still be horizontal. It merely wouldn't *look*
> horizontal, an optical illusion.

I guess that depends on your definition of what a horizon is - and what
a straight line is, if not the path followed by a beam of light.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-15 Thread Marko Rauhamaa
Random832 :

> On Thu, Sep 15, 2016, at 15:06, Steve D'Aprano wrote:
>> No, the horizon would still be horizontal. It merely wouldn't *look*
>> horizontal, an optical illusion.
>
> I guess that depends on your definition of what a horizon is - and
> what a straight line is, if not the path followed by a beam of light.

It is actually quite interesting how the brain forms an accurate idea of
a straight line and, say, a circle. Whenever you get a new pair of
glasses, the brain needs a recalibration and manages to do it within a
week.

I don't think it has anything with "the path followed by a beam of
light."


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-15 Thread Ethan Furman

On 09/15/2016 12:19 PM, Random832 wrote:

On Thu, Sep 15, 2016, at 15:06, Steve D'Aprano wrote:



No, the horizon would still be horizontal. It merely wouldn't *look*
horizontal, an optical illusion.


I guess that depends on your definition of what a horizon is - and what
a straight line is, if not the path followed by a beam of light.


Beams of light can be bent by both matter and gravity.

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-15 Thread Steve D'Aprano
On Fri, 16 Sep 2016 05:19 am, Random832 wrote:

> On Thu, Sep 15, 2016, at 15:06, Steve D'Aprano wrote:
>> No, the horizon would still be horizontal. It merely wouldn't *look*
>> horizontal, an optical illusion.
> 
> I guess that depends on your definition of what a horizon is - and what
> a straight line is, if not the path followed by a beam of light.

Light follows geodesics, not straight lines.

http://mathworld.wolfram.com/Geodesic.html

Hmmm... actually that suggests that an infinite flat earth is *not* a
Newtonian black hole, as I suggested, since light in Newtonian physics
travels in straight lines. So it would be an unusual kind of relativistic
black hole.

(A Newtonian black hole is just a star or planet sufficiently big that the
escape velocity is greater than the speed of light. Hmmm again... what is
the escape velocity of an infinite plane with gravitational acceleration of
1 gee?)



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

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


Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-15 Thread Random832
On Thu, Sep 15, 2016, at 15:31, Steve D'Aprano wrote:
> Light follows geodesics, not straight lines.

What is a straight line on a curved space if not a geodesic? That was
actually what I was getting at.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-15 Thread Gregory Ewing

Marko Rauhamaa wrote:

It is actually quite interesting how the brain forms an accurate idea of
a straight line and, say, a circle. Whenever you get a new pair of
glasses, the brain needs a recalibration and manages to do it within a
week.


I had an interesting experience in that area a few years
ago. One of the entries in the PyWeek[1] game programming
competition was a platform game set on the inside of a
circular world. You saw a small part of the world at
a time side-on, with the ground curving up slightly
to the left and right.

After playing for a while, my brain must have trained
itself to see the curved ground as straight, because
when I looked away, all horizontal straight lines
looked like they were curved *downwards* slightly!

[1] A competition for Python-based games, so getting
a bit closer to being back on-topic.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


how to robot recognize basic geometric object in window or ubuntu window

2016-09-15 Thread meInvent bbird
i am doing a robot to automate window itself with python 

i give some basic png diagram such as square, circle, triangle
and hope it recognize all kinds of square like things in window 
such as textbox of notepad etc

how a robot recognize basic geometric object in window or ubuntu window

i use cv2 template matching method 
and then draw black square or rectangle as a template

however, it can recognize the size of template only

and recognize not a square diagram from capture screen

then i try a black ground and white line of square, it recognize a File in menu

i feel that it need to try all kinds of color, and size in order to recognize
similar object in screen capture diagram

how do a robot recognize many color and size in seconds?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to automate java application in window using python

2016-09-15 Thread meInvent bbird
On Thursday, September 15, 2016 at 3:52:41 PM UTC+8, Lawrence D’Oliveiro wrote:
> On Thursday, September 15, 2016 at 7:13:05 PM UTC+12, meInvent bbird wrote:
> > how to automate java application in window using python
> > 
> > 1. scroll up or down of scroll bar
> > 2. click button
> > 3. type text in textbox
> 
> Well, don’t leave us in suspense! Give us the link to your blog post!

i do not have blog post, 

search nothing about this in google, 

is it possible to automate java application with python?
-- 
https://mail.python.org/mailman/listinfo/python-list