Using Help inside Python

2009-05-03 Thread rose
Hi,
I have an idea of the basics of programming language in
general. How to access help in python i.e. help followed by something
or to get to know about some inbuilt module or method etc. how do I
access help from within the IDLE using the help command.

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


Re: Using Help inside Python

2009-05-03 Thread rose
On May 3, 8:15 pm, Steven D'Aprano  wrote:
> On Sun, 03 May 2009 07:49:49 -0700, rose wrote:
> > Hi,
> >             I have an idea of the basics of programming language in
> > general. How to access help in python i.e. help followed by something or
> > to get to know about some inbuilt module or method etc. how do I access
> > help from within the IDLE using the help command.
>
> > Thank You.
>
> At the prompt, type any of:
>
> help()
>
> help(module)
>
> help(function)
>
> help(any_object)
>
> help("keyword")  # note the quotes around the keyword
>
> then hit Enter to get help about that object or keyword.
>
> --
> Steven

Many Thanks to you Steven, for such a concise explanation of using the
help. May I request some examples to make it a bit more explicit.
--
http://mail.python.org/mailman/listinfo/python-list


acteress images and movies

2008-06-28 Thread rose
acteress images and movies
   you want download the latest songs and movie pictures!
in the next film nametha play a role of queen!!
want more comments!
click it!

http://trichysathya.blogspot.com
***
--
http://mail.python.org/mailman/listinfo/python-list


acteress images and movies

2008-06-28 Thread rose
acteress images and movies
   you want download the latest songs and movie pictures!
in the next film nametha play a role of queen!!
want more comments!
click it!

http://trichysathya.blogspot.com
***
--
http://mail.python.org/mailman/listinfo/python-list


INSTALLATION DOES NOT WORK FRO GITBASH COMMAND LINE

2022-08-23 Thread Gladstone Rose
Why is my installation of Python does not work at the command line for git bash.

I get the following message
bash: python3: command not found

Sent from Mail for Windows

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


Dynamic classes

2005-11-25 Thread Dave Rose
Hello all.
  I was wondering if creating classes could be dynamic.  I want to know if I 
