Re: Welcome to the "Python-list" mailing list (Digest mode)

2018-01-28 Thread nelson jon kane
When I enter the word python in the search box on my Chrome Windows 10, this is 
what comes up. Can you tell me what each of these "types" of Python mean? Thank 
you.

[cid:aa3fd74d-d71d-42c0-b063-4f20c463987b]


From: Python-list  on 
behalf of python-list-requ...@python.org 
Sent: Sunday, January 28, 2018 1:28:19 PM
To: nelsonjonka...@live.com
Subject: Welcome to the "Python-list" mailing list (Digest mode)

Welcome to the Python-list@python.org mailing list! The purpose of
this mailing list is to support general discussions about the Python
programming language.  Please remember that this list is mirrored to
the Usenet newsgroup comp.lang.python.

For more information on the Python programming language see


To post to this list, send your message to:

  python-list@python.org

General information about the mailing list is at:

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

If you ever want to unsubscribe or change your options (eg, switch to
or from digest mode, change your password, etc.), visit your
subscription page at:

  https://mail.python.org/mailman/options/python-list/nelsonjonkane6%40live.com


You can also make such adjustments via email by sending a message to:

  python-list-requ...@python.org

with the word `help' in the subject or body (don't include the
quotes), and you will get back a message with instructions.

You must know your password to change your options (including changing
the password, itself) or to unsubscribe without confirmation.  It is:

  Parkhill40

Normally, Mailman will remind you of your python.org mailing list
passwords once every month, although you can disable this if you
prefer.  This reminder will also include instructions on how to
unsubscribe or change your account options.  There is also a button on
your options page that will email your current password to you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Welcome to the "Python-list" mailing list (Digest mode)

2018-01-28 Thread nelson jon kane
Where did this guy in the video below get the version of Python that he's 
using? I don't have it in my computer.His version has this across the top:  
 
*for.py - C:/Users/Madhur/Desktop/for.py*



  https://www.youtube.com/watch?v=I5_UxvF_svw

[https://www.bing.com/th?id=OVP.24cLPPXEaXtBRV4AsjxkNwEsCo&pid=Api]<https://www.youtube.com/watch?v=I5_UxvF_svw>

Python Programming Tutorial - 18: The FOR 
Loop<https://www.youtube.com/watch?v=I5_UxvF_svw>
www.youtube.com
In this tutorial we'll check out the FOR Loop in python and see how it is 
different from the WHILE Loop.




____
From: nelson jon kane 
Sent: Sunday, January 28, 2018 6:05:04 PM
To: python-list@python.org
Subject: Re: Welcome to the "Python-list" mailing list (Digest mode)


When I enter the word python in the search box on my Chrome Windows 10, this is 
what comes up. Can you tell me what each of these "types" of Python mean? Thank 
you.

[cid:aa3fd74d-d71d-42c0-b063-4f20c463987b]


From: Python-list  on 
behalf of python-list-requ...@python.org 
Sent: Sunday, January 28, 2018 1:28:19 PM
To: nelsonjonka...@live.com
Subject: Welcome to the "Python-list" mailing list (Digest mode)

Welcome to the Python-list@python.org mailing list! The purpose of
this mailing list is to support general discussions about the Python
programming language.  Please remember that this list is mirrored to
the Usenet newsgroup comp.lang.python.

For more information on the Python programming language see
<http://www.python.org/>

To post to this list, send your message to:

  python-list@python.org

General information about the mailing list is at:

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

If you ever want to unsubscribe or change your options (eg, switch to
or from digest mode, change your password, etc.), visit your
subscription page at:

  https://mail.python.org/mailman/options/python-list/nelsonjonkane6%40live.com


You can also make such adjustments via email by sending a message to:

  python-list-requ...@python.org

with the word `help' in the subject or body (don't include the
quotes), and you will get back a message with instructions.

You must know your password to change your options (including changing
the password, itself) or to unsubscribe without confirmation.  It is:

  Parkhill40

Normally, Mailman will remind you of your python.org mailing list
passwords once every month, although you can disable this if you
prefer.  This reminder will also include instructions on how to
unsubscribe or change your account options.  There is also a button on
your options page that will email your current password to you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: quick script to read digital terrain elevation data?

2006-02-22 Thread Kane
fh.read(12))
)

print "Spatial Resolution: %15.5f, %15.5f, %15.5f" %
(self.spatialResolution[0],

self.spatialResolution[1],

self.spatialResolution[2]
  )

