27 Discussion / Question Topics

Remove Filter
Member Avatar for shadwickman

I'm not sure if this is the best place to post this, but I've noticed a large request for pyHook for Python 2.6. I had a solution to this in a recent thread [URL="http://www.daniweb.com/forums/thread203368.html"]here[/URL], but people are most likely going to miss that. I built pyHook's source for use with …

Member Avatar for bujisky
0
610
Member Avatar for shadwickman

Hello, I was wondering how to go about having a redirect of stdout with Python take effect in a C extension. My python script redirects sys.stdout into a file handle created with [i]open(...)[/i], but within the function in my compiled C-extension, any output ([i]printf[/i], [i]puts[/i], etc) is still given to …

Member Avatar for Gribouillis
0
602
Member Avatar for shadwickman

Hello! I have a question in regards to [I]malloc[/I]/[I]calloc[/I] and [I]free[/I] in C. What I'm unsure about is the "depth" (for lack of a better word) that [I]free[/I] operates to. I know that sounds strange so let this example hopefully explain what I mean: [code=c] #include <stdlib.h> int main () …

Member Avatar for shadwickman
0
124
Member Avatar for shadwickman

Hello, I know you probably get quite a few threads asking this, but the DaniWeb search didn't pull up what I was looking for. So here we go: I have a page that I've made as "private" by including my access control script at the top. The access control script …

0
100
Member Avatar for shadwickman

