Re: SQLAlchemy - web framework ?

2014-05-12 Thread Sayth Renshaw
I am saying 'do it myself' in that with flask that provide a small base and then all functionality is added by me directly, with the assistance of community modules. Compared to Django whose developers have created an integrated set of defaults with more functionality standard, which is good if

Why do I keep getting emails from Dennis?

2014-11-23 Thread Sayth Renshaw
I keep receiving emails from Dennis and it appears Dennis only on this list, I am signed up to comp.lang.python and am unsure why I keep getting Dennis' s emails. Sayth -- https://mail.python.org/mailman/listinfo/python-list

lxml objectify - attribute elements to list.

2015-02-08 Thread Sayth Renshaw
Hi How can I actually access the values of an element with lxml objectify? for example if I had this element in my xml file. Track VenueName=Flemington VenueDesc=Flemington VenueAbbr=FLEM VenueCode=151 TrackName=Main TrackCode=149 I can see all the attributes using this. In [86]: for child

Re: lxml objectify - attribute elements to list.

2015-02-08 Thread Sayth Renshaw
Awesome, thanks so much for the help. Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with map python 2

2015-01-04 Thread Sayth Renshaw
Thank you for those solutions so varied. Am going to have a party with them to see what works best for me. Strange is there a way too use lousy comprehension without returning just the matching odd values? Sayth On Mon, 5 Jan 2015 5:06 AM Dan Stromberg drsali...@gmail.com wrote: I'm partial

Re: beautifulSoup 4.1

2015-03-20 Thread Sayth Renshaw
On Friday, 20 March 2015 15:20:41 UTC+11, Sayth Renshaw wrote: HI Probably very easy question. If I have a section of html. tr td class=abbreviationApp/td tdApproaching/td td class=abbreviationD/N/td tdDid nothing/td td class=abbreviationDGO/td tdDidn't go on/td td class

beautifulSoup 4.1

2015-03-19 Thread Sayth Renshaw
HI Probably very easy question. If I have a section of html. tr td class=abbreviationApp/td tdApproaching/td td class=abbreviationD/N/td tdDid nothing/td td class=abbreviationDGO/td tdDidn't go on/td td class=abbreviationDRO/td tdDidn't run on/td td class=abbreviationH/In/td tdHung in/td td

Re: Is it normal to cry when given XML?

2015-05-05 Thread Sayth Renshaw
Adam I am glad to hear it in someways because it's something I have never heard it. For a person relatively new to XML most articles and tutorials demonstrate getting it out to a more manageable format. I had been using xbase to inspect the data and query but really ask I want to do was push

Is it normal to cry when given XML?

2015-05-05 Thread Sayth Renshaw
Hi Just checking if the reaction to cry when given XML is normal. I thought maybe I am approaching it all wrong, using lxml largely or some xquery to club it into submission. See the usual goal is just to take the entire XML and push it into a database. or in future experiment with Mongo or

Re: itertools py3.4 - filter list using not equal - fails as bool

2015-05-13 Thread Sayth Renshaw
Thank You for the explanations. I found this counter implementation is really cool and easily adaptable to more solutions. Thanks Alternatively collections.Counter() supports an arbitrary number of bins... import collections freq = collections.Counter(t[1] for t in stats) freq

itertools py3.4 - filter list using not equal - fails as bool

2015-05-12 Thread Sayth Renshaw
why can't I filter a list based on an itertools condition using dropwhile? This is the docs and the example. https://docs.python.org/3/library/itertools.html#itertools.dropwhile def less_than_10(x): return x 10 itertools.takewhile(less_than_10, itertools.count()) = 0, 1, 2, 3, 4, 5, 6,

refer to xpath attributes generally

2015-05-28 Thread Sayth Renshaw
Is there a way to specify to all attributes in xpath? Instead of directly Eg //element/@attr So that you could effectively loop and filter if an element had more than one Attribute? So items = tree.xpath(@all_attrs) From lxml import etree Tree = etree.Xpath(//root) For k, v in items:

Re: refer to xpath attributes generally