can make a class Person, then read in a list of names (say people's names) 
so then I can have a class instance created for each name in the list?

  Why do I want to do this?  I was just thinking if I had a name on the 
list, Dave, I could then be able to read the name in the list, and assign 
Maria.birthday = <> and all the other attributes I would want to use a class 
for, except this is dynamic.  I don't know how to iterate thru the list to 
assign the different attributes yet, but this seemed reasonable to want to 
do, and thought I could learn from this.

Thanks!
Dave 


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


Re: Dynamic classes

2005-11-26 Thread Dave Rose
Duh!  how dumb am I?  A dictionary solves all those problems, with each 
entry named, and the value of each name could be a class instace. plus all 
the class instances can be iterated by a loop.

Thanks Piet & Alex for your guidance!
-Dave

"Piet van Oostrum" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>>>>>> "Dave Rose" <[EMAIL PROTECTED]> (DR) wrote:
>
>>DR> Hello all.
>>DR>   I was wondering if creating classes could be dynamic. I want to know
>>DR> if I can make a class Person, then read in a list of names (say
>>DR> people's names) so then I can have a class instance created for each
>>DR> name in the list?
>
> If you have the class Person, you are not creating it dynamically. And of
> course you can create instances dynamically as you describe.
>
>>DR>   Why do I want to do this?  I was just thinking if I had a name on 
>>the
>>DR> list, Dave, I could then be able to read the name in the list, and
>>DR> assign Maria.birthday = <> and all the other attributes I would want
>>DR> to use a class for, except this is dynamic. I don't know how to
>>DR> iterate thru the list to assign the different attributes yet, but this
>>DR> seemed reasonable to want to do, and thought I could learn from this.
>
> If I understand you correctly, you want to create a variable with name
> 'Maria' when you read the name "Maria". Creating variables dynamically is
> possible in Python but is almost always the wrong thing to do. Instead it
> is usually better to use a dictionary.
>
> class Person:
>  def __init__(self, name):
>  self.name = name
>
> persons = {}
>
> now you have a loop that reads persons' names, say in name.
>
> myperson = persons[name] = Person(name)
>
> Now I suppose you want to read additional attributes, while the list of
> possible attributes is in principle open.
>
> So suppose you have read the attribute name in attr and the value in val.
> The you can dynamically create an instance attribute with:
>
> setattr(myperson, attr, val)
> -- 
> Piet van Oostrum <[EMAIL PROTECTED]>
> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
> Private email: [EMAIL PROTECTED] 


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


GIS Related Scripting Issue

2005-08-17 Thread Mike Rose








I am currently using ArcGIS 9.1 and was referred to this
list to ask my question.  I am using a python script to loop through a series
of features, select all polygons that are within 5 miles, run statistics on
those selected polygons, then append the values to a new database(dbf).  I am
not sure if I am going about this correctly or not, but my script is definitely
not working.  I am getting an error when it tries to append to the dbf.  Here
is what I have so far.  I would really appreciate any help that someone could
provide.  Thanks in advance!

 

#
---

# final_hopefully.py

# Created on: Tue Aug 16 2005 04:39:33 PM

#   (generated by ArcGIS/ModelBuilder)

#
---

 

# Import system modules

import sys, string, os, win32com.client

 

# Create the Geoprocessor object

gp =
win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1")

 

# Load required toolboxes...

gp.AddToolbox("C:/Program
Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")

gp.AddToolbox("C:/Program
Files/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx")

 

 

# Local variables...

bgrps_data = "bgrps_data"

bgrps_data__2_ = "bgrps_data"

half_mile_parcels = "half_mile_parcels"

bgrps_data__3_ = "bgrps_data"

exported_data2_dbf = "C:\\Temp\\data2.dbf"

bgrps_data__4_ = "bgrps_data"

half_mile_parcels__2_ = "half_mile_parcels"

exported_data1_dbf = "C:\\Temp\\data1.dbf"

exported_data_dbf = "C:\\Temp\\data.dbf"

exported_data_dbf__2_ = "C:\\Temp\\data.dbf"

 

#Loop through each record

gp.Workspace= "C:\\Temp\\test.mdb"

 

# Process: Select Layer By Location (2)...

gp.SelectLayerByLocation_management(bgrps_data__4_,
"WITHIN_A_DISTANCE", half_mile_parcels__2_, "26400 Feet",
"NEW_SELECTION")

 

# Process: Summary Statistics (2)...

gp.Statistics_analysis(bgrps_data__3_, exported_data2_dbf,
"AGE_PERC MEAN;home_perc MEAN", "")

 

try:

    fcs = gp.listfeatureclasses()

 

#Loop through the list of feature classes

    fcs.Reset()

    fc = fcs.Next()

 

    while fc != "":

 

# Process: Select Layer By Location...

    gp.SelectLayerByLocation_management(bgrps_data__2_,
"WITHIN_A_DISTANCE", half_mile_parcels, "26400 Feet",
"NEW_SELECTION")

 

# Process: Summary Statistics (3)...

    gp.Statistics_analysis(bgrps_data,
exported_data1_dbf, "AGE_PERC MEAN;home_perc MEAN", "")

 

# Process: Append...

    gp.Append_management("C:\\temp\data2.dbf",
exported_data_dbf__2_, "TEST")

 

 

#Move to the next fc in the list

    fc = fcs.Next()    

 

except:

    gp.addmessage(gp.getmessages(2))

    print gp.getmessages(2)

 

Michael Rose

GIS Specialist

The Planning Center

ph.  (520) 623.6146

fx.  (520) 622.1950

http://www.azplanningcenter.com

[EMAIL PROTECTED]

 






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

Re: I forgot to wind up my example .... ; (

2005-04-29 Thread Dave Rose
So, I forgot the last part of my example that might gel in your mind why 
Objects are useful in certain situations.  Ok so you maybe followed my example 
of the shopping cart.  Let's just forget for a moment the use for shopping 
carts is for  websites.  Let's just say you were going to write the lines 
directly into Python, like maybe at the IDLE interpreter.  Like maybe you're 
testing the functionality of the routine for correctness, not actual 
implementation.

You have a ShoppingCartClass(), and three users-> Dave, Tommy, Bryan.
ShoppngCartClass() has 3 methods:
.AddItem()
.RemoveItem()
.CheckOut()

These are really just 'def' routintes you write in the class to do some action 
or calculation.  Here, we want to either add an item to 'the cart', remove 
one, or finalize the order. 

In the interpreter,  you could do this. Define 3 users of the 
ShoppingCartClass.

Dave = ShoppingCartClass()
Tommy = ShoppingCartClass()
Bryan = ShoppingCartClass()


Ok.  Now you could do different things to each:

Dave.AddItem(sku=5)
Tommy.AddItem(sku=77)
Tommy.AddItem(sku=12)
Tommy.RemoveItem(sku=12)
Dave.CheckOut(state=CT, ccard='visa', ccardnum='1234-5678-8765-431')
Tommy.CheckOut(stsate=RI, ccard='mastercard', ccardnum='431-123-4321-1234')
Bryan.CancelOrder()

so, if you were then to take account of what you had, you'd know:
Dave has item SKU=5
Tommy has item SKU=77
Bryan has his order cancelled.

This is still very hard-coded.  You could abstract, or maybe variablize, 
things more. Let's try:

You can mix classes with say dictionaries, to make their use in routines more 
beneficial.

So, you could have:

user = âDaveâ
ShoppingCart={}
ShoppingCart[user] = ShoppingCartClass()
user = âTommyâ
ShoppingCart[user] = ShoppingCartClass()
user = âDaveâ
ShoppingCart[user].AddItem(sku=55)
user = âTommyâ
ShoppingCart[user].CheckOut( ... )
ShoppingCart[âDaveâ].CheckOut( ... )

Putting the classes in the dictionary allow you to use names from things like 
fields, config files, text files, TextControls in my favorite program 
wxPython, etc.

If you can wrap your mind around this, you're well on your way to using OOP I 
believe.  If not, , don't give up. I'm just a python/programming newbie and 
maybe missed the boat completely with my posting.

-Dave 

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


Trouble with Multi-threading

2013-12-10 Thread dan . rose
I am running PYTHON 2.7.3 and executing a PYTHON program that uses 
multi-threading.  I am running this on a 64-bit Windows 2008 R2 server 
(Service Pack 1).

Three months ago, I was able to execute this program just fine.  I ran the 
program and opened Task Manager and verified that the program successfully 
obtained all of the multiple threads it requested.

Now, when I go to run this same program (no changes to the program), I am 
getting this message:

Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] 
on win32
Type "copyright", "credits" or "license()" for more information.
>>>  RESTART 

>>> 

>>> 

I look in Task Manager and I don't see any threads for PYTHON.

So, I am hoping that somebody in this forum could help me out.

What is it that I should look for or turn on to find out what is blocking 
this program from creating the threads.

---
 Daniel Rose
 IT Technical Analyst, MSS Development
 Parker Hannifin Corporation
 dan.r...@parker.com
 216-896-3351

"PLEASE NOTE: The preceding information may be confidential or
privileged. It only should be used or disseminated for the purpose
of conducting business with Parker. If you are not an intended
recipient, please notify the sender by replying to this message and
then delete the information from your system. Thank you for your
cooperation."
-- 
https://mail.python.org/mailman/listinfo/python-list


arrays in python

2006-02-10 Thread Kermit Rose
From: Kermit Rose
Date: 02/10/06 17:36:34
To: [EMAIL PROTECTED]
Subject: Arrays
 
  
Hello.
 
I want to write a program in python using integer arrays.
 
I wish to calculate formulas using 200 digit integers.
 
I could not find any documentation in python manual about declaring arrays.
 
I searched the internet
 
and found an example that said I must declare
 
from Numeric import *
 
 
and I downloaded a numerical python  extension,
 
but still  have not found a way to declare an array of given length.
 
The zeros function always gives me an error message.
 
 
Kermit   <[EMAIL PROTECTED] >
 
 
 
 

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


Re: 2-dimensional data structures

2006-02-18 Thread Kermit Rose






 
 

From: anthonyberet
Date: 02/18/06 17:11:01
To: python-list@python.org
Subject: Re: 2-dimensional data structures
 
 
I am not sure how to most efficiently identify which region any given
square on the grid is actually in - any thoughts, for those that have
done this? - I don't want a massive list of IF conditionals if I can
avoid it.
 
 
Kermit says:
 
There is a MUCH more efficient way to do this!
 
If you are doing a  9 by 9  soduku,
 
Each row and column has exactly the digits 1 through 9
 
Think of your data as being in a list 81 cells long that is accessed 3 different ways.
 
As a 9 by 9,  row wise,
 
As a 9 by 9  column wise
 
As a 3 by 3 by 9  where the first two subscripts identify the region, and the last identify one of
the 9 values within the region.
 
 
And ,  most important,
 
To search for a value not yet in a row, column, or region,
 
Define holding list of length 9.
 
Suppose a  row has 4,2,8 in it,
 
and the corresponding column has 2,3,1 in it
 
and the correspond region has 2,  7, 6 in it.
 
Then you  initialize your hold vector to -1,
 
and set
 
hold(4) = 4
hold(2) = 1
hold(8) = 1
hold(2) = 1
hold (3) = 1
hold(1) = 1
hold(2) = 1
hold(7) = 1
hold(6) = 1
 
Then by scaning only the nine elements of hold, you see that
 
hold(5) = -1, , and hold(9) = -1  are the only values not  reset, and 
 
only  5 and 9 are possible choices for the  target cell.
 
 
 
 
 
 
 







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

Byte-operations.

2005-05-18 Thread Dave Rose
I hope someone can please help me.  A few months ago, I found a VBS file, 
MonitorEDID.vbs on the internet.  It is great in that it will extract from the 
registry of Windows the serial number of the attached monitor. (System 
Administration / PC Inventory usage is obvious)

Standalone, it works fine. However, I'd like to integrate it with other system 
interrogations via Tim Golden's WMI and Marc Hammonds Win32all to get RAM, HD 
size, CPU, PC Serial Number, etc and to also take that info and toss into a 
lite database, such as KirbyBase.

However, my Python is limited.  I've gotten the first half of the program 
translated (I believe, I haven't done exhaustive testing).

So, the data is stuck in a dictionary.  A clipping is shown here:

{0: '\x00\xff\xff\xff\xff\xff\xff\x00$M\x93!\x01\  <-SNIP-> '}

Anyway, the functions from VBS I don't know how to translate to Python are:

#location(0)=mid(oRawEDID(i),0x36+1,18)
#location(1)=mid(oRawEDID(i),0x48+1,18)
#
##you can tell if the location contains a serial number if it starts 
with 0x00 00 00 ff
#strSerFind=chr(0x00) & chr(0x00) & chr(0x00) & chr(0xff)
#
##or a model description if it starts with 0x00 00 00 fc
#strMdlFind=chr(0x00) & chr(0x00) & chr(0x00) & chr(0xfc)


##the week of manufacture is stored at EDID offset 0x10
#tmpmfgweek=ord(mid(oRawEDID(i),0x10+1,1))


##store it in month/year format 
#if tmpEDIDMajorVer < 255-48 and tmpEDIDRev < 255-48 :
#tmpver=chr(48+tmpEDIDMajorVer) & "." & chr(48+tmpEDIDRev)
#else:
#tmpver="Not available"


#if (Byte1 and 16) > 0:
#Char1=Char1+4


If someone can help me understand what to do with these types of commands, I'd 
be much appreciative.  Once it's translated, I'd be happy to share this!


Thanks!
Dave


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


refactoring, unit testing, ant, etc.

2005-06-08 Thread Dave Rose
Hello all
  I've been learning Python for the past few months, reading tutorials and 
postings here.  I've bought the personal Komodo then downloaded Eclipse with 
Pydev.  IDLE also is a staple of everyday use.

  ~10 years ago, I had CS as a minor in college.  I learned some C and modula-2 
to name the relevent languages.  Back then I was compiling on a VAX.  Much 
different than today.

  I was hoping someone could guide me a bit with current-day practices.  I've 
been pythoning along, but I hear about things I don't know about (re-factoring, 
unit-testing, debugging, ant build tools) and I don't know how they're 
applicable to make my life easier.  Tutorials didn't shed too much light -- 
they make it seem to be more work than I need now.

  To be clear, I've used debuggers in the past, but it seems when I set break-
points, the Eclipse just skips merrily past them, or steps at every line, and 
for wxPython, that's annoying given all the support libraries.  I also use 
wxPython and wxGlade, so those seem to ignore debug mode completely for some 
reason.

  Can someone please shed some light onto how I should really use my IDE to 
make my life more enjoyable?  I feel I just don't know how to use the tools 
that are available, and that's frustrating.

Thanks so much!
Dave

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


Python to open command script file

2008-12-11 Thread dave rose
Hello all
 I would like to know how to do the following.  I'd like to have a generic 
python program that the user will open a command-script file to do actions.

So, my python program will get a list of servers, enumerate them within a 
checklistbox in wxpython.  Then I want to open a command-file that will run 
against each selected server that will look like this:

---SAMPLE
copy abc.xyz from c:\source to u:\target
copy all from c:\source to u:\target
unload netshld from server1
-END SAMPLE--

(where I have a class serverfuncs, where I can:
s = serverfuncs()
s.unload('', '')

Really, I can do all the actions, but I don't know how to trigger them from an 
independent script file.

Thanks!
-Dave

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


Re: Python interface problem with Windows

2010-06-26 Thread Kermit Rose

On 6/26/2010 5:27 PM, Robert Kern wrote:


I do not provide Python support in private email. Please try the python-list:

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

or its USENET gateway:

   news:comp.lang.python

On Sat, Jun 26, 2010 at 16:23, Kermit Rose  wrote:

Hello Robert.

I had a friend download Python in order that he run a python program
that I had written.

After he had Python 2.6 installed, I copied my Python program
to his c-drive.

I then opened idle, and then new window.

I then used the windows copy and paste to copy the source code into
the new window.

I then attempted to save the new code.

It responded that the Python26 folder did not have permission for me to
save the file.

It seems to be a problem with the operating system interface with the
installation of Python2.6

We checked the properties of the Python26 folder.

It had the read only property set.

We unchecked the read only property, and then clicked "apply".

Then when we checked properties of Python26 folder again,
it still had the read only property set.

Can you help us?  We would like to be able to create and run Python
programs on his computer.

Kermit Rose







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


2. Re: Python interface problem with Windows (Benjamin Kaplan)

2010-06-27 Thread Kermit Rose

On 6/26/2010 9:30 PM, python-list-requ...@python.org wrote:



Today's Topics:




2. Re: Python interface problem with Windows (Benjamin Kaplan)





> Message: 2
> Date: Sat, 26 Jun 2010 16:26:47 -0700
> From: Benjamin Kaplan 
> To: python-list@python.org
> Subject: Re: Python interface problem with Windows
> Message-ID:
>
> Content-Type: text/plain; charset=ISO-8859-1

> You don't need to save scripts in C:\Python26. In fact, doing so is a
> very bad idea. You should keep the libraries in one place (that would
> be C:\Python26 ) and all of your individual programs somewhere else
> (like your Documents folder) where you don't have to worry if two
> different projects have files of the same name. For security reasons,
> you don't have permission to write to the whole hard drive, just your
> home directory.




I do not know how to import code from any other directory than the 
default, C:\Python26.


And how do I save the code in a different directory than the default, 
c:\Python26?



Kermit Rose





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


Re: What's the difference between VAR and _VAR_?

2005-09-09 Thread S. D. Rose
I can't get the value of the variable (out of the class function) if it has
two leading underscores.

-Dave

>>> class encrypt:
 def encrypt(self, userValue):
  self.initialNumber = userValue
  self.__secretSeed = 7
  return self.initialNumber * self.__secretSeed

>>> enc = encrypt()
>>> enc.encrypt(5)
35
>>> print enc.initialNumber
5
>>> print enc.__secretSeed

Traceback (most recent call last):
  File "", line 1, in -toplevel-
print enc.__secretSeed
AttributeError: encrypt instance has no attribute '__secretSeed'



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


Python Image Library

2005-12-16 Thread S. D. Rose
I have a question about PIL.

I get a 50k photo from a MySQL table, convert it to grey-scale, do some
rotations, etc.  Then I want to put it back.  It seems that after I do the
greyscale, it converts from 'JPEG' to 'RAW'.  Can anyone tell me how I
convert the image back to 'JPEG' and then insert the photo into the MySQL
database? I've tried .tostring('jpeg') but that told me it couldn't load the
jpeg encoder.

My steps are here:

>>> import MySQLdb
>>> import array, cStringIO
>>> import Image, ImageOps

>>> con = MySQLdb(db='', host='', user='', passwd='')
>>> cur = con.cursor()
>>> cur.execute('SELECT photo FROM photos')
>>> result = cur.fetchone()
>>> photo = result[0].tostring()

>>> colorImg = Image.open(cStringIO.StringIO( photo))
>>> colorImg.show()   # Shows a color image on the Win32 screen

>>> img.format
'JPEG'

>>> bwImg =imageOps.grayscale(img)
>>> bwImg.format

>>> todb = bwImg.tostring(encoder_name='JPEG')
TRACEBACK ...
IOError: encoder JPEG not available.
>>>

Any help telling me how to take the bwImg image (not the PIL object) and
placing it back into a MySQL database would be highly appreciated!

Thanks!
Dave



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


Re: Python Image Library

2005-12-16 Thread S. D. Rose
Sorry-- meant to post to comp.python.image

"S. D. Rose" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a question about PIL.
>
> I get a 50k photo from a MySQL table, convert it to grey-scale, do some
> rotations, etc.  Then I want to put it back.  It seems that after I do the
> greyscale, it converts from 'JPEG' to 'RAW'.  Can anyone tell me how I
> convert the image back to 'JPEG' and then insert the photo into the MySQL
> database? I've tried .tostring('jpeg') but that told me it couldn't load
the
> jpeg encoder.
>
> My steps are here:
>
> >>> import MySQLdb
> >>> import array, cStringIO
> >>> import Image, ImageOps
>
> >>> con = MySQLdb(db='', host='', user='', passwd='')
> >>> cur = con.cursor()
> >>> cur.execute('SELECT photo FROM photos')
> >>> result = cur.fetchone()
> >>> photo = result[0].tostring()
>
> >>> colorImg = Image.open(cStringIO.StringIO( photo))
> >>> colorImg.show()   # Shows a color image on the Win32 screen
>
> >>> img.format
> 'JPEG'
>
> >>> bwImg =imageOps.grayscale(img)
> >>> bwImg.format
>
> >>> todb = bwImg.tostring(encoder_name='JPEG')
> TRACEBACK ...
> IOError: encoder JPEG not available.
> >>>
>
> Any help telling me how to take the bwImg image (not the PIL object) and
> placing it back into a MySQL database would be highly appreciated!
>
> Thanks!
> Dave
>
>
>
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>



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


File object question

2005-12-22 Thread S. D. Rose
Hello all.
  If I read a binary file:

file = open('c:\\logo.gif', 'rw'') # Read from FS as one way to get the
object, d/l from website another...
file.read()

is there anyway I can determine the 'size' of the object file? (Without
going to the filesystem and reading the filesize from the directory ...)

Thanks!



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


Re: Pydev questions: versions and keybindings

2005-12-22 Thread S. D. Rose
Would

(Eclipse) Help | About -> [Plug-in Details] | Plug-in Name -> PyDev - Python
Development Environment

do the trick for you?

-Dave

"Kenneth McDonald" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm trying to find out if I have the most recent version of Pydev for
> Eclipse installed, but can't find the version number in the Pydev
> user interface. Is it available anywhere in there?
>
> And, the reason that I'm trying to find the most recent update is
> because I can't redefine one keystroke that appears to be hardwired
> into Pydev (?) I'd like to bind ^/ to forward-word, but it keeps on
> applying commenting to the current line. I actually went and deleted
> the Pydev binding for comment line (which was actually ^-Shift-/, if
> I remember correctly), but to no avail. A visual check of keybindings
> in all modes reveals that nothing else is bound to ^/, so I'm trying
> to figure out what's going on.
>
> Many thanks,
> Ken
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>



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


Re: File object question

2005-12-23 Thread S. D. Rose
Yes, len() will do what I want.  I didn't realize it would work with binary,
I thought it was good only for variables, lists, etc.

Thanks!
-Dave

"Kent Johnson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> S. D. Rose wrote:
> > Hello all.
> >   If I read a binary file:
> >
> > file = open('c:\\logo.gif', 'rw'') # Read from FS as one way to get the
> > object, d/l from website another...
> > file.read()
> >
> > is there anyway I can determine the 'size' of the object file? (Without
> > going to the filesystem and reading the filesize from the directory ...)
>
> Once you have read the data you can get the size of that:
> d = file.read()
> print len(d)
>
> Is that what you mean? Otherwise I don't know how you can get the size of
a file without
> asking the filesystem...
>
> Kent
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>



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


Help extracting info from HTML source ..

2007-01-25 Thread s. d. rose
Hello All.
  I am learning Python, and have never worked with HTML.  However, I would 
like to write a simple script to audit my 100+ Netware servers via their web 
portal.

  I was reading Chapter 8 of Dive into Python, which deals with this topic. 
In the web portal of the server, there is a section similar to this:

  -->  clients and http://eugenia.blogsome.com/?s=ipkall";>clever services. <--

which I took from SlashDot, but what I'm talking about is using the word 
'services' to represent the link to eugenia.blogsome.com.

What I'd like to do is save the two pieces of info relative to the server 
name.  Probably in a dictionary, such as server1[link] to the page on 
eugenia.blogsome.com and server1[description] to 'services'.

I've used the example from Dive into Python to get the actual link in the 
source of the HTML, but I don't know how to get the text that is the 
hyperlink.

So in the portal, I've got a link 'Scheduled Server Reboot' going to say 
/ScheduledTasks/ID3/ on Server1, using similar to above clipped HTML 
source code.

Can someone please help me?  Sure, I could manually go to each server, but I 
wouldn't learn anything.  I've learned some, but also have real deadlines, 
so I eagerly hope for any assistance & instruction.

Thank you!
-Dave
Shelton, CT 



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


Dell Support Web Site Automation.

2006-04-25 Thread S. D. Rose
Hello all.  Awhile back I was playing with win32all package to get system 
information from the Dell PCs.  However, I'm using a win32 program, bginfo, 
to get the information on the PC and insert it into a MySQL database.  Of 
the fields I'm recording, I am saving the system serial number.

I was wondering if it's possible, or highly involved, to have a list of 
serial numbers and have a python script iterate thru and go on-line and 
automate the Support.Dell.Com website, inserting the serial number and 
choosing System Details, to be able to get the out-of-warranty date and 
maybe other information I can't get using bginfo or win32all.

Thanks for your help!
-Dave 



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


Spam levels.

2018-02-10 Thread C W Rose via Python-list

I've been reading a limited range of Usenet groups since the late 1980s,
and until the recent problems in comp.lang.python had never bothered with
any sort of filtering; it's easier just to ignore people.  However, the
sheer volume of spam in comp.lang.python finally defeated me, so I set up
a filter in my leafnode NNTP server, which pulls from eternal-september
and gmane (read-only).  The results for the last few weeks are below:

  Jan 20 15:34:39 comp.lang.python: 50 articles fetched, 71 killed
  Jan 21 14:21:30 comp.lang.python: 25 articles fetched, 18 killed
  Jan 26 13:04:40 comp.lang.python: 85 articles fetched, 276 killed
  Jan 28 22:58:42 comp.lang.python: 83 articles fetched, 184 killed
  Jan 29 16:07:11 comp.lang.python: 41 articles fetched, 52 killed
  Jan 30 16:57:03 comp.lang.python: 57 articles fetched, 56 killed
  Jan 31 16:52:01 comp.lang.python: 39 articles fetched, 87 killed
  Feb 1 16:02:49 comp.lang.python: 39 articles fetched, 73 killed
  Feb 2 14:39:46 comp.lang.python: 43 articles fetched, 57 killed
  Feb 3 18:17:55 comp.lang.python: 19 articles fetched, 108 killed
  Feb 4 15:28:03 comp.lang.python: 36 articles fetched, 122 killed
  Feb 5 15:26:08 comp.lang.python: 45 articles fetched, 79 killed
  Feb 6 16:29:40 comp.lang.python: 68 articles fetched, 93 killed
  Feb 7 16:43:26 comp.lang.python: 32 articles fetched, 118 killed
  Feb 8 16:01:14 comp.lang.python: 41 articles fetched, 100 killed
  Feb 9 17:06:09 comp.lang.python: 47 articles fetched, 201 killed

giving the totals:  
  Kept: 750 articles
  Killed: 1695 articles

Until the last few days the spammers were using a fixed format,
but recently I've had to play whack-a-mole with filtering, so the
Killed total is probably underestimated by ten or twenty posts.

No other groups (in the limited set which I read) have the problem,
and I don't understand why the spammers neither spam a range of
groups, nor change their adddresses more frequently.  It may be
that destroying comp.lang.python is their actual objective.

Either way, a depressing state of affairs.

Will

-- 
"As democracy is perfected, the office of the president represents, more and
 more closely, the inner soul of the people.  On some great and glorious day,
 the plain folks of the land will reach their heart's desire at last, and the
 White House will be occupied by a downright fool and a complete narcissistic
 moron." -- H. L. Mencken.

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


Respam levels.

2018-02-13 Thread C W Rose via Python-list

Having run a check for straightforward spam, I now find that there's a site
editing and reposting non-spam posts.  An example of the changed headers
follows:

Original post headers:
>
> From c...@seckford.org Sun Feb 11 23:23:22 2018
> Path: 
> eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
> Message-ID: <4sd3le-ct4@tanner.seckford.org>
> From: C W Rose 
> Newsgroups: comp.lang.python
> Subject: Spam levels.
> Date: Sat, 10 Feb 2018 14:57:40 +
> Lines: 49
> Organization: None
> Injection-Info: reader02.eternal-september.org; 
> posting-host="208e6410f66c7dd789dea67159b51bb7";
>   logging-data="6406"; mail-complaints-to="ab...@eternal-september.org";  
> posting-account="U2FsdGVkX18su+yG7dqCpnqChqoPIY0JNXRwgNWzvcs="
> User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.79-gentoo-1 
> (i686))
> Cancel-Lock: sha1:H7zOidR0ivbNjqiWUB6DSoMMYu8=
> Xref: tanner.seckford.org comp.lang.python:139461
> 

Repost headers:
>
> From C Sun Feb 11 23:22:54 2018
> Path: 
> eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!news.bbs.geek.nz!.POSTED.agency.bbs.geek.nz!not-for-mail
> Message-ID: <847574...@f38.n261.z1.binkp.net>
> From: C W Rose  (C W Rose)
> Newsgroups: comp.lang.python
> Subject: Spam levels.
> Date: Sat, 10 Feb 2018 14:57:40 +1200
> Organization: fsxNet Usenet Gateway | bbs.nz/#fsxNet
> Mime-Version: 1.0
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> Injection-Info: news.bbs.geek.nz; 
> posting-host="M6YmRdZYyc42DJk0lNlt/X4dpP4dzvceBNabSmESN3E";
>   logging-data="24378"; mail-complaints-to="ab...@news.bbs.geek.nz"
> User-Agent: VSoup v1.2.9.47Beta [95/NT]
> X-MailConverter: SoupGate-Win32 v1.05
> X-Comment-To: All
> Xref: tanner.seckford.org comp.lang.python:139479

Looking at my current comp.lang.python news spool, 182 out of 683 messages
have been reposted by news.bbs.geek.nz; I haven't checked if they are all
duplicates.  The reformatting of the body of message is to date trivial,
just a reduction in line length.

This may be the result of a misconfigured spam filter, or an actual spam
attack; anyway, I've now filtered news.bbs.geek.nz from my feed.

Will

-- 
"When we look around us, this is what we find,
 The hope that springs eternal, springs right up your behind."
  -- Ian Dury

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


Re: Filtering computer.lang.python

2018-04-11 Thread C W Rose via Python-list
Thomas Jollans  wrote:
> 
> Welcome to python-list/comp.lang.python!
> 
> This isn't originally a Google group. Google just mirrors the old USENET
> group, which is awash with spam.
> 
> There is also a mailing list version of this group (posts are mirrored
> both ways) at https://mail.python.org/mailman/listinfo/python-list
> 
> The mailing list has proper spam filtering and some moderation. None (or
> barely any) of the regulars use Google Groups. Some people use USENET
> directly and maintain their own extensive filtering regime to make it
> readable. Probably most of us use the mailing list, because it's just so
> much nicer!
> 
> -- Thomas

I fetch comp.lang.python from eternal.september with leafnode, and after
30 years of Usenet I recently had to install a news filter to remove the
garbage.  After the initial flurry the filter doesn't need much updating,
but here's why it's necessary:

Feb  1 comp.lang.python: 39 articles fetched 73 killed
Feb  2 comp.lang.python: 43 articles fetched 57 killed
Feb  3 comp.lang.python: 19 articles fetched 108 killed
Feb  4 comp.lang.python: 36 articles fetched 122 killed
Feb  5 comp.lang.python: 45 articles fetched 79 killed
Feb  6 comp.lang.python: 68 articles fetched 93 killed
Feb  7 comp.lang.python: 32 articles fetched 118 killed
Feb  8 comp.lang.python: 41 articles fetched 100 killed
Feb  9 comp.lang.python: 47 articles fetched 201 killed
Feb 10 comp.lang.python: 44 articles fetched 137 killed
Feb 11 comp.lang.python: 36 articles fetched 130 killed
Feb 12 comp.lang.python: 13 articles fetched 79 killed
Feb 13 comp.lang.python: 18 articles fetched 65 killed
Feb 14 comp.lang.python: 34 articles fetched 72 killed
Feb 15 comp.lang.python: 15 articles fetched 63 killed
Feb 16 comp.lang.python: 14 articles fetched 72 killed
Feb 17 comp.lang.python: 50 articles fetched 62 killed
Feb 18 comp.lang.python: 37 articles fetched 35 killed
Feb 19 comp.lang.python: 58 articles fetched 57 killed
Feb 20 comp.lang.python: 71 articles fetched 46 killed
Feb 21 comp.lang.python: 63 articles fetched 95 killed
Feb 22 comp.lang.python: 35 articles fetched 91 killed
Feb 23 comp.lang.python: 38 articles fetched 91 killed
Feb 25 comp.lang.python: 51 articles fetched 153 killed
Feb 26 comp.lang.python: 70 articles fetched 89 killed
Feb 27 comp.lang.python: 64 articles fetched 68 killed
Mar  1 comp.lang.python: 98 articles fetched 133 killed
Mar  2 comp.lang.python: 65 articles fetched 110 killed
Mar  3 comp.lang.python: 38 articles fetched 113 killed
Mar  4 comp.lang.python: 31 articles fetched 16 killed
Mar  5 comp.lang.python: 51 articles fetched 104 killed
Mar  6 comp.lang.python: 46 articles fetched 40 killed
Mar  7 comp.lang.python: 18 articles fetched 71 killed
Mar  8 comp.lang.python: 44 articles fetched 85 killed
Mar  9 comp.lang.python: 43 articles fetched 65 killed
Mar 10 comp.lang.python: 16 articles fetched 39 killed
Mar 11 comp.lang.python: 25 articles fetched 59 killed
Mar 13 comp.lang.python: 43 articles fetched 186 killed
Mar 14 comp.lang.python: 20 articles fetched 76 killed
Mar 15 comp.lang.python: 32 articles fetched 33 killed
Mar 16 comp.lang.python: 16 articles fetched 79 killed
Mar 17 comp.lang.python: 11 articles fetched 69 killed
Mar 18 comp.lang.python: 4  articles fetched 70 killed
Mar 19 comp.lang.python: 10 articles fetched 67 killed
Mar 20 comp.lang.python: 42 articles fetched 33 killed
Mar 21 comp.lang.python: 43 articles fetched 77 killed
Mar 22 comp.lang.python: 14 articles fetched 35 killed
Mar 23 comp.lang.python: 37 articles fetched 39 killed
Mar 26 comp.lang.python: 139 articles fetched 144 killed
Mar 27 comp.lang.python: 83 articles fetched 86 killed
Mar 28 comp.lang.python: 39 articles fetched 45 killed
Mar 29 comp.lang.python: 12 articles fetched 29 killed
Mar 31 comp.lang.python: 67 articles fetched 125 killed

for totals of 2168 fetched and 4384 killed; that is, the group
is now 2/3 spam and the volume doesn't seem to be decreasing.
I don't understand why other groups gatewayed to Google Groups
aren't spammed, but from a limited sample they don't seem to be.

Will

-- 
"That which is hateful to you, do not do to your fellow.  That is the
 whole Torah; the rest is commentary."
  -- Hillel the Elder

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


Re: Spam levels.

2018-05-22 Thread C W Rose via Python-list
m  wrote:
> W dniu 10.02.2018 o 15:57, C W Rose pisze:
>> No other groups (in the limited set which I read) have the problem,
>> and I don't understand why the spammers neither spam a range of
>> groups, nor change their adddresses more frequently.  It may be
>> that destroying comp.lang.python is their actual objective.
>> 
>> Either way, a depressing state of affairs.
> 
> The sad thing is, that your post is unseen, because of spam :S
> 
> I also almost stopped reading c.l.python, because of enormous spam
> levels. Do I have any option to read it without spam, other than launch
> my own filtering NNTP server and do whack the mole game for myself?
> 
> Maybe join forces and establish such server for public use?
> 

The situation is getting worse:

comp.lang.python messages 29 Jan - 14 May 2018
Fetched: 3081
Killed: 6616
Valid: 31.77 %

Almost all of the garbage is coming from the "Case Solutions" poster,
with a hotmail address.  He's said himself that he doesn't read the
group, and there's really no point to endless reposting in a newsgroup
with no relevance to the posts, so it's just mindless vandalism.
He doesn't change addresses or headers much, so the filter seldom needs
updating; however, I think comp.lang.python is reaching the end of the line.

comp.lang.c has less overwhelming problems, due to a single obsessive:
comp.lang.c messages 29 Jan - 14 May 2018
Fetched: 3969
Killed: 618
Valid: 86.52 %

If you are using Linux, leafnode is easy to set up, and has enough filtering
to keep comp.lang.python readable.  I pull from news.eternal-september.org
and news.gmane.org (though I don't know how much longer gmane will last).
Both are free.

Will

-- 
"It is very disappointing that mindless individuals are vandalising
 the Larkin toads in Hull."
A police spokesman

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


Re: Python indentation (3 spaces)

2018-10-07 Thread C W Rose via Python-list
Ryan Johnson  wrote:
> The point that OP is trying to make is that a fixed standard that is
> distinguishable from the even-spacing Tab-length convention in code and
> text editors will establish a level of trust between the end developer and
> upstream developers or co-developers who may not have the same development
> environment. For example, the first Python library I ever tried to use was
> poorly maintained and had spaces on one line with tabs on the next, and the
> author mixed naming conventions and syntax from Python 2 and 3 in his code.
> That type of experience doesn’t exactly instill trust in the coding
> language’s standards, when a noob tries to use a library they found and
> ends up having to debug weird errors with weirder error messages on the
> first project they do.

The view of the Python Gods (TM) is that significant whitespace make
Python much easier to use, particularly for the inexperienced.  If
you disagree, then use another language.

(Leibnitz had some snappy phrases on the subject of Theodicy, which
explain the matter clearly.)

Will

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