Make sure you are in the same directory as your hello.py, then run the
interpreter/shell
Try this:
>>>import hello
then you can do things like:
>>>dir(hello)
and
>>>help(hello)
I'm not sure if that's what you were asking, but "import" is how you ..
import. HTH.
On Fri, Sep 4, 2009 at 5:31 P
On Sep 4, 2009, at 8:31 PM, kb1...@aim.com wrote:
I know, I'm a total noob (started yester day)
But when I enter this code:
x = 1
if x>0:
a = raw_input ("Type something in...I will echo it:")
print a
x=x+1
it does not loop..am I missing something here?
In your example the if statem
kb1...@aim.com wrote:
I know, I'm a total noob (started yester day)
But when I enter this code:
x = 1
if x>0:
a = raw_input ("Type something in...I will echo it:")
print a
x=x+1
it does not loop..am I missing something here?
You are missing a looping statement. In Python they are fo
I know, I'm a total noob (started yester day)
But when I enter this code:
x = 1
if x>0:
??? a = raw_input ("Type something in...I will echo it:")
??? print a
??? x=x+1
it does not loop..am I missing something here?
___
Tutor maillist - Tutor@python.org
On Fri, 2009-09-04 at 06:18 -0700, dan06 wrote:
> I'd like to learn a programming language - and I need help deciding between
> python and ruby. I'm interesting in learning what are the difference, both
> objective and subjective, between the two languages. I know this is a python
> mailing list, s
Hi,
I've never learned ruby, but from what I read, ruby is a pure OOP
language, and if you are going to do a lot of web creation, then ruby on
rails is a good one.
What I can advice is, if you choose to stick with python, perhaps you
shouldn't use python 3.x, but use python 2.5 (from what I
hello,
Wish you would not mind a really beginner question. I am trying to use
'run' command, but didnot success yet. How I did it:
(1) In a certain working folder, I produced simple python file, for an
example, hello.py, which is free of error.
(2) I called python from the same working folder usi
dan06 wrote:
I'd like to learn a programming language - and I need help deciding between
python and ruby. I'm interesting in learning what are the difference, both
objective and subjective, between the two languages. I know this is a python
mailing list, so knowledge/experience with ruby may be l
On Fri, 2009-09-04 at 06:18 -0700, dan06 wrote:
> I'd like to learn a programming language - and I need help deciding between
> python and ruby. I'm interesting in learning what are the difference, both
> objective and subjective, between the two languages. I know this is a python
> mailing list,
On Fri, Sep 4, 2009 at 1:34 PM, GoodPotatoes wrote:
> I simply want to remark out all non-word characters read from a line.
>
> Line:
> Q*bert says "#...@!$% "
>
> in Perl
> #match each non-word character, add "\" before it, globally.
>
> $_=s/(\W)/\\$1/g;
>
> output:
> Q\*bert\ says\ \"\...@\!\$\
On Fri, Sep 04, 2009 at 09:54:20AM -0700, Emile van Sebille wrote:
>On 9/4/2009 9:09 AM William Witteman said...
>>On Thu, Sep 03, 2009 at 11:26:35AM -0700, Emile van Sebille wrote:
>>
>>Thanks to Emile for pointing out the error. There were several other
>>errors - initiating the counter in the l
"dan06" wrote
I'd like to learn a programming language - and I need help deciding
between
python and ruby. I'm interesting in learning what are the difference,
There is lots of info on their web sites. asking a question like this is
troll baiting in a big way, any debate about languages wil
I simply want to remark out all non-word characters read from a line.
Line:
Q*bert says "#...@!$% "
in Perl
#match each non-word character, add "\" before it, globally.
$_=s/(\W)/\\$1/g;
output:
Q\*bert\ says\ \"\...@\!\$\%\ \ \" #perfect!
Is there something simple like this in python?
I
I think you will get at the least a slight bias toward Python. However,
I think you should do your own research and reach your own conclusions.
Simply to get you started I put the following into Google: 'Python or
Ruby: Which to learn' and got more than 1M hits.
Best of luck.
Robert
On Fri, 200
On 9/4/2009 9:09 AM William Witteman said...
On Thu, Sep 03, 2009 at 11:26:35AM -0700, Emile van Sebille wrote:
Thanks to Emile for pointing out the error. There were several other
errors - initiating the counter in the loop (d'oh!), premature sorting
of the dictionary by keys, not providing an
On Fri, 2009-09-04 at 06:18 -0700, dan06 wrote:
> I'd like to learn a programming language - and I need help deciding between
> python and ruby. I'm interesting in learning what are the difference, both
> objective and subjective, between the two languages. I know this is a python
> mailing list, s
On Thu, Sep 03, 2009 at 11:26:35AM -0700, Emile van Sebille wrote:
Thanks to Emile for pointing out the error. There were several other
errors - initiating the counter in the loop (d'oh!), premature sorting
of the dictionary by keys, not providing an index row for the output
file, not returning a
A primary draw of Ruby has always been Ruby on Rails, a web framework.
Python has a lot of really good web frameworks now, though, so this is less
of a concern.When I tried to learn Ruby, the docs were terrible. The
primary developers are Japanese, and the translations were very poor and
incompl
2009/9/3 Albert-Jan Roskam :
> Hi,
>
> I'm wondering what is the most common method of input validation. See the
> example below.
> -Is the code below the most common/recognizable way something like this is
> done?
> -Which of the options #1 and #2 is the preferred method? Option #2 looks less
>
I'd like to learn a programming language - and I need help deciding between
python and ruby. I'm interesting in learning what are the difference, both
objective and subjective, between the two languages. I know this is a python
mailing list, so knowledge/experience with ruby may be limited - in wh
On Thu, Sep 3, 2009 at 3:17 PM, David Perlman wrote:
> So, in summary, I would be interested in either of two things:
> 1. advice on how to do arithmetic on the string of bytes without converting
> it to a list of ints first, or
> 2. advice on how to convert it to a list of ints, and then back to
On Thu, Sep 3, 2009 at 6:01 PM, Jojo Mwebaze wrote:
> thanks guys,
> Currently i am using pyfits, a bit slow cause loads the file in memory,
> creates a subimage and then saves the file then transmits
> the file over the network! My idea is, if there is a way of creating a file
> pointer to the l
Hi allen (and perhaps this goes also for others),
just a suggestion, maybe when we post a problem, we should also mention
the python version that we use.
Sometimes, different version of python would give different results.
I tried it with Python 3.1 (python 3.x uses unicode for string) and
P
Thank you very much. :)
it works now.
2009/9/4 Christian Witts
> If it's not you can put an encoding line @ the top of your script like
> # -*- encoding: utf-8 -*-
>
> David Stanek wrote:
>
>> Is the encoding of your file set?
>>
>>
>> On 9/4/09, zhang allen wrote:
>>
>>
>>> Hi Christian,
>>>
If it's not you can put an encoding line @ the top of your script like
# -*- encoding: utf-8 -*-
David Stanek wrote:
Is the encoding of your file set?
On 9/4/09, zhang allen wrote:
Hi Christian,
Thanks for your tip.
But it seems to me still not working again.
i wirte this python code
k
Is the encoding of your file set?
On 9/4/09, zhang allen wrote:
> Hi Christian,
>
> Thanks for your tip.
>
> But it seems to me still not working again.
>
> i wirte this python code
>
> k = []
> s = u'Büro'
> for c in s:
> k.append(c)
> print k
>
> k=[u'B', u'\xa8', u'\xb9', u'r', u'o']
>
>
Hi Christian,
Thanks for your tip.
But it seems to me still not working again.
i wirte this python code
k = []
s = u'Büro'
for c in s:
k.append(c)
print k
k=[u'B', u'\xa8', u'\xb9', u'r', u'o']
i still have 5 different chars.
2009/9/4 Christian Witts
> zhang allen wrote:
>
>> Hi A
Hi Andre,
i tried this.
s = u'Büro'
print len(s)
prints 5.
it seems not working : )
2009/9/4 Andre Engels
> On Fri, Sep 4, 2009 at 2:20 PM, zhang allen wrote:
> > Hi All,
> >
> > Say i have unicode string Büro.
> > i want to iterate this string .
> >
> > i write this python code which doesn
zhang allen wrote:
Hi All,
Say i have unicode string * Büro*.
i want to iterate this string .
i write this python code which doesn't work.
s ='Büro'
for ch in s:
print ch
it seems *Büro* has 5 chars. *ü *consists of 2 bytes.
so does someone has any ideas?
how to iterate this string, so i ca
On Fri, Sep 4, 2009 at 2:20 PM, zhang allen wrote:
> Hi All,
>
> Say i have unicode string Büro.
> i want to iterate this string .
>
> i write this python code which doesn't work.
>
> s ='Büro'
> for ch in s:
> print ch
>
> it seems Büro has 5 chars. ü consists of 2 bytes.
>
> so does someone
Hi All,
Say i have unicode string * Büro*.
i want to iterate this string .
i write this python code which doesn't work.
s ='Büro'
for ch in s:
print ch
it seems *Büro* has 5 chars. *ü *consists of 2 bytes.
so does someone has any ideas?
how to iterate this string, so i can hava 4 chars, l
31 matches
Mail list logo