Aw: Re: Best way to check if there is internet?

2022-02-07 Thread Karsten Hilbert
> Or the internet acquires a new protocol that's designed
> for very-long-latency connections.

That's being worked on already

https://en.wikipedia.org/wiki/NASA_Deep_Space_Network

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


Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 12:20, Ethan Furman  wrote:
>
> On 2/7/22 4:27 PM, Greg Ewing wrote:
>  > On 8/02/22 8:51 am, Chris Angelico wrote:
>
>  >> Some day, we'll have people on Mars. They won't have TCP connections -
>  >> at least, not unless servers start supporting connection timeouts
>  >> measured in minutes or hours - but it wouldn't surprise me if some
>  >> sort of caching proxy system is deployed.
>  >
>  > Or the internet acquires a new protocol that's designed
>  > for very-long-latency connections.
>
> RocketNet -- a massive store-and-forward protocol.  ;-)
>

Definitely possible. Though wouldn't a rocket scientist call it
"store-and-prograde"? :)

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


Re: Best way to check if there is internet?

2022-02-07 Thread Michael Torrie
On 2/7/22 12:51, Chris Angelico wrote:
> Some day, we'll have people on Mars. They won't have TCP connections -
> at least, not unless servers start supporting connection timeouts
> measured in minutes or hours - but it wouldn't surprise me if some
> sort of caching proxy system is deployed.
> 
> On the other hand, it also wouldn't surprise me if we do everything at
> a high level instead - have a Martian PyPI mirror, Debian package
> mirror, etc, etc, etc - and then build a mirror synchronization
> protocol that uses UDP.
> 
> Either way, though: would a person on Mars "have the internet"? Yes,
> but not the internet as we know it...

Fun fact.  The team running the Ingenuity helicopter on mars has shell
access to Linux running on the copter.  Obviously not interactive in the
normal sense of course, but they can batch shell commands and pass them
through the communication network to the rover, which relays them to the
copter.  Standard out is relayed back to earth at the next opportunity.
 Currently they use this remote shell access to compress all the images
after each flight and use ffmpeg to create video sequences from stills
on the copter computer itself.  They also used it to do some hacks to
temporarily fix the watchdog timing issue they had initially.  One of
the Linux gurus on the project has given several interviews to the Linux
Unplugged podcast. Fastinating stuff!

It's likely they have a python interpreter onboard as well.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best way to check if there is internet?

2022-02-07 Thread Ethan Furman

On 2/7/22 4:27 PM, Greg Ewing wrote:
> On 8/02/22 8:51 am, Chris Angelico wrote:

>> Some day, we'll have people on Mars. They won't have TCP connections -
>> at least, not unless servers start supporting connection timeouts
>> measured in minutes or hours - but it wouldn't surprise me if some
>> sort of caching proxy system is deployed.
>
> Or the internet acquires a new protocol that's designed
> for very-long-latency connections.

RocketNet -- a massive store-and-forward protocol.  ;-)

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


Re: Best way to check if there is internet?

2022-02-07 Thread Greg Ewing

On 8/02/22 8:51 am, Chris Angelico wrote:

Some day, we'll have people on Mars. They won't have TCP connections -
at least, not unless servers start supporting connection timeouts
measured in minutes or hours - but it wouldn't surprise me if some
sort of caching proxy system is deployed.


Or the internet acquires a new protocol that's designed
for very-long-latency connections.

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


Re: Logging user activity

2022-02-07 Thread Cameron Simpson
On 06Feb2022 23:30, blessy carol  wrote:
>I have this task where I have to create log files to record user 
>activity whenever they make an entry or view something. Also, I have to 
>create Database log file whenever someone accessed or manipulated the 
>data in the database. The code is written python and used django 
>framework. I've connected django with oracle cloud database. So now I 
>want to if the basic logging details can be used to store the record of 
>these activities in the log file in the server. It  would be of great 
>help.

For the file, you can do that directly in the logging configuration - 
there's a FileHandler with a bunch of configuration options (like 
rolling over to a new file etc). Hook that to your logging setup.

For the db side, make a Djanog Model for your log table and write your 
own logging handler which makes new instance of the model containing log 
information. There might even by a prebuilt Django logging thing 
available for that - I haven't looked.

We had a "log everything!" requests for a project here.

I made a generic AuditLog Django model for this. It has a timestamp, a 
description, a log_type PositiveIntegerField, a user field (because we 
were tracking things by User, can be NULL for things not driven by a 
User eg app internals), a parent (ForeignKey to the AuditLog model so 
you can make hierarchical related log entries), and an:

entity = GenericForeignKey("entity_type", "entity_uuid")

which was a reference to some "primary" entity (Model instance) 
elsewhere where that was relevant, and a couple of JSON fields for state 
information.

