|
Glad to see you're having fun! Keep at it!
|
# ? Sep 25, 2013 05:26 |
|
|
# ? May 9, 2024 05:03 |
|
I love PyCharm so much. The solo-dev license is a bit of a steep price for someone just messing about with Python in their spare time but if you plan on using Python a lot then really you owe it to yourself to give the 30 day trial a go. It does a good job of getting you into good habits like using virtual environments/source control/unit testing without abstracting what's going on underneath TOO much so that it all becomes a bit voodoo. I am seriously pissed off that I didn't take advantage of that offer a while back where they dropped the price to £10 or so. "Psh, waste of money Eclipse with PyDev does anything PyCharm can do ". drat you 6-months-ago-me. VVV That's awesome. It looks like the free version is Python only, so you don't get any of the framework support like Django etc. I'm using Django most of the time so I'd still need a pro license but for python projects I really don't think there's a better alternative out there. NtotheTC fucked around with this message at 12:58 on Sep 25, 2013 |
# ? Sep 25, 2013 11:07 |
|
NtotheTC posted:I love PyCharm so much. The solo-dev license is a bit of a steep price for someone just messing about with Python in their spare time but if you plan on using Python a lot then really you owe it to yourself to give the 30 day trial a go. It does a good job of getting you into good habits like using virtual environments/source control/unit testing without abstracting what's going on underneath TOO much so that it all becomes a bit voodoo. In a somewhat-uncanny coincidence, JetBrains have just released a free edition of PyCharm. I haven't tried it yet and don't quite know what it's missing when compared to the full edition, but hopefully it isn't horrendously gimped!
|
# ? Sep 25, 2013 12:10 |
|
Has anyone used comments withing a ConfigParser config file? I can set up comments within the file like so:code:
I know json is meant to be a bit more robust, but the configparser config files are a lot more readable, which is important. Please don't reccomend json. NtotheTC posted:I love PyCharm so much. The solo-dev license is a bit of a steep price for someone just messing about with Python in their spare time but if you plan on using Python a lot then really you owe it to yourself to give the 30 day trial a go. It does a good job of getting you into good habits like using virtual environments/source control/unit testing without abstracting what's going on underneath TOO much so that it all becomes a bit voodoo. I've not tried pycharm, but sublime text with a few of the python-centric bells and whistles looks like it covers almost the same feature set. Anaconda is a big help, gives you a lot in one easy to use package.
|
# ? Sep 25, 2013 15:16 |
|
NtotheTC posted:I love PyCharm so much. The solo-dev license is a bit of a steep price for someone just messing about with Python in their spare time but if you plan on using Python a lot then really you owe it to yourself to give the 30 day trial a go. It does a good job of getting you into good habits like using virtual environments/source control/unit testing without abstracting what's going on underneath TOO much so that it all becomes a bit voodoo. Dominoes fucked around with this message at 15:27 on Sep 25, 2013 |
# ? Sep 25, 2013 15:17 |
|
sharktamer posted:Has anyone used comments withing a ConfigParser config file? I can set up comments within the file like so: Comments are ignored when the config is parsed. So when you write a parsed config back out you will lose the comments. You can try a hack in your config writing code to get comments. http://stackoverflow.com/questions/6620637/python-configparser-question-about-writing-comments-to-files edit: here is a hack with a nicer end result but a more involved implementation http://stackoverflow.com/questions/8533797/adding-comment-with-configparser
|
# ? Sep 25, 2013 15:43 |
|
sharktamer posted:
That being said ST2 is easier for small one-file projects, and I use it extensively for those.
|
# ? Sep 25, 2013 15:53 |
|
Dominoes posted:I'm going to check it out again. Are the advantages it provides over a text editor like Notepad++ useful for things other than large projects? If you're doing anything with source control or anything that requires pulling in dependencies (meaning you should be using pip+venv) then yes it's leagues ahead of notepad++ and even ST2. If you're bashing out a 10 line script just to test something then obviously you're not going to be using any of the extra functionality it has over something like notepad++. Code completion/navigation are huge productivity boosters when you get used to them, I'm not sure if Notepad++ handles that for Python? I came from Eclipse+PyDev and thought it covered pretty much everything in terms of making the developers life easier, but PyCharm still consistently surprises me with small quality of life things. It might also depend on what you like as a developer. Personally I'm one of those people that adores PEP8, so I like the prompting you get from that. Some people may find that annoying and want to turn it off however. In any sort of advanced IDE you're going to get window encroachment what with all the additional panes, which can be troublesome for people with small monitors but PyCharm has easy ways to tuck them away out of site when you don't need them.
|
# ? Sep 25, 2013 16:25 |
|
NtotheTC posted:If you're doing anything with source control or anything that requires pulling in dependencies (meaning you should be using pip+venv) then yes it's leagues ahead of notepad++ and even ST2. If you're bashing out a 10 line script just to test something then obviously you're not going to be using any of the extra functionality it has over something like notepad++. Code completion/navigation are huge productivity boosters when you get used to them, I'm not sure if Notepad++ handles that for Python? I came from Eclipse+PyDev and thought it covered pretty much everything in terms of making the developers life easier, but PyCharm still consistently surprises me with small quality of life things.
|
# ? Sep 25, 2013 16:35 |
|
sharktamer posted:Has anyone used comments withing a ConfigParser config file? I can set up comments within the file like so: Write your changes to a different file and have ConfigParser merge them with the base options?
|
# ? Sep 25, 2013 16:58 |
|
Is there a way to add .py files to Pycharm projects without changing their directory on the drive? The official tutorial's geared at Django. I tried to get into Django, but put it off because it (or the approach the tutorials took) involved a lot of complicated things that normal Python doesn't, and broken dependencies/third-party software. Are PyCharm's features geared towards complex projects beyond normal Python? Dominoes fucked around with this message at 17:20 on Sep 25, 2013 |
# ? Sep 25, 2013 17:16 |
|
Dominoes posted:Is there a way to add .py files to Pycharm projects without changing their directory on the drive? If you want to get into Django I'd recommend following the official Django tutorial. There's definitely a fair amount of stuff to pick up on top of regular Python. I'm not sure what you mean by adding .py files without changing their directory, do you mean you have some project files already on disk somewhere that you want to create a pycharm project from?
|
# ? Sep 25, 2013 18:16 |
|
What's considered the "best" GUI toolkit for Python? Nothing super specialized, just learning how to make message boxes and windows and buttons. Also, I'm still trying to decide between Django and Rails for web development purposes...I want to learn another language, but Django's already installed on my computer.
|
# ? Sep 25, 2013 18:17 |
|
Dominoes posted:Is there a way to add .py files to Pycharm projects without changing their directory on the drive? You might try creating a symbolic link to the orginal .py file within your project. Alternately, you can add any directory tree to a pycharm project via Settings-> Project Settings-> Project Structure-> + Add Content Root, and then set any folder within that tree as a source folder that will be added to the PYTHONPATH of any python process pycharm runs (I think). The former solution might not mesh well with some of pycharm's internal mechanisms, while the latter can't add just single files to the PYTHONPATH. Both solutions have their own issues with versioning, project portability, and interpreter availability. All told, Pycharm is probably the best tool out there for managing large, complex python projects. However, intelligently managing any sizable code project adds a layer of complexity and headaches that no tool can totally abstract away.
|
# ? Sep 25, 2013 18:30 |
|
Haystack posted:You might try creating a symbolic link to the orginal .py file within your project. Alternately, you can add any directory tree to a pycharm project via Settings-> Project Settings-> Project Structure-> + Add Content Root, and then set any folder within that tree as a source folder that will be added to the PYTHONPATH of any python process pycharm runs (I think). The former solution might not mesh well with some of pycharm's internal mechanisms, while the latter can't add just single files to the PYTHONPATH. Both solutions have their own issues with versioning, project portability, and interpreter availability. This is something I've been having trouble with. I am poo poo at organization and a tool that would help me just template a project structure would be awesome. I think I'll try out this PyCharm thing.
|
# ? Sep 25, 2013 18:33 |
|
CX_Freeze/Scipy problem: I'm creating a Windows EXE using cx_freeze, Python3 and the Scipy installation from lfd.uci.edu. Upon running the exe, I receive the error: ImportError: cannot import name nonlin. The Scipy file line this references, in site-packages\scipy\optimize_root.py: from . import nonlin. I can load a console with Python, and successfully run import scipy.optimize.nonlin. Adding scipy.optimize.nonlin to my setup.py includes doesn't solve the problem. nonlin.py is located in the optimize directory in my scipy install, and its corresponding location as a compiled file in the library file cx_freeze generates. Any ideas?
|
# ? Sep 25, 2013 22:07 |
|
I think I might be getting into trouble with an equals sign and arrays. I have a code here with one array, metro, that I start with. I then need to make another array, metro2, that I need to equal metro. I make changes to metro2 (flipping one random value), and then calculate information from it and compare two values. If the changes pass, I make metro equal to metro2 and start the loop over again. My problem is that I just ran into a situation where the value mHp was larger than mH, so it should not have triggered any changes, yet at the end metro was equal to metro2. Is there another way to copy the information from one array to the other rather than equal signs? Because I think with the way python defines "equal" I might be getting into trouble. Thanks. edit: This is specifically what I'm referring to: http://www.saltycrane.com/blog/2007/11/how-to-copy-python-lists-or-other/ Here's my code Python code:
|
# ? Sep 25, 2013 22:37 |
|
metro2 = metro is making metro2 point to the same object as metro. When you modify one you are modifying both. metro2 = metro[:] will make a new copy and modifying one will only modify that copy.
|
# ? Sep 25, 2013 23:05 |
|
Thanks, that's exactly what I was looking for.
|
# ? Sep 25, 2013 23:09 |
|
the posted:I think I might be getting into trouble with an equals sign and arrays. metro2 = metro This results in metro2 being assigned the same object as metro, i.e. both variables point to the same thing. Without knowing what kind of object metro is I can't tell you how to get a copy, but maybe it has a copy() method or something like that which you can use.
|
# ? Sep 25, 2013 23:09 |
|
It's a 2d array, metro2 = metro[:] seems to work
|
# ? Sep 25, 2013 23:23 |
|
Pollyanna posted:What's considered the "best" GUI toolkit for Python? Nothing super specialized, just learning how to make message boxes and windows and buttons. PySide is my personal recommendation TkInter is another popular one, never personally used it https://wiki.python.org/moin/GuiProgramming has a decent list, you're probably going to have to filter through a lot of trash though
|
# ? Sep 26, 2013 00:34 |
|
fwiw, I don't like tkinter. I think it's popular mainly because it comes with a lot of python distributions. I liked PyGTK + glade pretty well and I believe the PyQt bindings provide a similarly nice experience.
|
# ? Sep 26, 2013 01:04 |
|
a lovely poster posted:PySide is my personal recommendation
|
# ? Sep 26, 2013 01:09 |
|
Alright, the earlier problem is still happening and I don't know why Here is my code. I added in questions and breaks in order to figure out what was going on. I'll only include the relevant part for the sake of brevity: Python code:
code:
|
# ? Sep 26, 2013 01:24 |
|
Wow, Kivy looks right up my alley. I'll try it out and see what it can do.
|
# ? Sep 26, 2013 01:25 |
|
the posted:Alright, the earlier problem is still happening and I don't know why In the code you posted previously, you have this part: Python code:
|
# ? Sep 26, 2013 01:32 |
|
Yes, I've fixed that. Sorry, here's the whole piece:Python code:
|
# ? Sep 26, 2013 01:35 |
|
Try metro2 = metro.copy() then. Sorry, based on the link in your earlier post I assumed you were talking about lists and I didn't look too closely at it.
|
# ? Sep 26, 2013 01:57 |
|
returnh posted:Try metro2 = metro.copy() then. Sorry, based on the link in your earlier post I assumed you were talking about lists and I didn't look too closely at it. Ok, thanks! Why doesn't metro2 = metro[:] work, though? edit: I got the whole thing working, finally, Thanks for your help guys the fucked around with this message at 02:08 on Sep 26, 2013 |
# ? Sep 26, 2013 02:00 |
|
the posted:Ok, thanks! Why doesn't metro2 = metro[:] work, though? That is just a clever trick that works on python lists.
|
# ? Sep 26, 2013 02:11 |
|
My problem with PyCharm (which I picked up when it went on sale) was that it seemed like I had to set my entire environment up in my native OS (Windows at the time). I usually ssh into a linux VM to run things and edit text files in a native editor over nfs/samba shares so it seemed like overkill, especially when sometimes I develop on my Mac and sometimes here. Maybe it's easier than I am making it out to be but ST2 seems to be working great for me.
|
# ? Sep 26, 2013 02:13 |
|
Houston, I have a problem. I am working on a problem where I have to work with some *really* large numbers. I.e. 2^100 and 2^400 I need to create arrays of those sizes. Numpy is borking out, (ValueError: Maximum allowed dimension exceeded). What can I do?
|
# ? Sep 26, 2013 04:09 |
|
Is that even physically possible? An array of length 2^100 would require more bytes of memory than there are atoms in the observable universe
|
# ? Sep 26, 2013 04:16 |
|
MeramJert posted:Is that even physically possible? An array of length 2^100 would require more bytes of memory than there are atoms in the observable universe Anything's possible when you can imagine it! I decided that it was probably best to create each one individually on the fly and do what I needed with it then create all 2^100 at once.
|
# ? Sep 26, 2013 04:37 |
|
the posted:Anything's possible when you can imagine it! http://www.freemars.org/jeff/2exp100/question.htm
|
# ? Sep 26, 2013 04:40 |
|
Hed posted:My problem with PyCharm (which I picked up when it went on sale) was that it seemed like I had to set my entire environment up in my native OS (Windows at the time). I usually ssh into a linux VM to run things and edit text files in a native editor over nfs/samba shares so it seemed like overkill, especially when sometimes I develop on my Mac and sometimes here. Maybe it's easier than I am making it out to be but ST2 seems to be working great for me. You can set up most IDEs to SCP files over to your target and run them when you click build. Alternatively, I think PyCharm has Vagrant support, so it could even build the VM for you, if necessary.
|
# ? Sep 26, 2013 04:43 |
|
the posted:Anything's possible when you can imagine it! Memory considerations are always important, especially in a language like Python. If you don't mind sharing, what exactly are you working on? Could you go a step further and use generators?
|
# ? Sep 26, 2013 04:49 |
|
the posted:Anything's possible when you can imagine it! I think you're going to need to reconsider the problem. If you were able to create and process 5 billion values per second, it would still take you 8,034,049,677,726 years to finish processing 2^100 items. It would take you 16,365,648,229,188,348,669,769,622,693,617,633,758,353,505,071,270,657,019,287,917,011,380,868,608,709,999,588,234,284,181,058,663,913,016 years to process your 2^400 items.
|
# ? Sep 26, 2013 05:15 |
|
|
# ? May 9, 2024 05:03 |
|
Houston Rockets posted:Memory considerations are always important, especially in a language like Python. If you don't mind sharing, what exactly are you working on? Could you go a step further and use generators? It's more appropriate for the Scientific/Computing thread in SAL, but here goes: I'm simulating an Ising Model. The first portion of the assignment was to create a 4x4 Array, where each spot was a -1 or 1. I had to create all 2^16 possible configurations. Then I had to calculate the "energy" by performing a calculation where each spot is multiplied by it's nearest neighbor and then summed over the entire configuration. The second portion of the assignment used what was called a Metropolis Algorithm, where a 4x4 matrix was randomly generated (or chosen from the list of all in part one). Then a random spot in the array was flipped in sign, and the energy was recalculated. If the energy level was within a certain parameter, the new array was kept and the cycle was repeated about 50000 times. The resulting data should equal part one. For the third part, I have to do the Metropolis algorithm for a 10x10 and 20x20 matrix, hence the 2^100 and 2^400 possible total configurations.
|
# ? Sep 26, 2013 05:25 |