Re: help me in a program in python to implement Railway Reservation System using file handling technique.

2018-11-26 Thread Mario R. Osorio
On Saturday, November 24, 2018 at 1:44:21 AM UTC-5, Chris Angelico wrote: > On Sat, Nov 24, 2018 at 5:36 PM wrote: > > > > hello all, > > please hepl me in the above program. python to implement Railway > > Reservation System using file handling technique. > >

Re: help me in a program in python to implement Railway Reservation System using file handling technique.

2018-11-25 Thread Bob Gailer
On Nov 24, 2018 1:35 AM, wrote: > > hello all, > please hepl me in the above program. What do you mean by "the above program"? I don't see any. python to implement Railway Reservation System using file handling technique. > > System should perform below operation

Re: help me in a program in python to implement Railway Reservation System using file handling technique.

2018-11-25 Thread francis
On Saturday, 24 November 2018 14:33:29 UTC+8, jasmin amrutia wrote: > hello all, > please hepl me in the above program. python to implement Railway Reservation > System using file handling technique. > > System should perform below operations. > a. Reserve a ticket for a pa

Re: help me in a program in python to implement Railway Reservation System using file handling technique.

2018-11-23 Thread Chris Angelico
On Sat, Nov 24, 2018 at 5:36 PM wrote: > > hello all, > please hepl me in the above program. python to implement Railway Reservation > System using file handling technique. > > System should perform below operations. > a. Reserve a ticket for a passenger. > b. List info

help me in a program in python to implement Railway Reservation System using file handling technique.

2018-11-23 Thread jasminamrutia007
hello all, please hepl me in the above program. python to implement Railway Reservation System using file handling technique. System should perform below operations. a. Reserve a ticket for a passenger. b. List information all reservations done for today’s trains. -- https://mail.python.org

Re: file handling issues

2013-09-07 Thread Piet van Oostrum
Leo Carnovale writes: > Ah and one other thing! > What is this crypto algorithm you speak of? I desperately need some sort of > encryption as at the moment anyone can simply open the text file and change > the numbers to numbers that work! > Where can I learn more about it? You can google for

Re: file handling issues

2013-09-06 Thread Leo Carnovale
On Saturday, 7 September 2013 13:58:43 UTC+10, Michael Torrie wrote: > On 09/06/2013 09:05 PM, Leo Carnovale wrote: > > > Ah and one other thing! What is this crypto algorithm you speak of? I > > > desperately need some sort of encryption as at the moment anyone can > > > simply open the text f

Re: file handling issues

2013-09-06 Thread Michael Torrie
On 09/06/2013 09:05 PM, Leo Carnovale wrote: > Ah and one other thing! What is this crypto algorithm you speak of? I > desperately need some sort of encryption as at the moment anyone can > simply open the text file and change the numbers to numbers that > work! Where can I learn more about it? Th

Re: file handling issues

2013-09-06 Thread Leo Carnovale
On Saturday, 7 September 2013 13:03:14 UTC+10, Leo Carnovale wrote: > On Saturday, 7 September 2013 02:17:03 UTC+10, Piet van Oostrum wrote: > > > leo.carnov...@gmail.com writes: > > > > > > > > > > > > > I am making this little game and I am trying to make some sort of script > > > that

Re: file handling issues

2013-09-06 Thread Leo Carnovale
On Saturday, 7 September 2013 02:17:03 UTC+10, Piet van Oostrum wrote: > leo.carnov...@gmail.com writes: > > > > > I am making this little game and I am trying to make some sort of script > > that does the following: > > >>Checks to see if a file exists > > > >If it does, check the numbers

Re: file handling issues

2013-09-06 Thread Piet van Oostrum
leo.carnov...@gmail.com writes: > I am making this little game and I am trying to make some sort of script that > does the following: >>Checks to see if a file exists > >If it does, check the numbers in it > >If it doesn't, make one and fill it with some numbers >>Sorts out if the numbers in th

Re: file handling issues

2013-09-06 Thread leo . carnovale
On Friday, 6 September 2013 20:20:02 UTC+10, leo.ca...@gmail.com wrote: > I am making this little game and I am trying to make some sort of script that > does the following: > > >Checks to see if a file exists > > >If it does, check the numbers in it > > >If it doesn't, make one and fill it

