Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Extracting the Date from the UI date and time spinner
-
@Phuket2
what about the header of the list??
#fieldnames = list(data_dict.keys()) # get a list of the keys to use as the header
as long we use list we skip an important figer whish the header of the cells
my Quation is can we cobine the two methods
(dict )for header and( list )for appending the value?
like dict is outer method and inside this dict sublist to store order data?? -
@Phuket2
i tried in both sides lists inside dict & and dicts inside one list
but i got invalid sentax 🤔😒
any idea.. -
Can we get a GitHub repo here so that @abushama can post the original code and we can set in pull requests for targeted fixes? EDIT: added
fields
for readabilityfrom collections import namedtuple fields = ('year', 'month', 'day', 'text') note = namedtuple('note', fields) notes = [note(2017, 8, 11, 'yesterday'), note(2017, 8, 12, 'today'), note(2017, 8, 13, 'tomorrow')] fmt = '{:<10} {:<10} {:<10} {}' print(fmt.format(*fields)) for n in notes: print(fmt.format(*n)) """ year month day text 2017 8 11 yesterday 2017 8 12 today 2017 8 13 tomorrow """
-
@ccc, I made a repo here. I am not sure I did it in a smart way or not. I tried to give it a bit of structure in case have to help someone else, including myself :) in the future.
@ccc, I have looked for this, a permission to let anyone do what they want to the repo without having to invite them. So they can push, pull merge etc...It seems something like that would make sense for a repo like this.
Anyway, any thoughts to make the structure of the repo better would be appreciated. Even if i have to start again, that's ok. I did create the repo in github, web. But i was able to clone it, and push the pyui to it from Pythonista using StaSh. That's a big step for me. I am still not using ssh keys yet. I will get to that nextSide Note to @omz : Is there a thread id that you suppress in the forum's display? This would be handy for something like this when making a repo to work with someone on a forum problem....Just a though (btw, i just mean a single id for a thread, at the first message).
-
@abushama , I am not sure why you are getting an error. I copied the code straight from the post and pasted it into a new file and it worked. Well, some extra text is copied in that I had to delete, but that should be fairly obvious. But it works under 2.7 and 3.6.
But please when you get invalid syntax, or an error, copy it and paste it into your post. I know some of these things can be confusing when you are first getting started. But it should not take long before you start to get the hang of it. I would hold off on @ccc suggested code for the moment, even though it maybe better. Focus on get the list version going first. Once that's up and running correctly, can upgrade it and more Pythonetic.@abushama, the latest version of the code (list version as above) and the test pyui file is in a repo here. If you don't know about Github and repos, lets not get into that here on this post. I barely can use them.
But anyway, please look at the list version of the code closely. Make sure you haven't changed it accidentally or copied extra info from the post (look at the very top of you file).
If you still get the error, please copy the error and paste it in a post. If you do get it working, please let us know!Determined to get you going with this :)
-
I would hold off on @ccc suggested code
Always good advise. ;-) I edited my code above to make it easier to understand.
-
@Phuket2
it works👍🏽
thank you -
@ccc
thank you
ur code is helpful
and the advice ander process -
@abushama here is version using namedtuples as @ccc pointed out. It's worth to look at if you don't know about namedtuples.As @ccc would say, they are your friend :) Don't worry if you have moved on about this topic. It was good for me to do it, I am trying to get my python code to be more compliant and pass the style checks and pyflakes test. So just take a look if you are interested.
-
dear fellowz
i am really getting avery good informationz from both of u
and i explore ur pagez u r far step over in this pythonista app which am very lucky that my simple project get ur attention and both of u willing to help me to do it in right way.
as i said before am still KG1 In pythonista😂 so now adays am trying to learn how to store this data that i come up with not in CSV file but in SQLite file so i can manpulate in the future.
and if i face any challngez first thing i will do to knock ur doors both of u asking for ur help😂
so thank u very much once again and best wishz in ur projects