|
Bunny Cuddlin posted:I know SDL supports it. SDL supports DirectInput and the Windows Multimedia interface, but doesn't support XInput. How do you know that SDL "supports it"?
|
# ? Nov 5, 2012 05:05 |
|
|
# ? Jun 13, 2024 04:43 |
|
Suspicious Dish posted:SDL supports DirectInput and the Windows Multimedia interface, but doesn't support XInput. How do you know that SDL "supports it"? Well lol, I guess that's where I got the idea
|
# ? Nov 5, 2012 22:48 |
|
All this is telling you is that the Xpad driver in the kernel is better than the DirectInput one.
|
# ? Nov 5, 2012 22:59 |
|
Suspicious Dish posted:All this is telling you is that the Xpad driver in the kernel is better than the DirectInput one. I was only explaining why I "knew" they could be treated by two different axes by SDL; I'd seen it in using my controller on my Linux dev machine. I see now that it is a DirectInput issue (which is even acknowledged by Microsoft here).
|
# ? Nov 5, 2012 23:07 |
|
Is there a good windows compatible module or method in Python for making live data tools? I basically want to make something that consists of a list of items, with associated numbers that update using live information with text input to run basic commands. Kind of like a curses app, I guess, but curses doesn't work on Windows and all the ports suck. I looked at libtcod which was a roguelike module but it did not handle text fields easily.
|
# ? Nov 6, 2012 16:03 |
|
Sylink posted:Is there a good windows compatible module or method in Python for making live data tools? If you don't need it to be in a console window, try Tkinter. It's a useful library for making simple GUIs, and it's part of the standard library.
|
# ? Nov 6, 2012 16:10 |
|
I might have to do something like that or even pygame. I tried curses a bit and it almost does what I need but I want stuff to be running while entering input, while curses does everything in a step fashion so everything pauses while it waits for keypresses (since its just for utilities not super real time stuff, I'm not sure how roguelikes get around that, probably a different lib).
|
# ? Nov 6, 2012 19:39 |
|
Sylink posted:I might have to do something like that or even pygame. most roguelikes operate on a step basis too
|
# ? Nov 6, 2012 21:16 |
|
Sylink posted:I tried curses a bit and it almost does what I need but I want stuff to be running while entering input, while curses does everything in a step fashion so everything pauses while it waits for keypresses (since its just for utilities not super real time stuff, I'm not sure how roguelikes get around that, probably a different lib). You can poll for input without blocking. It's called no-delay mode.
|
# ? Nov 7, 2012 19:50 |
|
if you're interested i also write stuff on this blog sometimes and i took that guy's code and wrapped in a simple class to play with a while ago. https://gist.github.com/4035738
|
# ? Nov 8, 2012 02:07 |
|
I wonder if anybody here has tried to do a REST client in Python using the requests module in particular, but I generally have a flow control question. I am doing a streaming get, which looks to be designed to run forever if you let it. However, I'd like to be able to break out of it in the most proper, elegant way possible. Right now, I just break out of the loop processing it and that's that. My gripes: 1. The streaming get is technically still going at the scope level I break out of 2. I don't know of a way to specify loop scope when I execute the break. I'm doing something like this: code:
|
# ? Nov 8, 2012 16:31 |
|
Rocko Bonaparte posted:I wonder if anybody here has tried to do a REST client in Python using the requests module in particular, but I generally have a flow control question. I am doing a streaming get, which looks to be designed to run forever if you let it. However, I'd like to be able to break out of it in the most proper, elegant way possible. Right now, I just break out of the loop processing it and that's that. Looks like requests has an Session object supports __exit__ and a close method, and can be passed as the 'session' kwarg.
|
# ? Nov 8, 2012 22:15 |
|
I'm making a serious attempt at learning Python, so I'm looking for a good Python IDE. The only other IDE I have good experience with is Visual Studio for a C# and C++ class, pop up tips and the ability to set break points with a nice list of variables and their values are probably the two things that helped the most in learning those, and as a novice programmer, probably things I require to hold my hand as I get into Python. After looking at the IDE list I see that Spyder looks like a decent choice, the only downside is that it looks like it only supports Python 2, and I'd like to stick with version 3. So my questions are: 1. Is there a Python 3 IDE that contains breakpoints and pop up hints? 2. Is it a terrible idea to use version 2 and Spyder instead of version 3 and some possibly lesser IDE?
|
# ? Nov 8, 2012 23:12 |
|
Alligator posted:if you're interested i also write stuff on this blog sometimes and i took that guy's code and wrapped in a simple class to play with a while ago. This is cool, thank you. I ended up doing XInput calls whenever I got an event for axis 2 and keeping track of previous values for each axis in order to decide which one was pressed. I wanted to monkey-patch it into the Joystick object in pygame but you can't modify objects from extension code at runtime
|
# ? Nov 8, 2012 23:25 |
|
Drunk Badger posted:I'm making a serious attempt at learning Python, so I'm looking for a good Python IDE. The only other IDE I have good experience with is Visual Studio for a C# and C++ class, pop up tips and the ability to set break points with a nice list of variables and their values are probably the two things that helped the most in learning those, and as a novice programmer, probably things I require to hold my hand as I get into Python. I've always liked PyDev http://pydev.org/
|
# ? Nov 8, 2012 23:27 |
|
Drunk Badger posted:I'm making a serious attempt at learning Python, so I'm looking for a good Python IDE. The only other IDE I have good experience with is Visual Studio for a C# and C++ class, pop up tips and the ability to set break points with a nice list of variables and their values are probably the two things that helped the most in learning those, and as a novice programmer, probably things I require to hold my hand as I get into Python. Full discretion, I know these guys: PTVS I'm not sure about version support.
|
# ? Nov 8, 2012 23:27 |
|
Drunk Badger posted:I'm making a serious attempt at learning Python, so I'm looking for a good Python IDE. The only other IDE I have good experience with is Visual Studio for a C# and C++ class, pop up tips and the ability to set break points with a nice list of variables and their values are probably the two things that helped the most in learning those, and as a novice programmer, probably things I require to hold my hand as I get into Python. Why not just keep using Visual Studio?
|
# ? Nov 8, 2012 23:44 |
|
I thought I tried this once, and it didn't work. I'll give it another try since it supports VS 2012.
|
# ? Nov 9, 2012 01:18 |
|
Drunk Badger posted:I'm making a serious attempt at learning Python, so I'm looking for a good Python IDE. The only other IDE I have good experience with is Visual Studio for a C# and C++ class, pop up tips and the ability to set break points with a nice list of variables and their values are probably the two things that helped the most in learning those, and as a novice programmer, probably things I require to hold my hand as I get into Python. I strongly, STRONGLY recommend PyCharm: http://www.jetbrains.com/pycharm/ I've spent money on both a personal license and had the company shell out too. There are a few free license options, but I mention the fact I've paid for it to show that I definitely believe in it. Rocko Bonaparte posted:I wonder if anybody here has tried to do a REST client in Python using the requests module in particular, but I generally have a flow control question. I am doing a streaming get, which looks to be designed to run forever if you let it. However, I'd like to be able to break out of it in the most proper, elegant way possible. Right now, I just break out of the loop processing it and that's that. This library: http://slumber.in/ (originally found it in this thread actually) has been great for rest stuff whenever I've needed it, and it uses requests under the hood. Maybe it'll help you one way or the other.
|
# ? Nov 9, 2012 01:25 |
|
Lurchington posted:I strongly, STRONGLY recommend PyCharm: http://www.jetbrains.com/pycharm/ I'll second PyCharm, its worked pretty well for me mixing 2.7/3.3/Pypy.
|
# ? Nov 9, 2012 02:08 |
|
Count me as another STRONG vote for PyCharm. I exclusively use it to write Python 3.2 and 3.3 code, and it's never let me down.
|
# ? Nov 9, 2012 02:42 |
|
I won a personal license for PyCharm from the last PyCon. I've only downloaded and installed it. I have yet to actually use it for anything.
|
# ? Nov 9, 2012 15:03 |
|
PyCharm is pretty amazing. I can't quite get myself to pay for it since I don't get paid to code. I mostly use Sublime Text anymore. It's not a full IDE, but it's pretty sweet.
|
# ? Nov 9, 2012 17:47 |
|
Thermopyle posted:PyCharm is pretty amazing. I can't quite get myself to pay for it since I don't get paid to code. If you do any open source development, PyCharm has a free license that has to be renewed by the lead developer of the project annually.
|
# ? Nov 9, 2012 19:42 |
|
I've got an open source licence for PyCharm for one of my projects. After applying, it took something like a week for them to review my project/application and issue my licence. It's really good. Only problem I've ever ran into with it was broken git integration in a specific version of it, which I believe has since been fixed.
|
# ? Nov 9, 2012 21:50 |
|
A few weeks ago my company put on PyData NYC, a conference dedicated to data analytics with python. Authors and contributors of numpy, scipy, pandas, pytables, ipython, and other projects all gave great talks to several hundred attendees. Today all the talks were made available on Vimeo, for anyone interested! http://vimeo.com/channels/pydata/videos/sort:preset/format:detail
|
# ? Nov 10, 2012 05:51 |
|
BigRedDot posted:A few weeks ago my company put on PyData NYC, a conference dedicated to data analytics with python. Authors and contributors of numpy, scipy, pandas, pytables, ipython, and other projects all gave great talks to several hundred attendees. Today all the talks were made available on Vimeo, for anyone interested!
|
# ? Nov 10, 2012 19:30 |
|
Thermopyle posted:PyCharm is pretty amazing. I can't quite get myself to pay for it since I don't get paid to code. If I had an IDE for every language I use weekly I'd have dozens of them, so I figure sticking with an all-in-one that works is probably the most efficient! edit; apparently updating to the latest build or restarting fixed the parameter hints, though they're still clumsy (show up only in the status bar, and only after typing one parameter and a comma!). The Gripper fucked around with this message at 07:45 on Nov 11, 2012 |
# ? Nov 11, 2012 07:13 |
|
Heya Mostly Newbie to Python. I'm tying to open up a .csv saved by openoffice and getting the Errno 22: invalid mode 'rb' or filename 'C:\\python\\test.csv' error. Right before that, I open up another csv-- whose origins I don't know, but may be openoffice as well, or might be excel. Here is the code: import csv SubsetCL = [] # this defines an empty array to be filled with the first file data (not actually necessary) SubsetNature = [] # this defines an empty array to be filled with the second file data (not actually necessary) tower = open("C:\python\CLA_Corynn_SubsetPython.csv", "rb") # this opens the first file for reading only grail = open("C:\python\test.csv", "rb") # this opends the second file for reading only credits = ("ComparisonResults.csv", "w") #this creates a csv file called "ComparisonResults.csv" and sets it to be writeable and the error is on line 9, grail = open("C:\python\test.csv", "rb") Any thoughts? I can't upload the file, unfortunately, since it's proprietary. Obdicut fucked around with this message at 16:57 on Nov 11, 2012 |
# ? Nov 11, 2012 16:17 |
|
I don't know, there's a few things that could go wrong there. \t is a special escape character (tab), so in your loading of test it's probably replacing it with C:\\python\test.csv (non-existant because \t is a tab character). You can either just use double \'s in the filename, or quote it as a raw string i.e. open(r"C:\python\test.cvs","rb"). Then again, if you typed the error out correctly then you may have just spelled test.csv as test.cvs. I'm going to assume you're using Python 2.7 and the \t escaping is your problem, since Python 3.3 gives a better error (invalid argument c:\\python\test) instead of the ambiguous one 2.7 gives. The Gripper fucked around with this message at 16:46 on Nov 11, 2012 |
# ? Nov 11, 2012 16:43 |
|
The Gripper posted:I don't know, there's a few things that could go wrong there. Yes, that was it. Than you very kindly. Used raw and it solved the problem immediately.
|
# ? Nov 11, 2012 16:59 |
|
And sorry to be a pest, but can someone explain this bit of code to me?code:
Obdicut fucked around with this message at 18:26 on Nov 11, 2012 |
# ? Nov 11, 2012 18:08 |
|
Obdicut posted:And sorry to be a pest, but can someone explain this bit of code to me? The line "for master_row in masterlist" is iterating over master list, like this: Python code:
Strings can't be appended to but I guess csv readers return an array containing the string or somesuch? Don't know much about that part, going to bed so too tired to search it up. Also use [code=python] tags, python relies on indentation which you don't have without them! Edit: Yeah, quickly searched it up. "Each row read from the csv file is returned as a list of strings" Jewel fucked around with this message at 18:19 on Nov 11, 2012 |
# ? Nov 11, 2012 18:13 |
|
That's just how for loops work. You ask it to iterate over each element in a list or iterable, and give it a variable name to access the current element by:Python code:
That code is confusing because results_row is defined by copying hosts_row (and the paste removed all the indenting), but as far as I can tell all three _row variables are lists.
|
# ? Nov 11, 2012 18:18 |
|
The Gripper posted:That's just how for loops work. You ask it to iterate over each element in a list or iterable, and give it a variable name to access the current element by: Jewel posted:
Thank you both very kindly for your help. I may be being dense, but: A) If they're lists, why can't I append? B) Why does "for hosts_row in c1:" create a list? You don't have to declare it first?
|
# ? Nov 11, 2012 18:32 |
|
c1 is a csv.reader, and each row it reads from a CSV file is a list of columns in that row (e.g. a row containing "some,kind,of,data" becomes a list ["some","kind","of","data"]), so in that case each row is a list of columns in the row (so hosts_row is that list). The for loop basically breaks up a group of <things> into one <thing> at a time, no matter what that <thing> is. You don't really need to declare anything in Python to assign to it, which is all the for loop is doing automatically for you. It's equivalent to this: Python code:
I don't know why you wouldn't be able to append, what are you trying to append to and what is happening instead of what you want? The Gripper fucked around with this message at 19:19 on Nov 11, 2012 |
# ? Nov 11, 2012 19:01 |
|
The Gripper posted:c1 is a csv.reader, and each row it reads from a CSV file is a list of columns in that row (e.g. a row containing "some,kind,of,data" becomes a list ["some","kind","of","data"]), so in that case each row is a list of columns in the row (so hosts_row is that list). The for loop basically breaks up a group of <things> into one <thing> at a time, no matter what that <thing> is. Gah, sorry, I solved it. I just had all my references backwards. I had this stuff: tower = file("C:\python\CLA_Corynn_SubsetPython.csv", "r") tim = csv.reader(tower) and was referring to the wrong one. As soon as I fixed it, It worked fine. Final code for the curious: code:
|
# ? Nov 11, 2012 20:37 |
|
What's the right way to transfer files to/from a samba share in a python script running on an Ubuntu system without storing the users auth information? I assume there is a way of doing this because you don't have to input your Samba credentials when you double-click a Samba share in Nautilus...
|
# ? Nov 11, 2012 20:37 |
|
Nautilus does this by using the credentials stored in the gnome-keyring. That obviously does store the credentials, but needs unlocking once in a while. I found this thing in the cheeseshop. Maybe that will help you.
|
# ? Nov 11, 2012 20:44 |
|
|
# ? Jun 13, 2024 04:43 |
|
Thermopyle posted:What's the right way to transfer files to/from a samba share in a python script running on an Ubuntu system without storing the users auth information? You can use Gio to do the copy directly, which will use the credentials from the keyring. Python code:
|
# ? Nov 11, 2012 21:15 |