How to write code to store data into buffer using python?
Please Reply
With a keyboard.
Although if you're really keen, you could use a magnetized needle and
edit the sectors on the hard disk directly.
--
Steven
How to write code to store data into buffer using python?
Please reply.
Also, please don't double-post like you just did, as that's bad
netiquette and just wastes everyone's time.
Cheers,
Chris
--
Follow the path of the Iguana...
http://rebertia.com
On Mon, Oct 13, 2008 at 7:15 AM, Aditi Meher <mehe...@gmail.com> wrote:
> Hello
>
> How to write code to store data into buffer using python?
>
> Please Reply
> --
> http://mail.python.org/mailman/listinfo/python-list
>
A text/code editor might be useful.
I am connecting database using python,and i am inserting some data into it.
e.g.name and roll nos(some 100 records are stored)
My question is "I want to display 10 records at a time and want to
store remaining records into buffer and after displaying 10 records
again i want to display next 10 records."
Can you please provide me how to do this using python,what is the code for this?
Reply
I have no idea what platform you are using to display the data. Is it
a GUI? A Web app? A command-line utility?
I won't give you code, but I'll give you a general description. Most
SQL-based databases allow you to write a clause for your SELECT
statement such as "LIMIT 10". You'll want to read the documentation
for the database and the connection library to figure out how best to
do this.
If you want to load all the records and only show ten, this snippet
may come in handy:
results[10:20] # Get a list of results 10, 11, 12, 13, ..., 18, 19.
0-based, of course.
As for how to display the data, that depends on your platform.
Hello
I am using ubuntu operating system,i am using python and self app for
DB storage.
I hv already mentioned in my question that i want to display 10
records out of 100,how to create buffer to store remaining records
which i am not displaying.
I know the logic,but my language of sytax is not good so i want actual
code please can u mail it to me.
I have created DB using self app and after that created table using
python into DB, i hv also inserted the records into it using python.
please reply.
> I know the logic,but my language of sytax is not good
There's no fault in not knowing the language, unless you choose not to
rectify that by learning. If, on the other hand, you want to have
programs without learning how to program in the language, you've come
to the wrong place.
> so i want actual code please can u mail it to me.
What price and terms are you offering for the service of someone
writing your code for you?
Alternatively, if you want actual code, please *learn* from the
well-written tutorials and then *write some* yourself, present it
here, and we can discuss it in public for the benefit of all.
--
\ “Yesterday I told a chicken to cross the road. It said, ‘What |
`\ for?’” —Steven Wright |
_o__) |
Ben Finney
> I am using ubuntu operating system,i am using python and self app for
> DB storage.
>
> I hv already mentioned in my question that i want to display 10
> records out of 100,how to create buffer to store remaining records
> which i am not displaying.
>
> I know the logic,but my language of sytax is not good so i want actual
> code please can u mail it to me.
>
> I have created DB using self app and after that created table using
> python into DB, i hv also inserted the records into it using python.
Maybe you're making things more complicated that they should be.
You don't have to create a "buffer" to store records. If you only want to
move forward (that is, you don't have to show previous records) just keep
the cursor, and use cursor.fetchmany(10) to fetch the next 10 rows to show.
If you have to move back and forth, just use cursor.fetchall and store the
result (this is your "buffer", a list of records).
For 100 records that's all you need. If you expect it to grow to 100000
records, or have many users concurrently updating the database, this might
not be the right answer.
--
Gabriel Genellina
> Hello
>
> How to write code to store data into buffer using python?
buffer = data
> Please reply.
--
David C. Ullrich
> How to write code to store data into buffer using python?
Write following code:
buffer = data