How to get a place's longitude and latitude?

2020-02-24 Thread Souvik Dutta
Hi guys I want to make a program that kinda sends an sos message with the
measures of longitude and latitude (which is super inconvenient) to
someone. How can I do that I mean how can I get the longitude and latitude?
Any help would be appreciated.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to get a place's longitude and latitude?

2020-02-24 Thread Abdur-Rahmaan Janhangeer
On phone?

On Mon, 24 Feb 2020, 20:02 Souvik Dutta,  wrote:

> Hi guys I want to make a program that kinda sends an sos message with the
> measures of longitude and latitude (which is super inconvenient) to
> someone. How can I do that I mean how can I get the longitude and latitude?
> Any help would be appreciated.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to get a place's longitude and latitude?

2020-02-24 Thread Aakash Jana
You might use webscraping with requests and beautiful soup to scrape up
some website for that gives such utility


On Mon, 24 Feb 2020, 9:36 pm Souvik Dutta  Hi guys I want to make a program that kinda sends an sos message with the
> measures of longitude and latitude (which is super inconvenient) to
> someone. How can I do that I mean how can I get the longitude and latitude?
> Any help would be appreciated.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to get a place's longitude and latitude?

2020-02-24 Thread Chris Angelico
On Tue, Feb 25, 2020 at 3:04 AM Souvik Dutta  wrote:
>
> Hi guys I want to make a program that kinda sends an sos message with the
> measures of longitude and latitude (which is super inconvenient) to
> someone. How can I do that I mean how can I get the longitude and latitude?
> Any help would be appreciated.

This is a difficult thing to do in general, so you're going to have to
get specific. Are you building a desktop app? A phone app? Is it
something that runs via a web browser? What sort of platform are you
using, and are you okay with requiring the user to do some
configuration beforehand in order to have an easy one-click "send help
now"?

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


Re: How to get a place's longitude and latitude?

2020-02-24 Thread Abdur-Rahmaan Janhangeer
Ever heard of QPython? It has a sl4a  Api

http://edu.qpython.org/qsl4a-develop/index.html?form=web

You can pull in GPS coordinates!

On Mon, 24 Feb 2020, 20:07 Souvik Dutta,  wrote:

> Yes.
>
> On Mon, 24 Feb, 2020, 9:36 pm Abdur-Rahmaan Janhangeer, <
> [email protected]> wrote:
>
>> On phone?
>>
>> On Mon, 24 Feb 2020, 20:02 Souvik Dutta,  wrote:
>>
>>> Hi guys I want to make a program that kinda sends an sos message with the
>>> measures of longitude and latitude (which is super inconvenient) to
>>> someone. How can I do that I mean how can I get the longitude and
>>> latitude?
>>> Any help would be appreciated.
>>> --
>>> https://mail.python.org/mailman/listinfo/python-list
>>>
>>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to get a place's longitude and latitude?

2020-02-24 Thread Joel Goldstick
On Mon, Feb 24, 2020 at 11:10 AM Aakash Jana  wrote:
>
> You might use webscraping with requests and beautiful soup to scrape up
> some website for that gives such utility
>
>
> On Mon, 24 Feb 2020, 9:36 pm Souvik Dutta 
> > Hi guys I want to make a program that kinda sends an sos message with the
> > measures of longitude and latitude (which is super inconvenient) to
> > someone. How can I do that I mean how can I get the longitude and latitude?
> > Any help would be appreciated.
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
> --
> https://mail.python.org/mailman/listinfo/python-list

I found this article for using a raspberry pi and a gps card.  It
might give you some ideas:

https://tutorials-raspberrypi.com/build-raspberry-pi-gps-location-navigation-device/

-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays
-- 
https://mail.python.org/mailman/listinfo/python-list


time.localtime add a parameter for timezone

2020-02-24 Thread qbit
How about adding a time zone parameter to time.localtime?

A  offset just like the form: ± hh[:mm[:ss]].
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: How to get a place's longitude and latitude?

2020-02-24 Thread legaulph
Try something like

import requests
import json

url =
"https://nominatim.openstreetmap.org/search.php?q=city+country&format=json&l
imit=1"
result = requests.get(url)
dataobj = result.json()
x = dataobj[0]['lat'] + "," + dataobj[0]['lon']
print(x)



-Original Message-
From: Python-list  On
Behalf Of Aakash Jana
Sent: Monday, February 24, 2020 11:08 AM
To: Souvik Dutta 
Cc: [email protected]
Subject: Re: How to get a place's longitude and latitude?

