Re: Saving/exporting plots from Jupyter-labs?

2022-02-21 Thread Martin Schöön
Den 2022-02-14 skrev Martin Schöön : > > Now I am trying out Jupyter-labs. I like it. I have two head- > scratchers for now: > > 2) Why is Jupyter-labs hooking up to Google-analytics? Now I can answer this one myself. In a tab I had been working my way through a Holoviews tutorial. The tutorial d

Re: Saving/exporting plots from Jupyter-labs?

2022-02-15 Thread Martin Schöön
Den 2022-02-15 skrev Reto : > On Mon, Feb 14, 2022 at 08:54:01PM +, Martin Schöön wrote: >> 1) In notebooks I can save a plot by right-clicking on it and do >> save image as. In Jupyter-lab that does not work and so far I >> have not been able to figure out how to do it. Yes, I have looked >> i

Re: Saving/exporting plots from Jupyter-labs?

2022-02-14 Thread Reto
On Mon, Feb 14, 2022 at 08:54:01PM +, Martin Schöön wrote: > 1) In notebooks I can save a plot by right-clicking on it and do > save image as. In Jupyter-lab that does not work and so far I > have not been able to figure out how to do it. Yes, I have looked > in the documentation. Shift + righ

Saving/exporting plots from Jupyter-labs?

2022-02-14 Thread Martin Schöön
I have used Jupyter notebooks for some time now. I am not a heavy or advanced user. I find the notebook format a nice way to create python documents. Now I am trying out Jupyter-labs. I like it. I have two head- scratchers for now: 1) In notebooks I can save a plot by right-clicking on it and do

Re: Recommendation for drawing graphs and creating tables, saving as PDF

2021-06-12 Thread Chris Nyland
If you don't want to have to do any layout, Graphviz, which you mentioned, is probably the best and there are/were Python libraries that will let you control it to automatically produce files. The whole point of graphviz is to do all the layout, however my only grip is it doesn't always make the be

Re: Recommendation for drawing graphs and creating tables, saving as PDF

2021-06-11 Thread Martin Di Paola
You could try https://plantuml.com and http://ditaa.sourceforge.net/. Plantuml may not sound as the right tool but it is quite flexible and after a few tweak you can create a block diagram as you shown. And the good thing is that you *write* which elements and relations are in your diagram an

Re: Recommendation for drawing graphs and creating tables, saving as PDF

2021-06-11 Thread Neal Becker
Jan Erik Moström wrote: > I'm doing something that I've never done before and need some advise for > suitable libraries. > > I want to > > a) create diagrams similar to this one > https://www.dropbox.com/s/kyh7rxbcogvecs1/graph.png?dl=0 (but with more > nodes) and save them as PDFs or some forma

Re: Recommendation for drawing graphs and creating tables, saving as PDF

2021-06-11 Thread Rich Shepard
On Fri, 11 Jun 2021, Jan Erik Moström wrote: I looked around around but could only find two types of libraries for a) libraries for creating histograms, bar charts, etc, b) very basic drawing tools that requires me to figure out the layout etc. I would prefer a library that would allow me to sta

Recommendation for drawing graphs and creating tables, saving as PDF

2021-06-11 Thread Jan Erik Moström
I'm doing something that I've never done before and need some advise for suitable libraries. I want to a) create diagrams similar to this one https://www.dropbox.com/s/kyh7rxbcogvecs1/graph.png?dl=0 (but with more nodes) and save them as PDFs or some format that can easily be converted to PD

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Chris Angelico
On Fri, Oct 23, 2020 at 3:35 AM Grant Edwards wrote: > Moving from 2.x to 3.x isn't too bad, but trying to maintain > compatiblity with both is painful. At this point, I would probably > just abandon 2.x. > Definitely. No point trying to support both when you're starting with code from a Py3 exam

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Grant Edwards
On 2020-10-22, Chris Angelico wrote: > On Fri, Oct 23, 2020 at 12:15 AM Shaozhong SHI wrote: >> What should I know or watch out if I decide to move from Python 2.7 >> to Python 3? > > Key issues? Well, for starters, you don't have to worry about whether > your strings are Unicode or not. They ju

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Chris Angelico
On Fri, Oct 23, 2020 at 12:15 AM Shaozhong SHI wrote: > > Thanks, Chris. > > What should I know or watch out if I decide to move from Python 2.7 to Python > 3? > > What are the key issues? Syntax? > Keep it on-list please :) Key issues? Well, for starters, you don't have to worry about whether

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Marco Sulla
: > > I would add that usually I do not recommend saving files on databases. I > > usually save the file on the disk and the path and mime on a dedicated > > table. > > I used to do that because backing up the database became huge. Now I use > ZFS snapshots with send/recei

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread D'Arcy Cain
On 10/22/20 7:23 AM, Marco Sulla wrote: I would add that usually I do not recommend saving files on databases. I usually save the file on the disk and the path and mime on a dedicated table. I used to do that because backing up the database became huge. Now I use ZFS snapshots with send

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Chris Angelico
On Thu, Oct 22, 2020 at 8:28 PM Shaozhong SHI wrote: > > I found this last option is very interesting. > > Saving the dataframe to memory using StringIO > > https://naysan.ca/2020/06/21/pandas-to-postgresql-using-psycopg2-copy_from/ > > But, testing shows > unicode

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Marco Sulla
I would add that usually I do not recommend saving files on databases. I usually save the file on the disk and the path and mime on a dedicated table. -- https://mail.python.org/mailman/listinfo/python-list