This is massive overkill for your needs, but we only wanted to do this 
once, so needs like yours also use this model here.

Then you can write simple log calls which make model instances with what 
you need to log in them.

The only only real catch for us was transactions - if something fails 
and rolls back the transaction it also throws away the log entries 
because they're in the transaction. For your needs that is probably 
fine.

For us, we want to use it for error tracking/diagnosis too, so I've got 
a ticket to hand the logging to a distinct Thread (which magicly makes a 
distinct db connection, outside the transaction). That way the logging 
can survive a transaction rollback.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 09:31, <2qdxy4rzwzuui...@potatochowder.com> wrote:
>
> On 2022-02-08 at 06:51:20 +1100,
> Chris Angelico  wrote:
>
> > Either way, though: would a person on Mars "have the internet"? Yes,
> > but not the internet as we know it...
>
> By current definition, they *can't* have the internet as we know it.
>
> Wikipedia,¹ Mirrian-Webster,² and TechTerms.com³ (the first three that
> came up in my search engine, which is admittedly Earthbound for now) all
> use words like "global" and phrases like "across the world" or "around
> the world," all of which arguably exclude Mars, or at least a network
> that covers both Earth and Mars.
>

Yes, well, globally-unique IDs are probably going to be
universally-unique IDs too, but we're not hugely bothered by that.
Remember, you can get targeted advertising on the ISS too...

https://xkcd.com/713/

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


Re: Best way to check if there is internet?

2022-02-07 Thread 2QdxY4RzWzUUiLuE
On 2022-02-08 at 06:51:20 +1100,
Chris Angelico  wrote:

> Either way, though: would a person on Mars "have the internet"? Yes,
> but not the internet as we know it...

By current definition, they *can't* have the internet as we know it.

Wikipedia,¹ Mirrian-Webster,² and TechTerms.com³ (the first three that
came up in my search engine, which is admittedly Earthbound for now) all
use words like "global" and phrases like "across the world" or "around
the world," all of which arguably exclude Mars, or at least a network
that covers both Earth and Mars.

IMO, Mars and its current and future living beings are better off
without the World Wide Web, too.

¹ https://en.wikipedia.org/wiki/Internet
² https://www.merriam-webster.com/dictionary/Internet
³ https://techterms.com/definition/internet
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Logging user activity

2022-02-07 Thread Peter J. Holzer
On 2022-02-06 23:30:41 -0800, blessy carol wrote:
> I have this task where I have to create log files to record user
> activity whenever they make an entry or view something. Also, I have
> to create Database log file whenever someone accessed or manipulated
> the data in the database. The code is written python and used django
> framework. I've connected django with oracle cloud database. So now I
> want to if the basic logging details can be used to store the record
> of these activities in the log file in the server.

There are three places where you can do that in a centralized manner:

1. In the database itself. AFAIK Oracle has an audit system, but I've
   never used it.
2. At the Django ORM layer. Django has the ability to log all database
   queries it makes
3. At the web request level. Your web server (probably) already logs
   every request but not necessarily the information you are interested
   in. But you could write a piece of middleware for your Django which
   extracts log-worthy information and logs that.

The first two options are probably too low-level, and especially the
second is really hard to interpret in an automated manner (which is what
you probably want to do - otherwise why log in the first place?)

So I'd try the third option. But it really depends a lot on the
structure of your application on whether it's feasible to extract all
the data you need at that point. It's possible that you will have to go
through all the views in your app, see what data they are requesting and
altering and craft appropriate log messages for each.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 08:30, Cameron Simpson  wrote:
>
> On 08Feb2022 06:51, Chris Angelico  wrote:
> >Some day, we'll have people on Mars. They won't have TCP connections -
> >at least, not unless servers start supporting connection timeouts
> >measured in minutes or hours - but it wouldn't surprise me if some
> >sort of caching proxy system is deployed.
>
> The TCP ESTABLISHED state has no timeouts at all (though intemediate
> stateful things can get bored).  The setup/teardown do though :-)

That's what I mean - not a lot of point trying to establish a TCP
socket if the other end will give up on you after a mere ninety
seconds. It's extremely convenient that an established connection
lasts forever until touched in some way (even across reconfigurations
of the network - which is how you can redo a server's network over
SSH), but first you have to get to that!

> But
> they can be proxied. Our previous satellite modem proxied TCP locally
> and ran a more-suitable-satellite protocol from the modem to the
> downstation, where it became TCP again and went on its way.

Yup. I'm not sure whether we'll proxy TCP, proxy HTTP, or have high
level mirrors, but one way or another, people on Mars will want their
internets plsthx.

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


Re: Best way to check if there is internet?

