Hi,
I know that i can do readline() from a file object.
However, how can I read till a specific seperator?
for exmple,
if my files are
name
profession
id
#
name2
profession3
id2
I would like to read this file as a record.
I can do this in perl by defining a record seperator;
is there an equivalent in python?
thanks
Jul 18 '05
35 2955
Andrew Dalke wrote: Mike Meyer:
Trivia question: Name the second most powerfull country on earth not using the metric system for everything.
The UK?
Before going there I thought they were a fully metric country. But I saw weather reports in degrees F, distances in yards and miles, and of course pints of beer.
Andrew da***@dalkescie ntific.com
Plus the builders quite routinely ask suppliers for things like "a meter
of two (inches) by four (inches)". They don;t care that they're getting
the closest metric equivalent, to them a 2 x 4 is still a 2 x 4.
regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
Jeff Shannon schreef: John Machin wrote:
Subtle distinction: A metER is a measuring device. A MetRE is a unit of distance.
... except in the US, where we stubbornly apply the same spelling to both of those. (It figures that we Americans just ignore subtle distinctions... .)
Or there is some Dutch influence... ;)
(In Dutch it's "meter" for both meanings.)
--
JanC
"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9
On Mon, 03 Jan 2005 23:15:23 GMT, Andrew Dalke
<da***@dalkesci entific.com> declaimed the following in comp.lang.pytho n: Before going there I thought they were a fully metric country. But I saw weather reports in degrees F, distances in yards and miles, and of course pints of beer.
Yeah, but those pints are bigger than our pints...
Roughly 20 fl.oz. vs 16 fl.oz.
-- =============== =============== =============== =============== == < wl*****@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG < wu******@dm.net | Bestiaria Support Staff < =============== =============== =============== =============== == < Home Page: <http://www.dm.net/~wulfraed/> < Overflow Page: <http://wlfraed.home.ne tcom.com/> <
On Mon, 03 Jan 2005 19:14:54 -0500, Steve Holden <st***@holdenwe b.com>
declaimed the following in comp.lang.pytho n: Plus the builders quite routinely ask suppliers for things like "a meter of two (inches) by four (inches)". They don;t care that they're getting the closest metric equivalent, to them a 2 x 4 is still a 2 x 4.
And what do they get? A normal finished 2x4 runs about 1.5x3.5
inches...
A 1x4 is 0.75x3.5
-- =============== =============== =============== =============== == < wl*****@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG < wu******@dm.net | Bestiaria Support Staff < =============== =============== =============== =============== == < Home Page: <http://www.dm.net/~wulfraed/> < Overflow Page: <http://wlfraed.home.ne tcom.com/> <
Mike Meyer <mw*@mired.or g> wrote:
... Trivia question: Name the second most powerfull country on earth not using the metric system for everything.
Well, then, just name the 2nd most powerful country on earth, period
(I'm not going to get myself in trouble by guessing whether said 2nd
country is China, Russia, "Europe" [not a country, I know;-)], ...).
TVs and other displays are sold as "20 inches" (or whatever) everywhere,
printers' resolutions are always given in pixels per inch, etc.
Alex
Dennis Lee Bieber wrote: On Mon, 03 Jan 2005 19:14:54 -0500, Steve Holden <st***@holdenwe b.com> declaimed the following in comp.lang.pytho n:
Plus the builders quite routinely ask suppliers for things like "a meter of two (inches) by four (inches)". They don;t care that they're getting the closest metric equivalent, to them a 2 x 4 is still a 2 x 4.
And what do they get? A normal finished 2x4 runs about 1.5x3.5 inches...
A 1x4 is 0.75x3.5
Who knows, but htey don;t complain about it. In the UK also the sizes
refer to the rough cut, before finish planing.
regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Eric Wichterich |
last post by:
Hello Pythonistas,
does anyone know an equivalent python statement for perl's
"next"-statement?
(Perl's "next" skips a loop cycle and continues with the next loop
cycle - it does not abort the whole loop).
Thank you!
Eric
|
by: Edward WIJAYA |
last post by:
Hi,
I am new to Python, and I like to
learn more about it. Since I am
used to Perl before, I would like
to know what is Python equivalent
of Perl code below:
$filename = $ARGV;
|
by: Dmitry |
last post by:
Hello everyone,
I have a really simple question here:
I have a plain space delimited file that I want to read with WHILE
loop 1 line at the time and process each input record as an array of
elements. Then, on the next iteration of the loop, clean up the array
and populate it with contents of the next input record. Each input
record consists of 7 fields / elements separated by spaces. The reason
I need this is because I have to switch...
|
by: championsleeper |
last post by:
we have a system that recives plain text files from numerous external
sources (database and others). our system recieves the information and
then processes it. each line in the input file is a record. our system
recognizes part of the records by character location
(1-6)=date,(7-9)=age etc, parses the record according to the
configuration it reads and proceses the data.
quite often, the quality of the recieved data is not "good" and we...
|
by: Gregg |
last post by:
Hello all,
I have been banging my head over a problem that I am having reading a
comma seperated file (CSV) that can contain from 1 to 10,000 records.
My code snipit is as follows:
**Start code snipit**
Dim strCustFullName as string
Dim strCustAddr1 as string
| |
by: lgo |
last post by:
I have read several variations of this topic posted on this news group.
However I was not able to find the answer for my problem.
I am trying to build code (see below) to update a large single record
using data from a temporary (editing) table with identical field
structure. I iterate through the fields (some 50 of them) with a For
Each - Next loop to update each field with the SQL statement. The
updating works fine with numeric data type...
|
by: arnuld |
last post by:
I have created a program to print the input words on stdout. Input is
taken dynamically from stdin. In each word, each input character is
allocated dynamically. I have ran this program with a file containing a
*single* word made of 25525500 letters and this program works fine on it.
I will welcome any suggestions for improvement.
/* * A program that will ask the user for input and then will print the words on stdout
* and will also...
|
by: sixtyfootersdude |
last post by:
Good Morning!
I am just starting to learn perl and I am somewhat mistifide about when I should do:
print("@input");
and when I should do:
print(@input)
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |