Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

QuarkJets posted:

That's technically correct, which is the best kind of correct. Kind of like how a bicycle is basically a Ferrari, your smart phone is basically a supercomputer, or how genital herpes is basically a cold sore

(I'm a scientific computing guy so JS is a total non-starter; but I have messed around with Javascript integration in a Qt application for funsies, which is kind of cool because it makes it not too hard to create your C++ objects from Javascript. But you can also just do Python integration, which I've found is way more powerful)

Do you have any good resources for scientific computing with python you could recommend? I'm a scientific computing guy too and until a few months ago I've been working exclusively with Fortran and C. But now I've/we've switched to a new software package that's built on C++ but with python interfaces. I've managed to jump into python and get things running smoothly though the first few weeks were really confusing especially cause even though I "knew" what a class/oop was I didn't really know how to use them. Basically I've been reading a lot of "how to do things the python way" which are okay but I haven't found anything that was more on the lines of "how to do things the python way for fortran programmers with no oop experience."

Adbot
ADBOT LOVES YOU

QuarkJets
Sep 8, 2008

Boris Galerkin posted:

Do you have any good resources for scientific computing with python you could recommend? I'm a scientific computing guy too and until a few months ago I've been working exclusively with Fortran and C. But now I've/we've switched to a new software package that's built on C++ but with python interfaces. I've managed to jump into python and get things running smoothly though the first few weeks were really confusing especially cause even though I "knew" what a class/oop was I didn't really know how to use them. Basically I've been reading a lot of "how to do things the python way" which are okay but I haven't found anything that was more on the lines of "how to do things the python way for fortran programmers with no oop experience."

Like many/most scientific computing people, I'm self-taught (because even graduate-level scientific computing courses are mostly worthless), so I don't really know of any good resources are for learning OOP with scientific programming. But I'm pretty sure they exist! I'd recommend asking in the scientific/maths computing thread

For using Python you'll want to be aware of Numpy, which gives bindings to most of the good Fortran matrix math functions. It sounds like you're using a package that uses C++ for the lifting and Python as a glue language, which is really common and often very effective. Be aware that loops in Python are much slower than loops in C/Fortran, so the goal is to either write clever Numpy expressions or to export computationally-heavy loops to C/C++/Fortran (eg adding 1 to every element in an NxN array with Python for loops is slow, but the one-liner Numpy expression to do this is as fast as C/Fortran). The best advice is probably to write code in Python without caring much about efficiency, and then if speed is an issue start looking at how to make things faster; preemptive optimization is a trap and usually a waste of time.

Since you come from Fortran/C, just think of a class as a special type of structure, in that it can hold both variables (attributes) and functions (methods).

QuarkJets fucked around with this message at 22:01 on Dec 11, 2016

nonathlon
Jul 9, 2004
And yet, somehow, now it's my fault ...
I'm throwing together a simple CRUD webapp, for the first time in years. I took at look around at what was available, and settled on flask-appbuilder. Which leads to:

* Opinions on flask-appbuilder? The task really is simple (like one straightforward db object, no relationships) and I want to get it done and cleared as soon as possible.

* How do you handle flask-appbuilder migration / evolution of db schema? This seems to be weirdly missing from the documentation. Is it like any other flask app?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

outlier posted:

I'm throwing together a simple CRUD webapp, for the first time in years. I took at look around at what was available, and settled on flask-appbuilder. Which leads to:

* Opinions on flask-appbuilder? The task really is simple (like one straightforward db object, no relationships) and I want to get it done and cleared as soon as possible.

* How do you handle flask-appbuilder migration / evolution of db schema? This seems to be weirdly missing from the documentation. Is it like any other flask app?

Never used appbuilder, but the first google result for "flask-appbuilder migration" is this: https://github.com/dpgaspar/Flask-AppBuilder/issues/105

Baby Babbeh
Aug 2, 2005

It's hard to soar with the eagles when you work with Turkeys!!



I've been doing Python for about a year now, and I feel like I've finally gotten over the newbie hump. That is to say, given a task I can usually start to think about how I'd program it in Python, my Python programs mostly work, and when they don't it's not usually because of some giant, game-breaking flaw but rather because I made a small, dumb mistake that 5 minutes of Googling allows me to fix.