file handling issues

2013-09-06 Thread leo . carnovale
I am making this little game and I am trying to make some sort of script that does the following: >Checks to see if a file exists >If it does, check the numbers in it >If it doesn't, make one and fill it with some numbers >Sorts out if the numbers in the file are in the right format >If they ar

Re: question about file handling with "with"

2012-03-29 Thread Nobody
On Wed, 28 Mar 2012 11:31:21 +0200, Jabba Laci wrote: > Is the following function correct? Is the input file closed in order? > > def read_data_file(self): > with open(self.data_file) as f: > return json.loads(f.read()) Yes. The whole point of being able to use a file as a context m

Re: Difference between json.load() and json.loads() [From: RE: question about file handling with "with"]

2012-03-28 Thread Nadir Sampaoli
2012/3/28 ian douglas > > The functions with an s take string parameters. The others take file > streams. > > foo = '{"age": 38}' > my_json = json.loads(foo) > I see, it makes perfectly sense now. Thanks for clearing it up. -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between json.load() and json.loads() [From: RE: question about file handling with "with"]

2012-03-28 Thread ian douglas
On Mar 28, 2012 6:54 AM, "Nadir Sampaoli" wrote: > > Hello everyone (my first message in the mailing list), > >> >> > Is the following function correct? >> Yes, though I'd use json.load(f) instead of json.loads(). > > > The docs aren't very clear (at least for me) about the difference between json

Difference between json.load() and json.loads() [From: RE: question about file handling with "with"]

2012-03-28 Thread Nadir Sampaoli
Hello everyone (my first message in the mailing list), > > Is the following function correct? > Yes, though I'd use json.load(f) instead of json.loads(). > The docs aren't very clear (at least for me) about the difference between json.load()

Re: question about file handling with "with"

2012-03-28 Thread Peter Otten
Jabba Laci wrote: > Is the following function correct? Yes, though I'd use json.load(f) instead of json.loads(). > Is the input file closed in order? > > def read_data_file(self): > with open(self.data_file) as f: > return json.loads(f.read()) The file will be closed when the wit

question about file handling with "with"

2012-03-28 Thread Jabba Laci
Hi, Is the following function correct? Is the input file closed in order? def read_data_file(self): with open(self.data_file) as f: return json.loads(f.read()) Thanks, Laszlo -- http://mail.python.org/mailman/listinfo/python-list

Re: file handling

2010-06-14 Thread Cameron Simpson
Please don't top post; post below and trim the content. Also, please do a reply-to-all to keep the discussion on the list. Further content is below... On 14Jun2010 11:44, madhuri vio wrote: | On Mon, Jun 14, 2010 at 11:39 AM, Cameron Simpson wrote: | > ODT files are _not_ text files. If I recal

Re: file handling

