Hello,
Are there any tools for documenting a module other than Sphinx?
Apparently, I need a full-blown dev box with Visual Studio installed
to get Sphinx up, due to the dependency on Jinja, which comes
source-only and requires VC.
I wrote a module, I'd like to produce a decent document of its
Hi Michael,
I can recommend epydoc. You can find it here:
http://epydoc.sourceforge.net/ It's a nice tool and you should have no problems
with the installation.
Ralf
Michael Powe hat am 13. September 2010 um 11:54
geschrieben:
> Hello,
>
> Are there any tools for documenting a module
On 11/09/2010 20.43, bob gailer wrote:
On 9/11/2010 12:12 PM, Roelof Wobben wrote:
...
You can't.
I made that comment in the context of the OPs function:
def readposint():
x = raw_input("Please enter a positive integer :")
try:
if (int(x)<0 or (float(x) - int(x)> 0)): raise(ValueError)
except
On Mon, 13 Sep 2010 12:29:07 pm Huy Ton That wrote:
> Hm, thanks guys; I just had to verify I was thinking sanely about it.
> I am going to pick up classmethods next. Do any of you have common
> design patterns for the usage. They are just items I haven't
> integrated in my coding, and I want to be
On Mon, 13 Sep 2010 08:55:46 pm Francesco Loffredo wrote:
> I don't like this rough behaviour of int(), spitting out an
> exception if given a legitimate string representation of a float. Can
> some of you Tutors explain me why it must be so?
The int() function behaves as a constructor, producing
Hello,
I have this string called test with the contents of 'het is een wonder \\TIS'
Now I want to get rid of the \\ so I do this : test2 = test.replace ('\\', '')
And I get at the python prompt this answer : 'het is een wonder TIS'
So that's right.
Now I try the same in a IDE with this progr
First, *THANK YOU!* for your clear and thorough explaination, Steven.
On 13/09/2010 13.59, Steven D'Aprano wrote:
On Mon, 13 Sep 2010 08:55:46 pm Francesco Loffredo wrote:
I don't like this rough behaviour of int(), spitting out an
exception if given a legitimate string representation of a floa
Hello,
In your script, you need to escape each backslash, in order to have it
come out correctly to the interpreter. IOW, in the shell, '\\' is
what is being processed. But in your script, you want to send '\\' to
the shell, and in order to do that, you have to escape each backslash,
or ''.
On Mon, Sep 13, 2010 at 12:03:27PM +0200, r...@schoenian-online.de wrote:
>
> Hi Michael,
> ??
> I can recommend epydoc. You can find it here:
> ??http://epydoc.sourceforge.net/??It's a nice tool and you should have no
> problems
> with the installation.
> ??
> Ralf
> ??
> ??
> ??
Thank you, muc
Thank you all,
I was taking a look at the module decimal.py as you cited, and it makes
sense now. Looks very useful to make tools without having to instantiate
anything.
On Mon, Sep 13, 2010 at 7:05 AM, Steven D'Aprano wrote:
> On Mon, 13 Sep 2010 12:29:07 pm Huy Ton That wrote:
> > Hm, thanks g
On 9/13/2010 8:19 AM, Roelof Wobben wrote:
Hello,
I have this string called test with the contents of 'het is een wonder \\TIS'
Now I want to get rid of the \\ so I do this : test2 = test.replace ('\\', '')
And I get at the python prompt this answer : 'het is een wonder TIS'
So that's right.
> From: rwob...@hotmail.com
> To: bgai...@gmail.com
> Subject: RE: [Tutor] wierd replace problem
> Date: Mon, 13 Sep 2010 15:19:12 +
>
>
>
>
>
>> Date: Mon, 13 Sep 2010 11:07:19 -0400
>> From: bgai...@gmail.com
Forwarding to the list.
Date: Mon, 13 Sep 2010 11:07:19 -0400
From: bgai...@gmail.com
To: tutor@python.org
Subject: Re: [Tutor] wierd replace problem
On 9/13/2010 8:19 AM, Roelof Wobben wrote:
Hello,
I h
Hi @all!
I'm about to write a class for serial communication on Win32 and Linux which
provides a method called "talk" to send something over the serial line,
wait for
the answer and returns it. My problem is, that I don't know how long the
answer
will be (ok max 260 bytes but most answers are much
On Mon, Sep 13, 2010 at 12:19:23PM +, Roelof Wobben wrote:
>
> Hello,
>
> I have this string called test with the contents of 'het is een wonder \\TIS'
>
> Now I want to get rid of the \\ so I do this : test2 = test.replace ('\\', '')
> And I get at the python prompt this answer : 'het is e
On Mon, Sep 13, 2010 at 12:03:27PM +0200, r...@schoenian-online.de wrote:
>
> Hi Michael,
> I can recommend epydoc. You can find it here:
> ??http://epydoc.sourceforge.net/??It's a nice tool and you should
> have no problems with the installation.
> Ralf
Hello,
I just want to follow up that ep
Date: Mon, 13 Sep 2010 12:17:47 -0400
From: mich...@trollope.org
To: tutor@python.org
Subject: Re: [Tutor] wierd replace problem
On Mon, Sep 13, 2010 at 12:19:23PM +, Roelof Wobben wrote:
>
> Hello,
>
> I have this string called test with the conten
On Mon, Sep 13, 2010 at 12:37 PM, Roelof Wobben wrote:
>
>
>
>
> Date: Mon, 13 Sep 2010 12:17:47 -0400
> From: mich...@trollope.org
> To: tutor@python.org
> Subject: Re: [Tutor] wierd replace problem
>
>
> On Mon, Sep 13, 2010 at 12:19:23PM +, Roelof W
> From: rwob...@hotmail.com
> To: joel.goldst...@gmail.com
> Subject: RE: [Tutor] wierd replace problem
> Date: Mon, 13 Sep 2010 16:45:28 +
>
>
>
>
>
>> Date: Mon, 13 Sep 2010 12:42:56 -0400
>> From: joel.goldst...@gma
> From: rwob...@hotmail.com
> To: tutor@python.org
> Date: Mon, 13 Sep 2010 16:46:09 +
> Subject: [Tutor] wierd replace problem
>
>
>
>
>
>> From: rwob...@hotmail.com
>> To: joel.goldst...@gmail.com
>> Subject:
"Huy Ton That" wrote
I was taking a look at the module decimal.py as you cited, and it
makes
sense now. Looks very useful to make tools without having to
instantiate
anything.
Thats not a good way to think of them.
Doing things without instantiating is usually better done by a
function.
"Roelof Wobben" wrote
Now I want to get rid of the \\ so I do this : test2 = test.replace
('\\', '')
And I get at the python prompt this answer : 'het is een wonder TIS'
So that's right.
OK,. Thats replacing a double slash in the data
for line in file:
line2 = line.replace ("\\","")
On 9/13/2010 12:58 PM, Roelof Wobben wrote:
The orginal text can be found here :
http://openbookproject.net/thinkcs/python/english2e/resources/ch10/alice_in_wonderland.txt
There are no \ in that text!
--
Bob Gailer
919-636-4239
Chapel Hill NC
> To: tutor@python.org
> From: alan.ga...@btinternet.com
> Date: Mon, 13 Sep 2010 18:28:46 +0100
> Subject: Re: [Tutor] wierd replace problem
>
>
> "Roelof Wobben" wrote
>
>> Now I want to get rid of the \\ so I do this : test2 = test.replace
>> ('\\', ''
On 9/13/2010 1:50 PM, Roelof Wobben wrote:
[snip]
hello Alan,
Your right. Then it prints like this "'tis
Which is not right. It must be tis.
So the replace does not what it supposed to do.
Sorry but I am now more confused. After discovering no \ in the text
file now you seem to have have a n
On Mon, Sep 13, 2010 at 2:08 PM, bob gailer wrote:
> On 9/13/2010 1:50 PM, Roelof Wobben wrote:
>
> [snip]
>
> hello Alan,
>>
>> Your right. Then it prints like this "'tis
>> Which is not right. It must be tis.
>> So the replace does not what it supposed to do.
>>
>> Sorry but I am now more co
> From: rwob...@hotmail.com
> To: bgai...@gmail.com
> Subject: RE: [Tutor] wierd replace problem
> Date: Mon, 13 Sep 2010 18:19:43 +
>
>
>
>
>
>> Date: Mon, 13 Sep 2010 14:08:46 -0400
>> From: bgai...@gmail.co
> From: rwob...@hotmail.com
> To: joel.goldst...@gmail.com
> Subject: RE: [Tutor] wierd replace problem
> Date: Mon, 13 Sep 2010 18:23:36 +
>
>
>
>
>
>> Date: Mon, 13 Sep 2010 14:18:36 -0400
>> From: joel.goldst...@gma
On Mon, Sep 13, 2010 at 6:10 PM, André da Palma wrote:
> Last year i was working with serial communication as well and there is
> already a library for python, i guess it's pySerial. Try to google it,
> perhaps
it can be useful for you.
Yes you're totally right! And that's the package im using
I've been coding Python long enough that 'asking forgiveness instead of
permission' is my first instinct, but the resulting code is sometimes
clumsy, and I wonder if someone can suggest something I'm missing, or at
least validate what's going on here in some way.
What I'm trying to do is write a f
On 13/09/10 16:36, Markus Hubig wrote:
Hi @all!
I'm about to write a class for serial communication on Win32 and Linux
which
provides a method called "talk" to send something over the serial
line, wait for
the answer and returns it. My problem is, that I don't know how long
the answer
will b
On 9/13/2010 8:36 AM Markus Hubig said...
Hi @all!
I'm about to write a class for serial communication on Win32 and Linux which
provides a method called "talk" to send something over the serial line,
wait for
the answer and returns it. My problem is, that I don't know how long the
answer
will be
On 9/13/2010 11:31 AM Brian Jones said...
I've been coding Python long enough that 'asking forgiveness instead of
permission' is my first instinct, but the resulting code is sometimes
clumsy, and I wonder if someone can suggest something I'm missing, or at
least validate what's going on here in s
On Mon, Sep 13, 2010 at 8:33 PM, Adam Bark wrote:
> Ideally you would send a specific ending packet and you read one byte at a
> time until the
>
right sequence comes up. Alternatively you could have the first byte as a
> length indicator.
>
Oh my dear! You're damn right! The protocol im impleme
On 13/09/10 19:31, Brian Jones wrote:
I've been coding Python long enough that 'asking forgiveness instead
of permission' is my first instinct, but the resulting code is
sometimes clumsy, and I wonder if someone can suggest something I'm
missing, or at least validate what's going on here in som
> I've been coding Python long enough that 'asking forgiveness instead of
> permission' is my first instinct, but the resulting code is sometimes clumsy,
> and I wonder if someone can suggest something I'm missing, or at least
> validate what's going on here in some way.
>
> What I'm trying to
Thanks for the replies so far. One thing that's probably relevant: once a
directory is created, I can expect to write a couple of hundred files to it,
so doing a 'try os.makedirs' right off the bat strikes me as coding for the
*least* common case instead of the *most* common (which is that the
dire
I suggest something like:
try:
os.makedirs(path)
except:
pass
open("%s/%s" % (path, filename), 'w').write(filedata)
- Original Message -
From: "Emile van Sebille"
To:
Sent: Monday, September 13, 2010 11:56 AM
Subject: Re: [Tutor] What's the best way to ask forgiveness here?
> Date: Mon, 13 Sep 2010 15:31:08 -0400
> Subject: Re: [Tutor] FW: wierd replace problem
> From: joel.goldst...@gmail.com
> To: rwob...@hotmail.com
>
>
>
> On Mon, Sep 13, 2010 at 2:24 PM, Roelof Wobben
>> wrote:
>
>
>
>
>
On 13/09/10 20:12, Brian Jones wrote:
Thanks for the replies so far. One thing that's probably relevant:
once a directory is created, I can expect to write a couple of hundred
files to it, so doing a 'try os.makedirs' right off the bat strikes me
as coding for the *least* common case instead of
Suppose i am taking input or various variables like
a=raw_input("...") //hello
b=raw_input("")//hi
c=raw_input("...")//hello
d=raw_input("..")//hello
but i want to run a common function when input is hello
so instead of
if a=="hello":
fun()
then aga
ANKUR AGGARWAL wrote on 09/13/2010 04:45:41 PM:
> Suppose i am taking input or various variables like
> a=raw_input("...") //hello
> b=raw_input("")//hi
> c=raw_input("...")//hello
> d=raw_input("..")//hello
> but i want to run a common function when
On Tue, Sep 14, 2010 at 6:45 AM, ANKUR AGGARWAL wrote:
> Suppose i am taking input or various variables like
> a=raw_input("...") //hello
> b=raw_input("")//hi
> c=raw_input("...")//hello
> d=raw_input("..")//hello
> but i want to run a common functi
On 9/13/2010 2:21 PM, Roelof Wobben wrote:
From: rwob...@hotmail.com
To: bgai...@gmail.com
Subject: RE: [Tutor] wierd replace problem
Date: Mon, 13 Sep 2010 18:19:43 +
I suggest you give a clear, complete and correct problem statement.
Right now
On Tue, 14 Sep 2010 04:18:36 am Joel Goldstick wrote:
> How about using str.split() to put words in a list, then run strip()
> over each word with the required characters to be removed ('`")
Doesn't work. strip() only removes characters at the beginning and end
of the word, not in the middle:
On Mon, Sep 13, 2010 at 6:41 PM, Steven D'Aprano wrote:
> On Tue, 14 Sep 2010 04:18:36 am Joel Goldstick wrote:
>
> > How about using str.split() to put words in a list, then run strip()
> > over each word with the required characters to be removed ('`")
>
>
> Doesn't work. strip() only removes ch
On Tue, 14 Sep 2010 08:05:33 am bob gailer wrote:
> > 3.Write a program called alice_words.py that creates a text file
> > named alice_words.txt containing an alphabetical listing of all the
> > words found in alice_in_wonderland.txt together with the number of
> > times each word occurs. The firs
On Tue, 14 Sep 2010 09:08:24 am Joel Goldstick wrote:
> On Mon, Sep 13, 2010 at 6:41 PM, Steven D'Aprano
wrote:
> > On Tue, 14 Sep 2010 04:18:36 am Joel Goldstick wrote:
> > > How about using str.split() to put words in a list, then run
> > > strip() over each word with the required characters to
On Tue, 14 Sep 2010 05:07:03 am Evert Rol wrote:
> Note 2: the directory can exist, but not have write access to your
> process. So between the try-except for creating a directory and the
> try-except for creating a file, you may put in a try-except for
> chmod.
If some application tried changing
On Tue, 14 Sep 2010 04:31:00 am Brian Jones wrote:
> I've been coding Python long enough that 'asking forgiveness instead
> of permission' is my first instinct, but the resulting code is
> sometimes clumsy, and I wonder if someone can suggest something I'm
> missing, or at least validate what's goi
On Tue, 14 Sep 2010 05:12:12 am Brian Jones wrote:
> Thanks for the replies so far. One thing that's probably relevant:
> once a directory is created, I can expect to write a couple of
> hundred files to it, so doing a 'try os.makedirs' right off the bat
> strikes me as coding for the *least* commo
theList = ["21 trewuuioi","3zxc","134445"]
print sorted(theList)
Hi, the result of the sorted list above doesn't print in the order I
want. Is there a straight forward way of getting python to print
['3zxc','21 trewuuioi','134445']
rather than ['134445', '21 trewuuioi', '3zxc']?
Any help would be
On 14/09/10 01:11, Pete O'Connell wrote:
theList = ["21 trewuuioi","3zxc","134445"]
print sorted(theList)
Hi, the result of the sorted list above doesn't print in the order I
want. Is there a straight forward way of getting python to print
['3zxc','21 trewuuioi','134445']
rather than ['134445',
On Mon, Sep 13, 2010 at 9:11 PM, Adam Bark wrote:
> On 14/09/10 01:11, Pete O'Connell wrote:
>>
>> theList = ["21 trewuuioi","3zxc","134445"]
>> print sorted(theList)
>>
>> Hi, the result of the sorted list above doesn't print in the order I
>> want. Is there a straight forward way of getting pyth
On 14/09/10 02:24, Pete O'Connell wrote:
Hi I don't actaully need the list printed reversed, I need it printed
from smallest number to largest
Just sorting gives you the list from smallest to largest.
For example:
#
theList = ["21 trewuuioi","374zxc","13447"]
print sorted(theL
Hi,
I'm parsing IMDB movie reviews (each movie is in its own text file). In my
script, I'm trying to extract genre information. Movies have up to three
categories of genres--but not all have a "genre" tag and that fact is making my
script abort whenever it encounters a movie text file that doe
On Mon, Sep 13, 2010 at 9:58 PM, wrote:
> Hi,
>
> I'm parsing IMDB movie reviews (each movie is in its own text file). In my
> script, I'm trying to extract genre information. Movies have up to three
> categories of genres--but not all have a "genre" tag and that fact is making
> my script abort
On Tue, Sep 14, 2010 at 1:58 PM, wrote:
> rgenre = re.split(r';', rf.info["genre"]) # When movies have genre
First question. Why are you not using an XML parser (it looks like
your IMDB data files _are_ XML). e.g: elementree (in the standard
library).
> else len(rgenre)<1: # I was hoping thi
Hi Vince,
Thanks very much for the one-line version--unfortunately, I still get errors.
The overall script runs over every text file in a directory, but as soon as it
hits a text file without a tag, it gives this error:
Traceback (most recent call last):
File
"C:\Users\tylersc\Desktop\Tyle
Tyler,
This is a simple error the KeyError is caused because the key isn't in the
dictionary
http://docs.python.org/library/exceptions.html#exceptions.KeyError and easy
fix you can either check for the key prior to using or use the get method
1) rgenre = re.split(r';', rf.info["genre"]) if "genre
On Tue, Sep 14, 2010 at 2:46 PM, wrote:
> rgenre = re.split(r';', rf.info["genre"])
> KeyError: 'genre'
Use something like this:
if "genre" in rf.info:
rgenre = re.split(..., ...)
else:
# ... no genre
cheers
James
--
-- James Mills
--
-- "Problems are solved by method"
61 matches
Mail list logo