Hello, I am currently trying to figure out some event stuff with Javascript. I have the page capturing all [I]onkeypress[/I] events by calling my function [I]keyPress[/I], and passing the event as an argument. The key presses get passed to a text field that I have on the page (even if …

Member Avatar for codejoust
0
161
Member Avatar for shadwickman

For some reason (this hasn't happened to me in the past), any wxPython scripts I package via py2exe crash on my other Windows computer (lacking a Python install). If I try running it on my other machine, I get an error message telling me to look at a log file …

0
88
Member Avatar for shadwickman

Hello, I've just recently tried to make a class template whose constructor should be able to accept a variable amount of arguments of the class passed to the template. I have something like this, with the prototype inside the class definition, and the actual implementation of the constructor defined outside: …

Member Avatar for shadwickman
0
166
Member Avatar for shadwickman

Hello, I'm using easyPHP to locally test some scripts I'm building, but I came across a problem that I can't seem to resolve. Within one of my PHP scripts, there's a segment where I end the PHP ([icode]?>[/icode]) and output a form in HTML, then resume the PHP section ([icode]<?php[/icode]). …

Member Avatar for phpbeginners
0
464
Member Avatar for shadwickman

Hello. I haven't ever needed to bother trying to do things to the console such as clearing one line, changing colours, etc. But now I was wondering if there is a (preferably built-in) cross-platform way of clearing just the current line in the console. I have a program which does …

0
67
Member Avatar for shadwickman

If anyone is still interested in those old, nostalgic text-based games to run in the console, there's Python Universe Builder by Joe Strout. Yes, it's a dead project as the last release dates back to 2006, but it still works fine if anyone is interested. On the [URL="http://py-universe.sourceforge.net/"]Sourceforge page for …

1
115
Member Avatar for shadwickman

This technically isn't fully a Python-related question, but I couldn't find a better place to post it than here. I'm just curious about how to get/update weather information from the internet... like say that sidebar gadget in Vista that updates the weather and temperature from some online-source. The problem is, …

Member Avatar for shadwickman
0
122
Member Avatar for shadwickman

Hello! I just started trying to get the grasp of Assembly a few days ago, so I decided to write a program to print the Fibonacci numbers up to the 25th one. I'm using NASM, and it's for the x86 processor. I came up with this code, but it'll loop …

Member Avatar for shadwickman
0
2K
Member Avatar for shadwickman

Hello, I've loved Python ever since I picked it up a couple years ago, but I have a question about the proper way to do something. There's a way of condensing an if/else conditional that has 2 options (True, False), for simple things. Assume that [icode]playerWins[/icode] is a boolean: [code=python] …

Member Avatar for shadwickman
0
112
Member Avatar for shadwickman

Hi, I was wondering what was wrong with the following code. It creates a [i]vector <int>[/i] and assigns it the values 0 - 51. Then it shuffles these values and prints it to the screen. When I compile it, I get no errors, but when it runs, it throws an …

Member Avatar for shadwickman
0
113
Member Avatar for shadwickman

Hi, I'm really confused now about how to return an int[] from a C++ function. Inside the function, I need to dynamically resize the array, but at the end I want the variable returned to be an array, not a pointer, but I have no idea how to do this: …

Member Avatar for daviddoria
0
346
Member Avatar for shadwickman

Hi, I didn't really know how to word the title, but I was just wondering if it was possible to write a function and make it accessible as if it was any other str function. It was a simple (but useful) few lines which returned a list of all the …

Member Avatar for shadwickman
0
156
Member Avatar for shadwickman

Hi, I have a GUI written with wxPython that contains a form. When the button is clicked, a script is executed to cycle through a specified directory and resize the images to a 50% size (the image manipulation is done with PIL). I used to run this script via the …

Member Avatar for shadwickman
0
141
Member Avatar for shadwickman

Hello! I've run into a slight problem with my script. As I iterate through a list of strings, I need to print each string, but they all need to print on the same line, so I used this: [code=python] for item in myList: print item, [/code] The comma puts each …

Member Avatar for shadwickman
0
138
Member Avatar for shadwickman

Hi, just a quick question but I couldn't find an answer to it. Say I have 3 variables, "a", "b", and "c". I want to assign each one a value of None. The only way I know of doing this is: a, b, c = None, None, None Is there …

Member Avatar for shadwickman
0
118
Member Avatar for shadwickman

Hi, I couldn't get this to work, but I was using a PHP script to go through the rows in a table in my database and if it found a specific value, to delete that row. However, it deletes ALL the rows no matter what I do and throws an …

Member Avatar for nav33n
0
708
Member Avatar for shadwickman

Hi, I was wondering how to get around a problem I was having with eval(). I have a list of strings and each one is the name of a python file found in the same directory as the current script. I was it to import these modules to use in …

Member Avatar for shadwickman
0
220
Member Avatar for shadwickman

Hi, I'm using wxPython (the latest version) and was wondering how to get rid of the scrollbar on the wx.TextCtrl (multiline) object. I couldn't find anything with Google or the search on the forums. Thanks!

Member Avatar for kushyer
0
137
Member Avatar for shadwickman

Hi, I was wondering if it's possible to call a function using a string that is the exact same as the name of the function. Here's an example in which I wanted to make 4 bitmap buttons using a for loop, and the event bound to each one would be …

Member Avatar for shadwickman
0
157
Member Avatar for shadwickman

Hi, I have a string that I want converted to an integer. I tried int() but it doesn't work because of what my string (as an example) is "2*2/4". I want it to make that into an integer and just put the answer (1). Is there a simple way to …

Member Avatar for shadwickman
0
113
Member Avatar for shadwickman

I was wondering if it is possible in Python to send a job to the user's printer. I have a string, and I wanted to be able to print it out on a piece of paper. I have wxPython installed and imported into the app if that makes any sort …

Member Avatar for shadwickman
0
181
Member Avatar for shadwickman

I was making a simple application with a GUI built with wxPython. I have created and layed out the main menu, and when the user clicks a button, it is *supposed* to make a different set of controls appear, getting rid of/hiding the main menu. I was wondering how to …

Member Avatar for shadwickman
0
109
Member Avatar for shadwickman

I just started learning Python about 2 days ago, and I threw this program together, just to get the hang of it. The program just creates a file named "PythonTest.txt" in the same directory as the .py file. The user can then enter lines that are written to the .txt …

Member Avatar for katharnakh
0
171