self.profileDimension = (
int(fh.read(6)),
int(fh.read(6))
)
print "map size is %i x %i" % (self.profileDimension[0],
self.profileDimension[1])
#dump the next 160 bytes
self.unknownA = fh.read(6)
self.unknownB = fh.read(16)
self.unknownC = fh.read(2)
self.unknownD = fh.read(2)
self.unknownE = fh.read(2)
self.unknownF = fh.read(4)
self.unknownG = fh.read(4)
self.unknownH = fh.read(124)

return None

def processProfiles(self, fh, oh):
lastProfile = 0
for c in range(self.columnCount):
print "Working on column %s" % c
current, next = fh.read(6), fh.read(6)
try:
profileID = {"current": int(current), "next":
int(next)}
except:
raise "Failed: %s, %s" % (repr(current), repr(next))

print repr(profileID)
#profileID = (fh.read(6), int(fh.read(6)))
profileSize = {"alpha": int(fh.read(6)), "beta":
fh.read(6)}
print repr(profileSize)
#profileSize = (int(fh.read(6)), int(fh.read(6)))

planCoords = (
float(fh.read(24).replace("D", "E")),
float(fh.read(24).replace("D", "E")),
)
print "planCoords: %15.5f, %15.5f" % planCoords

localElevation = float(fh.read(24).replace("D", "E"))
elevExtremea = (
float(fh.read(24).replace("D", "E")),
float(fh.read(24).replace("D", "E"))
)

#'kludge to force the end of processing'???
#if (profileID["current"] - 1) != lastProfile:
#print "%s - 1 != %s" % (profileID["current"],
lastProfile)
#print "%i lines were written to the file" %
self.cellCount
#return None

lastProfile = profileID["next"]
print "Column %i has %i rows" % (profileID["next"],
profileSize["alpha"])
self.firstRow = int(planCoords[1] - self.southMostSample) /
self.spatialResolution[1]

self.lastRow = self.firstRow + profileSize["alpha"]

#skip ahead to the first row
self.base = []
for r in range(self.firstRow):
self.base.append(0)

for r in range(self.firstRow, self.lastRow):
value = fh.read(6)
print self.firstRow, r, self.lastRow, repr(value)
try:
self.base.append(int(value))
except:
raise "the horrors of war!"
#self.base.append(int(fh.read(3)))

#if cutting out a section, adjust the rows
if outType == 2:
#subset
self.firstRow = rowStr
planCoords[1] = planCoords[1] + (self.firstRow - 1) *
self.deltaY
lastRow = max(lastRow, rowEnd)

mod = c % colInt
if mod == 0 and c >= self.colStr:
if outType == 2:
writeSubset(oh, planCoords[0], planCoords[1])
else:
D.writeNormal(oh, planCoords[0], planCoords[1])

#trailer bytes?
#fh.read(424)

return None

YMAX = 2048
XMAX = 2048
SW = 0
NW = 1
NE = 2
SE = 3

infile = "/home/jkane/pypov-0.0.2/rawdata/1843.CDO"

print "DEM to x,y,z ascii file, Python variation based on C version 6"
print "  Python version by Jason Kane, BroadLink Communications 2004"
print "  C version by Sol Katz, BLM April 1997"

fh = open(infile)
D = DEM()
D.getheader(fh)

D.verticalScale = 1.0

#easy enough...
if D.spatialResolution[0] == 3.0:
comp = 2.0
D.deltaY = D.spatialResolution[0] / 3600
else:
comp = 0.0
D.deltaY = D.spatialResolution[0]

D.eastMost = max(D.groundCoords["NE"][0], D.groundCoords["SE"][0])
D.westMost = min(D.groundCoords["NW"][0], D.groundCoords["SW"][0])
D.northMost = max(D.groundCoords["NE"][1], D.groundCoords["NW"][1])
D.southMost = min(D.groundCoords["SW"][1], D.groundCoords["SE"][1])

