[Tutor] Oracle forms
Is there anyway I can use Python to fill in an Oracle form rather than typing it in myself.I.e take values from a .csv file and put them into an Oracle form.Any ideas (I have googled it) what libraries to use? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] Matrix help
Hi, I was just looking help for a matrix that I am building, it needs to look like this 1, 0, 0, ...,0 A,b,c,0,...,0 0,a,b,c,...,0 0,0,a,b,c,..0 0,0,0,a,b,c,...,0 0,0,0,0...0, 1 It has n rows and columns and the first and last line has to have 1s at the corners as shown, and a,b,c going diagonal and 0’s everywhere else, I am really struggling and it would be a great help to even be shown how to begin, Thanks Connie --- This email has been checked for viruses by AVG. http://www.avg.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Oracle forms
David Holland via Tutor wrote: > Is there anyway I can use Python to fill in an Oracle form rather than > typing it in myself.I.e take values from a .csv file and put them into an > Oracle form.Any ideas (I have googled it) what libraries to use? If I understand you correctly you want to enter data into a database, in bulk. For that you typically bypass any GUI, and connect to the database directly. With Python and Oracle that would look like http://www.oracle.com/technetwork/articles/dsl/python-091105.html As it is possible to do a lot of damage (provided you have the necessary credentials) I suggest that you discuss this with your IT department before you proceed. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Oracle forms
On 03/22/2018 11:35 AM, Peter Otten wrote: > David Holland via Tutor wrote: > >> Is there anyway I can use Python to fill in an Oracle form rather than >> typing it in myself.I.e take values from a .csv file and put them into an >> Oracle form.Any ideas (I have googled it) what libraries to use? > > If I understand you correctly you want to enter data into a database, in > bulk. For that you typically bypass any GUI, and connect to the database > directly. With Python and Oracle that would look like > > http://www.oracle.com/technetwork/articles/dsl/python-091105.html > > As it is possible to do a lot of damage (provided you have the necessary > credentials) I suggest that you discuss this with your IT department before > you proceed. >From the Python viewpoint, no clue. Oracle Forms has its own API. Naturally, that requires a unique scripting language to use ("but it's easy to learn!"). Maybe if they were building it today they would use a known scripting language instead, who knows. And the API package has, I believe, add-on costs. It's Oracle, after all. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Oracle forms
On 22/03/18 15:22, David Holland via Tutor wrote: > Is there anyway I can use Python to fill in an Oracle form What kind of Oracle form? There are at least 2 that I'm aware of. 1) The Oracle Forms thick client app framework which runs on a PC and connects to the database server. (I believe this is now obsolescent and no longer supported by Oracle?) 2) Web Forms built using the Oracle web server framework In either case it is usually better to access the database directly from Python rather than trying to write data into the GUI. The only case where the latter would be needed is if the Forms client implemented some kind of data processing prior to sending the data to the sever. If that is the case you can try the usual screen or web scraping options. But they are always messy and unreliable so should be a last resort. Check that there isn't an API you can use first. Also the OS and Python version may make a difference so let us know exactly what you need to do. Finally, there are literally dozens of other Oracle applications that all have forms interfaces (HR, CRM, ERM, Workflow, Middleware, Financials, Java, etc etc). So if it's not the database product you need to tell us that too. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Matrix help
Connie Callaghan wrote: > Hi, > I was just looking help for a matrix that I am building, it needs to look > like this 1, 0, 0, ...,0 > A,b,c,0,...,0 > 0,a,b,c,...,0 > 0,0,a,b,c,..0 > 0,0,0,a,b,c,...,0 > 0,0,0,0...0, 1 > > It has n rows and columns and the first and last line has to have 1s at > the corners as shown, and a,b,c going diagonal and 0’s everywhere else, I > am really struggling and it would be a great help to even be shown how to > begin, Assuming you are not using numpy the easiest way is to start with a list of lists containing only zeros: >>> N = 5 >>> my_matrix = [[0] * N for row in range(N)] >>> my_matrix [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]] This becomes a bit more readable with pprint: >>> from pprint import pprint >>> pprint(my_matrix) [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]] You can then modify the matrix: >>> my_matrix[0][0] = my_matrix[-1][-1] = 1 >>> pprint(my_matrix) [[1, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 1]] For the other values use a for loop, like >>> for i in range(1, N): ... my_matrix[i][i-1] = 42 ... >>> pprint(my_matrix) [[1, 0, 0, 0, 0], [42, 0, 0, 0, 0], [0, 42, 0, 0, 0], [0, 0, 42, 0, 0], [0, 0, 0, 42, 1]] Oops, one more 42 than b-s in your example. Looks like you need to adjust the range() arguments. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Matrix help
On 22/03/18 11:35, Connie Callaghan wrote: > Hi, > I was just looking help for a matrix that I am building, it needs to look > like this > 1, 0, 0, ...,0 > A,b,c,0,...,0 > 0,a,b,c,...,0 > 0,0,a,b,c,..0 > 0,0,0,a,b,c,...,0 > 0,0,0,0...0, 1 What exactly are the a,b,c values? Are they variables or literal characters? Or something else? Also, how many cells do the ... represent? Do you know in advance? or are they dynamically calculated? If the latter then based on what? The first and last rows are completely different - no a,b,c values - how are they determined? ie How do you know you have reached the last row? We need a much more rigorous specification. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor