Sorry, LAST Question from Python - Array

Hi !

Sorry
Sorry
Sorry

I cannot find documentation/example about the usage of Array, or wxArray in Python.
I am very lamer, newbie, and other in Python, and I want to Load an Text File to an array, and process it's data.

But how can I use an LIST/ARRAY/etc in Python/wx ?

I want to do this:

1. define an 1 dimensional string array
2. load the text file to it (enough the example of access the items in array A, or the add/and get the count of items)
3. define an 2 dimensional string array
4. (enough the example of access the items in array B)

If you have an example of usage the arrays/lists, send me to my private mail address.

Please help me !

10000000000000000000000 Thanx:
KK

...

I don't think wxArray is available in wxPython - there's no class for it
as far as I can tell.

···

#--------------------------------
Jeff Sasmor
jeff@sasmor.com
----- Original Message -----
From: "Kepes Krisztian" <Kepes.Krisztian@peto.hu>
To: <wxPython-users@lists.wxwindows.org>
Sent: Thursday, February 27, 2003 4:30 AM
Subject: [wxPython-users] Sorry, LAST Question from Python - Array

Hi !

Sorry
Sorry
Sorry

I cannot find documentation/example about the usage of Array, or wxArray in Python.
I am very lamer, newbie, and other in Python, and I want to Load an Text File to an array, and process it's data.

But how can I use an LIST/ARRAY/etc in Python/wx ?

I want to do this:

1. define an 1 dimensional string array
2. load the text file to it (enough the example of access the items in array A, or the add/and get the count of items)
3. define an 2 dimensional string array
4. (enough the example of access the items in array B)

If you have an example of usage the arrays/lists, send me to my private mail address.

Please help me !

10000000000000000000000 Thanx:
KK

...

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Why not use the python 'list' type. It appears to have all of the
functionality you are looking for. You can make a list of lists to get a
multidimensional array, though it is a bit crude.

Kevin Walden

···

-----Original Message-----
From: Jeff Sasmor [mailto:jsasmor@gte.net]
Sent: Thursday, February 27, 2003 6:16 AM
To: wxpython-users@lists.wxwindows.org; Kepes.Krisztian@peto.hu
Subject: Re: [wxPython-users] Sorry, LAST Question from Python - Array

I don't think wxArray is available in wxPython - there's no class for it
as far as I can tell.
#--------------------------------
Jeff Sasmor
jeff@sasmor.com
----- Original Message -----
From: "Kepes Krisztian" <Kepes.Krisztian@peto.hu>
To: <wxPython-users@lists.wxwindows.org>
Sent: Thursday, February 27, 2003 4:30 AM
Subject: [wxPython-users] Sorry, LAST Question from Python - Array

Hi !

Sorry
Sorry
Sorry

I cannot find documentation/example about the usage of Array, or wxArray
in Python.
I am very lamer, newbie, and other in Python, and I want to Load an Text
File to an array, and process it's data.

But how can I use an LIST/ARRAY/etc in Python/wx ?

I want to do this:

1. define an 1 dimensional string array
2. load the text file to it (enough the example of access the items in
array A, or the add/and get the count of items)
3. define an 2 dimensional string array
4. (enough the example of access the items in array B)

If you have an example of usage the arrays/lists, send me to my private
mail address.

Please help me !

10000000000000000000000 Thanx:
KK

...

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Hi!

You don't need wxPython for this, just use a plain Python list:

def loadFile(filename):
    file_as_list = open(filename, 'rb').readlines()

This reads the lines of the file into the list file_as_list and you're done. (BTW, 'rb' means that the file is read in binary mode, just 'r' does conversion of the Unix/Windows newline, more infos in the tutorials)

Look up any Python tutorial, lists are a central piece of the language and are extensively covered. Take a look at the tutorial that comes with the Python distribution for more information/details. Another good tutorial can be found at www.diveintopython.org.

Good luck

       martin

Kepes Krisztian wrote:

···

Hi !

Sorry

I cannot find documentation/example about the usage of Array, or wxArray in Python.
I am very lamer, newbie, and other in Python, and I want to Load an Text File to an array, and process it's data.

But how can I use an LIST/ARRAY/etc in Python/wx ?

I want to do this:

1. define an 1 dimensional string array
2. load the text file to it (enough the example of access the items in array A, or the add/and get the count of items)
3. define an 2 dimensional string array
4. (enough the example of access the items in array B)

If you have an example of usage the arrays/lists, send me to my private mail address.

Please help me !

10000000000000000000000 Thanx:
KK

...

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Hey, just for fun don't forget the new file() built-in introduced in Python 2.2!

    file_as_list = open(filename, 'rb').readlines()

can be written as

    file_as_list = file(filename, 'rb').readlines()

BTW, 'open' is now considered to be an alias for 'file'.

···

#--------------------------------
Jeff Sasmor
jeff@sasmor.com
----- Original Message -----
From: "Martin Krueger" <martin.krueger@chello.at>
To: <wxPython-users@lists.wxwindows.org>
Sent: Thursday, February 27, 2003 3:57 PM
Subject: Re: [wxPython-users] Sorry, LAST Question from Python - Array

Hi!

You don't need wxPython for this, just use a plain Python list:

def loadFile(filename):
    file_as_list = open(filename, 'rb').readlines()

This reads the lines of the file into the list file_as_list and you're
done. (BTW, 'rb' means that the file is read in binary mode, just 'r'
does conversion of the Unix/Windows newline, more infos in the tutorials)

Look up any Python tutorial, lists are a central piece of the language
and are extensively covered. Take a look at the tutorial that comes with
the Python distribution for more information/details. Another good
tutorial can be found at www.diveintopython.org.

Good luck

       martin

Kepes Krisztian wrote:

Hi !

Sorry
Sorry
Sorry

I cannot find documentation/example about the usage of Array, or wxArray in Python.
I am very lamer, newbie, and other in Python, and I want to Load an Text File to an array, and process it's data.

But how can I use an LIST/ARRAY/etc in Python/wx ?

I want to do this:

1. define an 1 dimensional string array
2. load the text file to it (enough the example of access the items in array A, or the add/and get the count of items)
3. define an 2 dimensional string array
4. (enough the example of access the items in array B)

If you have an example of usage the arrays/lists, send me to my private mail address.

Please help me !

10000000000000000000000 Thanx:
KK

...

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Thanks for the info!
I guess I should really start to read the "what's new in version ..." pages one of these days :wink:

    martin

Jeff Sasmor wrote:

···

Hey, just for fun don't forget the new file() built-in introduced in Python 2.2!

   file_as_list = open(filename, 'rb').readlines()

can be written as

   file_as_list = file(filename, 'rb').readlines()

BTW, 'open' is now considered to be an alias for 'file'.

#--------------------------------
Jeff Sasmor
jeff@sasmor.com
----- Original Message ----- From: "Martin Krueger" <martin.krueger@chello.at>
To: <wxPython-users@lists.wxwindows.org>
Sent: Thursday, February 27, 2003 3:57 PM
Subject: Re: [wxPython-users] Sorry, LAST Question from Python - Array

Hi!

You don't need wxPython for this, just use a plain Python list:

def loadFile(filename):
   file_as_list = open(filename, 'rb').readlines()

This reads the lines of the file into the list file_as_list and you're done. (BTW, 'rb' means that the file is read in binary mode, just 'r' does conversion of the Unix/Windows newline, more infos in the tutorials)

Look up any Python tutorial, lists are a central piece of the language and are extensively covered. Take a look at the tutorial that comes with the Python distribution for more information/details. Another good tutorial can be found at www.diveintopython.org.

Good luck

      martin

Kepes Krisztian wrote:

Hi !

Sorry

I cannot find documentation/example about the usage of Array, or wxArray in Python.
I am very lamer, newbie, and other in Python, and I want to Load an Text File to an array, and process it's data.

But how can I use an LIST/ARRAY/etc in Python/wx ?

I want to do this:

1. define an 1 dimensional string array
2. load the text file to it (enough the example of access the items in array A, or the add/and get the count of items)
3. define an 2 dimensional string array
4. (enough the example of access the items in array B)

If you have an example of usage the arrays/lists, send me to my private mail address.

Please help me !

10000000000000000000000 Thanx:
KK

...

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org