Re: Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Marco Sulla
Try to save it in a binary field on PG using hdf5: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_hdf.html On Thu, 22 Oct 2020 at 11:29, Shaozhong SHI wrote: > I found this last option is very interesting. > > Saving the dataframe to memory using

Dataframe to postgresql - Saving the dataframe to memory using StringIO

2020-10-22 Thread Shaozhong SHI
I found this last option is very interesting. Saving the dataframe to memory using StringIO https://naysan.ca/2020/06/21/pandas-to-postgresql-using-psycopg2-copy_from/ But, testing shows unicode argument expected, got 'str' Any working example for getting DataFrame into a Postgr

Re: Problem saving datetime to file and reading it back for a calculation

2020-10-11 Thread Cameron Simpson
On 11Oct2020 20:39, Steve wrote: >Still, I enjoyed the kluge I created making it work based on discovery... Poking around in the datetime module will definitely make you aware of its power, and its pitfalls. Well worth doing. At the very least you'll usually want it when printing times out for hu

RE: Problem saving datetime to file and reading it back for a calculation

2020-10-11 Thread Steve
Thanks for the responses. Somehow, all of my python messages were shifted into the deleted folder so I missed all of them until I caught the one from MRAB. I will sift through them and probably update my technique to use seconds as suggested. Still, I enjoyed the kluge I created making it work b

Re: Problem saving datetime to file and reading it back for a calculation

2020-10-11 Thread MRAB
On 2020-10-11 20:25, Steve wrote: Thanks for the response. I must have spent hours looking on-line for a method to treat datetime variables yet not one site mentioned the "pickle" module you indicatged. I did, however solve my problem. It may be a kluge but it seems to work. I learned that I

RE: Problem saving datetime to file and reading it back for a calculation

2020-10-11 Thread Steve
eInfo.close() # === Granted, there may be other ways to do this but I actually enjoy the exploration... Still, I would like to see other methods. Steve -Original Message- From: Dieter Maurer Sent: Sunday, October 11, 2020 12:48 PM To: Steve Subje

Re: Problem saving datetime to file and reading it back for a calculation

2020-10-10 Thread Chris Angelico
0 seconds. The difference shows up when the conversion between UTC and local time changes - most commonly when Daylight Saving Time starts or ends... (And I guess if you care about leap seconds, then Unix time would be inappropriate there too. But I rather doubt that most of us are bothered by that.)

Re: Problem saving datetime to file and reading it back for a calculation

2020-10-10 Thread Cameron Simpson
On 10Oct2020 18:17, Steve wrote: >I would like to use the line: >HoursDiff = int((d2-d1).total_seconds()/3600) >to determine the difference in hours between two timedate entries. > >The variable d2 is from datetime.now() >and d1 is read from a text file. > >I can save d2 to the file only if I conv

Re: Problem saving datetime to file and reading it back for a calculation

2020-10-10 Thread Peter Pearson
On Sat, 10 Oct 2020 18:17:26 -0400, Steve wrote: > I would like to use the line: > HoursDiff = int((d2-d1).total_seconds()/3600) > to determine the difference in hours between two timedate entries. > > The variable d2 is from datetime.now() > and d1 is read from a text file. > > I can save d2 to t

Problem saving datetime to file and reading it back for a calculation

2020-10-10 Thread Steve
I would like to use the line: HoursDiff = int((d2-d1).total_seconds()/3600) to determine the difference in hours between two timedate entries. The variable d2 is from datetime.now() and d1 is read from a text file. I can save d2 to the file only if I convert it to string and, at a later date, it

Re: No option available for saving files

2019-06-07 Thread Terry Reedy
On 6/7/2019 10:51 AM, Calvin Spealman wrote: The python shell is good for experimenting and testing some things out, but you are right it isn't for writing programs you actually re-use and run later. You can use any text editor you want, Visual Studio Code and Sublime Text are both popular, but a

Re: No option available for saving files

2019-06-07 Thread Calvin Spealman
The python shell is good for experimenting and testing some things out, but you are right it isn't for writing programs you actually re-use and run later. You can use any text editor you want, Visual Studio Code and Sublime Text are both popular, but anything will do at all. There is also a simple

No option available for saving files

2019-06-07 Thread Shreya Joshi
Hi ma’am/sir, I’ve started using python Shell 3.6.8-32 bit executable installer on windows OS. But there is no option to save or open a new file. This gives an output after every line. But, I want to work on longer codes to execute programs. Am I using the right interface? Please help. Here is

Re: I am facing problem in saving my file.

2018-12-16 Thread Abdur-Rahmaan Janhangeer
error message? Abdur-Rahmaan Janhangeer Mauritius -- https://mail.python.org/mailman/listinfo/python-list

I am facing problem in saving my file.

2018-12-16 Thread mallickaman2003
Sent from Mail for Windows 10 -- https://mail.python.org/mailman/listinfo/python-list

Re: Saving application configuration to the ini file respecting order of sections/options and providing mechanism for (nested) complex objects

2018-08-22 Thread zljubisic
Thanks. As I can see python 3.7 is the best option. Thank you very very muchs for the code as well. Best regards. -- https://mail.python.org/mailman/listinfo/python-list

Re: Saving application configuration to the ini file respecting order of sections/options and providing mechanism for (nested) complex objects

2018-08-21 Thread Peter Otten
zljubi...@gmail.com wrote: > 1. saving json will result in unordered ini file. It could be solved by > using OrderedDict that will than with json.dumps be saved to file in the > same order as options are added to the ordered dict. dict-s are guaranteed to keep insertion order in Python

Saving application configuration to the ini file respecting order of sections/options and providing mechanism for (nested) complex objects

2018-08-21 Thread zljubisic
nal text editor. So I have created dict with all options hoping that I will be able to save it with json.dumps and read it with json.loads, but I have run to several problems: 1. saving json will result in unordered ini file. It could be solved by using OrderedDict that will than with json.dumps be sa

Problem in extracting and saving multi-dimensional time series data from netcdf file to csv file

2018-04-17 Thread shalu . ashu50
Hi All, I am using winpython spyder 3.6. I am trying to extract a variable with their time series values (daily from 1950 to 2004). The data structure is as follows: Dimensions: (bnds: 2, lat: 90, lon: 144, time: 20075) Coordinates: * lat (lat) float64 -89.0 -87.0 -85.0 -83.0 -81.

Re: saving octet-stream png file

2016-08-22 Thread Jon Ribbens
On 2016-08-22, Larry Martell wrote: > On Mon, Aug 22, 2016 at 1:25 PM, Jon Ribbens > wrote: >> On 2016-08-22, Larry Martell wrote: >>> (Pdb) type(request.POST[key]) >>> >>> (Pdb) request.encoding = "iso-8859-1" >>> (Pdb) type(request.POST[key]) >>> *** MultiValueDictKeyError: >>> "u'right-carot

Re: saving octet-stream png file

2016-08-22 Thread Larry Martell
On Mon, Aug 22, 2016 at 1:25 PM, Jon Ribbens wrote: > On 2016-08-22, Larry Martell wrote: >> On Sun, Aug 21, 2016 at 5:24 PM, Jon Ribbens >> wrote: >>> On 2016-08-19, Larry Martell wrote: fd.write(request.POST[key]) >>> >>> You could try: >>> >>> request.encoding = "iso-8859-1" >>> fd

Re: saving octet-stream png file

2016-08-22 Thread Wildman via Python-list
On Mon, 22 Aug 2016 13:21:43 -0400, Larry Martell wrote: > On Fri, Aug 19, 2016 at 4:51 PM, Lawrence D’Oliveiro > wrote: >> On Saturday, August 20, 2016 at 6:03:53 AM UTC+12, Terry Reedy wrote: >>> >>> An 'octet' is a byte of 8 bits. >> >> Is there any other size of byte? > > Many, many years ag

Re: saving octet-stream png file

