On 2016-08-27 15:23, c...@zip.com.au wrote:
On 27Aug2016 09:06, Alex Kleider wrote:
On 2016-08-26 21:58, Ben Finney wrote:
Alex Kleider writes:
Am I to assume that if I have activated a virtualenv, then the
following shebang
#!/usr/bin/env python
will use the python specified in the venv/bin
On 27Aug2016 09:06, Alex Kleider wrote:
On 2016-08-26 21:58, Ben Finney wrote:
Alex Kleider writes:
Am I to assume that if I have activated a virtualenv, then the
following shebang
#!/usr/bin/env python
will use the python specified in the venv/bin/?
Yes, the purpose of that shebang is to t
On 2016-08-26 21:58, Ben Finney wrote:
Alex Kleider writes:
Am I to assume that if I have activated a virtualenv, then the
following shebang
#!/usr/bin/env python
will use the python specified in the venv/bin/?
Yes, the purpose of that shebang is to tell the OS that *whichever*
‘python’ comm
Alex Kleider writes:
> Am I to assume that if I have activated a virtualenv, then the
> following shebang
> #!/usr/bin/env python
> will use the python specified in the venv/bin/?
Yes, the purpose of that shebang is to tell the OS that *whichever*
‘python’ command is found first, is the one to u
On 2016-08-25 21:27, Ben Finney wrote:
That's exactly the wrong thing to do. Your shebang line should *not*
assume a custom location of the Python interpreter.
It's the responsibility of the operating system or virtualenv to
provide
the Python interpreter command in a standard place.
Instead
Alex Kleider writes:
> I'm still struggling with what is the best way to set up a project
> directory.
One thing to learn is that there's no one right way that is universally
applicable.
In particular, you are asking about *social* conventions here. These are
prone to change and negotiation and
I'm still struggling with what is the best way to set up a project
directory.
All the sources I've read seem to agree that one should have a top
level project directory under which one might expect to find the
following:
COPYING.txt # or LICENSE.txt
README.rst
setup.py
and if the pr
> Traceback (most recent call last):
> File "E:\tests\project_name\start.py", line 1, in
> from src import moda
> File "E:\tests\project_name\src\moda.py", line 1, in
> import modb
> ImportError: No module named 'modb'
Hi Wiktor,
In Python 3, imports are not relative by default.
Hi,
let's assume I have this project tree:
project_name/
|-src/
| |- __init__.py
| |- moda.py
| '- modb.py
'- start.py
And individual files contain:
- modb.py: -
def hello(txt):
return "Hello " + txt + "!"
def plus1(num):
return num + 1
- moda.
On 03/13/2014 03:29 AM, Scott W Dunning wrote:
Hey Everyone,
I just got through doing a Guess-the-number script and was looking for
something else to practice on. Do any of you have any suggestions on some
things I could work on? Keep in mind I am not only extremely new to python I
am new t
On 03/13/2014 07:17 AM, Ben Finney wrote:
Scott W Dunning writes:
I just got through doing a Guess-the-number script and was looking for
something else to practice on. Do any of you have any suggestions on
some things I could work on? Keep in mind I am not only extremely new
to python I am new
On 03/13/2014 03:29 AM, Scott W Dunning wrote:
Hey Everyone,
I just got through doing a Guess-the-number script and was looking for
something else to practice on. Do any of you have any suggestions on some
things I could work on? Keep in mind I am not only extremely new to python I
am new t
On 03/12/2014 10:29 PM, Scott W Dunning wrote:
Hey Everyone,
I just got through doing a Guess-the-number script and was looking for
something else to practice on. Do any of you have any suggestions on some
things I could work on? Keep in mind I am not only extremely new to python I
am new
On 13 March 2014 02:29, Scott W Dunning wrote:
> Hey Everyone,
>
> I just got through doing a Guess-the-number script and was looking for
> something else to practice on. Do any of you have any suggestions on some
> things I could work on? Keep in mind I am not only extremely new to python
> I
Scott W Dunning writes:
> I just got through doing a Guess-the-number script and was looking for
> something else to practice on. Do any of you have any suggestions on
> some things I could work on? Keep in mind I am not only extremely new
> to python I am new to programming. Thanks for any sugge
Hey Everyone,
I just got through doing a Guess-the-number script and was looking for
something else to practice on. Do any of you have any suggestions on some
things I could work on? Keep in mind I am not only extremely new to python I
am new to programming. Thanks for any suggestions!!!
Sc
On Wed, Jan 29, 2014 at 10:45:53PM +0530, Reuben wrote:
> Hi,
>
> Do we need to follow any particular directory structure for creating any
> New projects or could we just randomly create a folder containing the
> script of interest?
Yes and no.
If all you're doing is writing a single file script
Hi,
Do we need to follow any particular directory structure for creating any
New projects or could we just randomly create a folder containing the
script of interest?
Regards,
Reuben
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subsc
On 03/11/13 03:10, phua hock choon wrote:
/Hi Bob ,/
//
/I was looking at the a/m project from penn Uni with interest while
learning ArcGis python scripting./
//
/Would like to enquire whether you still have the solution (Script) for
the " Parsing rhinoceros sightings "/
If you read Bob's post(
Hi Bob ,
I was looking at the a/m project from penn Uni with interest while learning
ArcGis python scripting.
Would like to enquire whether you still have the solution (Script) for the "
Parsing rhinoceros sightings "
Awaiting for your favourable reply.
tks
vincent__
Dave Angel davea.name> writes:
>
> > str_num = '1234567890'
> > n = 5
> >
> > strings = [str_num[i:i+5] for i in range(0, len(str_num)) if
> > len(str_num[i:i+5])==5]
>
> If you changed the range() size, you could eliminate the extra if test.
> After all, the only ones that'll be short are t
On 31/05/13 21:49, Nick Shemonsky wrote:
I did stumble upon using reduce ...but I didn't really
understand what it was doing
def product(intlist):
return reduce(operator.mul, intlist)
I explain reduce thusly in my Functional Programming topic:
-
The reduce function
On 05/31/2013 04:49 PM, Nick Shemonsky wrote:
Here's the final code... I kept the if statement that way if I throw
in a random series of numbers that isn't evenly divisible by 5, it'll
always work itself out. And this answered the 1000 digit problem
without issue.
str_num = '1234567890'
n =
Thanks for the responses. I am using python 2.7. I'm not new to
programming but might as well be... I last programmed heavily about a
decade ago in college. I was a MIS major so I did my fair share of
c++, sql, and php work but now I'm a windows sys admin so I haven't
used it much at all in a long
On 31/05/13 19:23, Nick Shemonsky wrote:
or maybe it'd be quicker to compare a to b through each iteration and
just keep the larger product rather than creating a giant list
You are probably right if it is a giant list.
str_num = '1234567890'
n = 5
strings = [str_num[i:i+5] for i in range(0
On 05/31/2013 02:23 PM, Nick Shemonsky wrote:
Hey there everybody. I'm new to python
Welcome. But are you new to programming, or just to Python in
particular? And which Python? I'd guess 2.7
and am attempting to teach
myself to code while brushing up on my math skills via the problems at
Hey there everybody. I'm new to python and am attempting to teach
myself to code while brushing up on my math skills via the problems at
projecteuler.net. My solutions thus far have been mostly brute force
and this is no exception but I'm having an issue with tackling some
iteration in the problem.
On 13/10/12 05:55, Brett Dailey wrote:
I'm working on a few projects and need some help.
We don;t do homework but we can offer suggestions. But first we need
more detail.
What is your programming language/version/OS?
What GUI framework are you using?
What is your skill level? Can you use othe
On 13/10/2012 06:54, Devin Jeanpierre wrote:
Do your own homework.
-- Devin
Manners if you don't mind. We don't want to drive newbies away from
Python by being harsh towards them. So it's do your own homework, please :)
--
Cheers.
Mark Lawrence.
On 13/10/12 16:54, Devin Jeanpierre wrote:
Do your own homework.
Oooh, nasty. Next you'll be using ... sarcasm. Perhaps even ... irony.
http://www.youtube.com/watch?v=Ygg2KlicnOQ
http://www.youtube.com/watch?v=evj24bXakqg
--
Steven
___
Tutor mailli
On 13/10/12 15:55, Brett Dailey wrote:
I'm working on a few projects and need some help.
[...]
Hi Brett, and welcome!
We like to see that people make an effort to solve their problems. This is a
list for learning about Python the language, not a list for doing people's
homework for them.
Plea
Do your own homework.
-- Devin
On Sat, Oct 13, 2012 at 12:55 AM, Brett Dailey
wrote:
> I'm working on a few projects and need some help. Here's what the first one
> needs to do:
>
> "Credits"
> 1. Create a list of strings. Make sure your program will work with any
> number of strings.
> 2. Make
I'm working on a few projects and need some help. Here's what the first one
needs to do:
"Credits"
1. Create a list of strings. Make sure your program will work with any number
of strings.
2. Make this text appear at the bottom of the screen and “crawl” to the top.
The crawl should be at a slow
On 19/10/11 05:06, Narguess Dadfar wrote:
I have to project all shapefiles to NAD_1983_UTM_Zone_10N
Means nothing to me...
I use Python 2.6
what codes I have used is as follow:
Well done.
Does it work?
If not what doesn't work? Do you get error messages?
What do they say? Is the data dif
I have to project all shapefiles to NAD_1983_UTM_Zone_10N
I use Python 2.6
what codes I have used is as follow:
import arcpy
inFolder = arcpy.GetParameterAsText(0)
outC = arcpy.GetParameterAsText(1)
arcpy.env.workspace = inFolder
fcList = arcpy.ListFeatureClasses()
try:
desc = arcpy.Describe(ou
On Thu, Jan 27, 2011 at 8:03 PM, Ben Ganzfried wrote:
> Hey guys,
>
> Would it be feasible for a beginner to write a script that could connect
> with:
> https://chrome.google.com/extensions/detail/laankejkbhbdhmipfmgcngdelahlfoji
> ? More specifically, I am interested in writing a script such tha
Hey guys,
Would it be feasible for a beginner to write a script that could connect
with:
https://chrome.google.com/extensions/detail/laankejkbhbdhmipfmgcngdelahlfoji
? More specifically, I am interested in writing a script such that the user
would have to enter a short password (say 6 random lett
Steven D'Aprano wrote:
On Mon, 30 Aug 2010 05:31:00 am bob gailer wrote:
My current reasoning was something of this sort: Find all the
factors of a number, then reduce them to just the prime factors
Very inefficient. IMHO the proper way is to generate a list of all
the prime numbers
"Nick" wrote
I didn't call the functions in the program because I was
calling them myself in the interpreter after running it.
I assume you mean after importing it?
Running a program is generally taken to mean executing the script as
a standalone program. To execute the internal functions
On Mon, 30 Aug 2010 05:31:00 am bob gailer wrote:
> > My current reasoning was something of this sort: Find all the
> > factors of a number, then reduce them to just the prime factors
>
> Very inefficient. IMHO the proper way is to generate a list of all
> the prime numbers up to the square root
"Did you test the program? That is one way to tell whether it works perfectly.
What you showed above will do one visible thing - it will print "Don't forget
to consider primes 2, 3, 5, and 7\n". The rest is a somewhat confusing
collection of function definitions and comments. You never call the
On 8/29/2010 3:08 AM, Nick wrote:
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
#don't forget 2,3,5,7. this function doesn't deliver those as output.
def is_prime(b): #checks a number greater than 7 to see if it is
prime and
"Nick" wrote
What is the largest prime factor of the number 600851475143 ?
For help on the math aspects try Wikipedia.
Look up Prime factors...
Would it be useful for me to buy a book, and if so what are some
easily accessible ones? I feel dive into python is just too
advanced for me.
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
#don't forget 2,3,5,7. this function doesn't deliver those as output.
def is_prime(b): #checks a number greater than 7 to see if it is prime and
returns if is.
if b % 2 != 0 and b
prasad rao schreef:
> hello!
> I got it 266333.
> My code==
>
> t=0
> for x in range(1000):
> if divmod(x,3)[1]==0:t+=x
> if divmod(x,5)[1]==0:t+=x
> t=266333
>
> Am I correct in comprehention of the problem?
Not entirely: you're counting numbers that are multiples of both 3 and 5
double
hello! I got it 266333.
My code==
t=0
for x in range(1000):
if divmod(x,3)[1]==0:t+=x
if divmod(x,5)[1]==0:t+=x
t=266333
Am I correct in comprehention of the problem?
Prasad
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/
It says: Find the difference between the sum of the squares of the first *
one
hundred* natural numbers and the square of the sum.
You did range(1,111).
On Thu, Apr 24, 2008 at 1:13 PM, kinuthia muchane <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I am trying to solve problem 6 on the Project Euler, bu
On Thu, Apr 24, 2008 at 11:13:31PM +0300, kinuthia muchane wrote:
> return sum([k*k for k in range(1,111)])# sum of the squares of the
> first one hundred numbers
Wouldn't the first hundred numbers be range(1,101)?
> def aux1():
> inter = sum([k for k in range(1,111))# square of the s
Hi,
I am trying to solve problem 6 on the Project Euler, but when I submit
my answer, I am told that it is wrong. Here is the problem:
The sum of the squares of the first ten natural numbers is,
1² + 2² + ... + 10² = 385
The square of the sum of the first ten natural num
Carlos schrieb:
> And if by chance you are familiar with genetic algorithms, well that
> would be perfect, because you can take a look at how I took a genetic
> algorithm python module and applied to my project.
I'm afraid that I don't have the domain specific knowledge to be of much help
here and
Jonathon Sisson schrieb:
> Christopher Arndt wrote:
>> P.S. This is basically just rephrasing what has been already said by others
>> and
>> better: http://www.catb.org/~esr/faqs/smart-questions.html
>
> Seriously, that is an excellent guide. Eric S. Raymond writes some high
> quality stuff. A
Christopher Arndt wrote:
> P.S. This is basically just rephrasing what has been already said by others
> and
> better: http://www.catb.org/~esr/faqs/smart-questions.html
Seriously, that is an excellent guide. Eric S. Raymond writes some high
quality stuff. Anyone new to posting on this list (
Carlos schrieb:
> I don't know if this is a good thing to ask in this mailing list, or if
> it is possible for someone to take a look and spot my errors, but I
> really can't think of a better way.
It might be a better idea to ask for solutions or hints for a specific problem
or comments on a sp
Kent,
Yes it is a little longer than that, let me see how can I make it more
compact and will get back to the list with a URL.
Thanks!!!
Carlos
Kent Johnson wrote:
> Carlos wrote:
>> Hello,
>>
>> I have been working in a script for my master thesis project (M Arch)
>> and since this is the fir
Carlos wrote:
> Hello,
>
> I have been working in a script for my master thesis project (M Arch)
> and since this is the first project that I do in this way, I would like
> to know if someone here would be interested in taking a look at what I
> have done so far. My impression is that since I h
Hello,
I have been working in a script for my master thesis project (M Arch)
and since this is the first project that I do in this way, I would like
to know if someone here would be interested in taking a look at what I
have done so far. My impression is that since I have been learning on my
o
56 matches
Mail list logo