Re: When will os.remove fail?

2017-03-14 Thread eryk sun
On Tue, Mar 14, 2017 at 10:05 PM, Dennis Lee Bieber wrote: > On Wed, 15 Mar 2017 00:07:32 +1100, Chris Angelico > >>Yes, but you can't always control the process that opens them. For >>example, it's annoyingly difficult to update a running executable. >> > I wouldn't be surprised if Windows mmap(

Open SourceCraft Interview w/Python Instructor Trey Hunner

2017-03-14 Thread Christina Lugo
Hello, *I wanted to let you know about an interview I just published on Open SourceCraft with Trey Hunner, who worked his way from a freelance Python dev to a Python instructor. He also runs weekly free Python chat where he discusses Python, teaching, open source, and more. Here is the link

Re: python and databases

2017-03-14 Thread Michael Torrie
On 03/14/2017 01:59 PM, Xristos Xristoou wrote: > I have a database in microsoft ACCESS with about 150 records.. if I > want to get some data from this database using a query in python and > i want to store in some variables in python that will do this ? to > avoid the 150 if ...: Using the stand

Re: When will os.remove fail?

2017-03-14 Thread eryk sun
On Tue, Mar 14, 2017 at 7:01 PM, Grant Edwards wrote: > > 1. I think I can see the VMS heritage of Windows shining through. That's not surprising considering that VMS and NT have the same architect -- Dave Cutler -- and that I/O system and file systems were design by former DEC programmers that h

Re: python and databases

2017-03-14 Thread Irmen de Jong
On 14-3-2017 20:59, Xristos Xristoou wrote: > I have a database in microsoft ACCESS with about 150 records.. if I want to > get some > data from this database using a query in python and i want to store in some > variables in python that will do this ? to avoid the 150 if ...: Using the > stand

Re: python and databases

2017-03-14 Thread BrJohan
On 2017-03-14 20:59, Xristos Xristoou wrote: I have a database in microsoft ACCESS with about 150 records.. if I want to get some data from this database using a query in python and i want to store in some variables in python that will do this ? to avoid the 150 if ...: Using the standard li

Re: python and databases

2017-03-14 Thread Chris Angelico
On Wed, Mar 15, 2017 at 6:59 AM, Xristos Xristoou wrote: > I have a database in microsoft ACCESS with about 150 records.. if I want to > get some data from this database using a query in python and i want to store > in some variables in python that will do this ? to avoid the 150 if ...: > Us

Re: python and pyqt4