2016-08-22 Thread Jon Ribbens
On 2016-08-22, Larry Martell wrote: > On Sun, Aug 21, 2016 at 5:24 PM, Jon Ribbens > wrote: >> On 2016-08-19, Larry Martell wrote: >>> fd.write(request.POST[key]) >> >> You could try: >> >> request.encoding = "iso-8859-1" >> fd.write(request.POST[key].encode("iso-8859-1")) >> >> It's hacky

Re: saving octet-stream png file

2016-08-22 Thread Larry Martell
On Fri, Aug 19, 2016 at 4:51 PM, Lawrence D’Oliveiro wrote: > On Saturday, August 20, 2016 at 6:03:53 AM UTC+12, Terry Reedy wrote: >> >> An 'octet' is a byte of 8 bits. > > Is there any other size of byte? Many, many years ago, probably c. 1982 my Dad came into my house and saw a Byte Magazine l

Re: saving octet-stream png file

2016-08-22 Thread Larry Martell
On Mon, Aug 22, 2016 at 10:36 AM, Larry Martell wrote: > On Fri, Aug 19, 2016 at 4:24 PM, Chris Kaynor > wrote: >> On Fri, Aug 19, 2016 at 12:00 PM, Larry Martell >> wrote: >> >>> On Fri, Aug 19, 2016 at 1:24 PM, Chris Angelico wrote: >>> > On Sat, Aug 20, 2016 at 3:10 AM, Larry Martell >>> w

Re: saving octet-stream png file

2016-08-22 Thread Larry Martell
On Fri, Aug 19, 2016 at 4:24 PM, Chris Kaynor wrote: > On Fri, Aug 19, 2016 at 12:00 PM, Larry Martell > wrote: > >> On Fri, Aug 19, 2016 at 1:24 PM, Chris Angelico wrote: >> > On Sat, Aug 20, 2016 at 3:10 AM, Larry Martell >> wrote: >> >> I have some python code (part of a django app) that pro

Re: saving octet-stream png file

2016-08-22 Thread Larry Martell
On Sun, Aug 21, 2016 at 5:24 PM, Jon Ribbens wrote: > On 2016-08-19, Larry Martell wrote: >> fd.write(request.POST[key]) > > You could try: > > request.encoding = "iso-8859-1" > fd.write(request.POST[key].encode("iso-8859-1")) > > It's hacky and nasty and there might be a better "official" me

Re: saving octet-stream png file

2016-08-21 Thread Jon Ribbens
On 2016-08-19, Larry Martell wrote: > fd.write(request.POST[key]) You could try: request.encoding = "iso-8859-1" fd.write(request.POST[key].encode("iso-8859-1")) It's hacky and nasty and there might be a better "official" method but I think it should work. -- https://mail.python.org/mailma

Re: saving octet-stream png file

2016-08-20 Thread Marko Rauhamaa
Random832 : > On Sat, Aug 20, 2016, at 03:50, Marko Rauhamaa wrote: >> 2'scomplement arithmetics is quite often taken advantage of in C >> programming. Unfortunately, with the castration of signed integers >> with the most recent C standards, 2's-complement has been dangerously >> broken. > > No p

Re: saving octet-stream png file

2016-08-20 Thread Grant Edwards
On 2016-08-19, Random832 wrote: > On Fri, Aug 19, 2016, at 16:51, Lawrence D’Oliveiro wrote: >> On Saturday, August 20, 2016 at 6:03:53 AM UTC+12, Terry Reedy wrote: >> > >> > An 'octet' is a byte of 8 bits. >> >> Is there any other size of byte? > > Not very often anymore. Used to be some system

Re: saving octet-stream png file

2016-08-20 Thread Random832
On Sat, Aug 20, 2016, at 03:50, Marko Rauhamaa wrote: > 2'scomplement arithmetics is quite often taken advantage of in C > programming. Unfortunately, with the castration of signed integers with > the most recent C standards, 2's-complement has been dangerously broken. No part of any version of th

Re: saving octet-stream png file

2016-08-20 Thread Marko Rauhamaa
Random832 : > On Fri, Aug 19, 2016, at 16:51, Lawrence D’Oliveiro wrote: >> On Saturday, August 20, 2016 at 6:03:53 AM UTC+12, Terry Reedy wrote: >> > An 'octet' is a byte of 8 bits. >> Is there any other size of byte? > Not very often anymore. The main difference between an octet and a byte is t

Re: saving octet-stream png file

2016-08-19 Thread Random832
On Fri, Aug 19, 2016, at 21:09, Steve D'Aprano wrote: > Depends what you mean by "byte", but the short answer is "Yes". > > In the C/C++ standard, bytes must be at least eight bytes. As the below > FAQ > explains, that means that on machines like the PDP-10 a C++ compiler will > define bytes to be

