Noufal Ibrahim noufal at airtelbroadband.in writes:
Greetings everyone,
I'm using the python standard logging package for a personal project
of mine and have initialised it like so.
logger = logging.getLogger(pydagogue)
handler = logging.StreamHandler()
Hello.
Iam beginning to use python on
windows.
how canI add a path to Python search-list
whereI can store my python scripts ?
On IDLE the command browse path
lets me to see the existing path but not to edit it.
thanks
Eli___
Tutor maillist -
Hello.
I wish that my Python program will not be stored on
a single file.
how canI call one python script from another
?
Thanks
Eli___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I use Python 2.4 IDLE to open a py code which import numeric.
I have installed both scipy and numpy into my c:\python24. However, it
was still reported as:
from Numeric import *
ImportError: No module named Numeric
I got confused...
___
Tutor
Hi Eli,
You really dont have to edit the search path, because if all the files lie in the same-directory as the top-level file, then Python automatically includes that directory in its search path.
HTH,
Regards,
Asrarahmed
On 11/6/06, Eli Brosh [EMAIL PROTECTED] wrote:
Hello.
Iam beginning to
Eli Brosh wrote:
Hello.
I wish that my Python program will not be stored on a single file.
how can I call one python script from another ?
Put part of the script in a module that you import from another module.
Read more here:
http://docs.python.org/tut/node8.html
Kent
Hi Folks,
I have written a function that takes a date and an integer representing the number of days.
Please test it, comment onthe logic.
Here is the code:
CODE BEGINS
The function takes two arguments, date and number of days. It checks for the right format and if the format is okay, it
Hello to all,
This is my first script, I mean the first that I'm trying to do on my
own. Its a very simple Cellular Automata thing, the idea is that the
initial list A_List is rewritten based on some rules, in this case
Wolfram's rule 30. You can modify the list length and its initial state,
On Mon, 6 Nov 2006, linda.s wrote:
I use Python 2.4 IDLE to open a py code which import numeric.
I have installed both scipy and numpy into my c:\python24. However, it
was still reported as:
Hi Linda,
We need more details. What version of scipy and numpy did you install?
Where did you
On Mon, 6 Nov 2006, Asrarahmed Kadri wrote:
I have written a function that takes a date and an integer representing
the number of days.
Please test it, comment on the logic .
Hi Asrarahmed,
You should be able to write your own tests too. You might want to look
at:
Alan Gauld wrote:
Michael Sparks [EMAIL PROTECTED] wrote
That's equivalent to the regular expression:
* ^[0-9A-Za-z_.-]*$
While using a dictionary is probably overkill, so is a regex.
A simple string holding all characters and an 'in' test would probably
be both easier to read and
On Mon, 6 Nov 2006, Carlos wrote:
This is my first script, I mean the first that I'm trying to do on my
own. Its a very simple Cellular Automata thing, the idea is that the
initial list A_List is rewritten based on some rules, in this case
Wolfram's rule 30. You can modify the list
Eli Brosh [EMAIL PROTECTED] wrote
I wish that my Python program will not be stored on a single file.
how can I call one python script from another ?
As Kent says normally you don't call one script from another,
instead you write a set of functions (or classes) that you put in
one or more
Eli Brosh schrieb:
Hello.
I am beginning to use python on windows.
how can I add a path to Python search-list where I can store my
python
scripts ?
As has been said there are two aspects.
If you want your scripts to execute as programs you need to
modify the PATH environment variable
Asrarahmed Kadri [EMAIL PROTECTED] wrote
Please test it, comment on the logic .
I haven't tested it but here are some comments:
import string
import datetime
import traceback
def dateCheck(date1,num_days):
flag = True
startdate = None
enddate = None
if num_days 0 or
I've been using python is 1.5* but haven't used `is` that much.
1)where do `is` and `==` yield the same results?
2)where do they not yield the same results?
3)is there a special method for `is'.
4)Pointers to docs are welcome.
thanks
tim
--
Tim Johnson [EMAIL PROTECTED]
Carlos [EMAIL PROTECTED] wrote
Here is the code:
Note: Right now maya is not needed to run the code.
import time
#This is the initial state. You can put as many integers as you wish
A_List = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]
A_Len = len(A_List)
print 'A_List: ',A_List
print
Tim Johnson wrote:
I've been using python is 1.5* but haven't used `is` that much.
1)where do `is` and `==` yield the same results?
2)where do they not yield the same results?
is tests for object identity - 'a is b' is true if a is the same object
as b. There is no special method, no
[Forwarding to Tutor; busy at the moment]
-- Forwarded message --
Date: Mon, 6 Nov 2006 18:41:54 +
From: Asrarahmed Kadri [EMAIL PROTECTED]
To: Danny Yoo [EMAIL PROTECTED]
Subject: Re: [Tutor] Please help to debug this function.. it takes a date and
num. of days and
Michael Sparks [EMAIL PROTECTED] wrote
A regex compiles to a jump table, and executes as a statemachine.
Sometimes, but it depends on the implementation.
If someone uses a C++ compiler that uses the standard library
implememation of regex (like say the Microsoft Visual C++
version up till V6
Greetings, all:
-Original Message-
Date: Mon, 6 Nov 2006 10:32:32 +
From: Michael Sparks [EMAIL PROTECTED]
Subject: Re: [Tutor] Amazing power of Regular Expressions...
To: tutor@python.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=iso-8859-1
On Monday
Wow... I had to click this e-mail just because I saw the first posts on the mentioned thread and could see it turning for the worst.. I'm serious, if you think ^[0-9A-Za-z_.-]*$ is unclear and complex, go away
and relearn regales. Michael.If this is your method to helping people, you should be
On 07/11/06, Kent Johnson [EMAIL PROTECTED] wrote:
If anyone really cares which Python implementation is faster, the timeit
module is your friend. Assertions like would probably be faster or
it's also quicker don't hold much weight. In Python, if you want to
know what is faster, you must test.
Hi again,
Thanks for your comments they are really appreciated.
Alan, yes you are right, there is no need to use S, A_Len works the same
way. Beginner mistake
The dictionary way seems to be way better than my idea, will give it a try.
And Danny, your CA is very nice.
Do you know a better way
Wow... I had to click this e-mail just because I saw the first posts on the
mentioned thread and could see it turning for the worst..
Hi everyone,
So let's try to squash this one now. There are more interesting problems
to solve. Or other flame wars to fight.
Let me see if we can do
Do you know a better way to do this?
if i A_Len-1:
a = A_List[i-1]
b = A_List[i]
c = A_List[i+1]
else:
a = A_List[i-1]
b = A_List[i]
c = A_List[0]
Hi Carlos,
Here's one
Carlos [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Do you know a better way to do this?
if i A_Len-1:
a = A_List[i-1]
b = A_List[i]
c = A_List[i+1]
else:
a = A_List[i-1]
b =
Danny Yoo [EMAIL PROTECTED] wrote
Here's one way to handle it. If you're familiar with modulo clock
arithmetic, you might want to apply it above.
Indeed, I should have thought of that.
Good catch Danny.
Alan G.
___
Tutor maillist -
Danny Yoo [EMAIL PROTECTED] wrote
So let's try to squash this one now. There are more interesting
problems
to solve. Or other flame wars to fight.
I wasn't aware we were having a war, but I'm happy to desist :-)
Let me see if we can do something constructive. I've been doing a
shallow,
Chris Hengge wrote:
I may have just missed the point to your attempt to derail this
conversation =P
Ah, well, don't worry. I didn't learn of lambda until I'd been using
Python for a year or more.
I was trying to pass arguments to callbacks in TKinter.
one of the Pythonistas (Alan, Danny,
Danny Yoo wrote:
Do you know a better way to do this?
[snip stuff]
Hi Carlos,
Here's one way to handle it. If you're familiar with modulo clock
arithmetic, you might want to apply it above.
Also, consider this example, Carlos:
aList = [1,2,3,4,5,6]
a,b,c = aList[1:4]
a
2
* Alan Gauld [EMAIL PROTECTED] [061106 14:01]:
The other advantage in Ruby is that the block can be arbitrarily
complex, not just a single expression as in a Python lambda. This
allows us to embed loops and all sorts, effectively adding new
command structures to the language in a way that
On Mon, 6 Nov 2006, Chris Hengge wrote:
I may have just missed the point to your attempt to derail this
conversation =P
Hi Chris,
Ah! Are we talking about regular expressions anymore?
No?
Good. *grin*
Why do all that when you can just
str = Hello World
print str * 2
Let me do a
[Danny]
If you're using NumPy, then the correct package name for it is 'numpy',
not 'Numeric'.
from numpy import *
[Linda]
I think the code is suing Numeric (is it called numpy now? if so, how
to make the change?)
So it's not your code? If it's not your own code then, nail down what
Dear Guys,
I have downloaded CGkit and Aqsis and tried the examples from it.
I run the samples, like the torus with grass. It is simple fantastic.
I would like to make some artistic visualization with the power of python
and the beauty of a professional renderer.
I think about colored
What does
Pythonw -i test.py -i
do in Mac machine?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Monday 06 November 2006 22:52, Alan Gauld wrote:
I wasn't aware we were having a war, but I'm happy to desist :-)
FWIW, I wasn't aware of one either. (Mind you I've often noticed what passes
for plain speaking in the UK passes for vehement flame war elsewhere, so
maybe that's it)
Anyway,
* Kent Johnson [EMAIL PROTECTED] [061106 10:31]:
In [9]: a=[1,2]
In [10]: b=[1,2]
Hmmm! Hmmm!
Lookee here:
## console session
a=[1,2]
b=[1,2]
a is b
False
c='1' ## one byte
d='1' ## one byte
c is d
True
c='1,2'
d='1,2'
c is d
False
The Hmmm! is emmitted because I'm
For small string object python has optimization method so it is really the same object!Cheers,pujoOn 11/7/06, Tim Johnson
[EMAIL PROTECTED] wrote:* Kent Johnson
[EMAIL PROTECTED] [061106 10:31]: In [9]: a=[1,2] In [10]: b=[1,2]Hmmm! Hmmm!Lookee here:## console session a=[1,2] b=[1,2] a is b
Just out of curiousity (since I really can't say myself), does the code
below import re each time it loops? I ran the same commands and saw
quite similar results (0.176 usec per loop for the first test and 0.993
usec per loop for the second test), and I was just curious if that
import (and
On 07/11/06, Jonathon Sisson [EMAIL PROTECTED] wrote:
Just out of curiousity (since I really can't say myself), does the code
below import re each time it loops? I ran the same commands and saw
quite similar results (0.176 usec per loop for the first test and 0.993
usec per loop for the
c='1' ## one byte
d='1' ## one byte
c is d
True
c='1,2'
d='1,2'
c is d
False
The Hmmm! is emmitted because I'm thinking that if everything is an
object in python, then why does `c is d` evaluate to True when
the assigned value is 1 byte and evaluate to False when the assigned
value
On 11/6/06, Tim Johnson [EMAIL PROTECTED] wrote:
* Kent Johnson [EMAIL PROTECTED] [061106 10:31]: In [9]: a=[1,2] In [10]: b=[1,2]Hmmm! Hmmm!Lookee here:## console session
a=[1,2] b=[1,2] a is bFalse c='1'## one byte d='1'## one byte c is dTrue c='1,2' d='1,2'
c is dFalseThe Hmmm! is emmitted
others already gave good responses, so mine are short.
1)where do `is` and `==` yield the same results?
is is object identity comparison while
== is object value comparison
2)where do they not yield the same results?
they give different results when you have two different objects
regardless
How do i set the PYTHONPATH variable
?
From answers to my query on "editing path" I
realized that this is what should be done if i want to include another folder in
the Python search path.
I tried:
import sys
sys.path.append('additional path')
but it worked only at runtime and is forgotten
45 matches
Mail list logo