2017-03-14 Thread MRAB
On 2017-03-14 21:03, Vincent Vande Vyvre wrote: Le 14/03/17 à 20:56, Xristos Xristoou a écrit : i will want to create a simple python script with pyqt4 and Q designer where the user put a number (line_edit) and if that number is something the user take back three new codes(lineEdit_2,lineEdit_

Re: python and databases

2017-03-14 Thread Irving Duran
I don't know that there is a native library in python for you to call an MS Access db. Would you be able to extract the content into a CSV and read it that way? Also, is there a particular reason why you couldn't use an additional python lib? Thank You, Irving Duran On Tue, Mar 14, 2017 at 2:5

Re: When will os.remove fail?

2017-03-14 Thread Erik
On 14/03/17 13:56, Chris Angelico wrote: On Wed, Mar 15, 2017 at 12:30 AM, Jon Ribbens wrote: rm does not ask before deleting. However some Linux distributions take it upon themselves to put "alias rm='rm -i'" in /etc/profile. I have no such alias, but it still prompts. [snip] This is the

Re: python and pyqt4

2017-03-14 Thread Vincent Vande Vyvre
Le 14/03/17 à 20:56, Xristos Xristoou a écrit : i will want to create a simple python script with pyqt4 and Q designer where the user put a number (line_edit) and if that number is something the user take back three new codes(lineEdit_2,lineEdit_3,lineEdit_4) and if user press ok(buttonBox) th

Re: Python3.6 a little conundrum

2017-03-14 Thread Ian Kelly
On Tue, Mar 14, 2017 at 2:25 PM, Gilmeh Serda wrote: > Thanks. I guess I could get a new(-er) copy when that day comes and redo > all this. I trust 3.6.0 won't be the last one. :) As it says in the Book of Armaments, Chapter 2, verses 9–21: """ Three shall be the number thou shalt count, and the

python and databases

2017-03-14 Thread Xristos Xristoou
I have a database in microsoft ACCESS with about 150 records.. if I want to get some data from this database using a query in python and i want to store in some variables in python that will do this ? to avoid the 150 if ...: Using the standard library the python? know easily put it an SQL que

python and pyqt4

2017-03-14 Thread Xristos Xristoou
i will want to create a simple python script with pyqt4 and Q designer where the user put a number (line_edit) and if that number is something the user take back three new codes(lineEdit_2,lineEdit_3,lineEdit_4) and if user press ok(buttonBox) then plugin do something else in the some GUI. for t

Re: When will os.remove fail?

2017-03-14 Thread Chris Angelico
On Wed, Mar 15, 2017 at 5:28 AM, Michael Felt wrote: > Granted, I am a bit behind in the discussion - and I know nothing about how > Windows manages this since DOS 3.3 - there it also called unlink(). > > rm is the command we run. The system call it uses to remove a file is > unlink(). unlink() re

Re: When will os.remove fail?

2017-03-14 Thread Grant Edwards
On 2017-03-13, eryk sun wrote: [An impressive 150-line explanation of file removal on Windows.] Wow. I have two comments: 1. I think I can see the VMS heritage of Windows shining through. 2. You have my condolences regarding whatever it was that required you to know all that... VMS: for

Re: Extraction of model and date created tag from own picture/video recordings

2017-03-14 Thread MRAB
On 2017-03-14 07:34, zljubi...@gmail.com wrote: I am looking for the way to extract two simple information from pictures/videos that I have recorded with different devices that I own: model (of the device that has recorded) and recordings (local) creation time. So far, I tried different approa

Re: When will os.remove fail?

2017-03-14 Thread Michael Felt
On 13/03/2017 02:51, Steve D'Aprano wrote: On Mon, 13 Mar 2017 05:45 am, Alain Ketterlin wrote: Steve D'Aprano writes: [...] It seems that os.remove on Linux will force the delete even if the file is read-only or unreadable, provided you own the file. Your permissions on the file do not rea

Re: When will os.remove fail?

2017-03-14 Thread eryk sun
On Tue, Mar 14, 2017 at 1:07 PM, Chris Angelico wrote: > On Tue, Mar 14, 2017 at 10:32 PM, Steve D'Aprano > wrote: > >> I take it that you *can* delete open files, but only if the process that >> opens them takes special care to use "delete sharing". Is that correct? > > Yes, but you can't always

Re: When will os.remove fail?

2017-03-14 Thread eryk sun
On Tue, Mar 14, 2017 at 11:32 AM, Steve D'Aprano wrote: > On Mon, 13 Mar 2017 08:47 pm, eryk sun wrote: > >> One hurdle to getting delete access is the sharing mode. If there are >> existing File objects that reference the file, they all have to share >> delete access. Otherwise the open fails wit

Re: Issues with in try except and excel spreadsheet

2017-03-14 Thread Rhodri James
On 14/03/17 14:26, padawanweb...@gmail.com wrote: As an example, If I have the excel file open and there is data that needs to be written to the excel file than the exception will catch this error: IOError: [Errno 13] Permission denied: 'C:\\Users\\Administrator\\Desktop\\Version5.0\\DeviceTra

Re: When will os.remove fail?

2017-03-14 Thread Jon Ribbens
On 2017-03-14, Lele Gaifax wrote: > Jon Ribbens writes: >>>Otherwise, if a file is unwritable, standard input is a terminal, and >>>the -f or --force option is not given, or the -i or --interac‐ >>>tive=always option is given, rm prompts the user for whether to remove >>>

Re: When will os.remove fail?

2017-03-14 Thread Lele Gaifax
Jon Ribbens writes: >>Otherwise, if a file is unwritable, standard input is a terminal, >> and >>the -f or --force option is not given, or the -i or >> --interac‐ >>tive=always option is given, rm prompts the user for whether to >> remove >>the file.

Re: When will os.remove fail?

2017-03-14 Thread Chris Angelico
On Wed, Mar 15, 2017 at 1:30 AM, Jon Ribbens wrote: > On 2017-03-14, Chris Angelico wrote: >> On Wed, Mar 15, 2017 at 12:30 AM, Jon Ribbens >> wrote: >>> rm does not ask before deleting. However some Linux distributions >>> take it upon themselves to put "alias rm='rm -i'" in /etc/profile. >> >

Re: When will os.remove fail?

2017-03-14 Thread Jon Ribbens
On 2017-03-14, Frank Millman wrote: > If I type 'alias' at the console, it lists current aliases. 'root' shows > exactly what Jon quoted above. 'frank' shows no alias for 'rm'. > > I had a quick look to see what was setting it, but there is nothing in > /etc/profile or in /etc/bashrc. I don't kn

Re: Issues with in try except and excel spreadsheet

2017-03-14 Thread padawanwebdev
On Tuesday, March 14, 2017 at 4:42:39 AM UTC-7, Rhodri James wrote: > On 13/03/17 20:37, padawanweb...@gmail.com wrote: > > On Monday, March 13, 2017 at 11:10:36 AM UTC-7, Rhodri James wrote: > >> On 13/03/17 17:40, padawanweb...@gmail.com wrote: > >>> Hello, I'm having a problem with a try except

Re: When will os.remove fail?

2017-03-14 Thread Jon Ribbens
On 2017-03-14, Chris Angelico wrote: > On Wed, Mar 15, 2017 at 12:30 AM, Jon Ribbens > wrote: >> rm does not ask before deleting. However some Linux distributions >> take it upon themselves to put "alias rm='rm -i'" in /etc/profile. > > I have no such alias, but it still prompts. I'm think you

Re: When will os.remove fail?

2017-03-14 Thread Frank Millman
"Frank Millman" wrote in message news:oa8uaf$k9e$1...@blaine.gmane.org... On Fedora 22 (and for many previous versions) I have noticed that, if I log in as 'root', it does prompt, but if I log in as an ordinary user, it does not. If I type 'alias' at the console, it lists current aliases. 'r

Re: When will os.remove fail?

2017-03-14 Thread Chris Angelico
On Wed, Mar 15, 2017 at 1:22 AM, Frank Millman wrote: > "Chris Angelico" wrote in message > news:captjjmrim9tjhfolgynujatx_hkvxxq_d8yjpkx8y32qhcz...@mail.gmail.com... > > On Wed, Mar 15, 2017 at 12:30 AM, Jon Ribbens > wrote: (And the rm command won't ask if you say "-f".) >>> >>>

Re: When will os.remove fail?

2017-03-14 Thread Frank Millman
"Chris Angelico" wrote in message news:captjjmrim9tjhfolgynujatx_hkvxxq_d8yjpkx8y32qhcz...@mail.gmail.com... On Wed, Mar 15, 2017 at 12:30 AM, Jon Ribbens wrote: (And the rm command won't ask if you say "-f".) rm does not ask before deleting. However some Linux distributions take it upon

managing the RDFLib NamespaceManager

2017-03-14 Thread Adam Funk
I'm using RDFLib 4.2.2 (installed with pip3) in Python 3.5.2, and the automatic behaviour of the NamespaceManager is giving me conniptions, because the automatically generated namespaces go too far to the right in the URIs and make the right-hand parts of the QNames meaningless. For example, I hav

Re: When will os.remove fail?

2017-03-14 Thread Chris Angelico
On Wed, Mar 15, 2017 at 12:30 AM, Jon Ribbens wrote: > On 2017-03-14, Chris Angelico wrote: >>> (The bash rm command will ask you before deleting, but Python's os.remove >>> just removes it.) >> >> (And the rm command won't ask if you say "-f".) > > rm does not ask before deleting. However some L

Re: When will os.remove fail?

2017-03-14 Thread Jon Ribbens
On 2017-03-14, Chris Angelico wrote: >> (The bash rm command will ask you before deleting, but Python's os.remove >> just removes it.) > > (And the rm command won't ask if you say "-f".) rm does not ask before deleting. However some Linux distributions take it upon themselves to put "alias rm='rm

Re: When will os.remove fail?

2017-03-14 Thread Chris Angelico
On Tue, Mar 14, 2017 at 10:32 PM, Steve D'Aprano wrote: > On Mon, 13 Mar 2017 08:47 pm, eryk sun wrote: >> One hurdle to getting delete access is the sharing mode. If there are >> existing File objects that reference the file, they all have to share >> delete access. Otherwise the open fails with

Re: Issues with in try except and excel spreadsheet

2017-03-14 Thread Rhodri James
On 13/03/17 20:37, padawanweb...@gmail.com wrote: On Monday, March 13, 2017 at 11:10:36 AM UTC-7, Rhodri James wrote: On 13/03/17 17:40, padawanweb...@gmail.com wrote: Hello, I'm having a problem with a try except inside a while loop. The problem I see occuring has to do with an excel file the

Re: When will os.remove fail?

2017-03-14 Thread Steve D'Aprano
On Mon, 13 Mar 2017 08:47 pm, eryk sun wrote: > On Sun, Mar 12, 2017 at 5:48 PM, Steve D'Aprano > wrote: >> >> Does os.remove work like this under Windows too? > > os.remove calls DeleteFile on Windows. [...] Thanks for the unexpectedly detailed explanation! A few follow-up questions: > One

Extraction of model and date created tag from own picture/video recordings

2017-03-14 Thread zljubisic
I am looking for the way to extract two simple information from pictures/videos that I have recorded with different devices that I own: model (of the device that has recorded) and recordings (local) creation time. So far, I tried different approaches. I tried to use pymediainfo (https://pypi.p

Extraction of model and date created tag from own picture/video recordings

2017-03-14 Thread zljubisic
I am looking for the way to extract two simple information from pictures/videos that I have recorded with different devices that I own: model (of the device that has recorded) and recordings (local) creation time. So far, I tried different approaches. I tried to use pymediainfo (https://pypi.p