Re: saving octet-stream png file

2016-08-19 Thread Steve D'Aprano
On Sat, 20 Aug 2016 06:51 am, Lawrence D’Oliveiro wrote: > On Saturday, August 20, 2016 at 6:03:53 AM UTC+12, Terry Reedy wrote: >> >> An 'octet' is a byte of 8 bits. > > Is there any other size of byte? Depends what you mean by "byte", but the short answer is "Yes". In the C/C++ standard, byt

Re: saving octet-stream png file

2016-08-19 Thread Random832
On Fri, Aug 19, 2016, at 16:51, Lawrence D’Oliveiro wrote: > On Saturday, August 20, 2016 at 6:03:53 AM UTC+12, Terry Reedy wrote: > > > > An 'octet' is a byte of 8 bits. > > Is there any other size of byte? Not very often anymore. Used to be some systems had 9-bit bytes, and of course a lot of c

Re: saving octet-stream png file

2016-08-19 Thread Lawrence D’Oliveiro
On Saturday, August 20, 2016 at 6:03:53 AM UTC+12, Terry Reedy wrote: > > An 'octet' is a byte of 8 bits. Is there any other size of byte? -- https://mail.python.org/mailman/listinfo/python-list

Re: saving octet-stream png file

2016-08-19 Thread Chris Kaynor
On Fri, Aug 19, 2016 at 12:00 PM, Larry Martell wrote: > On Fri, Aug 19, 2016 at 1:24 PM, Chris Angelico wrote: > > On Sat, Aug 20, 2016 at 3:10 AM, Larry Martell > wrote: > >> I have some python code (part of a django app) that processes a > >> request that contains a png file. The request is

Re: saving octet-stream png file

2016-08-19 Thread Larry Martell
On Fri, Aug 19, 2016 at 3:00 PM, Larry Martell wrote: > On Fri, Aug 19, 2016 at 1:24 PM, Chris Angelico wrote: >> On Sat, Aug 20, 2016 at 3:10 AM, Larry Martell >> wrote: >>> I have some python code (part of a django app) that processes a >>> request that contains a png file. The request is sen

Re: saving octet-stream png file

2016-08-19 Thread Larry Martell
On Fri, Aug 19, 2016 at 1:24 PM, Chris Angelico wrote: > On Sat, Aug 20, 2016 at 3:10 AM, Larry Martell > wrote: >> I have some python code (part of a django app) that processes a >> request that contains a png file. The request is send with >> content_type = 'application/octet-stream' >> >> In

Re: saving octet-stream png file

2016-08-19 Thread Terry Reedy
On 8/19/2016 1:10 PM, Larry Martell wrote: I have some python code (part of a django app) that processes a request that contains a png file. The request is send with content_type = 'application/octet-stream' An 'octet' is a byte of 8 bits. So the content is a stream of bytes and MUST NOT be d

Re: saving octet-stream png file

2016-08-19 Thread Chris Angelico
On Sat, Aug 20, 2016 at 3:10 AM, Larry Martell wrote: > I have some python code (part of a django app) that processes a > request that contains a png file. The request is send with > content_type = 'application/octet-stream' > > In the python code I want to write this data to a file and still have

saving octet-stream png file

2016-08-19 Thread Larry Martell
I have some python code (part of a django app) that processes a request that contains a png file. The request is send with content_type = 'application/octet-stream' In the python code I want to write this data to a file and still have it still be a valid png file. The data I get looks like this:

Re: Saving Consol outputs in a python script

