Hi Dave,
Thanks for your reply with full function :) Great forum.. :)
On Sun, Feb 10, 2013 at 5:46 PM, David Hutto wrote:
> Here is the full function with an instance using the function:
>
> def text_wrapper(file_name = None, pre_text = None, text = None,
> post_text = None):
> f = open(
On Sun, Feb 10, 2013 at 11:45 AM, Morten Engvoldsen
wrote:
> Hi Dave,
> Thanks again for suggestion
No problem. I haven't used my python skills in a while, so I went
ahead and went through it fully.
--
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
--
http://mail.pytho
Here is the full function with an instance using the function:
def text_wrapper(file_name = None, pre_text = None, text = None,
post_text = None):
f = open(file_name, 'a')
f.write("%s\n%s\n%s\n" % (pre_text, text, post_text))
f.close()
text_wrapper(file_name = r"/home/dav
Hi Dave,
Thanks again for suggestion
On Sun, Feb 10, 2013 at 5:30 PM, David Hutto wrote:
> I haven't looked at text wrapper, but it would probably look
> something like this in a function, untested:
>
> def text_wrapper(file_name = None, pre_text = None, text = None,
> post_text = None):
>
Oops, I mean :
def text_wrapper(file_name = None, pre_text = None, text = None,
post_text = None):
f = open(file, 'a')
f.write("%s\n%s\n%s\n" % (pre_text, text, post_text)
f.close()
--
http://mail.python.org/mailman/listinfo/python-list
I haven't looked at text wrapper, but it would probably look
something like this in a function, untested:
def text_wrapper(file_name = None, pre_text = None, text = None,
post_text = None):
f = open(file, 'a')
f.write("%s\n%s\n%s\n" % (pre_text = None, text, post_text = None)
f.close(
Hi Dave,
This is good code, simple but makes the Coding Standard better.. Thanks to
all again
On Sun, Feb 10, 2013 at 5:01 PM, David Hutto wrote:
> Kind of like below:
>
> david@david-HP-Compaq-dc7600-Convertible-Minitower:~$ python
> Python 2.7.3 (default, Aug 1 2012, 05:16:07)
> [GCC 4.6.3] o
On Saturday, February 09, 2013 03:27:16 PM Morten Engvoldsen wrote:
> Hi Team,
> I Have saved my output in .doc file and want to format the output with
>
> *Start the File
>
> Some data here
>
>
> ***End of File*
>
Hi,
Thanks for your suggestion. This is a great forum for Python. :)
On Sun, Feb 10, 2013 at 4:12 PM, inq1ltd wrote:
> **
>
> On Saturday, February 09, 2013 03:27:16 PM Morten Engvoldsen wrote:
>
> > Hi Team,
>
> > I Have saved my output in .doc file and want to format the output with
>
> >
>
>
Hi Dave,
This sounds great, thanks for your help :)
On Sat, Feb 9, 2013 at 6:13 PM, Dave Angel wrote:
> On 02/09/2013 10:01 AM, Morten Engvoldsen wrote:
>
>> Hi Davea,
>> I am using Python 2.7.
>>
>>
> Sorry, I should have noticed the python version in the subject line, but
> didn't until this r
On 2/9/2013 11:21 AM, rusi wrote:
On Feb 9, 7:27 pm, Morten Engvoldsen wrote:
Hi Team,
I Have saved my output in .doc file and want to format the output with
*Start the File
Some data here
***End of File*
Can y
On 09/02/2013 14:27, Morten Engvoldsen wrote:
Hi Team,
I Have saved my output in .doc file and want to format the output with
*Start the File
Some data here
***End of File*
Can you let me know how can i do that using
On 02/09/2013 10:01 AM, Morten Engvoldsen wrote:
Hi Davea,
I am using Python 2.7.
Sorry, I should have noticed the python version in the subject line, but
didn't until this reply.
How about print >> outfile, "Start the File".center(55, "*")
after creating the file, and
print >> outfile, "
On Feb 9, 7:27 pm, Morten Engvoldsen wrote:
> Hi Team,
> I Have saved my output in .doc file and want to format the output with
>
> *Start the File
>
> Some data here
>
> ***End of File*
>
> Can you let me know how ca
Hi Davea,
I am using Python 2.7.
--
http://mail.python.org/mailman/listinfo/python-list
Morten Engvoldsen wrote:
> I know i can append "***Start file***" in the
> batchdata, but is there a better python code like multiply * into 10 times
> -- any python code i can add the formatting in dynamic way instead of
> hardcoding with "***Start file***
Hi Cain,
Thanks for your reply. I am stroning all the contents in "batchdate" and
then,
data = base64.encodestring(batchdata)
and then writing "data" in doc file.
I know i can append "***Start file***" in the
batchdata, but is there a better python code like multiply * into
On Sat, 9 Feb 2013 15:27:16 +0100
Morten Engvoldsen wrote:
> I Have saved my output in .doc file and want to format the output with
>
> *Start the File
>
> Some data here
>
>
> ***End of File*
>
> Can you let me
On 02/09/2013 09:27 AM, Morten Engvoldsen wrote:
Hi Team,
I Have saved my output in .doc file and want to format the output with
*Start the File
Some data here
***End of File*
Can you let me know how can i do th
> > I am having some difficulty generating the output I want from web
> > scraping. Specifically, the script I wrote, while it runs without any
> > errors, is not writing to the output file correctly. It runs, and
> > creates the output .txt file; however, the file is blan
runs without any
> > errors, is not writing to the output file correctly. It runs, and
> > creates the output .txt file; however, the file is blank (ideally it
> > should be populated with a list of names).
>
> > I took the base of a program that I had before for a dif
comcast.net> writes:
>
> Hello,
>
> I am having some difficulty generating the output I want from web
> scraping. Specifically, the script I wrote, while it runs without any
> errors, is not writing to the output file correctly. It runs, and
> creates the output .txt
On 4/26/2012 19:54, smac2...@comcast.net wrote:
> Hello,
>
> I am having some difficulty generating the output I want from web
> scraping. Specifically, the script I wrote, while it runs without any
> errors, is not writing to the output file correctly. It runs, and
> creates th
On 26/04/2012 18:54, smac2...@comcast.net wrote:
Hello,
I am having some difficulty generating the output I want from web
scraping. Specifically, the script I wrote, while it runs without any
errors, is not writing to the output file correctly. It runs, and
creates the output .txt file; however
Hello,
I am having some difficulty generating the output I want from web
scraping. Specifically, the script I wrote, while it runs without any
errors, is not writing to the output file correctly. It runs, and
creates the output .txt file; however, the file is blank (ideally it
should be populated
) Open the pickle file as above
(b) read the pickled object
(c) write the output to a file say "output.txt"
Can I have know if my above code is reading properly and how to write to an
output file 'output.txt'
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm having a small python script printing out UTF-8 characters.
# -*- coding: utf-8 -*-
print sys.stdout.encoding
s=u"abcdéfg" # string containing one non ASCII character
# just in case nntp kills it
for c in s:
print c
It work perfectly fine on my utf-8 capable terminal.
On Sep 8, 12:35 pm, MRAB wrote:
> Maggie wrote:
> > On Sep 8, 11:39 am, MRAB wrote:
> >> Maggie wrote:
> >>> My code is supposed to enumerate each line of file (1, 2, 3...) and
> >>> write the new version into the output file --
> >>> #
Maggie wrote:
On Sep 8, 11:39 am, MRAB wrote:
Maggie wrote:
My code is supposed to enumerate each line of file (1, 2, 3...) and
write the new version into the output file --
#!/usr/bin/python
import os.path
import csv
import sys
#name of output file
filename = "OUTPUT.txt"
#open the
On Tuesday 08 September 2009 17:22:30 Maggie wrote:
> My code is supposed to enumerate each line of file (1, 2, 3...) and
> write the new version into the output file --
>
> #!/usr/bin/python
>
> import os.path
> import csv
> import sys
>
> #name of output
On Sep 8, 11:39 am, MRAB wrote:
> Maggie wrote:
> > My code is supposed to enumerate each line of file (1, 2, 3...) and
> > write the new version into the output file --
>
> > #!/usr/bin/python
>
> > import os.path
> > import csv
> > impor
Maggie wrote:
My code is supposed to enumerate each line of file (1, 2, 3...) and
write the new version into the output file --
#!/usr/bin/python
import os.path
import csv
import sys
#name of output file
filename = "OUTPUT.txt"
#open the file
test = open ("test.txt", &q
My code is supposed to enumerate each line of file (1, 2, 3...) and
write the new version into the output file --
#!/usr/bin/python
import os.path
import csv
import sys
#name of output file
filename = "OUTPUT.txt"
#open the file
test = open ("test.txt", "r")
#re
On Jan 24, 3:25 pm, whatazor wrote:
> Hi all,
> I start to use this module in order to produce xml( and the make other
> things), but differently from gccxml I don't find the variable that
> set the name of the xml output file after the parsing (in gccxml is -
> fxml), so
Hi all,
I start to use this module in order to produce xml( and the make other
things), but differently from gccxml I don't find the variable that
set the name of the xml output file after the parsing (in gccxml is -
fxml), so it creates temporary files.
how can I do an Is there a tutorial
<[EMAIL PROTECTED]> wrote:
> I am using the print function in my python script.
> Can you please tell me what can I do to redirect the output to an file?
f = open('aaargh', 'w')
print>>f, 'killew wabbit'
Alex
--
http://mail.python.org/mailman/listinfo/python-list
http://diveintopython.org/scripts_and_streams/stdin_stdout_stderr.html
example 10.9 , redurectung output
--
http://mail.python.org/mailman/listinfo/python-list
I am using the print function in my python script.
Can you please tell me what can I do to redirect the output to an file?
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
> 1. How can I add a standard module named "datetime" in
> Jython when the error happens :"Traceback (innermost
> last):
> File "C:\python\test.py", line 3, in ?
> ImportError: no module named datetime "
> The line 3 is writen: "from datetime import datetime,
> tzinfor"
>
The datetime module wa
Hi, all
I have some questions to ask:
1. How can I add a standard module named "datetime" in
Jython when the error happens :"Traceback (innermost
last):
File "C:\python\test.py", line 3, in ?
ImportError: no module named datetime "
The line 3 is writen: "from datetime import datetime,
tzinfo
Thanks Steve. Appreciate it!
S
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Samantha wrote:
>> input = open(r'C:\Documents and
>> Settings\Owner\Desktop\somefile.html','r')
>> L = input.readlines()
>> input.close
>>
>> output = open(r'C:\Documents and
>> Setting
Samantha wrote:
input = open(r'C:\Documents and Settings\Owner\Desktop\somefile.html','r')
L = input.readlines()
input.close
output = open(r'C:\Documents and
Settings\Owner\Desktop\somefile_test.html','w')
for t in range(len(L)):
output.writelines(L[t])
output.close
I think you want to do [1]:
in
Is there a limit on the size of the file Python will read then output. I am
reading a file of 433 lines and when I output the same file it only will
output 421 lines. The last line is cut off also. This is the code I am using
as a test.
input = open(r'C:\Documents and Settings\Owner\Desktop\som
ok thanks
it works
S.
"Kent Johnson" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
> simon.alexandre wrote:
> > Hi all,
> >
> > I use csv module included in python 2.3. I use the writer and encouter
the
> > following p
simon.alexandre wrote:
Hi all,
I use csv module included in python 2.3. I use the writer and encouter the
following problem: in my output file (.csv) there is a duplication of the
end of line character, so when I open the csv file in Ms-Excel a blank line
is inserted between each data line.
From
simon.alexandre wrote:
> I use csv module included in python 2.3. I use the writer and encouter the
> following problem: in my output file (.csv) there is a duplication of the
> end of line character, so when I open the csv file in Ms-Excel a blank
> line is inserted between ea
Hi all,
I use csv module included in python 2.3. I use the writer and encouter the
following problem: in my output file (.csv) there is a duplication of the
end of line character, so when I open the csv file in Ms-Excel a blank line
is inserted between each data line.
OS: W2k
Someone has an
47 matches
Mail list logo