#trunc' up to nearest spatialResolution
D.eastMostSample = int(D.eastMost / D.spatialResolution[0]) *
int(D.spatialResolution[0])
D.westMostSample = int((D.westMost + comp) / D.spatialResolution[0]) *
int(D.spatialReso

Re: mod_python and open HTTP connection

2006-02-17 Thread Kane
> Does mod_python time out after a minute ?

No, but the browser may timeout.  Sending a periodic bit-o-data on a
long running page is a good idea anyway (so the user knows it is still
working).

>If I leave  an HTTP connection open so that the content keeps loading inside 
>the
>browser window indefinately, and if I close the browser window, the
>mod_python process is terminated, right?

In general this is not an issue.  However it depends to some degree on
what your mod_python program is doing.  Here is a really, REALLY feeble
example w/publisher:

def ping(req, target_ip):
  import commands
  output = commands.getoutput('ping -c 1 %s' % target_ip)
  return output

Even if the user closes the window or hits 'stop' the process stays
until the ping finishes.  In this example this is merely annoying (10k
pings takes almost 3 hours) but if it had been 'fping -el %s' instead
you would be in real trouble (since it would never exit).

Restarting apache clears such zombie processes.

btw, 'ping' as written above is horrible.  If a code review turned
_that_ up on production someone would be fired, along with whoever
hired them, whoever ate lunch with them and anyone that waves goodbye.

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


Re: Clearing a Text Widget

2005-07-22 Thread Kane Bonnette
Kane Bonnette wrote:
> Does anyone know how the clear the text from a Tkinter Text Widget? The 
> delete(0, END) trick that works for Entry widgets doesn't work for Text
> 
> I get "0 is an invalid index" when i try to do so
> 
> Thanks in advance

In case anyone's wondering, you must use 0.0 instead of 0 on a Text Widget
-- 
http://mail.python.org/mailman/listinfo/python-list


Clearing a Text Widget

2005-07-22 Thread Kane Bonnette
Does anyone know how the clear the text from a Tkinter Text Widget? The 
delete(0, END) trick that works for Entry widgets doesn't work for Text

I get "0 is an invalid index" when i try to do so

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


Re: changing colors in python

2005-04-14 Thread Kane
To convert ansi escape sequences into text colors you need a terminal
that understands what you are doing.  Linux does this by default; dos
and windows do not.  You need to have an extra program in memory.  The
conventional approach is the "ANSI.SYS" driver which probably still
ships with Windows (link below).

I've included a link to nansi.com but haven't used it with any windows
version > 3.1.  If memory serves it is significantly faster.

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q101875
http://alumnus.caltech.edu/~dank/nansi/

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


Re: Web Application Client Module

2005-04-12 Thread Kane
Since you need javascript the cheap-n-dirty approach (xml parser, gui
library of your choice and just enough widget logic/https for your app
to work) is a no-go.  I don't know of a python  library with html
rendering and javascript (and https support could easily be another
barrier).

Another option starts with Mozilla/Firefox; just strip away all
unnecessary GUI 'features' with a customized XUL.  I imagine you could
effectivly hardcode the 'home' URL and make the location bar read-only
without great effort.  That will give you HTTPS support, html rendering
and full javascript fairly painlessly.

Course' if your app was designed and tested for IE only you'll have to
wrap the MS rendering/javascript IE libraries.  Plenty of commercial
programs do it (AIM and Quickbooks come to mind) but I've never tried
and suspect there are serious licencing hurdles.

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


Re: Max files in unix folder from PIL process

2005-03-29 Thread Kane
Yes I'm talking Linux not BSD so with any luck you won't have the same
'ls' issue; it is not a crash but painfully slow.  The only other issue
I recall is wildcards fail if they encompass too many files (presumably
a bash/max command line size).

I would expect the various GUI file managers may give unpredictable
results; I would also not rely on remotely mounting the bigdir
cross-platform.

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


Re: Max files in unix folder from PIL process

2005-03-28 Thread Kane
I ran into a similar situation with a massive directory of PIL
generated images (around 10k).  No problems on the filesystem/Python
side of things but other tools (most noteably 'ls') don't cope very
well.As it happens my data has natural groups so I broke the big
dir into subdirs to sidestep the problem.

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


Re: html tags and python

2005-03-25 Thread Kane
If I understand what you are asking then Python & CGI are a poor
solution.  It would be easy to have one page ask for the month, click
submit, then have a second page ask for the exact date.  Easy; but
terrible design.

You want to have one page with a dropdown of months.  When you select a
month, you want to dynamicly alter a dropdown of dates without
refreshing the page.

For this task you'll want to pull JavaScript out of your toolbox.  This
is a fairly common "problem" and googling for examples/samples should
be quick-n-easy.

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