2016-05-03 Thread Terry Reedy
On 5/3/2016 8:14 AM, drewes@gmail.com wrote: Hello, I'm new to python and have a Question. I'm running a c++ file with a python script like: import os import subprocess subprocess.call(["~/caffe/build/examples/cpp_classification/classification", "deploy.prototxt", "this.caffemodel", "mean

Re: Saving Consol outputs in a python script

2016-05-03 Thread Stephen Hansen
On Tue, May 3, 2016, at 05:14 AM, drewes@gmail.com wrote: > What I need are the 2 values for the 2 classes saved in a variable in the > .py script, so that I can write them into a text file. > > Would be super nice if someone could help me! You shouldn't use the call() convienence function, b

Re: Saving Consol outputs in a python script

2016-05-03 Thread DFS
On 5/3/2016 8:14 AM, drewes@gmail.com wrote: Hello, I'm new to python and have a Question. I'm running a c++ file with a python script like: import os import subprocess subprocess.call(["~/caffe/build/examples/cpp_classification/classification", "deploy.prototxt", "this.caffemodel", "mean

Saving Consol outputs in a python script

2016-05-03 Thread drewes . mil
Hello, I'm new to python and have a Question. I'm running a c++ file with a python script like: import os import subprocess subprocess.call(["~/caffe/build/examples/cpp_classification/classification", "deploy.prototxt", "this.caffemodel", "mean.binaryproto", "labels.txt", "Bild2.jpg"]) and i

Re: Time saving tips for Pythonists

2015-06-20 Thread Miki Tebeka
> What are your best time saving tips when programming Python? * Use the REPL. Write small chunks of code and test them as you go * Know what's available in the standard library (sets, Counter, deque ...) * Learn how to pick good packages from PyPI (community, last commit ...) * imp

Re: Time saving tips for Pythonists

2015-06-18 Thread John Strick
On Thursday, June 18, 2015 at 6:11:11 AM UTC-4, Productivi .co wrote: > What are your best time saving tips when programming Python? PyCharm! -- https://mail.python.org/mailman/listinfo/python-list

Time saving tips for Pythonists

2015-06-18 Thread Productivi .co
Hello Pythonists! I'm preparing an article to show up at simplilearn.com about the best time saving tips Pyhonists use, and thus, conducting interviews with Pythonists like you. The interview question I would like to ask you is: *What are your best time saving tips when programming P

Re: Saving a file "in the background" -- How?

2014-10-31 Thread Chris Angelico
On Sat, Nov 1, 2014 at 1:06 AM, Steven D'Aprano wrote: > Chris Angelico wrote: > >> Sounds like a lot of hassle, and a lot of things that could be done >> wrongly. Personally, if I need that level of reliability and >> atomicity, I'd rather push the whole question down to a lower level: >> maybe c

Re: Saving a file "in the background" -- How?

2014-10-31 Thread Steven D'Aprano
Chris Angelico wrote: > Sounds like a lot of hassle, and a lot of things that could be done > wrongly. Personally, if I need that level of reliability and > atomicity, I'd rather push the whole question down to a lower level: > maybe commit something to a git repository and push it to a remote > s

Re: Saving a file "in the background" -- How?

2014-10-31 Thread Chris Angelico
On Fri, Oct 31, 2014 at 11:07 PM, Akira Li <4kir4...@gmail.com> wrote: > where atomic_open() [1] tries to overcome multiple issues with saving > data reliably: > > - write to a temporary file so that the old data is always available > - rename the file when all new data is

Re: Saving a file "in the background" -- How?

2014-10-31 Thread Akira Li
utes) then the step may be skipped. backup() makes sure that the data is saved and can be restore at any time. def backup(): with atomic_open('backup', 'w') as file: file.write(get_data()) where atomic_open() [1] tries to overcome multiple issues with saving

Re: Saving a file "in the background" -- How?

2014-10-30 Thread Terry Reedy
On 10/30/2014 6:21 PM, Joel Goldstick wrote: On Thu, Oct 30, 2014 at 5:30 PM, Virgil Stokes wrote: While running a python program I need to save some of the data that is being created. I would like to save the data to a file on a disk according to a periodical schedule (e.g. every 10 minutes).

Re: Saving a file "in the background" -- How?

2014-10-30 Thread Deepfriedice
Why not just call the save function as a separate thread? threading.Thread(target=save, args=(data)).start() -- https://mail.python.org/mailman/listinfo/python-list

Re: Saving a file "in the background" -- How?

2014-10-30 Thread Joel Goldstick
On Thu, Oct 30, 2014 at 5:30 PM, Virgil Stokes wrote: > While running a python program I need to save some of the data that is being > created. I would like to save the data to a file on a disk according to a > periodical schedule (e.g. every 10 minutes). Initially, the amount of data > is small

Saving a file "in the background" -- How?

2014-10-30 Thread Virgil Stokes
While running a python program I need to save some of the data that is being created. I would like to save the data to a file on a disk according to a periodical schedule (e.g. every 10 minutes). Initially, the amount of data is small (< 1 MB) but after sometime the amount of data can be >10MB

Error with saving animation

2014-10-10 Thread Partha Pratim Ghosh
Dear All, I am having a problem with saving the output of an animation as a file. I provide here two listing, first the small program which otherwise works well, except while executing the last few lines to save the output produces error which I also provide: 1. the program test.py : from

Re: Saving

2014-07-07 Thread Denis McMahon
On Sun, 06 Jul 2014 23:03:07 +, mrwhackadoo1 wrote: > Hi, I’ve been looking forever for this and I cant get it. > > I need to know how to save my code and save as programs because I write > code and I run it but then I cant save it for later. > > Please help and thank you for your time. Wri

Re: Saving

2014-07-06 Thread Cameron Simpson
On 06Jul2014 23:03, mrwhackad...@gmail.com wrote: I need to know how to save my code and save as programs because I write code Please help and thank you for your time. Please tell a bit more about your work environment (editors, IDEs, computer OS, etc). The basic answer to your question is t

Programmer's text editor (was: Saving)

2014-07-06 Thread Ben Finney
writes: > I need to know how to save my code and save as programs because I > write code and I run it but then I cant save it for later. You can write Python code using any text editor. You will do well to use a text editor which is deliberately designed for programming and other related editin

Saving

2014-07-06 Thread mrwhackadoo1
Hi, I’ve been looking forever for this and I cant get it. I need to know how to save my code and save as programs because I write code and I run it but then I cant save it for later. Please help and thank you for your time.-- https://mail.python.org/mailman/listinfo/python-list

Saving a file as netCDF4 in Python

2014-05-08 Thread Jamie Mitchell
Dear all, Apologies as this sounds like a very simple question but I can't find an answer anywhere. I have loaded a netCDF4 file into python as follows: swh=netCDF4.Dataset('path/to/netCDFfile,'r') I then isolate the variables I wish to plot: hs=swh.variables['hs'] year=swh.variables['year']

Re: Idle thread (Polling) python GUI and saving program state

2014-03-04 Thread MRAB
On 2014-03-04 02:41, Rolando wrote:> On Monday, March 3, 2014 6:06:22 PM UTC-8, MRAB wrote: >> On 2014-03-04 01:33, Rolando wrote: >> > I have a GUI with a bunch of cells which is my "View" in the MVC >> > design. The user enters some information in the view and I pass >> > this on to the mode

Re: Idle thread (Polling) python GUI and saving program state

2014-03-03 Thread Rolando
On Monday, March 3, 2014 6:06:22 PM UTC-8, MRAB wrote: > On 2014-03-04 01:33, Rolando wrote: > > > I have a GUI with a bunch of cells which is my "View" in the MVC > > > design. The user enters some information in the view and I pass this > > > on to the model so that using the information en

Re: Idle thread (Polling) python GUI and saving program state

2014-03-03 Thread MRAB
On 2014-03-04 01:33, Rolando wrote: > I have a GUI with a bunch of cells which is my "View" in the MVC > design. The user enters some information in the view and I pass this > on to the model so that using the information entered by the user > it(model) can do some processing. > > I have coded up

Idle thread (Polling) python GUI and saving program state

2014-03-03 Thread Rolando
I have a GUI with a bunch of cells which is my "View" in the MVC design. The user enters some information in the view and I pass this on to the model so that using the information entered by the user it(model) can do some processing. I have coded up my model as a state machine. Wherein, once a f

Re: [newbie] Saving binaries in a specific way

2013-12-17 Thread Djoser
Thank you. With numpy it works perfectly. I thought it would lost the information about int32 and int16 with this approach. Now I will try to make the script with struct too, but I'll need a bit more time to really understand. For me it's a new paradigm. But that's nice. :) -- https://mail.pyth

Re: [newbie] Saving binaries in a specific way

2013-12-17 Thread Oscar Benjamin
On 16 December 2013 22:19, Djoser wrote: > Hi all, Hi Djoser, > I am new to this forum and also to Python, but I'm trying hard to understand > it better. > I need to create a binary file, but the first 4 lines must be in > signed-Integer16 and all the others in signed-Integer32. I have a prog

Re: [newbie] Saving binaries in a specific way

2013-12-16 Thread rusi
On Tuesday, December 17, 2013 5:00:14 AM UTC+5:30, Djoser wrote: > Basically I have a .dat file, so I get some numbers and make a different > conversion. > > I'll try this struct script. I'm not used to it, but it seems to do what I > want. Construct is a very powerful utility for binary parsin

Re: [newbie] Saving binaries in a specific way

2013-12-16 Thread Djoser
Basically I have a .dat file, so I get some numbers and make a different conversion. I'll try this struct script. I'm not used to it, but it seems to do what I want. -- https://mail.python.org/mailman/listinfo/python-list

Re: [newbie] Saving binaries in a specific way

2013-12-16 Thread Tim Chase
On 2013-12-16 14:19, Djoser wrote: > I am new to this forum and also to Python, but I'm trying hard to > understand it better. Welcome aboard! > I need to create a binary file, but the first 4 lines must be in > signed-Integer16 and all the others in signed-Integer32. I have a > program that doe

Re: [newbie] Saving binaries in a specific way

2013-12-16 Thread Djoser
I'm using python 2.7. If I understood correctly, using bytearray I will lost the information about the signed 16, 32, since it makes automatically the conversion. Do you think that I can make the conversion as I proposed before or using struct and save with open()? -- https://mail.python.org/m

Re: [newbie] Saving binaries in a specific way

2013-12-16 Thread Chris Kaynor
On Mon, Dec 16, 2013 at 2:19 PM, Djoser wrote: > Hi all, > > I am new to this forum and also to Python, but I'm trying hard to > understand it better. > I need to create a binary file, but the first 4 lines must be in > signed-Integer16 and all the others in signed-Integer32. I have a program >

[newbie] Saving binaries in a specific way

2013-12-16 Thread Djoser
Hi all, I am new to this forum and also to Python, but I'm trying hard to understand it better. I need to create a binary file, but the first 4 lines must be in signed-Integer16 and all the others in signed-Integer32. I have a program that does that with Matlab and other with Mathematica, but

Re: Downloading/Saving to a Directory

2013-11-28 Thread Chris Angelico
On Fri, Nov 29, 2013 at 2:19 AM, TheRandomPast . wrote: > I've created a script that allows me to see how many images are on a webpage > and their URL however now I want to download all .jpg images from this > website and save them onto my computer. Are you doing this because you want those .jpg

Re: Downloading/Saving to a Directory

2013-11-28 Thread MRAB
On 28/11/2013 15:19, TheRandomPast . wrote: Hi, I've created a script that allows me to see how many images are on a webpage and their URL however now I want to download all .jpg images from this website and save them onto my computer. I've never done this before and I've become a little confuse

Downloading/Saving to a Directory

2013-11-28 Thread TheRandomPast .
Hi, I've created a script that allows me to see how many images are on a webpage and their URL however now I want to download all .jpg images from this website and save them onto my computer. I've never done this before and I've become a little confused as to where I should go next. Can some kind

Re: Reading log and saving data to DB

2013-08-15 Thread Guy Tamir
On Wednesday, August 14, 2013 4:46:09 PM UTC+3, mar...@python.net wrote: > On Wed, Aug 14, 2013, at 09:18 AM, Guy Tamir wrote: > > > Hi all, > > > > > > I have a Ubuntu server running NGINX that logs data for me. > > > I want to write a python script that reads my customized logs and after >

Re: Reading log and saving data to DB

2013-08-15 Thread Guy Tamir
On Thursday, August 15, 2013 1:34:38 AM UTC+3, Dennis Lee Bieber wrote: > On Wed, 14 Aug 2013 06:18:08 -0700 (PDT), Guy Tamir > > declaimed the following: > > > > >Hi all, > > > > > >I have a Ubuntu server running NGINX that logs data for me. > > > > Is the log coming from NGINX or

Re: Reading log and saving data to DB

2013-08-14 Thread mar...@python.net
On Wed, Aug 14, 2013, at 09:18 AM, Guy Tamir wrote: > Hi all, > > I have a Ubuntu server running NGINX that logs data for me. > I want to write a python script that reads my customized logs and after > a little rearrangement save the new data into my DB (postgresql). > > The process should run

Reading log and saving data to DB

2013-08-14 Thread Guy Tamir
Hi all, I have a Ubuntu server running NGINX that logs data for me. I want to write a python script that reads my customized logs and after a little rearrangement save the new data into my DB (postgresql). The process should run about every 5 minutes and i'm expecting large chunks of data on se

Re: Scan CSV file and saving it into an array

2013-04-24 Thread Oscar Benjamin
On 25 April 2013 00:01, Ana Dionísio wrote: > Hello! > > I have this script that scans a csv file and if the value in the first column > == 200 it saves that row into an array. > > The problem is, I need to save that row and the next 10 rows in that same > array. What can I add to the script so

Re: Scan CSV file and saving it into an array

2013-04-24 Thread Dave Angel
On 04/24/2013 07:01 PM, Ana Dionísio wrote: Hello! I have this script that scans a csv file and if the value in the first column == 200 it saves that row into an array. No it doesn't. It creates a list, then overwrites it with a numpy array, then overwrites that with a list of strings repres

  1   2   3   4   >