On 22/02/12 05:44, Elaina Ann Hyde wrote:
file is enormous, has over 50,000 rows and about 20 columns.
On modern computers its not that enormous - probably around 10M?
But there are techniques for this which we can cover another time is you
do hit files bigger than fit in memory.
I didn't g
On 22/02/12 04:00, ken brockman wrote:
Being a neophyte to Python, I was under the impression that you had to
install tkinter independently.of python.
No, its part of the standard library. On some *nix installs tk
support is not compiled in but tkinter should be there. But on Windows
its alwa
Hi Elaina,
On 22 February 2012 05:44, Elaina Ann Hyde wrote:
> #select the value if it is very, very, very close
> if i != j and Radeg[i] <= (Radeg2[j]+0.01) and Radeg[i]
Alan's pretty much said what I was thinking, but I have an additional
question/concern: Why do you inclu
On Wed, Feb 22, 2012 at 04:44:57PM +1100, Elaina Ann Hyde wrote:
> So, Python question of the day: I have 2 files that I could normally just
> read in with asciitable, The first file is a 12 column 8000 row table that
> I have read in via asciitable and manipulated. The second file is
> enormous,
Elaina Ann Hyde wrote:
> So, Python question of the day: I have 2 files that I could normally just
> read in with asciitable, The first file is a 12 column 8000 row table that
> I have read in via asciitable and manipulated. The second file is
> enormous, has over 50,000 rows and about 20 column
Hi,
I have a function that calculates the distance between two points on a
sphere. It works but I cant get it to return a float for use in another
script. Anyone know how I do that??
The function is below,
Thanks,
D
import math
def distance_on_unit_sphere(lat1, long1, lat2, long2):
# Con
On 22 February 2012 12:57, David Craig wrote:
> Hi,
> I have a function that calculates the distance between two points on a
> sphere. It works but I cant get it to return a float for use in another
> script. Anyone know how I do that??
>
> cos = (math.sin(phi1)*math.sin(phi2)*math.cos(theta
Hi,
I have created a list of containing strings that represent distances
between many different points and would like to display the results in a
table.
I have been trying to write them to a text file but it is difficult to
organise them into rows and columns with appropriate spacing to make it
> Hi,
> I have created a list of containing strings that represent distances between
> many different points and would like to display the results in a table.
> I have been trying to write them to a text file but it is difficult to
> organise them into rows and columns with appropriate spacing to
On 22/02/2012 13:40, Evert Rol wrote:
Hi,
This is always a tricky thing to go about. Nicely human-readable doesn't imply
nicely machine readable. Sometimes a single space or a single tab between
values/columns is more practical for a(nother) program to read, but not for
humans.
So I will work
David Craig wrote:
I have been trying to write them to a text file but it is difficult to
organise them into rows and columns with appropriate spacing to make it
readable. I would like something like,
Stations Station1 Station2
Station1 0.033.57654
Station2 33
David Craig wrote:
> distance = [[]]*len(stations)
That doesn't do what you think it does:
>>> a = [[]] * 3
>>> a
[[], [], []]
>>> a[0].append(42)
>>> a
[[42], [42], [42]]
See? You get a list that contains the same list len(stations) times. Use
[[] for _ in stations]
instead.
__
David Craig wrote:
Hi,
I have a function that calculates the distance between two points on a
sphere. It works but I cant get it to return a float for use in another
script. Anyone know how I do that??
You are going to have to explain what you mean in more detail.
If you mean, how can you pa
Thanks everyone, was able to get what I wanted from '/t' but I'm sure
the other formatting options will be useful in future.
@Peter
a = [[]] * 3
>>> a
[[], [], []]
>>> a[0].append(42)
>>> a
[[42], [42], [42]]
you had me worried for a minute, but
a = [[]] * 3
a[0]=[1,2,3]
a
[[1, 2, 3], [
On Wed, Feb 22, 2012 at 10:24 AM, David Craig wrote:
> you had me worried for a minute, but
> a = [[]] * 3
> a[0]=[1,2,3]
> a
> [[1, 2, 3], [], []]
>
That's not the same thing. In your example you create three copies of the
same empty list inside your outer list. You then throw away the first
On 2/21/2012 6:51 PM, William Stewart wrote:
hello
I need to rewrite area.py program so that it has separate functions for the
perimeter and area of a square, a rectangle, and a circle (3.14 * radius**2).
"Need to"" - why? Is this a homework assignment?
I am horrible at ma
On 22/02/12 13:14, David Craig wrote:
Hi,
I have created a list of containing strings that represent distances
between many different points and would like to display the results in a
table.
Others have mentioned using format strings.
If it is only for display you could switch to html.
Then de
Hello All,
My name is Leo. I'm just beginning to learn python. I am
learning on my own and have no previous programming experience. I decided
to create a version of john conway's game of life as a personal project.
I've been wondering what GUI to use.
I've been using Tkinter so far bu
On 2/22/2012 1:50 PM, leo degon wrote:
Hello All,
My name is Leo.
Hi Leo & Welcome to Python help.
We are a few volunteers who like assisting others.
A few guidelines:
- always reply-all so a copy goes to the list
- reply in-line rather than at the top.
- if your code is large put
On 2/21/2012 10:00 PM, Michael Lewis wrote:
Hi everyone,
I have some code where I import a file to use a module. That module
that I import
takes text and a multiplier, checks for any numbers in that text and
will then multiply those numbers by the given multiplier. The imported
module is belo
Hi. I need help.
I have installed Python 3.2.2 and have been using IDLE (the "Python shell") to
type and save a Python program, such as 'Hello World'.
However, the command prompt (the black box) will not allow me to type a Python
program or to "run" a Python program. So I tried to run a Pyth
On Wed, Feb 22, 2012 at 5:23 PM, Tamar Osher wrote:
> Hi. I need help.
>
> I have installed Python 3.2.2 and have been using IDLE (the "Python shell")
> to type and save a Python program, such as 'Hello World'.
>
> However, the command prompt (the black box) will not allow me to type a
> Python p
Dear Joel: HI! Thanks for helping. When I use the Python shell, and navigate
to the saved Python program, what happens is:
A second Python shell pops up, displaying the coding of the program (which is a
tiny 'hello world' program). This is what is displayed in the second Python
shell:
>>> pr
On 02/21/2012 10:00 PM, Michael Lewis wrote:
Hi everyone,
I have some code where I import a file to use a module. That module that I
import takes text and a multiplier, checks for any numbers in that text and
will then multiply those numbers by the given multiplier. The imported
module is below.
On Wed, Feb 22, 2012 at 4:35 PM, bob gailer wrote:
> On 2/21/2012 10:00 PM, Michael Lewis wrote:
>
> Hi everyone,
>
> I have some code where I import a file to use a module. That module that I
> import
>
> takes text and a multiplier, checks for any numbers in that text and will
> then multiply th
On Wed, Feb 22, 2012 at 5:49 PM, Tamar Osher wrote:
> Dear Joel: HI! Thanks for helping. When I use the Python shell, and
> navigate to the saved Python program, what happens is:
> A second Python shell pops up, displaying the coding of the program (which
> is a tiny 'hello world' program). Thi
Dear Joel: Hi! Thanks for helping. I typed cmd, and got the same black box,
this time labeled C:\windows\system32\cmd.exe instead of "Command Prompt".
When I type python myprogram.py, this is what appears on the screen:'python' is
not recognized as an internal or external command, operable p
On Wed, Feb 22, 2012 at 6:11 PM, Tamar Osher wrote:
> Dear Joel: Hi! Thanks for helping. I typed cmd, and got the same black
> box, this time labeled C:\windows\system32\cmd.exe instead of "Command
> Prompt". When I type python myprogram.py, this is what appears on the
> screen:
> 'python' is n
Thanks! I hope to find a Windows7 expert to help me.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
so I copied your format except I changed shape 3 to circle, Did I do the circle
part right?
and would this be considered seperate functions?
Thanks for your help
import math
from math import pi
menu = """
Pick a shape(1-3):
1) Square
2) Rectangle
3) Triangle
4) Quit
"""
shape = int
On 22/02/12 18:50, leo degon wrote:
Hello All,
My name is Leo. I'm just beginning to learn python. I am
learning on my own and have no previous programming experience. I
decided to create a version of john conway's game of life as a personal
project.
OK, Thats quite a good project
On 22/02/2012 23:29, Tamar Osher wrote:
Thanks! I hope to find a Windows7 expert to help me.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Try reading this http:
On 22/02/12 23:29, Tamar Osher wrote:
Thanks! I hope to find a Windows7 expert to help me.
You don't need a Windows 7 expert, just to set things
up properly.
First open up Notepad++ again and enter everything between
the then save to a file called myHello.py and exit Notepad++.
#
On 22/02/12 23:45, William Stewart wrote:
so I copied your format except I changed shape 3 to circle, Did I do the
circle part right?
Nearly.
The circumference is wrong, you need to calculate it not read it from
the user.
and would this be considered separate functions?
No, but your seco
I am learning python and need guidance for writing some code. I've written
a simple program (with pointers from people) that parses an tv show xml
feed and prints their values in plain text after performing some string
operations.
[CODE]feed = urllib.urlopen(rssPage) #rssPage: address of xml feed
Hi. I am still having trouble installing and using Python on my (new) Windows
7 computer, but I plan to contact Microsoft forums and see if they can help me,
since this is a Windows problem and not a Python problem.
My question: For the future, what type of computer is best for Python
develop
* Tamar Osher [2012-02-22 19:00]:
>
> Hi. I am still having trouble installing and using Python on my (new)
> Windows 7 computer, but I plan to contact Microsoft forums and see if
> they can help me, since this is a Windows problem and not a Python
> problem.
>
> My question: For the future, wh
On 23/02/2012 01:00, Tamar Osher wrote:
Hi. I am still having trouble installing and using Python on my (new) Windows
7 computer, but I plan to contact Microsoft forums and see if they can help me,
since this is a Windows problem and not a Python problem.
My question: For the future, what ty
Dear Alan: Hi. Thanks for helping me. I did it exactly the way you described,
and everything worked perfectly. Thanks for being a kind friend!
>From Your Friend: Tamar Osher
Email: emeraldoff...@hotmail.com
__
> Hi everyone,
>
> I have some code where I import a file to use a module. That module
> that I import
> takes text and a multiplier, checks for any numbers in that text and
> will then multiply those numbers by the given multiplier. The imported
> module is below. I am getting the text from a fil
On Wed, Feb 22, 2012 at 2:52 PM, Dave Angel wrote:
> On 02/21/2012 10:00 PM, Michael Lewis wrote:
>
>> Hi everyone,
>>
>> I have some code where I import a file to use a module. That module that I
>> import takes text and a multiplier, checks for any numbers in that text
>> and
>> will then multi
On Wed, Feb 22, 2012 at 8:50 PM, Peter Otten <__pete...@web.de> wrote:
> Elaina Ann Hyde wrote:
>
> > So, Python question of the day: I have 2 files that I could normally
> just
> > read in with asciitable, The first file is a 12 column 8000 row table
> that
> > I have read in via asciitable and
On 02/22/2012 08:54 PM, Michael Lewis wrote:
On Wed, Feb 22, 2012 at 2:52 PM, Dave Angel wrote:
I actually have a function written in my imported file to check if
a string is a valid float, but I didn't use it because I also have
raw_input in that same function, which I don't want. I'll rework
On 23/02/2012 01:55, Elaina Ann Hyde wrote:
[big snips]
Hi Elaina,
I'm sorry but I can't help with your problem with the memory cos I don't
know enough about the combination of Python and Unix wrt memory
management. However can I suggest that you use more whitespace in your
code to make it
First, thanks to everyone who helped me out regarding my Recognizing real
numbers post. I gained a lot of knowledge over the past two days!
I've noticed that after I execute some of my .py files, a Compiled Python
File is automatically saved to my directory. This doesn't happen for every
file that
On Wed, Feb 22, 2012 at 07:29:42PM -0800, Michael Lewis wrote:
> First, thanks to everyone who helped me out regarding my Recognizing real
> numbers post. I gained a lot of knowledge over the past two days!
>
> I've noticed that after I execute some of my .py files, a Compiled Python
> File is aut
On Wed, Feb 22, 2012 at 07:00:57PM -0600, Tamar Osher wrote:
>
> Hi. I am still having trouble installing and using Python on my (new)
> Windows 7 computer, but I plan to contact Microsoft forums and see if they
> can help me, since this is a Windows problem and not a Python problem.
>
> My qu
Hi everyone,
I have a program where I open a file (recipe.txt), I read that file and
write it to another file. I am doing some multiplying of numbers in
between; however, my question is, when I name the file I am writing to, the
file extension is changed, but the file name is not. What am I doing
On 2012/02/23 07:04 AM, Michael Lewis wrote:
Hi everyone,
I have a program where I open a file (recipe.txt), I read that file
and write it to another file. I am doing some multiplying of numbers
in between; however, my question is, when I name the file I am writing
to, the file extension is c
On 2012-02-23 01:59, Saad Javed wrote:
I am learning python and need guidance for writing some code. I've written
a simple program (with pointers from people) that parses an tv show xml
feed and prints their values in plain text after performing some string
operations.
[CODE]feed = urllib.urlope
50 matches
Mail list logo