473,385 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

python ,MySQl and http

I am new to programing and data base
I have Q about how to choose items from a list of strings which is in a file
as my favorit and put them in a http
all that should br writen in python
I have only made the connection but i dont know how to keep going on it???
May 16 '10 #1
1 1190
Glenton
391 Expert 256MB
Hi

Is this a homework assignment? We're happy to help, but more effort and more specific questions will get you better answers.

To get you started the following will open a file and put each line as a string in a python list:

Expand|Select|Wrap|Line Numbers
  1. myfile=open("filename.txt")
  2. mylist=myfile.readlines()
  3. myfile.close()
This is often a reasonable way to start, because there are many functions for manipulating python lists. See the docs for more.
May 17 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Doug | last post by:
I am thinking of using a Python based HTTP server instead of Apache. I would be interested in one that employed generators and coroutines. I know those are fairly new features of python, so...
3
by: james blair | last post by:
Hi I have a search page & the reults for the search are fetched from the database. I want that on the results page only first 25 results are shown & a link "next 25 results" be shown.Same for the...
1
by: Yong Wang | last post by:
> Hi: > We have a database system. In the database, we have an > attribute called date0, which contains date data (format: > i. e. 2004-08-12). I wrote a script to fetch the data > in a...
2
by: Christopher Kang | last post by:
I had a question about python and mysql, but I want to first thank those who taught me about the factory method, it was exactly what I needed. Anyway, I have a problem where I am pulling...
10
by: Python_it | last post by:
Python 2.4 MySQL-python.exe-1.2.0.win32-py2.4.zip How can I insert a NULL value in a table (MySQL-database). I can't set a var to NULL? Or is there a other possibility? My var must be variable...
3
by: Chris Seymour | last post by:
Can anybody provide any guidance on what I will need to do get mysql-python setup on my win xp workstation? I have Mysql 4.1 installed and activepython 2.4.3 installed. What do I need to do to...
2
by: Roopesh | last post by:
Hi, In my mod_python project I am using mysql as the database. There is table card in which unique cards are stored. When a user request comes he has to get a unique card. In this situation I want...
3
by: Devraj | last post by:
Hi everyone, My application uses MySQL as a backend and am using the MySQL/Python bindings. Are there any libraries that provide a database abstraction layer like Activerecords for Python?' ...
4
by: Con | last post by:
Hi, how does properly install the Python MySQL db module for Mac OS X? I was only able to locate the Win32 modules. Thanks in advance, -Conrad
3
by: Ethan Furman | last post by:
len wrote: I've never had the (mis?)fortune to work with COBOL -- what are the files like? Fixed format, or something like a dBase III style? I
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.