On 10/10/12 02:14, eryksun wrote:
another=input('Do you have another book to order for this student?',
'\nEnter y for yes: ')
Remove the comma, and this will parse correctly.
Oops, yes good catch, don't know where that came from.
another=input('''
Do you have
Hi,
I have a program that reads and writes files using ctypes. When I want it to
read AND write (e.g. read a file, select some stuff and write that), the
library returns a 'read-open' error. I think that the pointer to the file
handle for read and write point to the same address. To test that
Albert-Jan Roskam wrote:
> I have a program that reads and writes files using ctypes. When I want it
> to read AND write (e.g. read a file, select some stuff and write that),
> the library returns a 'read-open' error. I think that the pointer to the
> file handle for read and write point to the sa
On 10/10/12 11:02, Albert-Jan Roskam wrote:
I have a program that reads and writes files using ctypes.
Any particular reason why? That's not normally something I'd expect you
to need ctypes for. Unless you just want to play with ctypes...
When I want it to read AND write (e.g. read a file,
On Wed, Oct 10, 2012 at 6:02 AM, Albert-Jan Roskam wrote:
>
> elif pf.startswith("lin"):
> libc = ctypes.CDLL("libc.so.6")
> fopen = libc.fdopen
> fh = fopen(ctypes.c_char_p(fn), "rb")
> fhPtr = ctypes.byref(ctypes.c_int(fh))
> buff = ctypes.create_string_buffer(lines)
> ret = libc.fread(
- Original Message -
> From: eryksun
> To: Albert-Jan Roskam
> Cc: Python Mailing List
> Sent: Wednesday, October 10, 2012 1:40 PM
> Subject: Re: [Tutor] ctypes question
>
> On Wed, Oct 10, 2012 at 6:02 AM, Albert-Jan Roskam
> wrote:
>>
>> elif pf.startswith("lin"):
>> libc = cty
I'm trying to iterate over a list of elements, and make changes to the list
in front of the element I'm currently working with. I can update the list,
but the 'for' doesn't see the new element. Here's the code:
import string
def add_element(items, point):
items = items[:point+1][:] + [['n
I've been scraping info from a website with a url program I wrote. But now I
can't open their webpage, no matter which web browser I use. I think they've
somehow blocked me. How can I get back in? Is it a temporary block? And can I
get in with the same computer from a different wifi?
__
On Wed, Oct 10, 2012 at 4:35 PM, Benjamin Fishbein wrote:
> I've been scraping info from a website with a url program I wrote. But now
> I can't open their webpage, no matter which web browser I use. I think
> they've somehow blocked me. How can I get back in? Is it a temporary block?
> And can I
how could someone know enough to write their own web-scraping program and
NOT know that this is not about python or how to get around this problem?
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.o
On 10/10/2012 20:52, Ed Owens wrote:
I'm trying to iterate over a list of elements, and make changes to the list
in front of the element I'm currently working with. I can update the list,
but the 'for' doesn't see the new element. Here's the code:
import string
def add_element(items, point)
On 10/10/2012 21:35, Benjamin Fishbein wrote:
I've been scraping info from a website with a url program I wrote. But now I
can't open their webpage, no matter which web browser I use. I think they've
somehow blocked me. How can I get back in? Is it a temporary block? And can I
get in with the
Hi
On 10 October 2012 21:35, Benjamin Fishbein wrote:
> I've been scraping info from a website with a url program I wrote. But now I
> can't open their webpage, no matter which web browser I use. I think they've
> somehow blocked me. How can I get back in? Is it a temporary block? And can I
>
On 10/10/2012 03:52 PM, Ed Owens wrote:
> I'm trying to iterate over a list of elements, and make changes to the list
> in front of the element I'm currently working with. I can update the list,
> but the 'for' doesn't see the new element. Here's the code:
>
> import string
>
> def add_element(
On Wed, Oct 10, 2012 at 3:52 PM, Ed Owens wrote:
>
> import string
Why are you importing "string"? Most string functions one would need
are methods of str/unicode. Sometimes "string" is still required,
however.
> def add_element(items, point):
> items = items[:point+1][:] + [['new']] + items
On 11/10/12 07:35, Benjamin Fishbein wrote:
I've been scraping info from a website with a url program I wrote. But
now I can't open their webpage, no matter which web browser I use. I
think they've somehow blocked me. How can I get back in? Is it a
temporary block?
How the hell would we know??
On Tue, Oct 9, 2012 at 4:29 AM, eryksun wrote:
> Python 3 lets you use any Unicode letter as an identifier, including
> letter modifiers ("Lm") and number letters ("Nl"). For example:
>
> >>> aꘌꘌb = True
> >>> aꘌꘌb
> True
>
> >>> Ⅰ, Ⅱ, Ⅲ, Ⅳ, Ⅴ = range(1, 6)
> >>> Ⅰ, Ⅱ, Ⅲ, Ⅳ, Ⅴ
On 11/10/12 12:23, boB Stepp wrote:
On Tue, Oct 9, 2012 at 4:29 AM, eryksun wrote:
Python 3 lets you use any Unicode letter as an identifier, including
letter modifiers ("Lm") and number letters ("Nl"). For example:
>>> aꘌꘌb = True
>>> aꘌꘌb
True
>>> Ⅰ, Ⅱ, Ⅲ, Ⅳ, Ⅴ = ran
On 11/10/12 08:49, eryksun wrote:
Also, generally avoid mutating a list while iterating over it.
listiterator is just incrementing an index, so modifying the size of
the list can produce nonsense (e.g. if you remove the current item,
the next item will be skipped). Instead, create an empty list
19 matches
Mail list logo