On Thursday, 28 May 2020 03:07:48 UTC+8, Peter Otten wrote:
> BBT wrote:
>
> > I tried your code by replacing the Document portion:
>
> > But I received an error:
> > TypeError: __init__() takes 1 positional argument but 2 were given
>
> We seem to have different ideas of what replacing means.
BBT wrote:
> I tried your code by replacing the Document portion:
> But I received an error:
> TypeError: __init__() takes 1 positional argument but 2 were given
We seem to have different ideas of what replacing means.
Here is the suggested script spelt out:
import xlsxwriter
from docx.api i
On Thursday, 28 May 2020 02:40:49 UTC+8, Peter Otten wrote:
> BBT wrote:
>
> > On Thursday, 28 May 2020 01:36:26 UTC+8, Peter Otten wrote:
> >> BBT wrote:
> >>
> >> > I am trying to parse a word (.docx) for tables, then copy these tables
> >> > over to excel using xlsxwriter. This is my code:
>
On Thursday, 28 May 2020 02:40:49 UTC+8, Peter Otten wrote:
> BBT wrote:
>
> > On Thursday, 28 May 2020 01:36:26 UTC+8, Peter Otten wrote:
> >> BBT wrote:
> >>
> >> > I am trying to parse a word (.docx) for tables, then copy these tables
> >> > over to excel using xlsxwriter. This is my code:
>
BBT wrote:
> On Thursday, 28 May 2020 01:36:26 UTC+8, Peter Otten wrote:
>> BBT wrote:
>>
>> > I am trying to parse a word (.docx) for tables, then copy these tables
>> > over to excel using xlsxwriter. This is my code:
>> >
>> > from docx.api import Document
>> > import xlsxwriter
>> >
>> >
On Thursday, 28 May 2020 01:36:26 UTC+8, Peter Otten wrote:
> BBT wrote:
>
> > I am trying to parse a word (.docx) for tables, then copy these tables
> > over to excel using xlsxwriter. This is my code:
> >
> > from docx.api import Document
> > import xlsxwriter
> >
> > document = Document('/U
BBT wrote:
> I am trying to parse a word (.docx) for tables, then copy these tables
> over to excel using xlsxwriter. This is my code:
>
> from docx.api import Document
> import xlsxwriter
>
> document = Document('/Users/xxx/Documents/xxx/Clauses Sample - Copy v1 -
> for merge.docx') tables = d
The second _io_BufferedWriter_write_impl call is for show warning like
"ResourceWarning: unclosed file <_io.BufferedRandom name='myfile'>"
Try `f.close()`, or `with open(...)`.
On Thu, May 30, 2019 at 12:03 PM Windson Yang wrote:
>
> My script looks like this:
>
> f = open('myfile', 'a+b')
>
Ganesh Pal wrote:
> Hi Team
There is no team, just some random guys on the net. Sorry to disappoint
you...
> I need to write the values of an ordered dictionary into a file . All
> values should be in a single row with a header list
>
>
>
> *Example:*
>
>
>
> *student = [("NAME", "John"),
On 2018-06-21 18:11, Ganesh Pal wrote:
> Hi Team
>
> I need to write the values of an ordered dictionary into a file . All
> values should be in a single row with a header list
>
> *Example:*
>
> *student = [("NAME", "John"),*
> * ("AGE", 28),*
> * ("SCORE", 13),*
> *
On Thu, 21 Jun 2018 22:41:48 +0530, Ganesh Pal wrote:
[snip]
[what I think OP wants:]
>
> *.*
>
> *||STUDENT NAME||STUDENT AGE||MARKS SCORED||PASSED YEAR||FEES PAID||*
>
> *||John|| 28 || 13|| 2018 || 250
On Sunday, 6 May 2018 10:48:12 UTC+5:30, Chris Angelico wrote:
> On Sun, May 6, 2018 at 3:10 PM, Sharan Basappa
> wrote:
> > On Saturday, 5 May 2018 21:47:33 UTC+5:30, Steven D'Aprano wrote:
> >> On Sat, 05 May 2018 08:45:39 -0700, Sharan Basappa wrote:
> >>
> >> > Thanks a lot. I have actually
On Sun, May 6, 2018 at 3:10 PM, Sharan Basappa wrote:
> On Saturday, 5 May 2018 21:47:33 UTC+5:30, Steven D'Aprano wrote:
>> On Sat, 05 May 2018 08:45:39 -0700, Sharan Basappa wrote:
>>
>> > Thanks a lot. I have actually tried print with file handle as a
>> > parameter (the last option). I see th
On Saturday, 5 May 2018 21:47:33 UTC+5:30, Steven D'Aprano wrote:
> On Sat, 05 May 2018 08:45:39 -0700, Sharan Basappa wrote:
>
> > Thanks a lot. I have actually tried print with file handle as a
> > parameter (the last option). I see that the file is created but nothing
> > is logged.
>
> That
On Saturday, 5 May 2018 22:05:53 UTC+5:30, Mark Lawrence wrote:
> On 05/05/18 12:25, Sharan Basappa wrote:
> > In my program, I have print statements for debugging.
> > However, these are cluttering the display. So, I am trying to save
> > these to a file but somehow I cant seem to get it correct.
On 05/05/18 12:25, Sharan Basappa wrote:
In my program, I have print statements for debugging.
However, these are cluttering the display. So, I am trying to save
these to a file but somehow I cant seem to get it correct.
Use the logging module https://docs.python.org/3/library/logging.html
for
On Sat, 05 May 2018 08:45:39 -0700, Sharan Basappa wrote:
> Thanks a lot. I have actually tried print with file handle as a
> parameter (the last option). I see that the file is created but nothing
> is logged.
That could be a file buffer issue. Nothing will actually be written to
the disk until
On Saturday, 5 May 2018 19:00:12 UTC+5:30, Steven D'Aprano wrote:
> On Sat, 05 May 2018 04:25:50 -0700, Sharan Basappa wrote:
>
> > In my program, I have print statements for debugging. However, these are
> > cluttering the display. So, I am trying to save these to a file but
> > somehow I cant s
On Sat, 05 May 2018 04:25:50 -0700, Sharan Basappa wrote:
> In my program, I have print statements for debugging. However, these are
> cluttering the display. So, I am trying to save these to a file but
> somehow I cant seem to get it correct.
There are lots of way to solve this problem.
The bes
On Thu, 14 Dec 2017 09:08 pm, ayaskant.mantu...@gmail.com wrote:
> Hi,
>
> I want to replace the spaces in a sting with hyphen with my own replace
> function or with using the pre-defined replace function. Can anybody help me
> with this issue???
new_string = "string with spaces".replace(" ", "h
On Thu, Dec 14, 2017 at 9:08 PM, wrote:
> Hi,
>
> I want to replace the spaces in a sting with hyphen with my own replace
> function or with using the pre-defined replace function.
> Can anybody help me with this issue???
>
Ahh, the old "I want to" as a prefix for a homework assignment.
Start
On 7/14/17, Steve D'Aprano wrote:
> On Fri, 14 Jul 2017 09:06 am, Ned Batchelder wrote:
>
>> Steve's summary is qualitatively right, but a little off on the
>> quantitative
>> details. Lists don't resize to 2*N, they resize to ~1.125*N:
>>
>> new_allocated = (size_t)newsize + (newsize >> 3) +
On Fri, 14 Jul 2017 09:06 am, Ned Batchelder wrote:
> Steve's summary is qualitatively right, but a little off on the quantitative
> details. Lists don't resize to 2*N, they resize to ~1.125*N:
>
> new_allocated = (size_t)newsize + (newsize >> 3) + (newsize < 9 ? 3 : 6);
>
> (https://github
Rustom Mody writes:
> Yeah I know append method is supposedly O(1).
It's amortized O(1).
--
https://mail.python.org/mailman/listinfo/python-list
On Thursday, July 13, 2017 at 10:59:52 AM UTC-4, Pavol Lisy wrote:
> On 7/13/17, Steve D'Aprano wrote:
>
> > [1] Actually, CPython's lists initially quadruple the size of the array, up
> > to a
> > certain point, and then switch to doubling. This ensures that small lists
> > have
> > even fewer e
On Fri, Jul 14, 2017 at 2:26 AM, Steve D'Aprano
wrote:
> On Fri, 14 Jul 2017 01:09 am, Rustom Mody wrote:
>
>> Couple that with the fact that space-time are not unrelated on any modern VM
>> based OS + cache based hw. Doubly so for "managed" languages where gc buys
>> space for time.
>
> I don't u
On 7/13/17, Steve D'Aprano wrote:
> On Fri, 14 Jul 2017 12:59 am, Pavol Lisy wrote:
>
>> On 7/13/17, Steve D'Aprano wrote:
>>
>>> [1] Actually, CPython's lists initially quadruple the size of the array,
>>> up
>>> to a
>>> certain point, and then switch to doubling. This ensures that small lists
On Fri, 14 Jul 2017 12:59 am, Pavol Lisy wrote:
> On 7/13/17, Steve D'Aprano wrote:
>
>> [1] Actually, CPython's lists initially quadruple the size of the array, up
>> to a
>> certain point, and then switch to doubling. This ensures that small lists
>> have
>> even fewer expensive resizes, at th
On Fri, 14 Jul 2017 01:09 am, Rustom Mody wrote:
> Couple that with the fact that space-time are not unrelated on any modern VM
> based OS + cache based hw. Doubly so for "managed" languages where gc buys
> space for time.
I don't understand that comment. Space/time have *never* been unrelated.
On 13/07/17 16:09, Rustom Mody wrote:
Pavol Lisy wrote:
IMHO problem is doubling size for huge lists.
Or waste big memory for huge frozensets. I mean resize it to 2*N if
its size is just N+1.
Couple that with the fact that space-time are not unrelated on any modern VM based OS +
cache base
Pavol Lisy wrote:
> IMHO problem is doubling size for huge lists.
> Or waste big memory for huge frozensets. I mean resize it to 2*N if
> its size is just N+1.
Couple that with the fact that space-time are not unrelated on any modern VM
based OS + cache based hw. Doubly so for "managed" langua
On 7/13/17, Steve D'Aprano wrote:
> [1] Actually, CPython's lists initially quadruple the size of the array, up
> to a
> certain point, and then switch to doubling. This ensures that small lists
> have
> even fewer expensive resizes, at the cost of wasting a bit more memory, but
> its
> only a sm
On Thu, 13 Jul 2017 10:10 pm, Rustom Mody wrote:
> Yeah I know append method is supposedly O(1).
> I find that surprising...
> More so when the article
> https://wiki.python.org/moin/TimeComplexity
> talks of average case Vs amortized-worst case(!) Whatever does that mean?
"Average case" refers
Marko wrote:
> Simple, yes, but is the worst case
> insertion/deletion time still within
> O(log n)?
Good point; and needs to be applied to Steven's
append-using OP as well
Yeah I know append method is supposedly O(1).
I find that surprising...
More so when the article
https://wiki.python.or
Paul Rubin :
> Chris Angelico writes:
>> Maybe I'm completely on the wrong track here, but the last time I
>> implemented a self-balancing tree, it usually involved a fair amount
>> of mutation.
>
> AVL trees are fairly simple to implement without mutation. Red-black
> trees are traditionally im
Chris Angelico writes:
> Maybe I'm completely on the wrong track here, but the last time I
> implemented a self-balancing tree, it usually involved a fair amount
> of mutation.
AVL trees are fairly simple to implement without mutation. Red-black
trees are traditionally implemented with mutation,
On Thu, Jul 13, 2017 at 6:15 PM, Paul Rubin wrote:
> Chris Angelico writes:
>> some point it'll need to be rebalanced, which could at worst case
>> be O(n).
>
> No, you use a structure like an AVL tree or red-black tree, so it's
> within a constant factor of balanced after each insertion. You re
Chris Angelico writes:
> some point it'll need to be rebalanced, which could at worst case
> be O(n).
No, you use a structure like an AVL tree or red-black tree, so it's
within a constant factor of balanced after each insertion. You rewrite
O(log n) of the nodes, and juggle around a constant nu
On Wed, Jul 12, 2017 at 7:52 PM, Paul Rubin wrote:
> Not so easily in Python since the built-in list and dict types are
> designed for mutation update. In Haskell, the list type is a linked
> list and the dictionary type is a balanced tree. So, you can make a new
> list consisting of a new item
Steven D'Aprano writes:
> for parrot in parrots:
> accumulator[parrot.colour].append(parrot)
>
> That's pretty compact and understandable, but it require mutating a bunch
> of pre-allocated lists inside an accumulator. Can we re-write this in a
> functional sty
On Wed, 12 Jul 2017 17:47:50 +1200, Gregory Ewing wrote:
> Steve D'Aprano wrote:
>> - Greg's dict comprehension version requires N+1 passes through the
>> data,
>> one to convert to a list, and 1 per each possible key.
>
> Just to be clear, my solution was a response to the requirement that it
n': [], 'red': []}
> > for parrot in parrots:
> > accumulator[parrot.colour].append(parrot)
> >
> >
> > That's pretty compact and understandable, but it require mutating a bunch
> > of pre-allocated lists inside an accumulator. Can we re-write
Steve D'Aprano wrote:
- Greg's dict comprehension version requires N+1 passes through the data,
one to convert to a list, and 1 per each possible key.
Just to be clear, my solution was a response to the requirement
that it be written in a purely functional style. It's not now I
would actually
On Tue, 11 Jul 2017 04:58 pm, Chris Angelico wrote:
> On Tue, Jul 11, 2017 at 4:11 PM, Steven D'Aprano wrote:
[...]
>> accumulator = {'blue': [], 'green': [], 'red': []}
>> for parrot in parrots:
>> accumulator[parrot.colour].append(parrot)
[...]
> It's a partitioning filter. (Three way, not
;
> That's pretty compact and understandable, but it require mutating a bunch
> of pre-allocated lists inside an accumulator. Can we re-write this in a
> functional style?
>
> The obvious answer is "put it inside a function, then pretend it works by
> magic" but my colleag
7;: [], 'red': []}
>> for parrot in parrots:
>> accumulator[parrot.colour].append(parrot)
>>
>>
>> That's pretty compact and understandable, but it require mutating a bunch
>> of pre-allocated lists inside an accumulator. Can we re-write this
x27;s pretty compact and understandable, but it require mutating a bunch
> of pre-allocated lists inside an accumulator. Can we re-write this in a
> functional style?
Here is a sketch in OCaml-style (incomplete of course):
type color = Blue | Green | Red;;
type parrot = { c: color; ... };;
quire mutating a bunch
of pre-allocated lists inside an accumulator. Can we re-write this in a
functional style?
The obvious answer is "put it inside a function, then pretend it works by
magic" but my colleague's reply to that is "Yes, but I'll know that its
actually doing mu
#x27;s pretty compact and understandable, but it require mutating a bunch
> of pre-allocated lists inside an accumulator. Can we re-write this in a
> functional style?
>
> The obvious answer is "put it inside a function, then pretend it works by
> magic" but my colleague
parrot)
>
>
> That's pretty compact and understandable, but it require mutating a bunch
> of pre-allocated lists inside an accumulator. Can we re-write this in a
> functional style?
>
> The obvious answer is "put it inside a function, then pretend it works by
> magic&q
quire mutating a bunch
of pre-allocated lists inside an accumulator. Can we re-write this in a
functional style?
The obvious answer is "put it inside a function, then pretend it works by
magic" but my colleague's reply to that is "Yes, but I'll know that its
actually doin
Steven D'Aprano wrote:
Help me humour my colleague.
class Parrot:
def __init__(self, color, species, status):
self.color = color
self.species = species
self.status = status
def __repr__(self):
return "%s/%s/%s" % (self.species, self.color, self.status)
On 2017-04-21 12:58, Mohammed Ahmed wrote:
> Write a function sorting(L) that takes a list of numbers and
> returns the list with all elements sorted in ascending order.
> Note: do not use the sort built in function
>
> it is a python question
No "sort" functions here...
>>> lst=[3,1,4,1,5,9,2
On 21/04/2017 21:04, Mohammed Ahmed wrote:
On Friday, April 21, 2017 at 10:02:55 PM UTC+2, Chris Angelico wrote:
On Sat, Apr 22, 2017 at 5:58 AM, Mohammed Ahmed wrote:
Write a function sorting(L) that takes a list of numbers and returns the list
with all
elements sorted in ascending order.
No
On 04/21/2017 01:01 PM, Mohammed Ahmed wrote:
Write a function group(L) that takes a list of integers. The function returns a
list of
two lists one containing the even values and another containing the odd values.
it is a python question
In fact, this is *not* a question, Python or otherwise.
On Fri, Apr 21, 2017 at 2:01 PM, Mohammed Ahmed wrote:
> Write a function group(L) that takes a list of integers. The function returns
> a list of
> two lists one containing the even values and another containing the odd
> values.
>
> it is a python question
This group will be happy to help you
On 04/21/2017 01:58 PM, Mohammed Ahmed wrote:
> Write a function sorting(L) that takes a list of numbers and returns the list
> with all
> elements sorted in ascending order.
> Note: do not use the sort built in function
>
> it is a python question
Sounds like a basic homework question.
Which p
On 04/21/2017 01:04 PM, Mohammed Ahmed wrote:
On Friday, April 21, 2017 at 10:02:55 PM UTC+2, Chris Angelico wrote:
On Sat, Apr 22, 2017 at 5:58 AM, Mohammed Ahmed wrote:
Write a function sorting(L) that takes a list of numbers and returns the list
with all
elements sorted in ascending order.
On Sat, Apr 22, 2017 at 6:04 AM, Mohammed Ahmed wrote:
> On Friday, April 21, 2017 at 10:02:55 PM UTC+2, Chris Angelico wrote:
>> On Sat, Apr 22, 2017 at 5:58 AM, Mohammed Ahmed
>> wrote:
>> > Write a function sorting(L) that takes a list of numbers and returns the
>> > list with all
>> > eleme
On Friday, April 21, 2017 at 10:02:55 PM UTC+2, Chris Angelico wrote:
> On Sat, Apr 22, 2017 at 5:58 AM, Mohammed Ahmed wrote:
> > Write a function sorting(L) that takes a list of numbers and returns the
> > list with all
> > elements sorted in ascending order.
> > Note: do not use the sort built
On Friday, April 21, 2017 at 10:01:40 PM UTC+2, alister wrote:
> On Fri, 21 Apr 2017 12:58:52 -0700, Mohammed Ahmed wrote:
>
> > Write a function sorting(L) that takes a list of numbers and returns the
> > list with all elements sorted in ascending order.
> > Note: do not use the sort built in fun
On Fri, 21 Apr 2017 12:58:52 -0700, Mohammed Ahmed wrote:
> Write a function sorting(L) that takes a list of numbers and returns the
> list with all elements sorted in ascending order.
> Note: do not use the sort built in function
>
> it is a python question
& the reason for this question is wha
On Sat, Apr 22, 2017 at 5:58 AM, Mohammed Ahmed wrote:
> Write a function sorting(L) that takes a list of numbers and returns the list
> with all
> elements sorted in ascending order.
> Note: do not use the sort built in function
>
> it is a python question
Yes, it is. It looks like the sort of
Hi,
there are many possible solutions.
You'll need a serialiser to convert the Python object into bytes.
If you wan't to access the data from other applications, you can use json,
xml or other well known formats. Json and XML is in the Python standard
library.
You can also use a database.
As jso
On 16-4-2017 14:28, jorge.conr...@cptec.inpe.br wrote:
> Hi,
>
> I'm new on Python software. I would like to write on disk arrays in binary or
> ascii
> format. Can someone please help me?
>
> Thanks,
>
> Conrado
What kind of data is in the arrays?
Who or what will be reading the files?
And mo
On Tuesday, November 17, 2015 at 1:14:56 AM UTC+8, SW wrote:
> hi,
> I am trying to write Excel file suing output from another software where the
> output comes as myturnlist.Show()
>
> The first part is for the output from the software which is saved in the
> clipboard.
>
> The big middle pa
On Mon, Nov 16, 2015 at 11:20 AM, Michiel Overtoom wrote:
>
> Hi,
>
>> On 16 Nov 2015, at 18:14, syedmwaliul...@gmail.com wrote:
>> For some reason it doesn't save the file.
>
> Did you get an error message?
>
>> excel.activeWorkbook.SaveAs ("c:\TurnData.xlsx")
>
> When you use backslashes in stri
Hi,
> On 16 Nov 2015, at 18:14, syedmwaliul...@gmail.com wrote:
> For some reason it doesn't save the file.
Did you get an error message?
> excel.activeWorkbook.SaveAs ("c:\TurnData.xlsx")
When you use backslashes in strings, don't forget to escape them:
> excel.activeWorkbook.SaveAs("c:\\Tur
That worked, Thanks!
Vincent Davis
720-301-3003
On Thu, Oct 15, 2015 at 6:11 AM, Peter Otten <__pete...@web.de> wrote:
> Oscar Benjamin wrote:
>
> > On 15 October 2015 at 09:16, Peter Otten <__pete...@web.de> wrote:
> >>
> >> def preprocess(filename):
> >> with open(filename) as f:
> >>
Oscar Benjamin wrote:
> On 15 October 2015 at 09:16, Peter Otten <__pete...@web.de> wrote:
>>
>> def preprocess(filename):
>> with open(filename) as f:
>> for row in csv.reader(f):
>> # do stuff
>> yield row
>>
>> rows = preprocess("pandas.csv")
>
> Take the wi
On 15 October 2015 at 09:16, Peter Otten <__pete...@web.de> wrote:
>
> def preprocess(filename):
> with open(filename) as f:
> for row in csv.reader(f):
> # do stuff
> yield row
>
> rows = preprocess("pandas.csv")
Take the with statement outside of the generator
Vincent Davis wrote:
> I have a csv file I have to make some changes to before I read it into
> pandas. Currently I open the csv read each row, make changes and save it
> to a new file. Then read it into pandas with pandas.read_csv(). How do I
> skip writing the file to disk? Using python3.5.
>
>
On 31Jul2015 18:26, Chris Angelico wrote:
On Fri, Jul 31, 2015 at 6:15 PM, Cameron Simpson wrote:
For example, bash lacks
decent timezone support, so I can well believe random832's guess that
your five-hour offset is a simulation of that; but Python can do much
better work with timezones, so y
On Sat, Aug 1, 2015 at 12:26 AM, Grant Edwards wrote:
> On 2015-07-31, Chris Angelico wrote:
>
>> There are two basic approaches to this kind of job.
>>
>> 1) Go through every line of bash code and translate it into
>>equivalent Python code. You should then have a Python script which
>>bl
On 2015-07-31, Chris Angelico wrote:
> There are two basic approaches to this kind of job.
>
> 1) Go through every line of bash code and translate it into
>equivalent Python code. You should then have a Python script which
>blindly and naively accomplishes the same goal by the same method
[X-Post & F'up2 comp.unix.shell]
Chris Angelico wrote:
> On Fri, Jul 31, 2015 at 6:15 PM, Cameron Simpson wrote:
>> Actually, bash has no timezone support but the date command _does_, and
>> probably neither better nor worse than Python. All one has to do is set
>> the TZ environment variable, e
On Fri, Jul 31, 2015 at 6:15 PM, Cameron Simpson wrote:
>> For example, bash lacks
>> decent timezone support, so I can well believe random832's guess that
>> your five-hour offset is a simulation of that; but Python can do much
>> better work with timezones, so you can get that actually correct.
On 31Jul2015 17:47, Chris Angelico wrote:
On Fri, Jul 31, 2015 at 4:31 AM, wrote:
#!/bin/bash
[...]
_year=$(date -d "-5 hour" +%Y)
_month=$(date -d "-5 hour" +%m)
[...]
For example, bash lacks
decent timezone support, so I can well believe random832's guess that
your five-hour offset is a
On Fri, Jul 31, 2015 at 4:31 AM, wrote:
> #!/bin/bash
>
> _maillist='pa...@email.com'
> _hname=`hostname`
> _logdir=/hadoop/logs
> _dirlog=${_logdir}/directory_check.log
>
> _year=$(date -d "-5 hour" +%Y)
> _month=$(date -d "-5 hour" +%m)
> _day=$(date -d "-5 hour" +%d)
> _hour=$(date -d "-5 hour
On Thu, Jul 30, 2015, at 14:31, sutanu@gmail.com wrote:
> _year=$(date -d "-5 hour" +%Y)
> _month=$(date -d "-5 hour" +%m)
> _day=$(date -d "-5 hour" +%d)
> _hour=$(date -d "-5 hour" +%H)
What is the purpose of the -5 hour offset? Is it an attempt to
compensate for timezones?
--
https://mail.
On 30/07/2015 19:31, sutanu@gmail.com wrote:
#!/bin/bash
_maillist='pa...@email.com'
_hname=`hostname`
_logdir=/hadoop/logs
_dirlog=${_logdir}/directory_check.log
_year=$(date -d "-5 hour" +%Y)
_month=$(date -d "-5 hour" +%m)
_day=$(date -d "-5 hour" +%d)
_hour=$(date -d "-5 hour" +%H)
_hd
#!/bin/bash
_maillist='pa...@email.com'
_hname=`hostname`
_logdir=/hadoop/logs
_dirlog=${_logdir}/directory_check.log
_year=$(date -d "-5 hour" +%Y)
_month=$(date -d "-5 hour" +%m)
_day=$(date -d "-5 hour" +%d)
_hour=$(date -d "-5 hour" +%H)
_hdfsdir=`hdfs dfs -ls -d /hadoop/flume_ingest_*/$_yea
thanks for the reply i have resolve with the r'.'
i have another question on linux i write cp -Ruv source destination
There is one way to do it in python?
with shutil there is copythree but if the dest dir exist he give back an error.
Can you give me some ideas
Thanks
Luca
--
https://ma
On Thu, Jan 29, 2015 at 5:05 AM, Mark Lawrence wrote:
> Windows will accept forward slashes in path names.
Normally, yes. Does that work for UNC names too?
//server/share/pathname ? In any case, that's an alternative solution
to the same problem.
ChrisA
--
https://mail.python.org/mailman/listin
On 28/01/2015 14:12, Chris Angelico wrote:
On Thu, Jan 29, 2015 at 12:38 AM, MRAB wrote:
On 2015-01-28 13:22, luca72 wrote:
Hello i'm under windows, i have to write a file from my computer to a
local server like taht "\\DOCUMENTALE\my_folder\".
How i have to proceed ?
That's a path to a fol
On Thu, Jan 29, 2015 at 12:38 AM, MRAB wrote:
> On 2015-01-28 13:22, luca72 wrote:
>>
>> Hello i'm under windows, i have to write a file from my computer to a
>> local server like taht "\\DOCUMENTALE\my_folder\".
>> How i have to proceed ?
>>
> That's a path to a folder that just happens to be on
On 2015-01-28 13:22, luca72 wrote:
Hello i'm under windows, i have to write a file from my computer to a
local server like taht "\\DOCUMENTALE\my_folder\".
How i have to proceed ?
That's a path to a folder that just happens to be on another computer on
your network. Treat it the same way you wo
Marko Rauhamaa writes:
> Let me mention a related problem I ran into a couple of weeks ago.
> Linux's standard C library (glibc) implements fread(3) differently in
> RHEL 5 and RHEL 6/7. In RHEL 5, it blocks in a loop until it has read in
> the desired number of records. In RHEL 6 and 7, it appea
Alan Bawden :
> You might be right, because nothing in the Python 2 documentation I
> can find _explicitly_ says that file.write() is guaranteed to write
> everything I told it to, but that seems like a sufficiently surprising
> fact that I would expect the documentation to emphasize the danger.
Tal Bar-Or wrote:
> I am tryin to figure how to write a list i have as follows
> To a a csv to for example the 3rd column , i am really got stacked here i
> tried few codes with csv.writerow() but didn't got it work ,will really
> appreciate if someone could help me with that Please advice Thanks
First, you should consider reading the documentation of
struct.unpack_from and struct.pack_into at
http://docs.python.org/library/struct.html quite carefully. It says,
that these commands take a parameter called offset, which names the
location of the data in a buffer (e.g. an opened file).
exampl
On Sat, Oct 6, 2012 at 11:26 PM, Grant Edwards wrote:
> On 2012-10-06, Dennis Lee Bieber wrote:
>> On Fri, 5 Oct 2012 20:27:36 -0700 (PDT), palmeira
>> declaimed the following in gmane.comp.python.general:
>>
>>>
>>> #WRITE
>>> fb=open('testOUT.bin')
>>
>> Unless you specify otherwise, ope
On 2012-10-06, Dennis Lee Bieber wrote:
> On Fri, 5 Oct 2012 20:27:36 -0700 (PDT), palmeira
> declaimed the following in gmane.comp.python.general:
>
>>
>> #WRITE
>> fb=open('testOUT.bin')
>
> Unless you specify otherwise, open() defaults to read-only
It also defaults to 'text' mode which
palmeira wrote:
> Dear pythonists,
>
> I'm having a problem with read/write binary in python.
> I have a binary file that I need to read information, extract a array,
> modify this array and put these values into file again in same binary
> format.
> I need to use unpack_from and pack_into becaus
On Sat, Oct 6, 2012 at 1:27 PM, palmeira wrote:
> import struct
> bloco='>%df' %(252) #Binary format
>
> # READ
> fa=open('testIN.bin')
> my_array=struct.unpack_from(bloco,fa.read()[0*4:251*4])# my_aray = 252
> elements array
> ## This read is OK!
>
> #WRITE
> fb=open('testOUT.bin')
> test=st
palmeira於 2012年10月6日星期六UTC+8上午11時27分47秒寫道:
> Dear pythonists,
>
>
>
> I'm having a problem with read/write binary in python.
>
> I have a binary file that I need to read information, extract a array,
>
> modify this array and put these values into file again in same binary
>
> format.
>
> I
On 30 September 2012 09:26, Chris Angelico wrote:
> On Sun, Sep 30, 2012 at 6:51 AM, Tim Delaney
> wrote:
> > Personally I voted for the Fierce Snake[1][2] as the delimiter, but it
> was
> > voted down as "not Pythonic" enough.
> > I'm sure they were using that as a euphamism for "Python*ish*" t
On Sun, Sep 30, 2012 at 6:51 AM, Tim Delaney
wrote:
> Personally I voted for the Fierce Snake[1][2] as the delimiter, but it was
> voted down as "not Pythonic" enough.
> I'm sure they were using that as a euphamism for "Python*ish*" though.
>
> [1] https://en.wikipedia.org/wiki/Inland_Taipan
> [2]
On 29 September 2012 20:05, Chris Angelico wrote:
> On Sat, Sep 29, 2012 at 7:38 PM, Mark Lawrence
> wrote:
> >
> > My understanding is that Python 3.3 has regressed the performance of ''.
> > Surely the Python devs can speed the performance back up and, just for
> us,
> > use less memory at the
On Sat, Sep 29, 2012 at 3:38 AM, Mark Lawrence wrote:
> My understanding is that Python 3.3 has regressed the performance of ''.
> Surely the Python devs can speed the performance back up and, just for us,
> use less memory at the same time?
At least it will be stored as a Latin-1 '' for efficien
1 - 100 of 361 matches
Mail list logo