That is to say, I'm out of the zone of easy gains and into the vast, featureless plateau of mid-game mediocrity. I know I'm not very good, I know I'm not really using the language to its fullest potential, but I don't know exactly what I should be doing next. And it's tough because most of the resources for learning are aimed at beginners. These are too easy, but anything more advanced I struggle to understand.

So what are some good resources at this level? A lot of the stuff in the OP looks great, but it's also kind of old/often kind of 2.7 specific. Someone recommended O'Reilly's Python Cookbook as a good source for common Python patterns, but I'm also kind of the type of learner that needs a lot of the theory to pick things up. Memorizing a pattern doesn't really work for me, I need to know why if I'm going to remember to do it.

Cingulate
Oct 23, 2012

by Fluffdaddy
I think I used to be in a similar situation to you, and what took me to the next level (going from "abysmal" to "rather embarrassing") was contributing code to an open source project full of good coders and high coding standards. I'd submit code, get devastating reviews, and learn.
Github is a great learning tool.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
I'm at the same place. My personal next steps are understanding everything in the collections and abc libraries, and reading Fluent Python.

Eela6
May 25, 2007
Shredded Hen
Fluent Python is the best book on python programming I've ever read, and I take any opportunity to advertise it. I can vouch for the Python Cookbook - it's not simply recipes, it has decent explanations, too. Make sure you get the latest edition, it's substantially different from the python 2-focused versions. Effective Python is good too, It's very concise and doesn't have as much theory or explanation, so it might not be what you're looking for. The author of that text, Brett Slatkin, has a number of tutorials on YouTube that are worthwhile in their own right.

YouTube is a great resource for python knowledge, actually. Most of the presentations from the last four years or so of PyCons are available. Maybe start with Raymond Hettinger, who is a python core developer and one of the best python educators I've ever seen. 'Beyond Pep8' is a great piece on 'pythonic style', and his recent talk in Russia about async and parallelism was really good too, if you're looking for a place to start with that.

If you don't have a formal CS background and like theory, you can't do better than the big white book Introduction to Algorithms . A real programmer should never spend too long without reviewing the core material.

If you aren't familiar with these libraries, get familiar :
collections, functools, itertools

Eela6 fucked around with this message at 23:30 on Dec 15, 2016

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

QuarkJets posted:

Like many/most scientific computing people, I'm self-taught (because even graduate-level scientific computing courses are mostly worthless), so I don't really know of any good resources are for learning OOP with scientific programming. But I'm pretty sure they exist! I'd recommend asking in the scientific/maths computing thread

For using Python you'll want to be aware of Numpy, which gives bindings to most of the good Fortran matrix math functions. It sounds like you're using a package that uses C++ for the lifting and Python as a glue language, which is really common and often very effective. Be aware that loops in Python are much slower than loops in C/Fortran, so the goal is to either write clever Numpy expressions or to export computationally-heavy loops to C/C++/Fortran (eg adding 1 to every element in an NxN array with Python for loops is slow, but the one-liner Numpy expression to do this is as fast as C/Fortran). The best advice is probably to write code in Python without caring much about efficiency, and then if speed is an issue start looking at how to make things faster; preemptive optimization is a trap and usually a waste of time.

Since you come from Fortran/C, just think of a class as a special type of structure, in that it can hold both variables (attributes) and functions (methods).

Got any examples for this numpy stuff?

pmchem
Jan 22, 2010


Boris Galerkin posted:

Got any examples for this numpy stuff?

http://www.scipy-lectures.org/
https://ipgp.github.io/scientific_python_cheat_sheet/
http://kitchingroup.cheme.cmu.edu/pycse/

Eela6
May 25, 2007
Shredded Hen

Boris Galerkin posted:

Got any examples for this numpy stuff?

https://www.youtube.com/watch?v=EEUXKG97YRw

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

One of my favorite things about javascript ES2015 is template literals.
JavaScript code:
let aSeven = 7
let aThree = 3
let aString = `I'm a template literal and this is number ${aSeven + aThree}`
Anyway, I've been messing around with Python 3.6, and one of my favorite features is PEP-489's f-strings!

Python code:
>>> import datetime
>>> name = 'Fred'
>>> age = 50
>>> anniversary = datetime.date(1991, 10, 12)
>>> f'My name is {name}, my age next year is {age+1}, my anniversary is {anniversary:%A, %B %d, %Y}.'
'My name is Fred, my age next year is 51, my anniversary is Saturday, October 12, 1991.'
>>> f'He said his name is {name!r}.'
"He said his name is 'Fred'."
It's great! Makes string formatting so much less irritating and verbose.

Python 3.6 expected on the 23rd...

Hed
Mar 31, 2004

Fun Shoe
I just noticed that on the Py3.6 release notes this week. I must say I haven't used str.format() much because of its verbosity for simple strings but I'm excited to try f-strings.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I mean, it's nice, but at the same time, now Python has three string formatting options without any recommendations or standards for which ones you should use where.

Eela6
May 25, 2007
Shredded Hen

Suspicious Dish posted:

I mean, it's nice, but at the same time, now Python has three string formatting options without any recommendations or standards for which ones you should use where.

I fully intend to use f-strings exclusively going forward. I like the syntax a lot and I think they are easiest to understand. They work "pretty much how you would expect", which is generally a sign of good code. I don't think it's a ton of extra mental overhead for python programmers to understand.

That said, I get that this is messier than it could be. It's not exactly living up to "there should be one way to do it".

With the impending release of 3.6, I am most excited for the new dict/set {} implementation. Basically, all dicts are faster OrderedDicts. Since classes and functions use dictionaries internally, this opens up a lot of fun areas for metaprogramming!

Eela6 fucked around with this message at 06:44 on Dec 18, 2016

QuarkJets
Sep 8, 2008

I think f-strings are really cool and I see nothing wrong with having a new, cool string formatting option that works well

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun
That seems cool but I wonder why it got adopted when .format() is perfectly acceptable, this could turn into unreadable nightmare code (to be fair, so could .format() if you don't name everything, but I'm imagining a world where people are just throwing lambdas and callables into their format strings because they're too clever for their own good), and its purpose seems to solely be to save keystrokes. Like, I don't think it's a bad idea, but it seems like an option that exists solely because it can exist, and given the existence of .format(), seems a bit excessive.

Imagine someone doing this:
Python code:
def do_a_thing(x):
    if state == 'Z':
        return x
    else:
        return x * 2

y = 3

string1 = f"I'm a bad idea: {do_a_thing((lambda x: x * 2 if x % 2 == 0 else x * x)(y))}"
# or they could be more of an rear end in a top hat
string2 = f"I'm also a bad idea: {'{}'.format('GAH')}"
You can do this terrible nonsense with .format() of course, but with .format() all that nonsense is contained at the end of the string and isolated from the string, so it's a bit more readable and easier to fix. A well-disciplined team would avoid this, but I've seen enough "clever" code in my day-to-day that I know someone would think this is a good idea and create an unmaintainable mess.

I mean, it's mostly theoretical for me because we're still on Python 2.7. I want Python 3, it's such a nice language :smith:

Ghost of Reagan Past fucked around with this message at 17:37 on Dec 18, 2016

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!
The problem with .format() is that it removes the context of what a variable is from where it is in the string, especially when there are multiple variables to fill in. Consider the difference in readability between:
Python code:
"Hello, {}!".format(thing)
f"Hello, {thing}!"

# Even worse...
"{}:{}@{}".format(username, password, host)
f"{username}:{password}@{host}"
You can get this behavior with .format(), but it requires a lot of repeated code given how common an occurrence it is:
Python code:
"Hello, {thing}!".format(thing=thing)
You can technically kind of replicate f-strings with format by doing:
Python code:
"Hello, {thing}!".format(**locals())
but that's kinda nasty.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Ghost of Reagan Past posted:

You can do this terrible nonsense with .format() of course, but with .format() all that nonsense is contained at the end of the string and isolated from the string, so it's a bit more readable and easier to fix. A well-disciplined team would avoid this, but I've seen enough "clever" code in my day-to-day that I know someone would think this is a good idea and create an unmaintainable mess.

I mean, people are going to write unreadable code no matter what tools you give them. Here's a couple of your choices:

1. Leave string formatting as it is and bad coders will make unreadable messes of their strings in the various ways .format() lets you do and good coders will have strings that look ok but have a lot of repetition.
2. Introduce f-strings and bad coders will make unreadable messes right in the middle of their strings and good coders will have strings that look great in a succinct manner.

Personally, I prefer option #2.

Eela6
May 25, 2007
Shredded Hen

Thermopyle posted:

I mean, people are going to write unreadable code no matter what tools you give them. Here's a couple of your choices:

1. Leave string formatting as it is and bad coders will make unreadable messes of their strings in the various ways .format() lets you do and good coders will have strings that look ok but have a lot of repetition.
2. Introduce f-strings and bad coders will make unreadable messes right in the middle of their strings and good coders will have strings that look great in a succinct manner.

Personally, I prefer option #2.

Python gives you a lot of power and freedom. It lets you do things the way you want to. The good side of this is that well-written Python is some of the cleanest and easiest to understand code out there. The bad side of this is that there is no floor on just how bad Python coding can get.

There are plenty of languages that attempt to raise the floor by adopting a lot of restrictions, - Golang strikes me as an extreme example. Java doesn't have operator overloading for the same reason: abuses of operator overloading can make code almost impossible to understand. I think that's a valid approach for a language, but I like the way python is. It makes well-written libraries a pleasure to use.

For example, let's take numpy. An expression like
Python code:
A[A < 20] = 0
is pretty easy to understand, but would be a pain to express in Java, because it uses not one but three overloaded operators: __le__, __setitem__, and __getitem__.

[If you're reading the thread and not familiar with numpy or MATLAB, this means 'set every item in A that's less than 20 to zero']

Obviously a new way to format strings is not quite the same as operator overloading, but I think the same basic ideas apply.

I've always enjoyed this aphorism and think it applies: "Python is a language for consenting adults."

Eela6 fucked around with this message at 22:32 on Dec 18, 2016

QuarkJets
Sep 8, 2008

Ghost of Reagan Past posted:

That seems cool but I wonder why it got adopted when .format() is perfectly acceptable, this could turn into unreadable nightmare code (to be fair, so could .format() if you don't name everything, but I'm imagining a world where people are just throwing lambdas and callables into their format strings because they're too clever for their own good), and its purpose seems to solely be to save keystrokes. Like, I don't think it's a bad idea, but it seems like an option that exists solely because it can exist, and given the existence of .format(), seems a bit excessive.

Imagine someone doing this:
Python code:
def do_a_thing(x):
    if state == 'Z':
        return x
    else:
        return x * 2

y = 3

string1 = f"I'm a bad idea: {do_a_thing((lambda x: x * 2 if x % 2 == 0 else x * x)(y))}"
# or they could be more of an rear end in a top hat
string2 = f"I'm also a bad idea: {'{}'.format('GAH')}"
You can do this terrible nonsense with .format() of course, but with .format() all that nonsense is contained at the end of the string and isolated from the string, so it's a bit more readable and easier to fix. A well-disciplined team would avoid this, but I've seen enough "clever" code in my day-to-day that I know someone would think this is a good idea and create an unmaintainable mess.

I mean, it's mostly theoretical for me because we're still on Python 2.7. I want Python 3, it's such a nice language :smith:

This is like arguing that we shouldn't make screwdrivers because some idiot might poke himself in the eye.

Xarn
Jun 26, 2015
Probation
Can't post for 20 hours!
I have trouble with Mypy in Python 3.5, specifically with OrderedDict.

I know that an OrderedDict is always going to have string keys and specific type as values, but when running the script it complains that I am trying to index a type. However Mypy is ok with it and even type checks the variables properly, warning if I try to insert bad type.

Reduced example:
Python code:
#!/usr/bin/env python3.5

from collections import OrderedDict

# this works
def foo() -> OrderedDict:
    result = OrderedDict() # type: OrderedDict[str, int]
    result['foo'] = 123
    return result

# this doesn't
def foo2() -> OrderedDict[str, int]:
    result = OrderedDict() # type: OrderedDict[str, int]
    result['foo'] = 123
    return result

print(foo())
Leads to
code:
Traceback (most recent call last):
  File "./foo.py", line 12, in <module>
    def foo2() -> OrderedDict[str, int]:
TypeError: 'type' object is not subscriptable
Anyone knows what is up with that?

Eela6
May 25, 2007
Shredded Hen
Just a guess, but the class constructor might be the wrong approach. I'm on my phone, but try


code:
OrderedDict: [str,  Numbers.Integral] 


This might be barking completely up the wrong tree, though.

mystes
May 31, 2006

Xarn posted:

I have trouble with Mypy in Python 3.5, specifically with OrderedDict.

I know that an OrderedDict is always going to have string keys and specific type as values, but when running the script it complains that I am trying to index a type. However Mypy is ok with it and even type checks the variables properly, warning if I try to insert bad type.

Anyone knows what is up with that?
Can you even do this in MyPy? If OrderedDict is just a normal class, isn't there no way for MyPy to understand that it should actually take type parameters? Surely this is why you need the separate "typing" namespace?

Dominoes
Sep 20, 2007

mystes posted:

Can you even do this in MyPy? If OrderedDict is just a normal class, isn't there no way for MyPy to understand that it should actually take type parameters? Surely this is why you need the separate "typing" namespace?
Nailed it; it's the same reason you important List, Dict etc from typing, and use those rather than the builtin list, dict.

I'm don't know if there's a clean solution to this. You could probably call it a Dict and things would mostly work out. (although you're losing some of the self-documentation value; add a comment?). Or leave it as OrderedDict, but skip defining the key/val types.

Here's a SA post with another thought: post

Xarn
Jun 26, 2015
Probation
Can't post for 20 hours!

mystes posted:

Can you even do this in MyPy? If OrderedDict is just a normal class, isn't there no way for MyPy to understand that it should actually take type parameters? Surely this is why you need the separate "typing" namespace?

Actually Mypy understands just fine
Python code:
# Mypy: Needs type annotation for result
def foo() -> OrderedDict:
    result = OrderedDict()
    result['foo'] = 123
    result[123] = 123
    return result

# Mypy: No problems here
def foo2() -> OrderedDict:
    result = OrderedDict() # type: OrderedDict
    result['foo'] = 123
    result[123] = 123
    return result

# Mypy: Invalid index type "int" for "dict"
def foo3() -> OrderedDict:
    result = OrderedDict() # type: OrderedDict[str, int]
    result['foo'] = 123
    result[123] = 123
    return result
Its Python that has problems with this. Before this I actually though that Python ignores the parts after '->' completely :v:.


Dominoes posted:

You could probably call it a Dict and things would mostly work out. (although you're losing some of the self-documentation value; add a comment?).

Here's a SA post with another thought: post
I remember trying Dict and it didn't work (mypy complained), but apparently it does when I am not loving tired, so Dict it is.

Is some sort of OrderedDict standin not being in typing a bug or is it intended?

qkkl
Jul 1, 2013

by FactsAreUseless
Anyone have experience using Numba to run Python code on the GPU via CUDA? I have some working python code that is running on my GPU fine, but it is using 64-bit floating point operations. These are a lot slower than 32-bit operations on the GPU, but I can't figure out how to force Numba to use 32-bit. Is there a flag I can set somewhere that will force 32-bit operations to be used?

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Asymmetrikon posted:

You can technically kind of replicate f-strings with format by doing:
Python code:
"Hello, {thing}!".format(**locals())
but that's kinda nasty.

I wish there was room in the spec to add implicit naming to dictionary literals like JS is doing, you could just do something like
Python code:
meatbag = 'some guy - who cares'
"Hello, {meatbag}".format(**{meatbag})
Which would mostly obviate the need for a 'better' formatting option.

Huh, I thought 3 deprecated the modulo formatting, but I guess not? I mean, I would have, but whatever.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Yes, the implicit dict keys from JS is another thing Python needs to implement, ASAP. It's a big quality of life improvement.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



They can't do what I did there because {thing} already means "make a set consisting of 'thing'". IDK how you get around that without doing something kind of gross and unintuitive.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
I may have mentioned it in this thread already, but PEP 519 is what makes me happiest about using 3.6 (and prompted me to install 3.6 on all of my machines shortly after beta 4 was released). I've been heavily using pathlib in my code since it was added to the standard library in 3.4, and it's always been kind of painful to wrap Path objects in str() when passing them to many standard library functions and convenience I/O functions in third party libraries. It's really nice to drop the calls to str() and not worry about what specific type I'm using, as long as it implements the os.PathLike protocol.

The March Hare
Oct 15, 2006

Je rêve d'un
Wayne's World 3
Buglord

Lysidas posted:

I may have mentioned it in this thread already, but PEP 519 is what makes me happiest about using 3.6 (and prompted me to install 3.6 on all of my machines shortly after beta 4 was released). I've been heavily using pathlib in my code since it was added to the standard library in 3.4, and it's always been kind of painful to wrap Path objects in str() when passing them to many standard library functions and convenience I/O functions in third party libraries. It's really nice to drop the calls to str() and not worry about what specific type I'm using, as long as it implements the os.PathLike protocol.

Pathlib is a godsend.

Edison was a dick
Apr 3, 2010

direct current :roboluv: only
Pathlib is hot garbage that assumes all file paths are unicode. It continues to perpetuate a flawed assumptions of how paths work.
At least now the reason why it crashes if your home directory isn't encodable as unicode is that the pwd module is making the assumption rather than pathlib itself assuming that your home directory is encodable as a unicode string.

QuarkJets
Sep 8, 2008

qkkl posted:

Anyone have experience using Numba to run Python code on the GPU via CUDA? I have some working python code that is running on my GPU fine, but it is using 64-bit floating point operations. These are a lot slower than 32-bit operations on the GPU, but I can't figure out how to force Numba to use 32-bit. Is there a flag I can set somewhere that will force 32-bit operations to be used?

Have you tried importing float32 from numba and using that as the datatype for your data?

yippee cahier
Mar 28, 2005

Edison was a dick posted:

Pathlib is hot garbage that assumes all file paths are unicode. It continues to perpetuate a flawed assumptions of how paths work.
At least now the reason why it crashes if your home directory isn't encodable as unicode is that the pwd module is making the assumption rather than pathlib itself assuming that your home directory is encodable as a unicode string.

Maybe I'm a dummy but can you post a quick example of a home directory path that can't be represented by a unicode string?

qkkl
Jul 1, 2013

by FactsAreUseless

QuarkJets posted:

Have you tried importing float32 from numba and using that as the datatype for your data?

Yes, but you have to wrap every variable in the code with it. I know that the native CUDA API has an option that forces single-precision operations to be used, and was wondering if the Numba API exposed it somehow.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

yippee cahier posted:

Maybe I'm a dummy but can you post a quick example of a home directory path that can't be represented by a unicode string?

There were a bunch of posts by user hackbunny in the coding horrors thread (iirc) in the past week or two about the crazy encodings of path names.

On phone, otherwise I'd find them for you...

FoiledAgain
May 6, 2007

Thermopyle posted:

There were a bunch of posts by user hackbunny in the coding horrors thread (iirc) in the past week or two about the crazy encodings of path names.

On phone, otherwise I'd find them for you...

http://forums.somethingawful.com/showthread.php?threadid=2803713&userid=0&perpage=40&pagenumber=954#post466866270

Paul MaudDib
May 3, 2006

TEAM NVIDIA:
FORUM POLICE
What's the best all-around choice for an ORM? I am doing a simple project right now so it's not super critical but I'm trying to pick up skills that I could apply to other projects and I might as well start out properly.

edit: is there anything with a feature like Hibernate's hbm2ddl.auto functionality where it can create a valid database from the mapping configs?

Paul MaudDib fucked around with this message at 01:11 on Dec 21, 2016

Adbot
ADBOT LOVES YOU

Tigren
Oct 3, 2003

Paul MaudDib posted:

What's the best all-around choice for an ORM? I am doing a simple project right now so it's not super critical but I'm trying to pick up skills that I could apply to other projects and I might as well start out properly.

edit: is there anything with a feature like Hibernate's hbm2ddl.auto functionality where it can create a valid database from the mapping configs?

SqlAlchemy if not using Django. Django's ORM if you are.

  • Locked thread