2015-05-28 Thread Sayth Renshaw
On Friday, 29 May 2015 09:21:01 UTC+10, Sayth Renshaw wrote: Is there a way to specify to all attributes in xpath? Instead of directly Eg //element/@attr So that you could effectively loop and filter if an element had more than one Attribute? So items = tree.xpath(@all_attrs) From

Should iPython Notebook replace Idle

2015-07-03 Thread Sayth Renshaw
In future releases of Python should ipython Notebooks replace idle as the default tool for new users to learn python? This would as I see it have many benefits? 1. A nicer more usual web interface for new users. 2. Would allow the python documentation and tutorials to be distributed as ipython

Re: Should iPython Notebook replace Idle

2015-07-04 Thread Sayth Renshaw
On Sunday, 5 July 2015 05:16:04 UTC+10, Sturla Molden wrote: Jason Swails jason.swa...@gmail.com wrote: Everything gets swallowed into Python. I can't imagine this ever happening. IPython's successor Jupyter is also an REPL environment for Julia and R, and many other languages will also

Can't call file from another - well correctly

2015-07-04 Thread Sayth Renshaw
I was playing with odo(blaze http://blaze.pydata.org/en/latest/) and wanted to use it with a current script I have been using on the command line. So my 2 scripts are below, I will explain here hopefully to keep question clearer what I have done. Script 2 works for me from the command line as

Re: Can't call file from another - well correctly

2015-07-04 Thread Sayth Renshaw
On Sunday, 5 July 2015 10:23:17 UTC+10, Sayth Renshaw wrote: I was playing with odo(blaze http://blaze.pydata.org/en/latest/) and wanted to use it with a current script I have been using on the command line. So my 2 scripts are below, I will explain here hopefully to keep question clearer

Re: Is there an archive of the gohlke python binaries on windows

2015-11-08 Thread Sayth Renshaw
On Sunday, 8 November 2015 20:44:02 UTC+11, Chris Warrick wrote: > On 8 November 2015 at 06:55, Sayth Renshaw <flebber.c...@gmail.com> wrote: > > Just wondering if there is an archive mirror for these binaries available. > > i was looking for lxml 3.4.1 and the current

Re: Is there an archive of the gohlke python binaries on windows

2015-11-08 Thread Sayth Renshaw
On Sunday, 8 November 2015 21:30:59 UTC+11, Laura Creighton wrote: > In a message of Sat, 07 Nov 2015 21:55:32 -0800, Sayth Renshaw writes: > >Just wondering if there is an archive mirror for these binaries available. i > >was looking for lxml 3.4.1 and the current versio

Python version of Ruby devkit - Advice On library compilation

2015-11-08 Thread Sayth Renshaw
Hi I was wondering if there is a reason that we on windows with python do not have a version of Ruby devkit for python. Is it just for historical reason of life before pip became the package manager and released with python? I can't find the actual post in SO it came off this discussion

Re: Python version of Ruby devkit - Advice On library compilation

2015-11-08 Thread Sayth Renshaw
This is an exert DevKit Overview The DevKit is a toolkit that makes it easy to build and use native C/C++ extensions such as RDiscount and RedCloth for Ruby on Windows. Because on Windows with python libraries like lxml will fail with a vcvarsall error based on different c++ compilers.

Is there an archive of the gohlke python binaries on windows

2015-11-07 Thread Sayth Renshaw
Just wondering if there is an archive mirror for these binaries available. i was looking for lxml 3.4.1 and the current version is the latest on the page at 3.4.4 being on windows I cannot build it. http://www.lfd.uci.edu/~gohlke/pythonlibs/ Thanks Sayth --

Re: I'm wrong or Will we fix the ducks limp?

2016-06-03 Thread Sayth Renshaw
That totally makes sense I was just double checking, had hoped I could create a variable assign it to a list and append in one stroke. Thanks Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: I'm wrong or Will we fix the ducks limp?

2016-06-03 Thread Sayth Renshaw
> The problem is that you think that *variables* have a type. This isn't > the case. Objects have a type. A variable is a name by which you can > refer to an object. There are various ways in which you can associate a > object with a variable, the most obvious being an assignment statement. So

Re: I'm wrong or Will we fix the ducks limp?

2016-06-03 Thread Sayth Renshaw
> > def getsMeet(files=file_list): > > """Get a File or List of Files. > > > > From the list of files determine > > what meetings exist and prepare them > > to be parsed > > """ > > pyqFiles = [] > > for filename in sorted(file_list): > > pyqFiles =

Re: I'm wrong or Will we fix the ducks limp?

2016-06-03 Thread Sayth Renshaw
> > pyqFiles = [] > > for filename in sorted(file_list): > > pyqFiles = pyqFiles.append(pq(filename=my_dir + filename)) > > > > return pyqFiles > > [snip] > > PS I am really having a lot of fun coding. > > To have even more fun, note that the above can be replaced by

Re: I'm wrong or Will we fix the ducks limp?

2016-06-03 Thread Sayth Renshaw
On Saturday, 4 June 2016 02:04:43 UTC+10, Michael Selik wrote: > > > That totally makes sense I was just double checking, had hoped I could > > create a variable assign it to a list and append in one stroke. > > > > In fact you can! It's called a "list comprehension" > > pyqFiles =

I'm wrong or Will we fix the ducks limp?

2016-06-03 Thread Sayth Renshaw
Very briefly because I hope to shot down eloquently. Python is beautiful and is supposed to be a duck typed language, Yes? Then if I create and assign to a new variable with a list action why does the duck not quack? It feels wrong to spend a line writing what is already obvious def

How can I debug silent failure - print no output

2016-05-27 Thread Sayth Renshaw
Afternoon I am looking for help with this excerpt of code. The issue is that it completes with no error and with other code in I can see it connects to postgres however it is not picking up or parsing file, also no error though so I am not sure of the exact problem. I use prints to try and

Re: How can I debug silent failure - print no output

2016-05-28 Thread Sayth Renshaw
On Saturday, 28 May 2016 16:35:35 UTC+10, Sayth Renshaw wrote: > > > > > >Ok after printing a few things i have found an error. > > > > > >def GetArgs(): > > >'''parse XML from command line''' > > >parser = argparse.ArgumentPar

Re: How can I debug silent failure - print no output

2016-05-28 Thread Sayth Renshaw
> > > >Ok after printing a few things i have found an error. > > > >def GetArgs(): > >'''parse XML from command line''' > >parser = argparse.ArgumentParser() > > > >parser.add_argument("path", nargs="+") > >parser.add_argument('-e', '--extension', default='', > >

Re: How can I debug silent failure - print no output

2016-05-28 Thread Sayth Renshaw
On Saturday, 28 May 2016 18:02:06 UTC+10, Sayth Renshaw wrote: > So how do i get argparse to read the file arguments correctly? > > Looking at the namespace it all gets pushed into path and extension remains > empty. > > [sayth@localhost pyXML]$ python3 racemeeting.py data/

Re: How can I debug silent failure - print no output

2016-05-28 Thread Sayth Renshaw
So how do i get argparse to read the file arguments correctly? Looking at the namespace it all gets pushed into path and extension remains empty. [sayth@localhost pyXML]$ python3 racemeeting.py data/ *.xml Namespace(extension='', path=['data/', '*.xml']) This is the section I am running

Re: How can I debug silent failure - print no output

2016-05-27 Thread Sayth Renshaw
On Saturday, 28 May 2016 13:06:59 UTC+10, Michael Torrie wrote: > Add more print() calls. Offhand I'd say that pq(filename=filename) is > returning an empty list so that for loop is not doing anything. Hence > your debugging print() calls never happen. > > Add sanity print()'s earlier in your

Re: How can I debug silent failure - print no output

2016-05-28 Thread Sayth Renshaw
On Saturday, 28 May 2016 19:44:53 UTC+10, Sayth Renshaw wrote: > On Saturday, 28 May 2016 18:02:06 UTC+10, Sayth Renshaw wrote: > > So how do i get argparse to read the file arguments correctly? > > > > Looking at the namespace it all gets pushed into path and extensi

Re: why for loop print only once after add if statement

2016-05-28 Thread Sayth Renshaw
On Saturday, 28 May 2016 20:19:23 UTC+10, meInvent bbird wrote: > for item, i in enumerate(aa) > print item > > this writing, it can print all values > > for item, i in enumerate(aa) > if item == findit: > print item > > this only print the first value, means it only print once then

Re: Recommendation for Object-Oriented systems to study

2016-06-03 Thread Sayth Renshaw
On Monday, 30 May 2016 00:42:17 UTC+10, Ankush Thakur wrote: > Hello, > > I'm a self-taught programmer who has managed to claw his way out of Python > basics and even covered the intermediate parts. But I feel I have a ton of > theory in my head and would like to see some smallish applications

Best way to inplace alter a list going into postgres

2016-05-30 Thread Sayth Renshaw
Hi What is the best way to inplace alter a list going into a postgres database using split but being sure that the order of items remains correct. I am using this list of ids to retrieve data from XML horseattrs = ('id', 'race_id', 'horse', 'number', 'finished', 'age', 'sex',

Re: Best way to inplace alter a list going into postgres

2016-05-30 Thread Sayth Renshaw
Ah so I should create a function that processes and modifies in the middle of the process between obtaining and committing. Or if I need to do this and more processing should I be using something like sqlalchemy or peewee http://docs.peewee-orm.com/en/latest/ ? Sayth --

Re: Best way to inplace alter a list going into postgres

2016-05-31 Thread Sayth Renshaw
On Tuesday, 31 May 2016 15:58:40 UTC+10, Steven D'Aprano wrote: > On Tuesday 31 May 2016 14:27, Sayth Renshaw wrote: > > > > > Hi > > > > What is the best way to inplace alter a list going into a postgres database > > Is it relevant where it is going? >

Re: Best way to inplace alter a list going into postgres

2016-05-31 Thread Sayth Renshaw
Probably easier to handle in postgres http://stackoverflow.com/a/37538641/461887 select c1[1] as col1, c1[2] as col2, c1[3] as col3, c1[4] as col4, substr(col5, 2) as col5 from ( select string_to_array((string_to_array(the_column, ' '))[1], '-') as c1,

lxml - SubElement dump root doesn't dump like Element dump does

2016-06-19 Thread Sayth Renshaw
Afternoon Wondering has anyone much experience with lxml specifically objectify? When I pick up a file with lxml and use objectify dumping root works as expected actually better its quite nice. This is how i do it, file handling part left out for brevity. def getsMeet(file_list): for

Re: lxml - SubElement dump root doesn't dump like Element dump does

2016-06-20 Thread Sayth Renshaw
Thanks your way makes more sense indeed. In the example they create and access I think I just got lost in their example. Sayth -- https://mail.python.org/mailman/listinfo/python-list

I seem to be creating a dict that I cannot access the keys of

2016-06-24 Thread Sayth Renshaw
Really getting a little lost here with lxml. I cannot seem to create a dict of results using xpath or other that I could easily get the results from, currently I am always returned a printed copy of the whole file regardless of what parsing options I do. Can I ask is there something obvious

Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
Lxml -- https://mail.python.org/mailman/listinfo/python-list

LXML cannot access elements of dict created

2016-06-24 Thread Sayth Renshaw
I have created several varitions of my parser however I am still having the same issue, ,my return is the whole file, not a key of the dict as i have attempted to access. Not really sure where I am going wrong with it. I have left previous implementations in however to show where I have come

Re: Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
On Friday, 24 June 2016 07:03:18 UTC+10, David Shi wrote: > Which one is the best XML-parser? > Can any one tell me? > Regards. > David xml parser most use lxml http://lxml.de/index.html Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-24 Thread Sayth Renshaw
On Tuesday, 21 June 2016 21:03:28 UTC+10, Pushpanth Gundepalli wrote: > Guys, can you please share me some sites where we can practice python > programs for beginners and Intermediate. Here are some good beginner projects

Re: Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
On Friday, 24 June 2016 07:03:18 UTC+10, David Shi wrote: > Which one is the best XML-parser? > Can any one tell me? > Regards. > David Most would use lxml sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
On Friday, 24 June 2016 07:03:18 UTC+10, David Shi wrote: > Which one is the best XML-parser? > Can any one tell me? > Regards. > David Most use lxml Sayth -- https://mail.python.org/mailman/listinfo/python-list

lxml parsing whole file, unable to access elements

2016-06-24 Thread Sayth Renshaw
Hi I have created several versions of a parser for XML with lxml both objectify and lxml. They all work in that the parser returns the whole file however I cannot access elements or keys as I have tried to create a dict of the results to make it easier to put in an sql query later. However I

Re: Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
On Friday, 24 June 2016 07:03:18 UTC+10, David Shi wrote: > Which one is the best XML-parser? > Can any one tell me? > Regards. > David Most use lxml http://lxml.de/index.html Sayth -- https://mail.python.org/mailman/listinfo/python-list

My Generator yields a dictionary. Return entire file not specified key, value

2016-06-24 Thread Sayth Renshaw
When I am running my file which takes a file off the command line reads it and creates an objecitifed xml instance and then parses for each attribute into a dictionary and then yields it. At this point I am tring to use it to obtain specific key value elements, however I keep being returned

Re: I seem to be creating a dict that I cannot access the keys of

2016-06-25 Thread Sayth Renshaw
> > The code below is obviously wrong - it is surprising that you get > anything other than an exception. See comments below inserted into > your code. > > > def parseXML(): > > ... > > result = etree.tostring(tree.getroot(), pretty_print=True) > > "result" here is obviously a

Python Scraps, Napkins & Nuggets

2016-01-28 Thread Sayth Renshaw
Hi This may seem an odd request, however i thought i would ask do you have any diagrams, scribbles, presentations you have done when coaching someone at work that just seems to work for others consistently? In coaching non programming topics at work i have noticed the variance in learning

Re: Python Scraps, Napkins & Nuggets

2016-01-30 Thread Sayth Renshaw
On Friday, 29 January 2016 17:32:58 UTC+11, Sayth Renshaw wrote: > Hi > > This may seem an odd request, however i thought i would ask do you have any > diagrams, scribbles, presentations you have done when coaching someone at > work that just seems to work for othe

Re: OT: Anyone here use the ConEmu console app?

2016-04-12 Thread Sayth Renshaw
Win 10 will have full bash provided by project between Ubuntu and MS so that's pretty cool Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: Advice on Python build tools

2016-04-12 Thread Sayth Renshaw
On Tuesday, 12 April 2016 19:48:43 UTC+10, Sayth Renshaw wrote: > Hi > > Looking at the wiki list of build tools > https://wiki.python.org/moin/ConfigurationAndBuildTools > > Has anyone much experience in build tools as i have no preference or > experience to lean on.

Advice on Python build tools

2016-04-12 Thread Sayth Renshaw
Hi Looking at the wiki list of build tools https://wiki.python.org/moin/ConfigurationAndBuildTools Has anyone much experience in build tools as i have no preference or experience to lean on. Off descriptions only i would choose invoke. My requirements, simply i want to learn and build a

Controlling the passing of data

2016-04-28 Thread Sayth Renshaw
Hi This file contains my biggest roadblock with programming and that's the abstract nature of needing to pass data from one thing to the next. In my file here I needed to traverse and modify the XML file I don't want to restore it or put it in a new variable or other format I just want to

Re: Controlling the passing of data

2016-04-28 Thread Sayth Renshaw
> > Your actual problem is drowned in too much source code. Can you restate it > in English, optionally with a few small snippets of Python? > > It is not even clear what the code you provide should accomplish once it's > running as desired. > > To give at least one code-related advice: You

Re: Controlling the passing of data

2016-04-29 Thread Sayth Renshaw
> because a set avoids duplicates. If you say "I want to document my > achievements for posterity" I would recommend that you print to a file > rather than append to a list and the original code could be changed to > > with open("somefile") as f: > for achievement in my_achievements: >

Re: Controlling the passing of data

2016-04-28 Thread Sayth Renshaw
On Friday, 29 April 2016 01:19:28 UTC+10, Dan Strohl wrote: > If I am reading this correctly... you have something like (you will have to > excuse my lack of knowledge about what kinds of information these actually > are): > > > 1234 > first > > > 5678 > second > > > >

Re: Pivot table of Pandas

2016-04-28 Thread Sayth Renshaw
On Friday, 29 April 2016 09:56:13 UTC+10, David Shi wrote: > Hello, Matt, > Please see the web link.Pandas Pivot Table Explained > > |   | > |   |   |   |   |   | > | Pandas Pivot Table ExplainedExplanation of pandas pivot_table function. | > | | > | View on pbpython.com | Preview by Yahoo | >

Re: what is new with int conversion in Python 3

2016-05-22 Thread Sayth Renshaw
On Sunday, 22 May 2016 17:26:51 UTC+10, Sayth Renshaw wrote: > I am doing a passage in a book that was written for python 2 i am writing > everything in 3. > > This is the author Ivan Idris code to show time difference between python and > numpy arrays. The only edit I

what is new with int conversion in Python 3

2016-05-22 Thread Sayth Renshaw
I am doing a passage in a book that was written for python 2 i am writing everything in 3. This is the author Ivan Idris code to show time difference between python and numpy arrays. The only edit I made was to fix the print statements. #!/usr/bin/env/python import sys from datetime import

sqlite 3 attribute error __exit__

2016-05-15 Thread Sayth Renshaw
Hi I have a file and want to create the sqlite3 db. Using with however i receive an attribute error and it causes an exit. The relevant section of the file is: import sqlite3 conn = sqlite3.connect("trial.db") with conn, conn.cursor() as cur: # First, create tables.

Re: sqlite 3 attribute error __exit__

2016-05-15 Thread Sayth Renshaw
> > As you've written it, the statement declares your intent to enter both > ‘conn’ and ‘conn.cursor()’ as context managers. > > > > To “enter a context manager” entails calling the ‘__enter__’ method on > the context

Re: sqlite 3 attribute error __exit__

2016-05-15 Thread Sayth Renshaw
On Monday, 16 May 2016 12:45:26 UTC+10, DFS wrote: > On 5/15/2016 10:21 PM, Sayth Renshaw wrote: > > Hi > > > > I have a file and want to create the sqlite3 db. Using with however i > > receive an attribute error and it causes an exit. > > > > The relevant

Re: Trouble porting glob bash behavior with argparse to windows shell

2016-05-15 Thread Sayth Renshaw
On Wednesday, 4 May 2016 17:57:32 UTC+10, Sayth Renshaw wrote: > Oops sorry noticed you did in the glob. Sorry squinting at phone. > > Sayth Hi this seems to be causing me an error in my thinking as well as the program. I am creating a function GetArgs to take a path and file exten

Re: How to use pip to install dtrx?

2016-05-15 Thread Sayth Renshaw
On Saturday, 14 May 2016 07:39:23 UTC+10, Ehsan Hajiramezanali wrote: > Hi, > > I want to use pip to install dtrx. However, I got the following error. > > ~~~ > $ pip install --allow-external dtrx dtrx > DEPRECATION: --allow-external has been deprecated and will be removed > in the future. Due

Trouble porting glob bash behavior with argparse to windows shell

2016-05-03 Thread Sayth Renshaw
Is there something obvious to this I am doing wrong? Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: How to become more motivated to learn Python

2016-05-03 Thread Sayth Renshaw
On Tuesday, 3 May 2016 21:21:21 UTC+10, Cai Gengyang wrote: > So I have completed up to CodeAcademy's Python Unit 2 , now moving on to > Unit3 : Conditionals and Control Flow. > > But I feel my motivation wavering , at times I get stuck and frustrated when > trying to learn a new programming

Trouble porting glob bash behavior with argparse to windows shell

2016-05-03 Thread Sayth Renshaw
Hi I had a simple argparse working on ubuntu bash. However now I am trying to run the script on windows and it cannot work because cmd doesn't handle the glob like bash does. So I am attempting to modify my script to accommodate. As i am running python 3.5 i can use glob.glob for a list of

Re: installing scipy

2016-05-03 Thread Sayth Renshaw
On Wednesday, 27 April 2016 01:33:57 UTC+10, Heli wrote: > Hi all, > > I have a python34 installed on a windows-64bit machine. I am using Eclipse > pydev editor. I need to used griddata from scipy.interpolate. > > I have installed scipy using by downloading the followng wheel file: >

Mentor Request

2016-05-04 Thread Sayth Renshaw
Hi Wanting to ask if there was anyone on the list that would like to be a mentor? I have no expectation that you would do it for free, so would accept fair offers as well monetary or skill trade, or something regional from Australia that you would otherwise not have access to etc. I want to

Code Opinion - Enumerate

2016-05-01 Thread Sayth Renshaw
Looking at various Python implementations of Conway's game of life. I came across one on rosetta using defaultdict. http://rosettacode.org/wiki/Conway%27s_Game_of_Life#Python Just looking for your opinion on style would you write it like this continually calling range or would you use

Re: Code Opinion - Enumerate

2016-05-02 Thread Sayth Renshaw
Thanks for the opinion. I should add that is not my code in first post it's the code from Rosetta on how to do Conway's GOL. I thought it looked ugly. Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: Code Opinion - Enumerate

2016-05-02 Thread Sayth Renshaw
As a reference here is a functional implementation of conways GOL. http://programmablelife.blogspot.com.au/2012/08/conways-game-of-life-in-clojure.html The author first does it in clojure and then transliterates it to python. Just good for a different view. Sayth --

Re: Trouble porting glob bash behavior with argparse to windows shell

2016-05-04 Thread Sayth Renshaw
Thank you Peter. I was starting to flail and thought my use of glob.glob was wrong. As an aside should I be using os.path to negate system inconsistency? Thanks Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: Trouble porting glob bash behavior with argparse to windows shell

2016-05-04 Thread Sayth Renshaw
Oops sorry noticed you did in the glob. Sorry squinting at phone. Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: Code Opinion - Enumerate

2016-05-01 Thread Sayth Renshaw
Also not using enumerate but no ugly for i range implementation this one from code review uses a generator on live cells only. http://codereview.stackexchange.com/a/108121/104381 def neighbors(cell): x, y = cell yield x - 1, y - 1 yield x, y - 1 yield x + 1, y - 1 yield

Re: How to track files processed

2016-04-18 Thread Sayth Renshaw
Thank you Martin and Peter To clarify Peter at the moment only writing to csv but am wanting to set up an item pipeline to SQL db next. I will have a go at your examples Martin and see how i go. Thank you both for taking time to help. Sayth --

Why are my files in in my list - os module used with sys argv

2016-04-18 Thread Sayth Renshaw
Hi Why would it be that my files are not being found in this script? from pyquery import PyQuery as pq import pandas as pd import os import sys if len(sys.argv) == 2: print("no params") sys.exit(1) dir = sys.argv[1] mask = sys.argv[2] files = os.listdir(dir) fileResult =

Re: Why are my files in in my list - os module used with sys argv

2016-04-19 Thread Sayth Renshaw
On Tuesday, 19 April 2016 23:46:01 UTC+10, Peter Otten wrote: > Sayth Renshaw wrote: > > > Thanks for the insight, after doing a little reading I found this post > > which uses both argparse and glob and attempts to cover the windows and > > bash expansio

Re: Why are my files in in my list - os module used with sys argv

2016-04-19 Thread Sayth Renshaw
On Tuesday, 19 April 2016 23:21:42 UTC+10, Sayth Renshaw wrote: > On Tuesday, 19 April 2016 18:17:02 UTC+10, Peter Otten wrote: > > Steven D'Aprano wrote: > > > > > On Tue, 19 Apr 2016 09:44 am, Sayth Renshaw wrote: > > > > > >> Hi > > >

Re: Why are my files in in my list - os module used with sys argv

2016-04-19 Thread Sayth Renshaw
On Tuesday, 19 April 2016 18:17:02 UTC+10, Peter Otten wrote: > Steven D'Aprano wrote: > > > On Tue, 19 Apr 2016 09:44 am, Sayth Renshaw wrote: > > > >> Hi > >> > >> Why would it be that my files are not being found in this script? > > &

How to track files processed

2016-04-18 Thread Sayth Renshaw
Hi If you are parsing files in a directory what is the best way to record which files were actioned? So that if i re-parse the directory i only parse the new files in the directory? Thanks Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: What iterable method should I use for Lists of Lists

2016-04-17 Thread Sayth Renshaw
On Monday, 18 April 2016 12:05:39 UTC+10, Sayth Renshaw wrote: > Hi > > I have an XML and using pyquery to obtain the elements within it and then > write it to csv. > > What is the best most reliable way to take dictionaries of each element, and > print them(csv write

What iterable method should I use for Lists of Lists

2016-04-17 Thread Sayth Renshaw
Hi I have an XML and using pyquery to obtain the elements within it and then write it to csv. What is the best most reliable way to take dictionaries of each element, and print them(csv write later) based on each position so get item 0 of each list and then it 1 and so on. Any other code I

Create a forecast estimate updated with actuals weekly

2016-04-14 Thread Sayth Renshaw
Hi Wondering if someone has this knowledge, and please forgive my maths expressions. If I want to estimate need results to achieve a goal at the end of a term updated weekly with real results how would I structure this? So as an example to illustrate my thought process(which could be wrong)

Re: Advice on Python build tools

2016-04-14 Thread Sayth Renshaw
but so much clearer. Anyway checked out mako which has some improvement might see if there is another with support and create a nikola plugin and then give it a try. Cheers Sayth On Thu, 14 Apr 2016 1:19 am Chris Warrick <kwpol...@gmail.com> wrote: > On 12 April 2016 at 11:48, Sayt

Re: What iterable method should I use for Lists of Lists

2016-04-17 Thread Sayth Renshaw
On Monday, 18 April 2016 12:12:59 UTC+10, Sayth Renshaw wrote: > On Monday, 18 April 2016 12:05:39 UTC+10, Sayth Renshaw wrote: > > Hi > > > > I have an XML and using pyquery to obtain the elements within it and then > > write it to csv. > > > > Wha

Re: What iterable method should I use for Lists of Lists

2016-04-17 Thread Sayth Renshaw
On Monday, 18 April 2016 13:13:21 UTC+10, Sayth Renshaw wrote: > On Monday, 18 April 2016 12:12:59 UTC+10, Sayth Renshaw wrote: > > On Monday, 18 April 2016 12:05:39 UTC+10, Sayth Renshaw wrote: > > > Hi > > > > > > I have an XML and using p

Re: scipy install error,need help its important

2016-04-17 Thread Sayth Renshaw
On Monday, 18 April 2016 13:53:30 UTC+10, Xristos Xristoou wrote: > guys i have big proplem i want to install scipy > but all time show me error > i have python 2.7 and windows 10 > i try to use pip install scipy and i take that error > > raise NotFoundError('no lapack/blas resources found') >

Re: scipy install error,need help its important

2016-04-17 Thread Sayth Renshaw
On Monday, 18 April 2016 13:53:30 UTC+10, Xristos Xristoou wrote: > guys i have big proplem i want to install scipy > but all time show me error > i have python 2.7 and windows 10 > i try to use pip install scipy and i take that error > > raise NotFoundError('no lapack/blas resources found') >

Re: What iterable method should I use for Lists of Lists

2016-04-18 Thread Sayth Renshaw
> > You're getting very chatty with yourself, which is fine... but do you > need to quote your entire previous message every time? We really don't > need another copy of your XML file in every post. > > Thanks! > > ChrisA Oops sorry, everytime I posted I then thought of another resource and

Re: lxml - SubElement dump root doesn't dump like Element dump does

2016-06-20 Thread Sayth Renshaw
On Monday, 20 June 2016 16:19:31 UTC+10, Peter Otten wrote: > Sayth Renshaw wrote: > > > Afternoon > > > > Wondering has anyone much experience with lxml specifically objectify? > > > > When I pick up a file with lxml and use objectify dumping root works

How to flatten only one sub list of list of lists

2017-02-28 Thread Sayth Renshaw
How can I flatten just a specific sublist of each list in a list of lists? So if I had this data [ ['46295', 'Montauk', '3', '60', '85', ['19', '5', '1', '0 $277790.00']], ['46295', 'Dark Eyes', '5', '59', '83', ['6', '4', '1', '0 $105625.00']], ['46295', 'Machinegun Jubs', '6', '53',

generator function - Called and accepts XML attributes- Python 3.5

2016-09-10 Thread Sayth Renshaw
Hi I want to create a generator function that supplies my calling function a file, how though do I get the generator to accept attributes in the argument when called? This works not as a generator for filename in sorted(file_list): with open(dir_path + filename) as fd: doc =

  1   2   3   >