162 Posted Topics
Re: I don't like that feature of python 3.x Why did they change it? | |
Re: [B]P[/B]lease [B]E[/B]xcuse [B]M[/B]y [B]D[/B]runk [B]A[/B]unt [B]S[/B]ally As a side not, ask someone what 2+2*2 equals. Most people will say 8 instead of 6 lol. I've even got my teachers with it lol. | |
Re: [code] >>data = "4 stringfour" >>data = data.split() >>print data ["4","stringfour"] >> >>int(data[0]) + 10 #use float() for decimals. 14 [/code] | |
Re: Bluetooth or Wifi? And did you solve it? I'm having trouble with a BT shield. | |
Re: You could also do it with just the os module. I use a variation of the fallowing code to loop through a folder of pictures. But I set them as my background instead of formatting them. Play around with it, but it should work. [code] import ctypes, time, os p … | |
Re: I wrote a python script that captures the screen. It saves as .jpg, .bmp, .png, and .gif. I could add image resizing if needed. Let me know if you want a copy. | |
When I watch full length movies online, sometimes my mouse is hidden on the browser. Just inside the browser though. I have to repeatedly hit the ctrl button to see where its at. This only happens when I watch divx streamed video for long periods of time. After the mouse … | |
Re: You should really use code tags. It waits forever because it does not get a reply. [code] import serial print 'hi' ser = serial.Serial('COM2', baudrate=9600, timeout=5)#timeout in case no reply #you don't need to open the port either ser.write('1\r') #sometimes \r is needed to indicate data is done transferring ser.readline() … | |
Re: [code] from ctypes import * user = windll.user32 x = 640 y= 480 user.SetCursorPos(x,y) [/code] | |
Re: If its windows, try [URL="http://www.rutherfurd.net/python/sendkeys/"]SendKeys[/URL] module. | |
Re: Take a look at the os module. Something like: [code] import os os.system("NameOfExe.exe") [/code] This will start the .exe | |
My friend gave me 10,000+ ROM's for Sega, SNES, NES, and GBA. They where all individually zipped. I go fed up trying to unzip them one by one, and decided to write a script to do it for me. It unzipped about 5,000 in under a minute. Python's zipfile module … | |
Re: [URL="http://www.kitebird.com/articles/pydbapi.html"]Check here.[/URL] | |
Re: you can also use ctypes. [code] from ctypes import * myDLL = cdll.LoadLibrary('nameOfDll.dll') [/code] | |
Re: you could also use something like exec() it would be very inpractical though. os.sys() or os.popen() would be your best option. to use exec() though could look something like: [code] f = open('name.py','r') fr = f.readlines() for i in fr: exec(i) [/code] but that would be too much and too … | |
![]() | Re: It looks good. Like SoulMazer said, you don't need the "\n". And I don't use 3.0, I use 2.6 and in your addNames() function I noticed you using input(). In 2.6 input() is for numbers and raw_input() is for strings, I don't know about 3.0 but that would have given … ![]() |
I posted a snippet about using a microcontroller as a mouse, and it works great, but it moves the mouse as a stepper motion. How would I go about making it velocity driven? Like when I tilt the accelerometer further, the faster the mouse moves. I've seen it on youtube, … | |
Re: I'm on a Windows 7/64bit Not much of anything is available on 64 bit systems lol. | |
Re: [URL="http://www.jroller.com/RickHigh/entry/notes_on_creating_a_socket"]This[/URL] might help. You might also put a try statement where the problem happens, and when it hits the except, make it send the data again until it gets through? And maybe post the code that gives the error. | |
Re: [QUOTE=Clueless86;939226]Well I chose VIDLE...And it still does not work right, or maybe I am just stupid and not looking at things properly..I am just trying some pygame simple things, like making a window that will just close, instead its always busy and i have to use [ctrl+alt+del] to close it.. … | |
I used [URL="http://www.parallax.com/Store/Education/KitsandBoards/tabid/182/CategoryID/67/List/0/SortField/0/Level/a/ProductID/313/Default.aspx"]Parallax's Basic Stamp Homework Board[/URL] and an [URL="http://www.radioshack.com/product/index.jsp?productId=2909788"]accelerometer[/URL] to use as a mouse. It works better than I thought it would. [URL="http://sourceforge.net/projects/pyserial/"]PySerial[/URL] is used to grab the debugged values from the stamp. The circuit is compiled of two push buttons, 2 LEDs to tell when a button is … | |
Is there a way to grab values from a basic stamp with python? I just bought a Accelerometer and want to read the values with python. | |
Re: I'm not a C++ coder, but i did something similar in python using WMI. Or if you can call the command line from C++ you could use "tasklist", and check if its running. This is windows only though. | |
Re: With the encoded text, I would go with dictionary rather than tuples. As for the prefix stuff, try split.('sting') for the unique prefixes take a look at itertools More spacificaly [inlinecode]itertools.permutation(string)[/inlinecode] | |
I downloaded a dll for head tracking, and have been trying to use it for some time now. I am trying to make a python script that uses it and am getting errors. [URL="http://www.daniweb.com/forums/thread265466.html"]This is the post.[/URL] I posted it in the python forums, and no replies yet, since this … | |
I've been working on facial recognition and have obtained a dll that can recognize faces in an image, and gives cordinates aswell. It came with an example program written in C++ and I'm trying to port it to python. Here is the C++ code [CODE] #include "windows.h" #include "loadbmp.h" // … | |
Re: a menu could look something like this: [CODE] import sys while 1: print """ 1)Take Test 2)Test History 3)Exit""" choice = raw_input("Option: ") if choice == "1" or choice == "Take Test": print "choice 1 was made..." #Call the take test function #here..... elif choice == "2" or choice == … | |
Re: Any command line commands can be passes with python, not only the color. For example cls to clear the screen. | |
I have had python2.6 for a while and have un0installed and re-installed it several times. Now when I right click on some source code the option to open with the IDLE is gone. I have tried "open with" but that doesn't work either. I'm on Windows 7 Home. | |
Re: [QUOTE]Director in Munich, said: "Browsers are perhaps the most important piece of software for computer users today. We're innovating quickly with Chrome, and continue to work towards our three central principles: speed, security and simplicity. With the new release, we also give users even more choice and control over their … | |
Re: redyugi: your code gives x as 4 not 2. try this: [CODE] wordlist = ["bread", "cookies", "cake", "chocolate", "bread"] d = {} for word in wordlist: d[word] = d.get[word,0) + 1 [/CODE] And to see what the outcome is: [CODE] for i in d.keys(): print i,d[i] [/CODE] My results: [CODE] … | |
Re: Code tags help too. | |
Re: If you need it to be an integer you could use atoi() from the locale to pull it from the string. Use atof() for float points. [CODE] import locale nmbr = raw_input("enter a number") firstNum = nmbr[0] realNumber = locale.atoi(firstNum) [/CODE] | |
Re: I don't really understand either. If you could post an example of your code, and where it goes wrong I could help. And maybe try index() instead of find? for example: [CODE] l = range(1,51) try: print l[l.index(18)] except: print '18 not found' [/CODE] You will need the try, except … | |
If you don't know what a quine is, it is a program or script that's only purpose or function is to print out its own source code. I was wondering would this be considered a quine? [CODE] f = open("quine.py","r"); print f.read() [/CODE] quine.py is the script that this code … | |
Re: I always wanted a Vigenere Cipher. | |
Re: I don't understand what your asking. And no offense, but you really need to work on your spelling and grammar. | |
Re: I know this is a three year old post, but I was browsing around and found it. I made a desktop picture changer in python also. It doesn't take up any memory. [CODE] import ctypes, time, os p = "Path\to\picture\folder" SPI_SETDESKWALLPAPER = 20 #this and.. os.chdir(p) while 1: for i … | |
Re: I haven't worked with fasta files nor do I know what they are. But have you tried putting it in a try, except statement? [CODE] try: for seq_record in SeqIO.parse(open("mm.fa"), "fasta") : do something except IndexError: pass #or break [/CODE] Or maybe append the values you get from the file … | |
Re: I don't know if it will help, but I wrote a backdoor that supports file transfer. It might help. [url]http://www.daniweb.com/forums/thread256651.html[/url] I also have an updated version with two way file transfer. If your interested let me know. Hope I could help. | |
Re: you could also try a system restore, or if it was backed up, you could restore from the backup. A boot cd as mentioned above is also a good idea. If all else fails, you'll have to nuke the system and reinstall your OS. | |
I am new to this website, well posting on here anyway. I've taught myself allot about programming and scripting, so I wanna thank everyone for posting. This isn't my first program, but its the first useful thing I've done. It uses the 'w', 'a', 'd', 's' keys to move the … | |
Re: How about compiling it to be a background process. Like .pyw? I tried compiling .pyw's but it still shows the console box. Never mind lol. I found it. setup(windows=["file.py"]) | |
Re: I would like to know some details, but I MIGHT be interested. I would only be able to work on my part in my free time due to school and work. | |
Re: Try uninstalling and reinstalling. I don't know if you installed from a binary, but installing from source is usually a better option. | |
Everything works great. But sometimes I get an Error message saying something about ip/port bindings. I don't have the traceback but this could cause problems down the road. Any suggestions? [code] #Backdoor Server #Version 0.3.0 #Every now and the I get an Error dealing with the ip/port bindings # seems … | |
Re: This looks good. I read a little about killing processes in Gray Hat Python via PID. There is another way too with WMI([url]http://www.daniweb.com/forums/thread245419.html[/url]) I used it to kill the internet, but could be used for other things like notepad. Mine was set to kill the process at a certain time. | |
I've been reading a lot here lately on self replicating code. I wanted to try my hand at it. It only copies itself in forward directories. I.E. "C:\Users\cd.." is not supported yet but will be later. I wanted to post it here to see if anyone had ideas, tips, and … |
The End.