This is a small program i have written to read a contents from a INPUT FILE containing (+1000 Lines ) and writing simultaneously to another file. ( it works fine )
1.---- QUESTION:-
----...
hi... can anybody give me some sample codes for reading a text file line by line?
I need to make a program to read the content of the file and to extract info in certain lines
thank u
Hi,
I have a address "Santa Mora, AZ 86444
I want to substring this string into city, state and zip but what is the best way to do this?
Do I use partition, rfind, or or split?
Thanks
Jamie
Hi all,
How could i create a folder using python if the folder name is provided by the user. and check if the folder already exists or not
regards,
Freedom
Hi all,
Im trying to build a custom SSh client in python using sockets in windows.
below is a snippet of my function in the code
#!/usr/bin/env python
import os
import sys
from socket ...
Hi,
I am writing a python app using Tkinter for buttons and graphics and having trouble getting a timer working, what I need is a sample app that has three buttons and a label.
[start ti...
I am looking for an UDP broadcast client/server example in Python. Any hints?
#include <iostream>
using namespace std;
int main()
{
int a;
cout << "please input a number" << endl;
cin >> a;
cout << "this is the number " << a << endl;
...
I have been searching around for a way to compile my python scripts beyon .pyc or .pyo files mainly because my company would like to distribute some applications however those byte code files ...
I have to write a script to monitor a mysql connection. Before I do this I want to test if my machine can access Internet by pinging the DNS server of my provider. I have seen very complicated...
Hi all,
I am new to python.
I have 2 problesms.
1. I want to be able to distinguish between integers and other types in python.
for example I wan to be able to say a list = [ 1, ...
I need a couple lines of code to replace all non-alphanumeric characters from a python string with spaces. So, given the string "automobile sales & repair" I'd like it to return "automobile sa...
I have a method that may or may not infinite loop depending on user input. I would like to wrap the call to it in some way so that I may specify a time out and, in the case that it runs longe...
I'm trying to write a script that print first 50 numbers separated by , without any spaces, end of line characters between number. How can I do that?
I tried to use:
print ",",
however it g...
I need example code to parse the following HTML table into a list or array - I'm not sure the best way as I'm new to Python coming from VB. So far I've been able to get the HTML and split out...
I am looking to utilize either mid() or right() functions used in VB within Python. I can not seem to find similar functions for Python. I am trying to parse text in a file and if certain word...
Hi All,
Sorry if a similar question has been asked before and answered.
I am trying to write a piece that will read from a file and populate the file content into various tables in a datab...
I've been requested to put a python script in cron. Currently in real time the user changes to the directory that has the script and launches the script which works on data in that directory....
hello, all,
on my machine, SuSE 10.2 Enterprise Server, Qt Designer (4.21), Python 2.5 installed. I want to use pyuic (3.14.1) to convert a qt form (.ui) to python form (.py). However ...
Hi,
I've written a cool little script that helps to filter my email. It works really well and does exactly what I want.
I added another feature that would store all the email in a d...
For the sake of simplicity i have a test.txt file like this:
1 2 3
4 5 6
7 8 9
Using python I would like to read each line into a list so that i have
list1 = [1,2,3]
list2 = [4,5,...
Hi,
I have two strings that I want to convert into date and datetimes...
1) 05/15/2009
2) 20 May 2009 23:09:31 -0700
I am going the route of using datetime.datetime.fromtimestamp(time....
Ok, I'm a very-well-versed web developer in PHP and more. I've got a new job concentrating on front-end coding, but I have to cross over into some back-end as well, but based in Python not PH...
Hi there, I am creating a while loop to validate input from a user. I am using isalpha() and trying for the following:
name = 121231 #non alpha
while name.isalpha() = false :
name ...
How do I get the filename of the currently running python script?