You might use webscraping with requests and beautiful soup to scrape up some
website for that gives such utility


On Mon, 24 Feb 2020, 9:36 pm Souvik Dutta  Hi guys I want to make a program that kinda sends an sos message with 
> the measures of longitude and latitude (which is super inconvenient) 
> to someone. How can I do that I mean how can I get the longitude and
latitude?
> Any help would be appreciated.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
https://mail.python.org/mailman/listinfo/python-list

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


Re: time.localtime add a parameter for timezone

2020-02-24 Thread Dieter Maurer
qbit wrote at 2020-2-24 05:18 -0800:
>How about adding a time zone parameter to time.localtime?
>
>A  offset just like the form: ± hh[:mm[:ss]].

Why should this be necessary? `localtime` returns the time
in the "local timezone" -- and the "local timezone" usually
does not change between different calls to `localtime`.
Thus, it is best not to pass the timezone to each call to `localtime`
but use environment information.

If your "local timezone" does change frequently, you have (at least)
the following options:

 * use `time.tzset` to reset the internal variables used by
   `localtime` from the envvar `TZ` (which your have appropriately
   set earlier)

 * use `time.time` (instead of `time.localtime`) and add the offset
   yourself. `time.time` returns the UTC time.


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


Re: time.localtime add a parameter for timezone

2020-02-24 Thread Rhodri James

On 24/02/2020 17:21, Dieter Maurer wrote:

qbit wrote at 2020-2-24 05:18 -0800:

How about adding a time zone parameter to time.localtime?

A  offset just like the form: ± hh[:mm[:ss]].


Why should this be necessary? `localtime` returns the time
in the "local timezone" -- and the "local timezone" usually
does not change between different calls to `localtime`.


It can if your calls to localtime() happen either side of a daylight 
saving time switch.


That said, I agree that the timezone doesn't really belong in the output 
of localtime().  There are a very few occasions when you want it, but 
more often you should be working in UTC not local time.



--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Tkinter layout designer

2020-02-24 Thread mm0fmf
Can anyone recommend a graphic layout designer for Tkinter programs. I 
have a number of older C# Windows Forms apps that need porting so they 
can run on Linux and Windows and this is the chance to re-write them in 
Python. However, after using the forms designer in Visual Studio, 
manually coding up the widget positions etc. is a real pain in the 
backside.


So please, recommendations for a designer that is usable and functional 
please to save me working through everything a Google search throws up.


Thanks,
Andy


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


Re: Tkinter layout designer

2020-02-24 Thread Christian Gollwitzer

Am 24.02.20 um 22:29 schrieb mm0fmf:

Can anyone recommend a graphic layout designer for Tkinter programs.


There is no such thing for Tkinter. There is an outdated designer for Tk 
called Visual Tcl, but it can generate only Tcl code, not TkInter, and 
uses only old-style widgets.


I 
have a number of older C# Windows Forms apps that need porting so they 
can run on Linux and Windows and this is the chance to re-write them in 
Python. However, after using the forms designer in Visual Studio, 
manually coding up the widget positions etc. is a real pain in the 
backside


So please, recommendations for a designer that is usable and functional 
please to save me working through everything a Google search throws up.



If you want a designer, use QT, which brings the Qt Designer. Be careful 
though - if you misuse them, you can end up with inflexible GUIs, where 
changes in the font or display resolution can mess up your interface. 
Always test that your windows act sensibly upon resizing.


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


Re: Tkinter layout designer

2020-02-24 Thread Souvik Dutta
There is one called PAGES

On Tue, Feb 25, 2020, 12:05 PM Christian Gollwitzer  wrote:

> Am 24.02.20 um 22:29 schrieb mm0fmf:
> > Can anyone recommend a graphic layout designer for Tkinter programs.
>
> There is no such thing for Tkinter. There is an outdated designer for Tk
> called Visual Tcl, but it can generate only Tcl code, not TkInter, and
> uses only old-style widgets.
>
> > I
> > have a number of older C# Windows Forms apps that need porting so they
> > can run on Linux and Windows and this is the chance to re-write them in
> > Python. However, after using the forms designer in Visual Studio,
> > manually coding up the widget positions etc. is a real pain in the
> > backside
>
> > So please, recommendations for a designer that is usable and functional
> > please to save me working through everything a Google search throws up.
>
>
> If you want a designer, use QT, which brings the Qt Designer. Be careful
> though - if you misuse them, you can end up with inflexible GUIs, where
> changes in the font or display resolution can mess up your interface.
> Always test that your windows act sensibly upon resizing.
>
> Christian
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list