2010-06-13 Thread Cameron Simpson
On 14Jun2010 11:05, madhuri vio wrote: | i have a doubt about ...this..can u look into this.. | | a = open("human.odt","r") | b = a.readlines() | print b | | and i get d output something else... | | python monday.py | ["PK\x03\x04\x14\x00\x00\x00\x00\x00\xd6+\xce<^\xc62\x0c'\x00\x00\x00'\x00\x

Re: file handling

2010-06-13 Thread Benjamin Kaplan
On Sun, Jun 13, 2010 at 10:35 PM, madhuri vio wrote: > i have a doubt about ...this..can u look into this.. > > a = open("human.odt","r") > b = a.readlines() > print b > > and i get d output something else... > > python monday.py > ["PK\x03\x04\x14\x00\x00\x00\x00\x00\xd6+\xce<^\xc62\x0c'\x00\x00\

file handling

2010-06-13 Thread madhuri vio
i am waiting for the reply..as ia m unable to proceed -- madhuri :) -- http://mail.python.org/mailman/listinfo/python-list

Re: file handling

2010-06-13 Thread James Mills
On Mon, Jun 14, 2010 at 3:35 PM, madhuri vio wrote: > i have a doubt about ...this..can u look into this.. > > a = open("human.odt","r") > b = a.readlines() > print b > > and i get d output something else... > > python monday.py > ["PK\x03\x04\x14\x00\x00\x00\x00\x00\xd6+\xce<^\xc62\x0c'\x00\x00\x

file handling

2010-06-13 Thread madhuri vio
i have a doubt about ...this..can u look into this.. a = open("human.odt","r") b = a.readlines() print b and i get d output something else... python monday.py ["PK\x03\x04\x14\x00\x00\x00\x00\x00\xd6+\xce<^\xc62\x0c'\x00\x00\x00'\x00\x00\x00\x08\x00\x00\x00mimetypeapplication/vnd.oasis.opendocum

Re: query regarding file handling.

2009-11-13 Thread Rhodri James
On Thu, 12 Nov 2009 09:59:40 -, ankita dutta wrote: hi all, i have a file of 3x3 matrix of decimal numbers(tab separated). like this : 0.020.380.01 0.040.320.00 0.030.400.02 now i want to read 1 row and get the sum of a particular row. but when i am trying

Re: query regarding file handling.

2009-11-12 Thread Himanshu
2009/11/12 ankita dutta : > hi all, > > i have a file of 3x3 matrix of decimal numbers(tab separated). like this : > > 0.02    0.38    0.01 > 0.04    0.32    0.00 > 0.03    0.40    0.02 > > now i want to read 1 row and get the sum of a particular row. but when i am > trying with the following code,

Re: query regarding file handling.

2009-11-12 Thread Chris Rebert
On Thu, Nov 12, 2009 at 1:59 AM, ankita dutta wrote: > hi all, > > i have a file of 3x3 matrix of decimal numbers(tab separated). like this : > > 0.02    0.38    0.01 > 0.04    0.32    0.00 > 0.03    0.40    0.02 > > now i want to read 1 row and get the sum of a particular row. but when i am > try

query regarding file handling.

2009-11-12 Thread ankita dutta
hi all, i have a file of 3x3 matrix of decimal numbers(tab separated). like this : 0.020.380.01 0.040.320.00 0.030.400.02 now i want to read 1 row and get the sum of a particular row. but when i am trying with the following code, i am getting errors : *code*: " ln1=open(

Re: File Handling Problem

2009-09-06 Thread joy99
On Sep 5, 11:49 am, Chris Rebert wrote: > On Fri, Sep 4, 2009 at 11:39 PM, > SUBHABRATABANERJEE wrote: > > > > > And one small question does Python has any increment operator like ++ in C. > > No. We do  x += 1  instead. > > Cheers, > Chris > --http://blog.rebertia.com Thanx for your kind reply

Re: File Handling Problem

2009-09-04 Thread Chris Rebert
On Fri, Sep 4, 2009 at 11:39 PM, SUBHABRATA BANERJEE wrote: > And one small question does Python has any increment operator like ++ in C. No. We do x += 1 instead. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: File Handling Problem

2009-09-04 Thread SUBHABRATA BANERJEE
Dear Sir, Thank you for your kind reply. I would surely check your code. Meanwhile, I solved it using readlines() but not in your way. I will definitely have a look in your code. My solution came so smart that I felt I should not have posted this question. But I would like to know about, i) File

Re: File Handling Problem

2009-09-04 Thread Rami Chowdhury
No: readlines () retains the "\n"s; splitlines () loses them Ah, thank you for the clarification! On Fri, 04 Sep 2009 08:39:37 -0700, Tim Golden wrote: Rami Chowdhury wrote: f = open("myfile.txt", "r") list_one = f.read().splitlines() f.close() Or use f.readlines(), which would do the

Re: File Handling Problem

2009-09-04 Thread Tim Golden
Rami Chowdhury wrote: f = open("myfile.txt", "r") list_one = f.read().splitlines() f.close() Or use f.readlines(), which would do the same thing IIRC? No: readlines () retains the "\n"s; splitlines () loses them TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: File Handling Problem

2009-09-04 Thread Rami Chowdhury
f = open("myfile.txt", "r") list_one = f.read().splitlines() f.close() Or use f.readlines(), which would do the same thing IIRC? On Fri, 04 Sep 2009 07:46:42 -0700, Stephen Fairchild wrote: joy99 wrote: Dear Group, I have a file. The file has multiple lines. I want to get the line numb

Re: File Handling Problem

2009-09-04 Thread Lucas Prado Melo
On Fri, Sep 4, 2009 at 9:50 AM, joy99 wrote: > Dear Group, > > I have a file. The file has multiple lines. I want to get the line > number of any one of the strings. > Once I get that I like to increment the line number and see the string > of the immediate next line or any following line as outp

Re: File Handling Problem

2009-09-04 Thread Stephen Fairchild
joy99 wrote: > Dear Group, > > I have a file. The file has multiple lines. I want to get the line > number of any one of the strings. > Once I get that I like to increment the line number and see the string > of the immediate next line or any following line as output. The > problem as I see is ni

File Handling Problem

2009-09-04 Thread joy99
Dear Group, I have a file. The file has multiple lines. I want to get the line number of any one of the strings. Once I get that I like to increment the line number and see the string of the immediate next line or any following line as output. The problem as I see is nicely handled in list, like

Re: File handling problem.

2009-05-03 Thread SUBHABRATA BANERJEE
Dear Sir, Thanx for your prompt reply, I would be trying to work on your suggestion and get back to you as soon as possible. Best Regards, Subhabrata. On Sun, May 3, 2009 at 10:47 PM, Chris Rebert wrote: > On Sun, May 3, 2009 at 9:51 AM, SUBHABRATA BANERJEE > wrote: > > Dear Group, > > > > > >

Re: File handling problem.

2009-05-03 Thread Chris Rebert
On Sun, May 3, 2009 at 9:51 AM, SUBHABRATA BANERJEE wrote: > Dear Group, > > > > I am working on a code like the following: > > > > from decimal import* > > #SAMPLE TEST PROGRAM FOR FILE > > def sample_file_test(n): > >     #FILE FOR STORING PROBABILITY VALUES > >     open_file=open("/python26/New

Re: File handling problem.

2009-05-03 Thread SUBHABRATA BANERJEE
erated set of values and storing it. Is there any solution for it? >> >> Best Regards, >> SBanerjee. >> -- >> http://mail.python.org/mailman/listinfo/python-list >> >> >> >> > Hello > > Could you post excerpt of your file-handling code ? > I

Re: File handling problem.

2009-05-02 Thread Steven D'Aprano
On Sat, 02 May 2009 01:26:14 -0700, subhakolkata1234 wrote: > Dear Group, > > I am using Python2.6 and has created a file where I like to write some > statistical values I am generating. The statistical values are > generating in a nice way, but as I am going to write it, it is not > taking it, t

Re: File handling problem.

2009-05-02 Thread Pascal Chambon
properly but the values are not getting stored. It is picking up arbitrary values from the generated set of values and storing it. Is there any solution for it? Best Regards, SBanerjee. -- http://mail.python.org/mailman/listinfo/python-list Hello Could you post excerpt of your file-handling

File handling problem.

2009-05-02 Thread subhakolkata1234
Dear Group, I am using Python2.6 and has created a file where I like to write some statistical values I am generating. The statistical values are generating in a nice way, but as I am going to write it, it is not taking it, the file is opening or closing properly but the values are not getting sto

Re: Basic Question about Python WebServer File handling

2008-07-11 Thread Gabriel Genellina
En Thu, 10 Jul 2008 22:20:21 -0300, Alok Kumar <[EMAIL PROTECTED]> escribi�: I need to have a python webserver which can handle Get request from the clients and upload the *files* from 4 different directories. Can someone please point me what to exactly look for. Look at SimpleHTTPServer.py

Basic Question about Python WebServer File handling

2008-07-10 Thread Alok Kumar
Hi, I need to have a python webserver which can handle Get request from the clients and upload the *files* from 4 different directories. Can someone please point me what to exactly look for. Thanks you very much for this great help. Regards Alok Kumar -- http://mail.python.org/mailman/listinfo/

Text file handling in python

2007-12-10 Thread Noorhan Abbas
Hello, I am tring to access a text file in random acess way, that is, using f.tell() and f.seek() to seek a certain position in the text file. f.seek() does not seem to work properly, the file is opened in a read universal 'rU' mode. Thank you very much, Nora. ___

Re: File Handling & TRY/EXCEPT

2007-08-05 Thread Gabriel Genellina
En Fri, 03 Aug 2007 10:38:17 -0300, Robert Rawlins - Think Blue <[EMAIL PROTECTED]> escribió: > Thanks for your ideas guys, > > I'm unfortunately tied to 2.4 so don't have the full try except status, > but > I'm now working with the following code: > > def addApp(self, event): >

RE: File Handling & TRY/EXCEPT

2007-08-03 Thread Alex Popescu
"Robert Rawlins - Think Blue" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Thanks for your ideas guys, > > I'm unfortunately tied to 2.4 so don't have the full try except > status, but I'm now working with the following code: > > def addApp(self, event): > try: >

RE: File Handling & TRY/EXCEPT

2007-08-03 Thread Robert Rawlins - Think Blue
#x27;m a little reluctant about posting all my app code on the lists as I'd like to keep some of it private. How does that new version look? A little tidier? Thanks guys, Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Holden Sent: 03 Au

Re: File Handling & TRY/EXCEPT

2007-08-03 Thread Steve Holden
Robert Rawlins - Think Blue wrote: > Hello Guys, > > > > I’m looking for some advice on how best to handle file read/write errors > with try/except as i’m a little vague on this, I have a small memory > leak in my app and I’m starting to think its generated by my log file > write. For an exa

Re: File Handling & TRY/EXCEPT

2007-08-03 Thread Alex Popescu
"Robert Rawlins - Think Blue" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > This is a multipart message in MIME format. > > --=_NextPart_000_00B0_01C7D5B0.02EB8BA0 > Hello Guys, > > > > I'm looking for some advice on how best to handle file read/write > errors with try/except as

File Handling & TRY/EXCEPT

2007-08-03 Thread Robert Rawlins - Think Blue
Hello Guys, I'm looking for some advice on how best to handle file read/write errors with try/except as i'm a little vague on this, I have a small memory leak in my app and I'm starting to think its generated by my log file write. For an example of the function look below. def addApp

Re: file handling in a server (.py) file using xmlrpc

2005-07-08 Thread uwb
Jeremy Jones wrote: >>The script executes, no error messages, but the glob call turns up nothing >>while the identical call running from a console does in fact turn up files >>names as expected. >> >> > Wild guess, but I'm thinking your webserver process doesn't have > permissions to look in you

Re: file handling in a server (.py) file using xmlrpc

2005-07-08 Thread Jeremy Jones
uwb wrote: >Jeremy Jones wrote: > > > >>uwb wrote: >> >> >> >>>I've got a call to glob in a .py file sitting in an apache cgi-bin >>>directory which refuses to work while the exact same code works from a >>>python console session. >>> >>>I'm guessing that in order to read or write files from

Re: file handling in a server (.py) file using xmlrpc

2005-07-08 Thread uwb
Jeremy Jones wrote: > uwb wrote: > >>I've got a call to glob in a .py file sitting in an apache cgi-bin >>directory which refuses to work while the exact same code works from a >>python console session. >> >>I'm guessing that in order to read or write files from any sort of a >>script file sittin

Re: file handling in a server (.py) file using xmlrpc

2005-07-08 Thread Jeremy Jones
uwb wrote: >I've got a call to glob in a .py file sitting in an apache cgi-bin directory >which refuses to work while the exact same code works from a python console >session. > >I'm guessing that in order to read or write files from any sort of a script >file sitting in the cgi-bin directory on a

file handling in a server (.py) file using xmlrpc

2005-07-08 Thread uwb
I've got a call to glob in a .py file sitting in an apache cgi-bin directory which refuses to work while the exact same code works from a python console session. I'm guessing that in order to read or write files from any sort of a script file sitting in the cgi-bin directory on a server, somethin

Re: File Handling Problems Python I/O

2005-01-06 Thread Craig Ringer
On Fri, 2005-01-07 at 02:06, Josh wrote: > Peter, > > Thank you for the rookie correction. That was my exact problem. I > changed the address to use forward slashes and it works perfect. I did > not know that a backslash had special meaning within a string, but now > I do! Thanks again There's an

Re: File Handling Problems Python I/O

2005-01-06 Thread Peter Hansen
Josh wrote: He is the function where I am making the call. If I change the open statment to another file, say "c:\test.txt", a file I know exists, it will error out stating the file does not exist. Thanks def GetStartVars(self): try: DOWNFILE = open("c:\fixes.txt","r") Josh, it's surprising that th

Re: File Handling Problems Python I/O

2005-01-06 Thread Josh
Micheal, Thanks for the advice as the programming I am doing will be run on both Windows and Linux based PC's, that being the main reason for my venture into Python. I'm glad to see that people are willing to help out even the newbie's. Josh -- http://mail.python.org/mailman/listinfo/python-l

Re: File Handling Problems Python I/O

2005-01-06 Thread mhartl
Sorry, the BASE variable should be 'C:\\' on Windows: >>> BASE = 'C:\\' >>> import os >>> os.path.join(BASE, 'foo', 'bar', 'baz') 'C:\\foo\\bar\\baz' -- http://mail.python.org/mailman/listinfo/python-list

Re: File Handling Problems Python I/O

2005-01-06 Thread mhartl
You can use the os module to build path names in a platform-independent manner. On my Linux box, I can type >>> BASE = '/' >>> import os >>> os.path.join(BASE, 'foo', 'bar', 'baz') '/foo/bar/baz' On a Windows machine, you get >>> BASE = 'C:' >>> import os >>> os.path.join(BASE, 'foo', 'bar', 'b

Re: File Handling Problems Python I/O

2005-01-06 Thread Alex Martelli
Josh <[EMAIL PROTECTED]> wrote: ... > He is the function where I am making the call. If I change the open > statment to another file, say "c:\test.txt", a file I know exists, it Are you sure a file exist whose name is, c, colon, tab, e, s, t ...? \t is an escape sequence and it means TAB (char

Re: File Handling Problems Python I/O

2005-01-06 Thread deelan
Josh wrote: Peter, Thank you for the rookie correction. That was my exact problem. I changed the address to use forward slashes and it works perfect. I did not know that a backslash had special meaning within a string, but now I do! Thanks again you may want to check "python gotchas" to avoid other

Re: File Handling Problems Python I/O

2005-01-06 Thread Josh
Peter, Thank you for the rookie correction. That was my exact problem. I changed the address to use forward slashes and it works perfect. I did not know that a backslash had special meaning within a string, but now I do! Thanks again Josh -- http://mail.python.org/mailman/listinfo/python-list

Re: File Handling Problems Python I/O

2005-01-06 Thread Josh
He is the function where I am making the call. If I change the open statment to another file, say "c:\test.txt", a file I know exists, it will error out stating the file does not exist. Thanks Josh def GetStartVars(self): try: DOWNFILE = open("c:\fixes.txt","r") except IOError: print "Failed to o

Re: File Handling Problems Python I/O

2005-01-06 Thread Peter Hansen
Josh wrote: I am having a problem with Python. I am new to Python as a programming language, but I do have experience in other languages. I am experiencing strange problems with File handling and wonder if anyone else has seen this or knows what I am doing wrong. I am simply trying to open a file

Re: File Handling Problems Python I/O

2005-01-06 Thread Arjen Dijkstra
I don't think we can help if you don't post some of your code. Regards, Arjen Josh wrote: Hi, I am having a problem with Python. I am new to Python as a programming language, but I do have experience in other languages. I am experiencing strange problems with File handling and wonder

RE: File Handling Problems Python I/O

2005-01-06 Thread Batista, Facundo
Title: RE: File Handling Problems Python I/O [Josh] #- able to do so without a problem, but here's the catch: The open #- statement is only working on certain files. I open a simple text file #- say file1.txt without any issues, but I change the open statement to #- another text file a

File Handling Problems Python I/O

2005-01-06 Thread Josh
Hi, I am having a problem with Python. I am new to Python as a programming language, but I do have experience in other languages. I am experiencing strange problems with File handling and wonder if anyone else has seen this or knows what I am doing wrong. I am simply trying to open a file for