|
So are most people using 3.x for new projects now vs. 2.x? Also, even though it sounds fking evil, anyone using iron python?
|
# ? Oct 3, 2010 00:24 |
|
|
# ? Jun 13, 2024 05:29 |
|
Turk182 posted:So are most people using 3.x for new projects now vs. 2.x? Also, even though it sounds fking evil, anyone using iron python? Use 3.X when you can, and 2.X when you must (read: you need some library). No usage of IronPython, sorry.
|
# ? Oct 3, 2010 00:33 |
|
Be aware though that "when you must" might as well be: "if you intend to do anything for wider consumption" Toy projects, do what you want, but be at least familiar with 2.x syntax and use 2to3 where you can.
|
# ? Oct 3, 2010 03:38 |
|
Does anyone know how to change the last modified date/time of a directory using Python on a Windows OS? os.utime doesn't work as directories in Windows are not classified as 'files' apparently. I was thinking about getting the directory, creating a file within the directory and then subsequently deleting it, but that solution doesn't directly change the date/time, it's just a side effect of the file creation/deletion and it seems really inefficient. EDIT: I was doing it wrong apparently, just tested it again and now it works. Ghetto Wizard fucked around with this message at 16:02 on Oct 4, 2010 |
# ? Oct 4, 2010 15:54 |
|
It doesn't seem like there is a idiomatic way to update last modified times on directories in windows through python, although the kludge of creating a file there and removing it will mostly work (unless you don't have permissions to create files in that directory, although I'm not really sure if you could even affect that last modified time without that permission). It sounds like you're happy with what you came up with, but my suggestion was going to be to use the unix "touch" program, since its designed for exactly that use case. You can get it for windows here: http://gnuwin32.sourceforge.net/packages/coreutils.htm
|
# ? Oct 4, 2010 22:55 |
|
So I am pretty new to programming. I am mainly just screwing around right now. Currently I have this:code:
i = 5 if i is less than 10 add one to i. repeat until i = 10. Right now it adds the one to i since it is only 5 to start with, leaving me with 6, but how do I get it to repeat (I think this is called a loop?) until i is 10? I looked at some documentation but it isn't much help since I don't really know technical names for what I am trying to do.
|
# ? Oct 5, 2010 09:32 |
Tennis Ball posted:
This is "right", but there's something important you've missed. It only goes through the code once. You need to enclose this in some kind of loop, otherwise all this program does is set i to 6. Here's my version: code:
|
|
# ? Oct 5, 2010 09:44 |
|
I'm sorry for whipping out my OCD but I really need to re-write that to:code:
|
# ? Oct 5, 2010 13:03 |
code:
|
|
# ? Oct 5, 2010 13:10 |
|
On Windows, trying to pip install packages that require compiling, I always get:code:
I've now installed mingw, and I have... code:
For some reason it's still trying to use Visual Studio, and I can't for the life of me figure out why. Anyone have any ideas where else I might look?
|
# ? Oct 5, 2010 17:56 |
|
it's not exactly what you asked for, but I found this Windows Repository and it had all the main stuff I wanted (lxml, numpy, etc)
|
# ? Oct 6, 2010 00:25 |
|
Tennis Ball posted:So I am pretty new to programming. I am mainly just screwing around right now. Currently I have this: This lecture helped me out quite a bit.
|
# ? Oct 6, 2010 15:14 |
|
Alright, so I just finished going through a Jython phase, and I'd just like to say that I'm not sad to be putting it away. I spewed out 30,000 threads (which, granted is a lot) but it took me a bit too long to realize that setting the Java heap size doesn't actually keep java from using every last bit of memory it can. I could up to 50gb of virtual memory according to top, but the JMX monitoring service only showed like 2gb
|
# ? Oct 8, 2010 15:51 |
|
I'm starting to work with Python after screwing around with it about 2 years ago. (Which is to say that I'm starting from scratch). What is the recommended editor, or should I just use the Python Shell editor that comes Python? Is there a plugin for something like Eclipse that I might enjoy using a little more? I have CodeBlocks, but it looks like it doesn't work with .py files.
|
# ? Oct 8, 2010 19:14 |
|
I use gedit, use whatever you like
|
# ? Oct 8, 2010 21:32 |
|
tadashi posted:Is there a plugin for something like Eclipse that I might enjoy using a little more? Pydev is the main Python Eclipse plugin. I personally use Aptana Studio + Pydev. It's big and clunky, but the code completion, syntax highlighting, auto-debugger, etc are all very nice.
|
# ? Oct 8, 2010 23:28 |
|
I'm old as gently caress so I use TextWrangler.
|
# ? Oct 9, 2010 01:38 |
|
I've used Komodo Edit and WingIDE. Prefer WingIDE, I think.
|
# ? Oct 9, 2010 01:53 |
|
Carthag posted:I'm old as gently caress so I use TextWrangler. TextWrangler for smaller/one-shot projects, PyDev + Eclipse when I have a whole ecosystem to contend with. When I did more on windows, I used Pyscripter but there's enough undocumented behavior that you may end up with some weirdness.
|
# ? Oct 9, 2010 15:51 |
|
Vim for everything. I couldn't really imagine using anything else.
|
# ? Oct 9, 2010 16:26 |
|
Sailor_Spoon posted:Vim for everything. I couldn't really imagine using anything else. Vim is the be-all, end-all of editors. I too cannot imagine using anything else.
|
# ? Oct 9, 2010 16:43 |
|
Sailor_Spoon posted:Vim for everything. I couldn't really imagine using anything else. Also agreeing with this. Along these lines...is there an alternative syntax highlighting for Python that's a bit more colorful? I feel like the default only colors a minimal amount of the syntax (even more so with Java). I use the desert theme if that helps or makes a difference.
|
# ? Oct 9, 2010 21:13 |
|
Ferg posted:Also agreeing with this. I've apparently been using http://www.vim.org/scripts/script.php?script_id=790 for a while now. It seems satisfactory. By default I think it doesn't do everything it can, though, add "let python_highlight_all = 1" to your vimrc to turn on everything.
|
# ? Oct 9, 2010 22:31 |
|
Sailor_Spoon posted:I've apparently been using http://www.vim.org/scripts/script.php?script_id=790 for a while now. It seems satisfactory. By default I think it doesn't do everything it can, though, add "let python_highlight_all = 1" to your vimrc to turn on everything. Apparently so was I. That setting helped though. It highlights renegade tabbed whitespace with an obnoxious red highlight and, holy poo poo, actually highlights True/False/None! Thanks!
|
# ? Oct 9, 2010 23:39 |
|
Notepad++ on windows, gedit and vim on linux. ipython or just plain old python with readline enabled for prototyping things. Without exception, every python IDE i've tried is some combination of buggy, slow, lacking in features and ugly as all hell. Its pretty pathetic comparing IDEs for python to those for java.
|
# ? Oct 10, 2010 22:56 |
|
Which java IDE wouldn't you consider buggy, slow and ugly
|
# ? Oct 10, 2010 23:12 |
|
Otto Skorzeny posted:Which java IDE wouldn't you consider buggy, slow and ugly
|
# ? Oct 11, 2010 01:12 |
|
Sailor_Spoon posted:I've apparently been using http://www.vim.org/scripts/script.php?script_id=790 for a while now. It seems satisfactory. By default I think it doesn't do everything it can, though, add "let python_highlight_all = 1" to your vimrc to turn on everything. Thanks for posting this. I love the white space highlighting! I use vim on os x and linux; Sublime Text on Windows.
|
# ? Oct 11, 2010 07:22 |
|
Otto Skorzeny posted:Which java IDE wouldn't you consider buggy, slow and ugly Intellij Idea may be a bit slow and clunky, but it's light years ahead of anything that exists for python. gently caress eclipse though
|
# ? Oct 11, 2010 21:20 |
|
tripwire posted:Intellij Idea may be a bit slow and clunky, but it's light years ahead of anything that exists for python. gently caress eclipse though They also have a python IDE that finally left beta. http://www.jetbrains.com/pycharm/ Its probably the best python IDE out there, imo. I switched from Komodo to Pycharm and haven't looked back.
|
# ? Oct 12, 2010 07:40 |
|
Hey thread I have absolutely zero programming experience. Literally none. From the FAQ I read that Python was the most user-friendly way to learn, so I downloaded the shell and started going through this link: http://www.greenteapress.com/thinkpython/thinkCSpy/thinkCSpy.pdf learning the very basics of it. I hope you guys don't mind questions as they come up by a complete idiot, who has, again, absolutely no knowledge of this world at all.
|
# ? Oct 12, 2010 18:44 |
|
tbp posted:learning the very basics of it. I hope you guys don't mind questions as they come up by a complete idiot, who has, again, absolutely no knowledge of this world at all. I much prefer them to the idiotic questions from people who should know better
|
# ? Oct 12, 2010 19:37 |
|
tbp posted:Hey thread I'm right there with you.
|
# ? Oct 12, 2010 19:54 |
|
tbp posted:Hey thread I really got a lot out of Think Python when I was starting out. Although, I preferred the HTML version of the book over the pdf. You should be aware of Python's handful of gotchas. Pay particular attention to Number 3 and number 6. Number 6 WILL get you at some point. Edit: Fixed my link. Haystack fucked around with this message at 21:41 on Oct 12, 2010 |
# ? Oct 12, 2010 21:21 |
|
Haystack posted:I really got a lot out of Think Python when I was starting out. Although, I preferred the HTML version of the book over the pdf.
|
# ? Oct 12, 2010 21:37 |
|
Haystack posted:I really got a lot out of Think Python when I was starting out. Same. To give you guys some encouragement... I went through Think Python like 18 months ago with what amounted to zero modern programming experience. After I finished Think Python, I just went out to make solutions to several problems that I had, and Googled stuff that I didn't know or understand. I'm definitely not any type of guru, but I'm at the point where I'm contributing to a couple of open-source projects and have released some open-source stuff myself that is being used by others.
|
# ? Oct 12, 2010 22:42 |
|
Thank you for the links I'm nothing resembling a major right now that will require any sort of programming ability but the concept fascinates me and in this day and age having command of it couldn't hurt on any sort of resume. Any tasks or problems I should set about trying to solve, sort of like how a 5th grader learns math?
|
# ? Oct 12, 2010 23:20 |
|
For absolutely no programming knowledge, I'm actually a fan of Zed Shaw's intro: http://sheddingbikes.com/LearnPythonTheHardWay.pdf It's a VERY slow ramp-up and assumes basically nothing about previous experience.
|
# ? Oct 12, 2010 23:20 |
|
tbp posted:Any tasks or problems I should set about trying to solve, sort of like how a 5th grader learns math? The universal answer to this is to write something to solve a problem you have. After you pick up the basics in Think Python, start solving a problem or automating something you do all the time. Some ideas taken from my projects directory: 1) Write something to organize your download directory. 2) Something to fetch album art for your mp3's. 3) Scrape sports scores/bus schedule/whatever from some website. 4) Write a script to fetch emails and then take actions depending on contents of email. (Remote control your PC!) 5) Same as 4 but with IRC. 6) Fetch your Google Reader shared items and post them to IRC/forum/IM/etc 7) Fetch and graph some data from your modem/router web-admin 8) Organize your photos into folders by date.
|
# ? Oct 13, 2010 00:39 |
|
|
# ? Jun 13, 2024 05:29 |
|
UberJumper posted:They also have a python IDE that finally left beta. loving SOLD
|
# ? Oct 13, 2010 00:47 |