2022-02-07 Thread Cameron Simpson
On 08Feb2022 06:51, Chris Angelico  wrote:
>Some day, we'll have people on Mars. They won't have TCP connections -
>at least, not unless servers start supporting connection timeouts
>measured in minutes or hours - but it wouldn't surprise me if some
>sort of caching proxy system is deployed.

The TCP ESTABLISHED state has no timeouts at all (though intemediate 
stateful things can get bored).  The setup/teardown do though :-) But 
they can be proxied. Our previous satellite modem proxied TCP locally 
and ran a more-suitable-satellite protocol from the modem to the 
downstation, where it became TCP again and went on its way.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best way to check if there is internet?

2022-02-07 Thread Cameron Simpson
On 07Feb2022 11:40, Grant Edwards  wrote:
>Ah, c'mon... Every geek worth his salt knows a few real world IP
>addresses without relying on DNS. If you want to "ping Google", it's
> $ ping 8.8.8.8
> $ ping 8.8.4.4

And Cloudflare is 1.1.1.1. Speaking as someone who's seen his upstream 
provider have good G connectivity and degraded C connectiviy :-(

>If that doesn't work, then you ask 'route -n' for the IP address of
>the default gateway,

I tend to just check for the presence of the default route for services 
which should be "up" when there's internet. (Persistent ssh tunnels, in 
the main.) Not even a ping.

Some of those tunnels are further conditioned on a specific ping.

"ping -c 5 -q ip-addr-here" can be a simple Boolean test.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best way to check if there is internet?

2022-02-07 Thread Grant Edwards
On 2022-02-07, Dennis Lee Bieber  wrote:
> On Mon, 07 Feb 2022 11:40:24 -0800 (PST), Grant Edwards
> declaimed the following:
>
>>On 2022-02-07, Dennis Lee Bieber  wrote:
>>
>>> Also, for a machine freshly booted, with no cache, even pinging
>>> Google first requires making contact with a DNS server to ask for
>>> Google's IP address. With no network, the DNS look-up will fail
>>> before ping even tries to hit Google.
>>
>>Ah, c'mon... Every geek worth his salt knows a few real world IP
>>addresses without relying on DNS. If you want to "ping Google", it's
>>
>> $ ping 8.8.8.8
>>or
>> $ ping 8.8.4.4
>>
>
> Which happen to be Google's DNS servers -- not what most think of as
> "Google"

Right. So even asking "do you have Google" is too vague. :)

> Manipulates network routing tables.

Sorry, I didn't know that the Windows "route" command didn't recognize the
standard -n option.

--
Grant

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


Re: Best way to check if there is internet?

2022-02-07 Thread Dennis Lee Bieber
On Mon, 07 Feb 2022 11:40:24 -0800 (PST), Grant Edwards
 declaimed the following:

>On 2022-02-07, Dennis Lee Bieber  wrote:
>
>> Also, for a machine freshly booted, with no cache, even pinging
>> Google first requires making contact with a DNS server to ask for
>> Google's IP address. With no network, the DNS look-up will fail
>> before ping even tries to hit Google.
>
>Ah, c'mon... Every geek worth his salt knows a few real world IP
>addresses without relying on DNS. If you want to "ping Google", it's
>
> $ ping 8.8.8.8
>or
> $ ping 8.8.4.4
>

Which happen to be Google's DNS servers -- not what most think of as
"Google"

C:\Users\Wulfraed>ping www.google.com -4

Pinging www.google.com [142.251.45.36] with 32 bytes of data:
...


>:)
>
>If that doesn't work, then you ask 'route -n' for the IP address of
>the default gateway, and try pinging that. It's possible your default
>gateway is alive but configured to ignore ICMP ping requests, but I've
>never run into one like that.
>

No "route -n" here...

C:\Users\Wulfraed>route -n

Manipulates network routing tables.

ROUTE [-f] [-p] [-4|-6] command [destination]
  [MASK netmask]  [gateway] [METRIC metric]  [IF interface]

  -f   Clears the routing tables of all gateway entries.  If this
is
   used in conjunction with one of the commands, the tables are
   cleared prior to running the command.

  -p   When used with the ADD command, makes a route persistent
across
   boots of the system. By default, routes are not preserved
   when the system is restarted. Ignored for all other
commands,
   which always affect the appropriate persistent routes.

  -4   Force using IPv4.

  -6   Force using IPv6.

  command  One of these:
 PRINT Prints  a route
 ADD   Addsa route
 DELETEDeletes a route
 CHANGEModifies an existing route
  destination  Specifies the host.
  MASK Specifies that the next parameter is the 'netmask' value.
  netmask  Specifies a subnet mask value for this route entry.
   If not specified, it defaults to 255.255.255.255.
  gateway  Specifies gateway.
  interfacethe interface number for the specified route.
  METRIC   specifies the metric, ie. cost for the destination.
...


-- 
Wulfraed Dennis Lee Bieber AF6VN
wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 06:41, Grant Edwards  wrote:
> But, as has been pointed out previously "if there is internet" is too
> vague a question to have an answer.
>
> If all you have is proxied access to outside HTTPS servers, then I
> would consider the answer to be "no", but most people would say "yes"
> they have internet.

Some day, we'll have people on Mars. They won't have TCP connections -
at least, not unless servers start supporting connection timeouts
measured in minutes or hours - but it wouldn't surprise me if some
sort of caching proxy system is deployed.

On the other hand, it also wouldn't surprise me if we do everything at
a high level instead - have a Martian PyPI mirror, Debian package
mirror, etc, etc, etc - and then build a mirror synchronization
protocol that uses UDP.

Either way, though: would a person on Mars "have the internet"? Yes,
but not the internet as we know it...

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


Re: Openning Python program

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 06:51, Cecil Westerhof via Python-list
 wrote:
>
> Chris Angelico  writes:
>
> >> > How difficult would it be to get people to read those lines, though?
> >>
> >> That does remind me about a system administrator who wanted to make a
> >> point. He changed something on the server so all the Windows computers
> >> started up and gave a message:
> >> If you want to continue: click Cancel
> >>
> >> The help-desk became flooded with calls. I think he did a great job of
> >> showing a vulnerability. But it was not appreciated and he was fired.
> >> :'-(
> >>
> >
> > First image in this collection:
> >
> > https://thedailywtf.com/articles/How-Do-I-Use-This
> >
> > For those who can't click on links, it's a screenshot of a
> > confirmation dialogue. The user asked to cancel all the current
> > transfers, and the system wanted to check that the user really wanted
> > to do that; if you do indeed want to cancel those transfers, click
> > "Cancel", but if you actually don't want to, click "Cancel" instead.
>
> His dialog was crystal clear. The problem was that most users just
> click OK without reading the message. And that was what his little
> experiment showed.
>

Ah. Yes, that... that sounds like a very familiar and serious vulnerability.

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


Re: Openning Python program

2022-02-07 Thread Cecil Westerhof via Python-list
Chris Angelico  writes:

>> > How difficult would it be to get people to read those lines, though?
>>
>> That does remind me about a system administrator who wanted to make a
>> point. He changed something on the server so all the Windows computers
>> started up and gave a message:
>> If you want to continue: click Cancel
>>
>> The help-desk became flooded with calls. I think he did a great job of
>> showing a vulnerability. But it was not appreciated and he was fired.
>> :'-(
>>
>
> First image in this collection:
>
> https://thedailywtf.com/articles/How-Do-I-Use-This
>
> For those who can't click on links, it's a screenshot of a
> confirmation dialogue. The user asked to cancel all the current
> transfers, and the system wanted to check that the user really wanted
> to do that; if you do indeed want to cancel those transfers, click
> "Cancel", but if you actually don't want to, click "Cancel" instead.

His dialog was crystal clear. The problem was that most users just
click OK without reading the message. And that was what his little
experiment showed.

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


Re: Best way to check if there is internet?

2022-02-07 Thread Grant Edwards
On 2022-02-07, Dennis Lee Bieber  wrote:

> Also, for a machine freshly booted, with no cache, even pinging
> Google first requires making contact with a DNS server to ask for
> Google's IP address. With no network, the DNS look-up will fail
> before ping even tries to hit Google.

Ah, c'mon... Every geek worth his salt knows a few real world IP
addresses without relying on DNS. If you want to "ping Google", it's

 $ ping 8.8.8.8
or
 $ ping 8.8.4.4

:)

If that doesn't work, then you ask 'route -n' for the IP address of
the default gateway, and try pinging that. It's possible your default
gateway is alive but configured to ignore ICMP ping requests, but I've
never run into one like that.

But, as has been pointed out previously "if there is internet" is too
vague a question to have an answer.

If all you have is proxied access to outside HTTPS servers, then I
would consider the answer to be "no", but most people would say "yes"
they have internet.

If all you have is NAT'ed outbound TCP connections, even more people
would say "yes they have internet", but I would still answer "partially".

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


Correct way to setup a package with both compiled C code and Python code?

2022-02-07 Thread Christian Gollwitzer

Hi all,

we've developed a Python pacakge which consists of both a compiled 
extension module and some helper functions in Python. Is there a 
tutorial on how to package such an extension?


Most resources I found for distutils describe either building an 
extension or pure python modules. Currently I have a structure like this:


ABCD/__init__.py
ABCD/main.py
ccode/some.c
ccode/some.h
ccode/Makefile

The Makefile compiles the C code and creates ABCD/some.so, which 
"main.py" then imports. This works, but not e.g. on Windows and it's not 
integrated into pip, of course.


We're soon going to publish the package as open source code and it would 
be great to do "pip install ABCD" ultimately. Is there a simple example 
out there how to achieve this?


Additionally, we use OpenMP in the C code for parallelism. This is easy 
in the Makefile, one has to pass "-fopenmp" to gcc and "/openmp" to 
msvc. Is there a way to set this flag automatically depending on the 
compiler?


Best regards,

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


Re: Openning Python program

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 04:30, Cecil Westerhof via Python-list
 wrote:
>
> Chris Angelico  writes:
>
> > On Tue, 8 Feb 2022 at 02:53, Grant Edwards  
> > wrote:
> >>
> >> On 2022-02-06, Dennis Lee Bieber  wrote:
> >> > On Sun, 6 Feb 2022 13:44:07 +0530, "createkmontalb...@gmail.com"
> >> > declaimed the following:
> >> >
> >> >>   I cannot open python after downloading it keeps going to 
> >> >> modify/uninstall
> >> >>   ?? please help
> >> >
> >> > Stop clicking on the INSTALLER. What you downloaded is just the program
> >> > that installs and configures Python on your system. Stuff it away 
> >> > someplace
> >> > safe should you need to modify the current installation, but otherwise 
> >> > just
> >> > forget that it exists.
> >>
> >> This is _still_ a problem after all these years and countless
> >> identical complaints?
> >>
> >> How difficult would it be to add a few lines of text to the installer
> >> welcome screen explaining that you've just started the Python
> >> INSTALLER, and if you've already done the installation and want to
> >> "run Python" try ?
> >>
> >
> > How difficult would it be to get people to read those lines, though?
>
> That does remind me about a system administrator who wanted to make a
> point. He changed something on the server so all the Windows computers
> started up and gave a message:
> If you want to continue: click Cancel
>
> The help-desk became flooded with calls. I think he did a great job of
> showing a vulnerability. But it was not appreciated and he was fired.
> :'-(
>

First image in this collection:

https://thedailywtf.com/articles/How-Do-I-Use-This

For those who can't click on links, it's a screenshot of a
confirmation dialogue. The user asked to cancel all the current
transfers, and the system wanted to check that the user really wanted
to do that; if you do indeed want to cancel those transfers, click
"Cancel", but if you actually don't want to, click "Cancel" instead.

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


Re: Best way to check if there is internet?

2022-02-07 Thread Dennis Lee Bieber
On Mon, 7 Feb 2022 13:33:54 +0400, Abdur-Rahmaan Janhangeer
 declaimed the following:

>Popular browsers tell: No internet connection detected. A function that
>goes in the same sense. Unless they too are pinging Google.com to check ...
>

Ah, but WHEN do those browsers report that? When attempting to connect
to whatever the default "home" page has been set to? (Mine is configured to
use https://www.google.com as the default page -- if my router is down,
obviously the browser will time-out waiting for a response from Google, and
report "no network").

Pretty much any discovery of "no network" occurs when the application
attempts to make a normal connection to some target -- using whatever
protocol is normal for that application -- and fails to get a response.
ping is not a solution -- it is possible for firewalls to be configured to
drop with no response specific packets. A firewall configured to DROP
rather than REJECT results in a machine that just "isn't there" to outside
poking. That doesn't mean that the network is down -- only that the machine
you tried to poke is ignoring you.

Also, for a machine freshly booted, with no cache, even pinging Google
first requires making contact with a DNS server to ask for Google's IP
address. With no network, the DNS look-up will fail before ping even tries
to hit Google.

Consider that UDP is often used in a "fire and forget" mode -- packets
get sent to the network interface for forwarding, but there is no
expectation that the transport system will return success/failure packets.
For UDP, any such has to be built into the application level protocol(s).
TCP, OTOH, /is/ a "connected" protocol expecting to receive ACK/NAK packets
for each one it sends out. If it doesn't receive either it will, after some
time-out period, declare a broken connection.


-- 
Wulfraed Dennis Lee Bieber AF6VN
wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


Logging user activity

2022-02-07 Thread blessy carol
Hi,

I have this task where I have to create log files to record user activity 
whenever they make an entry or view something. Also, I have to create Database 
log file whenever someone accessed or manipulated the data in the database. The 
code is written python and used django framework. I've connected django with 
oracle cloud database. So now I want to if the basic logging details can be 
used to store the record of these activities in the log file in the server. It  
would be of great help. 

Thanks & Regards,
Blessy.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Openning Python program

2022-02-07 Thread Cecil Westerhof via Python-list
Chris Angelico  writes:

> On Tue, 8 Feb 2022 at 02:53, Grant Edwards  wrote:
>>
>> On 2022-02-06, Dennis Lee Bieber  wrote:
>> > On Sun, 6 Feb 2022 13:44:07 +0530, "createkmontalb...@gmail.com"
>> > declaimed the following:
>> >
>> >>   I cannot open python after downloading it keeps going to 
>> >> modify/uninstall
>> >>   ?? please help
>> >
>> > Stop clicking on the INSTALLER. What you downloaded is just the program
>> > that installs and configures Python on your system. Stuff it away someplace
>> > safe should you need to modify the current installation, but otherwise just
>> > forget that it exists.
>>
>> This is _still_ a problem after all these years and countless
>> identical complaints?
>>
>> How difficult would it be to add a few lines of text to the installer
>> welcome screen explaining that you've just started the Python
>> INSTALLER, and if you've already done the installation and want to
>> "run Python" try ?
>>
>
> How difficult would it be to get people to read those lines, though?

That does remind me about a system administrator who wanted to make a
point. He changed something on the server so all the Windows computers
started up and gave a message:
If you want to continue: click Cancel

The help-desk became flooded with calls. I think he did a great job of
showing a vulnerability. But it was not appreciated and he was fired.
:'-(

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


Re: Openning Python program

2022-02-07 Thread Grant Edwards
On 2022-02-07, Barry  wrote:
>> On 7 Feb 2022, at 15:55, Grant Edwards  wrote:
>> On 2022-02-06, Dennis Lee Bieber  wrote:
>>> On Sun, 6 Feb 2022 13:44:07 +0530, "createkmontalb...@gmail.com"
>>>  declaimed the following:
>>> 
  I cannot open python after downloading it keeps going to modify/uninstall
  ?? please help
[...]
>> This is _still_ a problem after all these years and countless
>> identical complaints?
>> 
>> How difficult would it be to add a few lines of text to the installer
>> welcome screen explaining that you've just started the Python
>> INSTALLER, and if you've already done the installation and want to
>> "run Python" try ?
>
> Better yet include the word setup in the installer .exe name.
> Just like almost every other installer does.

That's also been suggested repeatedly over the years also.

--
Grant


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


Re: Openning Python program

2022-02-07 Thread Grant Edwards
On 2022-02-07, Chris Angelico  wrote:
> On Tue, 8 Feb 2022 at 02:53, Grant Edwards  wrote:
>>
>>On 2022-02-06, Dennis Lee Bieber  wrote:
>>> On Sun, 6 Feb 2022 13:44:07 +0530, "createkmontalb...@gmail.com"
>>> declaimed the following:
>>>
   I cannot open python after downloading it keeps going to
   modify/uninstall ?? please help
>
>> This is _still_ a problem after all these years and countless
>> identical complaints?
>
>> How difficult would it be to add a few lines of text to the
>> installer welcome screen explaining that you've just started the
>> Python INSTALLER, and if you've already done the installation and
>> want to "run Python" try ?
>
> How difficult would it be to get people to read those lines, though?

There is that...

It's been ages since I installed Python on Windows, so maybe that info
has already been added and I've put my foot in it?

--
Grant


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


Re: Openning Python program

2022-02-07 Thread Barry


> On 7 Feb 2022, at 15:55, Grant Edwards  wrote:
> 
> On 2022-02-06, Dennis Lee Bieber  wrote:
>> On Sun, 6 Feb 2022 13:44:07 +0530, "createkmontalb...@gmail.com"
>>  declaimed the following:
>> 
>>>  I cannot open python after downloading it keeps going to modify/uninstall
>>>  ?? please help
>> 
>> Stop clicking on the INSTALLER. What you downloaded is just the program
>> that installs and configures Python on your system. Stuff it away someplace
>> safe should you need to modify the current installation, but otherwise just
>> forget that it exists.
> 
> This is _still_ a problem after all these years and countless
> identical complaints?
> 
> How difficult would it be to add a few lines of text to the installer
> welcome screen explaining that you've just started the Python
> INSTALLER, and if you've already done the installation and want to
> "run Python" try ?

Better yet include the word setup in the installer .exe name.
Just like almost every other installer does.

Barry

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

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


Re: Openning Python program

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 02:53, Grant Edwards  wrote:
>
> On 2022-02-06, Dennis Lee Bieber  wrote:
> > On Sun, 6 Feb 2022 13:44:07 +0530, "createkmontalb...@gmail.com"
> > declaimed the following:
> >
> >>   I cannot open python after downloading it keeps going to modify/uninstall
> >>   ?? please help
> >
> > Stop clicking on the INSTALLER. What you downloaded is just the program
> > that installs and configures Python on your system. Stuff it away someplace
> > safe should you need to modify the current installation, but otherwise just
> > forget that it exists.
>
> This is _still_ a problem after all these years and countless
> identical complaints?
>
> How difficult would it be to add a few lines of text to the installer
> welcome screen explaining that you've just started the Python
> INSTALLER, and if you've already done the installation and want to
> "run Python" try ?
>

