Could you further define 'modeling' in context?
Are you referring to using python in the context of 3D modeling, i.e.
computer aided design? If that be the case, python serves as an
embedded language for many 3D computer graphics programs. Everything
from Maya to Houdini use it as a command interf
On Sat, Mar 27, 2010 at 11:08 PM, yd wrote:
>
> Having a problem finding the first 1000 prime numbers, here is my code:-
>
> print(2)
> n =3
> counter =1
> while counter <=1000:
> for x in range(3,int((n**0.5)),2):
> if n%x != 0:
> print(n)
> n+=1
> counter+=1
> else:
>
On Sat, Mar 27, 2010 at 5:08 PM, yd wrote:
>
> Having a problem finding the first 1000 prime numbers, here is my code:-
>
> print(2)
> n =3
> counter =1
> while counter <=1000:
> for x in range(3,int((n**0.5)),2):
> if n%x != 0:
> print(n)
> n+=1
> counter+=1
> else:
>
Modulok wrote:
Could you further define 'modeling' in context?
Are you referring to using python in the context of 3D modeling, i.e.
computer aided design? If that be the case, python serves as an
embedded language for many 3D computer graphics programs. Everything
from Maya to Houdini use it as
Hello,
I have a main module importing other modules and defining a top-level variable,
call it 'w' [1]. I naively thought that the code from an imported module, when
called from main, would know about w, but I have name errors. The initial trial
looks as follows (this is just a sketch, the orig
On Sun, 28 Mar 2010 08:31:57 pm spir ☣ wrote:
> Hello,
>
> I have a main module importing other modules and defining a top-level
> variable, call it 'w' [1]. I naively thought that the code from an
> imported module, when called from main, would know about w,
Why would it?
If you write a module
>
>
> > What 'problem' are you trying to solve?
> In general, anytime you can use a premade solution, you are at an
> advantage,
> not cheating.
> That's one of the marks of a truly good programmer - being able to reuse as
> much code as possible.
> Unless it's a homework problem and he said "don't
spir # wrote:
Hello,
I have a main module importing other modules and defining a top-level variable,
call it 'w' [1]. I naively thought that the code from an imported module, when
called from main, would know about w, but I have name errors. The initial trial
looks as follows (this is just a
>From the virtual desk of Lowell Tackett
--- On Sat, 3/27/10, Dave Angel wrote:
> From: Dave Angel
> Subject: Re: [Tutor] python magazine
> To: "Lowell Tackett"
> Cc: "Benno Lang" , tutor@python.org
> Date: Saturday, March 27, 2010, 6:12 AM
>
>
> Lowell Tackett wrote:
> > >From the virt
On Sun, 28 Mar 2010 10:26:43 +0100
AG wrote:
> Modulok wrote:
> > Could you further define 'modeling' in context?
[...]
> The modelling I was referring to is not about 3-D design, but about
> scenario modelling. For example, to understand the impacts of climate
> change on particular bodies o
On 03/28/2010 09:57 PM, yd wrote:
> It's not homework i just want to be able to convert my algorithm into
> good code, and the only way to do that is by actually writing it. I'm
> just writing it to learn how it's done.
In most cases, when:
1) the code is effective (i.e. it always gives correct an
Lowell Tackett wrote:
>From the virtual desk of Lowell Tackett
--- On Sat, 3/27/10, Dave Angel wrote:
From: Dave Angel
Subject: Re: [Tutor] python magazine
To: "Lowell Tackett"
Cc: "Benno Lang" , tutor@python.org
Date: Saturday, March 27, 2010, 6:12 AM
Lowell Tackett wrote:
>F
On Sun, 28 Mar 2010 21:50:46 +1100
Steven D'Aprano wrote:
> On Sun, 28 Mar 2010 08:31:57 pm spir ☣ wrote:
> > Hello,
> >
> > I have a main module importing other modules and defining a top-level
> > variable, call it 'w' [1]. I naively thought that the code from an
> > imported module, when call
On Saturday March 27 2010 16:21:26 AG wrote:
> I apologise in advance for the vagueness of this query, but I am looking
> for a decent modern introduction to modelling using Python.
> Specifically, I want something that is a good introduction (i.e. doesn't
> expect one to already be a maths/ statis
okay. I got the subprocess bit to work and i have os walk doing its walk. But
now for something i did not think about until i started to think about how to
fit these two bits to work together.
os walk is going to traverse my dirs from some given starting point and process
files that it finds th
On 3/27/2010 5:45 AM Karjer Jdfjdf said...
I have made an extensive script that runs fine when started from the command
line or IDLE.
When I try to run it with cron it keeps giving errors:
Often when I have trouble running scripts from cron it's because
something in the environment is differ
On 3/28/2010 8:44 AM kevin parks said...
okay. I got the subprocess bit to work and i have os walk doing its walk. But
now for something i did not think about until i started to think about how to
fit these two bits to work together.
os walk is going to traverse my dirs from some given startin
On 3/28/2010 8:44 AM kevin parks said...
okay. I got the subprocess bit to work and i have os walk doing its walk. But
now for something i did not think about until i started to think about how to
fit these two bits to work together.
os walk is going to traverse my dirs from some given startin
On 3/26/2010 7:03 PM James Reynolds said...
Hello All,
I'm trying to write my first extension module, and I am getting the
following error in my command prompt and I was hoping you all could help me.
Hi James,
You'll probably get further asking on the setuptools support list.
Checking http:/
Since English is not my native language, so I got confused by some
requirement of my assignment. I already done, just want to make sure what I
did is what the assignment required, thank you!
BTW, I don't know how to do this:
If I want to fix some wrong words in a text file, how can I print out the
You know what, I just don't understand this line:
the name of the file containing the translated output is storyAmer.txt
and it is to located.
I don't know what kind of translated output he need. I guess:
1. the name of the file containing the translated output is *
storyAmer.txt* and it i
Eike Welk wrote:
On Saturday March 27 2010 16:21:26 AG wrote:
I apologise in advance for the vagueness of this query, but I am looking
for a decent modern introduction to modelling using Python.
Specifically, I want something that is a good introduction (i.e. doesn't
expect one to already be
On 3/28/2010 10:28 AM Shurui Liu (Aaron Liu) said...
> You know what, I just don't understand this line:
> the name of the file containing the translated output is storyAmer.txt
> and it is to located.
It sounds to me like we wants you to read in the source(british)
version, swap in the american s
I came out with a transigent answer: save the right text file*(storyAmer.txt
*) at the right place /cset1100py/assign19/
storyAmer.txt. Then I just add a command after the command which picked out
wrong words.
I wanna add
text_file = open("storyAmer.txt", "r")
But I don't know how to add its path
On 3/28/2010 5:31 AM, spir ☣ wrote:
Hello,
I have a main module importing other modules and defining a top-level variable,
call it 'w' [1]. I naively thought that the code from an imported module, when
called from main, would know about w, but I have name errors. The initial trial
looks as fo
On Sunday March 28 2010 19:37:41 AG wrote:
> Now that's looking very much along the lines of what I had in mind
> Eike. Very pricey ... might have to sit on that one for a while and
> scout around for a used copy. I can certainly use the on-line resource
> for as many pages as it allows one to ac
Eike Welk wrote:
On Sunday March 28 2010 19:37:41 AG wrote:
Now that's looking very much along the lines of what I had in mind
Eike. Very pricey ... might have to sit on that one for a while and
scout around for a used copy. I can certainly use the on-line resource
for as many pages as it a
Here's the thing, I wanna change some wrong words from a text file like this:
"I am a studaet." -> "I am a student."
I have tried to use this command:
str = "I am a studaet."
newstr = str[0:8] + "ent"
print newstr
But the system said TypeError: 'type' object is unsubscriptable
What's wrong
On 3/28/2010 2:23 PM Shurui Liu (Aaron Liu) said...
Here's the thing, I wanna change some wrong words from a text file like this:
"I am a studaet." -> "I am a student."
I have tried to use this command:
str = "I am a studaet."
newstr = str[0:8] + "ent"
print newstr
But the system said Ty
>>> s = "I am a studaet."
>>> new_s = s[0:8] + 'ent'
>>> print new_s
I am a sent
You are using str as a variable, str is used to convert anything into string
>>> a = 0
>>> b = str(a)
>>> type(b)
On Mon, Mar 29, 2010 at 2:53 AM, Shurui Liu (Aaron Liu)
wrote:
> Here's the thing, I wanna change
Also bookmark this page, it will be very useful once you have a little
knowledge about Numpy:
http://www.scipy.org/Numpy_Example_List_With_Doc
This is the page that I use most often.
Eike.
___
Tutor maillist - Tutor@python.org
To unsubscribe or cha
Tell me how to do what i want, please.
2010/3/28 Shashwat Anand :
s = "I am a studaet."
new_s = s[0:8] + 'ent'
print new_s
> I am a sent
>
> You are using str as a variable, str is used to convert anything into string
>
a = 0
b = str(a)
type(b)
>
>
>
> On Mon, Mar 2
I'd like to learn to pythonically redirect the output from a
line-oriented character device to a particular file or process,
regardless of focus, on a generic graphical OS. But I don't want to
redirect stdin entirely. Here's the usecase:
My school has a seminar for which we record attendance by s
On 28 March 2010 23:37, Shurui Liu (Aaron Liu) wrote:
> Tell me how to do what i want, please.
>
Both me and someone else have already told you how to replace a substring in
a string with something else in your earlier question/posting/thread. If
you've not understood what was written there, th
# Translate wrong British words
#Create an empty file
print "\nReading characters from the file."
raw_input("Press enter then we can move on:")
text_file = open("storyBrit.txt", "r+")
whole_thing = text_file.read()
print whole_thing
raw_input("Press enter then we can move on:")
print "\nWe are gon
spir # wrote:
On Sun, 28 Mar 2010 21:50:46 +1100
Steven D'Aprano wrote:
On Sun, 28 Mar 2010 08:31:57 pm spir ☣ wrote:
I'm going to assume you really want a single global value, and that you
won't regret that assumption later.
We talked at length about how to access that global from
Shurui Liu (Aaron Liu) wrote:
# Translate wrong British words
#Create an empty file
print "\nReading characters from the file."
raw_input("Press enter then we can move on:")
text_file = open("storyBrit.txt", "r+")
whole_thing = text_file.read()
print whole_thing
raw_input("Press enter then we ca
37 matches
Mail list logo