Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Feb 24, 2016 00:17
When I attempt a pip install using --extra-index-url [site:7001], it searches /simple/foo/ and /foo/ folders, doesn't find anything.
Feb 24, 2016 00:15
First time using PyPi to make a localized pip repo, can't seem to get my package showing in the supposed packages folder, located at ~/packages/ as per the simple setup. I do a pypi-server -U and it shows nothing, and when I run and check the web interface, there's nothing under /packages nor /simple. Anyone know some quick, easy things to check for? I followed the setup steps, created and modified my ~/.pip/pip.conf to include the index-url, etc.
Jun 9, 2015 22:32
Correct.
Jun 9, 2015 22:32
and not "Person LIVE! (07-30-91)"
Jun 9, 2015 22:31
But not "This Guy Live 08-11-92"
Jun 9, 2015 22:31
So something like "Some Band [95-96]"
Jun 9, 2015 22:31
@JonClements I should've clarified, this needs to find the first two options ANYWHERE in a string. The most common case is in brackets.
Jun 9, 2015 22:23
And why the parentheses?
Jun 9, 2015 22:22
@Jon How's that different from mine?
Jun 9, 2015 22:19
That was my current regex, but it matches on '07-09'
Jun 9, 2015 22:19
re.compile (r"\b'?\d\d-'?\d\d\b", re.IGNORECASE)
Jun 9, 2015 22:19
I did, but it matches for both.
Jun 9, 2015 22:18
Melon! Anyhoo, I'm a tad stumped. Any idea how to match something like "95-96" or "'95-'96" but not match "07-09-15" or any \d\d-\d\d-\d\d formats?
Jun 9, 2015 22:17
I've been here several times and never even heard of salad talk haha.
Jun 9, 2015 22:15
What's cbg? Did I miss something lol?
Jun 9, 2015 22:14
?
Mar 6, 2015 00:27
Easiest way to do this?
Mar 6, 2015 00:27
I just need a way to take a file, split into equal chunks, have each processed in its own thread, and return each thread's results.
Mar 6, 2015 00:25
I'm a tad confused about multiprocessing Queues in this case. :\
Mar 6, 2015 00:25
I got it working, but it's not getting the remainder of the Queue, only successfully getting when it doesn't run out.
Mar 6, 2015 00:24
Learning the multiprocessing library, need to split up a file and have each process work on a predefined amount. Is it viable to send in a multiprocessing Queue() filled with the full input file, and then in each Process() function have them Queue().get() until they have the chunk amount?
Feb 13, 2015 00:34
So if I have:
import static_data
data = static_data ()
main ()
The code in main() will always have whatever was done in static_data (), correct?
Feb 13, 2015 00:33
If you import a Python file and call its init, it HAS to complete doing so before your code continues right?
Feb 3, 2015 21:49
Thanks gents.
Feb 3, 2015 21:49
Will do.
Feb 3, 2015 21:49
Okay figured as much.
Feb 3, 2015 21:49
Does that take advantage of multiple cores on a box?
Feb 3, 2015 21:49
What's the library I should look into?
Feb 3, 2015 21:49
I'll look into doing it all in Python, I'd prefer that anyway.
Feb 3, 2015 21:48
What's so bad with Bash? It's on an 18-core Unix box, so they made it seem like that was fine to handle 1-16 concurrent Python scripts running in unison.
Feb 3, 2015 21:47
It's just what someone else was doing so I figured out how to do it.
Feb 3, 2015 21:47
I'm brand new to Bash.
Feb 3, 2015 21:46
Ergh, splits the data and passes it to each.
Feb 3, 2015 21:46
I see what you're saying. The "master" currently is the Bash file that splits and creates the Python files.
Feb 3, 2015 21:45
Which is something I could probably just do all in Python.
Feb 3, 2015 21:44
I'm not forking, I'm creating multiple Python processes with a batch file and passing in whatever parsed info to each.
Feb 3, 2015 21:44
Like if I did the list loading in each, it'd load it however many times there were parallel Python scripts running.
Feb 3, 2015 21:43
I'm just wondering if that's a smart way for a bunch of parallel Python scripts to access the same data without having to load it into memory more than once.
Feb 3, 2015 21:43
What do you mean "share data"?
Feb 3, 2015 21:42
Interesting.
Feb 3, 2015 21:42
So would you consider that the best way to have centralized loaded data for multiple parallel processes to get data from?
Feb 3, 2015 21:41
But the following times, it does not?
Feb 3, 2015 21:41
So the first time it's imported, it executes the file, right?
Feb 3, 2015 21:41
See, I did not know that.
Feb 3, 2015 21:40
Stupid question, I know, but I'm trying to find a way to only load data centrally and let all the instantiations use it without duplicating it.
Feb 3, 2015 21:40
I've got two files, A.py and B.py. B contains a class, B_data, that creates and populates lists with data from text files. On B_data.__init__, they are populated. If multiple instantiations of A call "import B", I assume they're multiple instantiations of B being called, right?
Dec 18, 2014 17:52
Yup, all relative to the same parent directory.
Dec 18, 2014 17:52
Okay, cool. Thanks!
Dec 18, 2014 17:52
No autocomplete, damnit chat.
Dec 18, 2014 17:52
Oh cool, thanks @ff