How difficult would it be to get people to read those lines, though?

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


Re: Openning Python program

2022-02-07 Thread Grant Edwards
On 2022-02-06, Dennis Lee Bieber  wrote:
> On Sun, 6 Feb 2022 13:44:07 +0530, "createkmontalb...@gmail.com"
> declaimed the following:
>
>>   I cannot open python after downloading it keeps going to modify/uninstall
>>   ?? please help
>
> Stop clicking on the INSTALLER. What you downloaded is just the program
> that installs and configures Python on your system. Stuff it away someplace
> safe should you need to modify the current installation, but otherwise just
> forget that it exists.

This is _still_ a problem after all these years and countless
identical complaints?

How difficult would it be to add a few lines of text to the installer
welcome screen explaining that you've just started the Python
INSTALLER, and if you've already done the installation and want to
"run Python" try ?

--
Grant


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


Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Mon, 7 Feb 2022 at 23:48, Lars Liedtke  wrote:
>
> Each Browser is doing it differently and even Windows or
> Linux-Desktopmanagers (NetworkManager).
>
> I have had cases, where one tool told me I had Internet and another one
> I hadn't.

Not at all surprised :) Though that situation would probably be best
described as "degraded service". (Unless one tool was straight-up
misconfigured, of course.)

> So What Chris Angelico wrote is propably the best way, ping e.g. Google,
> do a DNS lookup and try http for Status 200. Each with its own
> Errorhandling and if you have got all three, then it is propable that
> you have "Internet".
>

More specifically, what I'm saying is that the best way to determine
whether you "have internet" is to do the exact thing that you care
about. What do you need the internet for? Downloading things from web
sites? Then attempt an HTTP request. Do you need UDP transmission?
Then send a UDP packet somewhere and wait for a response. Etc.

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


Re: Best way to check if there is internet?

2022-02-07 Thread Lars Liedtke
P.S.: for ping a startingpoint can be icmplib, for dns dnspython and for 
http requests. But consider as well if you want to check for IPv4 and/or 
IPv6 Connectivity.


Am 07.02.22 um 13:47 schrieb Lars Liedtke:
Each Browser is doing it differently and even Windows or 
Linux-Desktopmanagers (NetworkManager).


I have had cases, where one tool told me I had Internet and another 
one I hadn't.


So What Chris Angelico wrote is propably the best way, ping e.g. 
Google, do a DNS lookup and try http for Status 200. Each with its own 
Errorhandling and if you have got all three, then it is propable that 
you have "Internet".


Cheers

Lars

Am 07.02.22 um 10:33 schrieb Abdur-Rahmaan Janhangeer:

Popular browsers tell: No internet connection detected. A function that
goes in the same sense. Unless they too are pinging Google.com to 
check ...


Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

github 
Mauritius


On Mon, Feb 7, 2022 at 1:28 PM Chris Angelico  wrote:


On Mon, 7 Feb 2022 at 20:18, Abdur-Rahmaan Janhangeer
 wrote:

Greetings,

Using the standard library or 3rd party libraries, what's the
best way to check if there is internet? Checking if google.com
is reachable is good but I wonder if there is a more native,
protocol-oriented
way of knowing?


What do you mean by "if there is internet"? How low a level of
connection do you want to test? You could ping an IP address that you
know and can guarantee will respond. You could attempt a DNS lookup.
You could try an HTTP request. Each one can fail in different ways,
for different reasons. It's best to test what you actually care about.

Even this URL recommends checking if a domain is up as a way to 
check for

internet connectivity:

https://www.ibm.com/support/pages/checking-network-connectivity-when-using-python-and-ibm-resilient-circuits 



That talks about a misconfigured proxy as being the most likely cause.
Is that something you're trying to test for?

There is no single concept of "there is internet". (Other than, in a
trivial sense, that the internet does exist.) What you need to know is
"can I use the internet?", and ultimately, that depends on what you
need it to do.

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


--
punkt.de GmbH
Lars Liedtke
.infrastructure

Kaiserallee 13a 
76133 Karlsruhe

Tel. +49 721 9109 500
https://infrastructure.punkt.de
i...@punkt.de

AG Mannheim 108285
Geschäftsführer: Jürgen Egeling, Daniel Lienert, Fabian Stein

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


Re: Best way to check if there is internet?

2022-02-07 Thread Lars Liedtke
Each Browser is doing it differently and even Windows or 
Linux-Desktopmanagers (NetworkManager).


I have had cases, where one tool told me I had Internet and another one 
I hadn't.


So What Chris Angelico wrote is propably the best way, ping e.g. Google, 
do a DNS lookup and try http for Status 200. Each with its own 
Errorhandling and if you have got all three, then it is propable that 
you have "Internet".


Cheers

Lars

