Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyutils module
#1
i'll upload/embed it here and see if i live through it.

works!  i used "(Select All)" and saved it and checked it and got an identical file.  md5 checksum is: 45a5d821d22b508421255ba6663a9e45
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
#2
see, i make mistakes. now i gotta do it all over, again (the edit button is gone)

Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
#3
Quote:
if version_info[:3] >= (3,4,0):
    from base64         import a85decode, a85encode

...but then you never use the imported functions?  And they're also undefined, if you're using an older version of python?
#4
Quote:see, i make mistakes. now i gotta do it all over, again (the edit button is gone)
This is actually better for the flow of dialogue. This is not the best example, but imagine if there were a few other people's posts between your first and second post. If you edit your initial post, the posts after it does not makes sense. Imagine someone coming to this thread having the exact same problem, and not being able to understand what is going on because people are editing their posts.
Recommended Tutorials:
#5
What happened a lot at the old forums, was someone would ask a homework question, then after they got the answer, they'd edit the original post to delete all traces of themselves. It's why the first reply was almost always just a quote of what they said, so they couldn't do that, lol.
#6
I made a new help doc...i know this is going to be asked numerous times in the future.
http://python-forum.io/misc.php?action=help&hid=32


:s
Recommended Tutorials:
#7
(Oct-04-2016, 07:39 PM)nilamo Wrote:
Quote:
if version_info[:3] >= (3,4,0):
    from base64         import a85decode, a85encode

...but then you never use the imported functions?  And they're also undefined, if you're using an older version of python?

is importing a function and not using it in the module considered bad?

i used to have a separate module just to import frequently used functions.  i merged that module because there were a lot of imported functions that were the same.  i wanted to have just one import in my other code so i merged them. then i made the base64 stuff more consistent by filling in the gaps for encode/decode.  i have yet to figure out the difference between a85... and b85...  i decided to include both, but maybe i don't need to.  if the a85 functions would be less often used in other code or a85 is an odd encoding then i would be inclined to remove them.  but i would not remove the version test. is that an issue?

(Oct-04-2016, 07:58 PM)metulburr Wrote: I made a new help doc...i know this is going to be asked numerous times in the future.
http://python-forum.io/misc.php?action=help&hid=32


:s

the difference between the code inserts was a typo ("b64" where it should have been "b85" on line45).  if i had been able to edit the inserted code, i would be fixing a typo. but code could be considered different; someone may have already downloaded the bad one.

a discussion around code (or documentation) might be good to have a wikipedia style history flow so everyone can see all the changes. but i have seen no forum with this feature. maybe a parallel wiki.python-forum.io would have uses.

the new way to display code is nice.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
#8
Quote:everyone can see all the changes. but i have seen no forum with this feature
That would be ideal. I was actually looking for a plugin like this when i first installed this software.  If we were able to do that, then we could be more lenient in editing.
Recommended Tutorials:
#9
(Oct-05-2016, 04:25 AM)Skaperen Wrote: is importing a function and not using it in the module considered bad?
No, it's just odd that the function is only sometimes there... there's no fallback for an older version of python. And if it's not being used within the module, and only there to help make something *else* easier, then you should probably add a comment saying so.
#10
(Oct-05-2016, 02:34 PM)nilamo Wrote:
(Oct-05-2016, 04:25 AM)Skaperen Wrote: is importing a function and not using it in the module considered bad?
No, it's just odd that the function is only sometimes there... there's no fallback for an older version of python.  And if it's not being used within the module, and only there to help make something *else* easier, then you should probably add a comment saying so.

the a85 and b85 functions were added in Python 3.4.0.  i want other stuff to still work if my module is imported in an earlier version.  i do the same test for the def of functions that depend on those a85 and b85 functions, so that importing my module (maybe by code i provide in the future) is not the point of failure.  dealing with cases like this is always tricky.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.


Possibly Related Threads…
Thread Author Replies Views Last Post
  pyutils.py Skaperen 8 6,055 May-09-2020, 01:22 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020