Am 07.02.22 um 10:33 schrieb Abdur-Rahmaan Janhangeer:

Popular browsers tell: No internet connection detected. A function that
goes in the same sense. Unless they too are pinging Google.com to check ...

Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

github 
Mauritius


On Mon, Feb 7, 2022 at 1:28 PM Chris Angelico  wrote:


On Mon, 7 Feb 2022 at 20:18, Abdur-Rahmaan Janhangeer
 wrote:

Greetings,

Using the standard library or 3rd party libraries, what's the
best way to check if there is internet? Checking if google.com
is reachable is good but I wonder if there is a more native,
protocol-oriented
way of knowing?


What do you mean by "if there is internet"? How low a level of
connection do you want to test? You could ping an IP address that you
know and can guarantee will respond. You could attempt a DNS lookup.
You could try an HTTP request. Each one can fail in different ways,
for different reasons. It's best to test what you actually care about.


Even this URL recommends checking if a domain is up as a way to check for
internet connectivity:


https://www.ibm.com/support/pages/checking-network-connectivity-when-using-python-and-ibm-resilient-circuits

That talks about a misconfigured proxy as being the most likely cause.
Is that something you're trying to test for?

There is no single concept of "there is internet". (Other than, in a
trivial sense, that the internet does exist.) What you need to know is
"can I use the internet?", and ultimately, that depends on what you
need it to do.

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


--
punkt.de GmbH
Lars Liedtke
.infrastructure

Kaiserallee 13a 
76133 Karlsruhe

Tel. +49 721 9109 500
https://infrastructure.punkt.de
i...@punkt.de

AG Mannheim 108285
Geschäftsführer: Jürgen Egeling, Daniel Lienert, Fabian Stein

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


Re: Best way to check if there is internet?

2022-02-07 Thread Abdur-Rahmaan Janhangeer
Popular browsers tell: No internet connection detected. A function that
goes in the same sense. Unless they too are pinging Google.com to check ...

Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

github 
Mauritius


On Mon, Feb 7, 2022 at 1:28 PM Chris Angelico  wrote:

> On Mon, 7 Feb 2022 at 20:18, Abdur-Rahmaan Janhangeer
>  wrote:
> >
> > Greetings,
> >
> > Using the standard library or 3rd party libraries, what's the
> > best way to check if there is internet? Checking if google.com
> > is reachable is good but I wonder if there is a more native,
> > protocol-oriented
> > way of knowing?
> >
>
> What do you mean by "if there is internet"? How low a level of
> connection do you want to test? You could ping an IP address that you
> know and can guarantee will respond. You could attempt a DNS lookup.
> You could try an HTTP request. Each one can fail in different ways,
> for different reasons. It's best to test what you actually care about.
>
> > Even this URL recommends checking if a domain is up as a way to check for
> > internet connectivity:
> >
> https://www.ibm.com/support/pages/checking-network-connectivity-when-using-python-and-ibm-resilient-circuits
>
> That talks about a misconfigured proxy as being the most likely cause.
> Is that something you're trying to test for?
>
> There is no single concept of "there is internet". (Other than, in a
> trivial sense, that the internet does exist.) What you need to know is
> "can I use the internet?", and ultimately, that depends on what you
> need it to do.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Mon, 7 Feb 2022 at 20:18, Abdur-Rahmaan Janhangeer
 wrote:
>
> Greetings,
>
> Using the standard library or 3rd party libraries, what's the
> best way to check if there is internet? Checking if google.com
> is reachable is good but I wonder if there is a more native,
> protocol-oriented
> way of knowing?
>

What do you mean by "if there is internet"? How low a level of
connection do you want to test? You could ping an IP address that you
know and can guarantee will respond. You could attempt a DNS lookup.
You could try an HTTP request. Each one can fail in different ways,
for different reasons. It's best to test what you actually care about.

> Even this URL recommends checking if a domain is up as a way to check for
> internet connectivity:
> https://www.ibm.com/support/pages/checking-network-connectivity-when-using-python-and-ibm-resilient-circuits

That talks about a misconfigured proxy as being the most likely cause.
Is that something you're trying to test for?

There is no single concept of "there is internet". (Other than, in a
trivial sense, that the internet does exist.) What you need to know is
"can I use the internet?", and ultimately, that depends on what you
need it to do.

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


Best way to check if there is internet?

2022-02-07 Thread Abdur-Rahmaan Janhangeer
Greetings,

Using the standard library or 3rd party libraries, what's the
best way to check if there is internet? Checking if google.com
is reachable is good but I wonder if there is a more native,
protocol-oriented
way of knowing?

Even this URL recommends checking if a domain is up as a way to check for
internet connectivity:
https://www.ibm.com/support/pages/checking-network-connectivity-when-using-python-and-ibm-resilient-circuits

Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

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