Re: [Tutor] Python OLS help

2016-06-01 Thread Michael Selik
On Tue, May 31, 2016 at 5:45 PM Vadim Katsemba wrote: > I typed in lm = smf.ols(formula='LATITUDE~DIAMETER',data=dataf).fit(), and > I ended up getting this error: ValueError: For numerical factors, > num_columns must be an int. > You may be using an old version of Patsy, the module that allows

Re: [Tutor] Python OLS help

2016-06-01 Thread Michael Selik
ue, May 31, 2016 at 8:03 PM, Michael Selik > wrote: > >> On Tue, May 31, 2016 at 5:45 PM Vadim Katsemba >> wrote: >> >>> I typed in lm = smf.ols(formula='LATITUDE~DIAMETER',data=dataf).fit(), >>> and I ended up getting this error: ValueError: For n

Re: [Tutor] Urgent: unicode problems writing CSV file

2016-06-08 Thread Michael Selik
On Wed, Jun 8, 2016 at 12:53 PM Alex Hall wrote: > All, > I'm working on a project that writes CSV files, and I have to get it done > very soon. I've done this before, but I'm suddenly hitting a problem with > unicode conversions. I'm trying to write data, but getting the standard > cannot encode

Re: [Tutor] Loop in pre-defined blocks

2016-06-13 Thread Michael Selik
On Mon, Jun 13, 2016 at 1:33 PM Ek Esawi wrote: > Here is a beginner code that might work for you. Best of luck. EK > > b=[12, 20, 35] > > for i in range(len(b)): > if i==0: > c=0 > else: > c=b[i-1] > for j in range(c, b[i]): > print(i+1,j+1) > If

Re: [Tutor] Loop in pre-defined blocks

2016-06-13 Thread Michael Selik
On Mon, Jun 13, 2016 at 6:28 PM Alan Gauld via Tutor wrote: > On 13/06/16 08:46, Ek Esawi wrote: > > Here is a beginner code that might work for you. Best of luck. EK > > > > b=[12, 20, 35] > > > > for i in range(len(b)): > > if i==0: > > c=0 > > else: > > c=b[i-1]

Re: [Tutor] Py 2.4.4: Inheriting from ftplib.FTP()

2016-06-17 Thread Michael Selik
On Fri, Jun 17, 2016 at 11:42 AM boB Stepp wrote: > On Thu, Jun 16, 2016 at 11:40 AM, Alan Gauld via Tutor > wrote: > > On 16/06/16 16:38, boB Stepp wrote: > > > >> class FTPFiles(FTP, object): > >> """FTP files to Windows server location(s).""" > > I was struggling to come up with a good na

Re: [Tutor] Best way to do FTP login?

2016-06-17 Thread Michael Selik
On Fri, Jun 17, 2016 at 12:46 PM boB Stepp wrote: > ftp = FTP('ip_address', 'username', 'password') > > Or > > ftp = FTP('ip_address') > ftp.login('username', 'password') > > Most of the examples I am seeing online use the second approach. Is > there some reason why this is to be preferred? No

Re: [Tutor] help with comparing list of tuples in python 2

2016-06-18 Thread Michael Selik
On Fri, Jun 17, 2016, 6:12 PM Lulu J wrote: > Hi there, > > My apologies if this is a trivial question but I am sort of new to python. > Here is my problem: > I have a list of dictionaries. Each dictionary has a word and its position > in the text the positions are in the form of a tuple. > Here

Re: [Tutor] For-else... Any other handy constructs hiding in Python?

2016-06-25 Thread Michael Selik
On Fri, Jun 24, 2016 at 11:58 AM Alex Hall wrote: > I know loops, comprehensions, ifs, and the like, > but I never knew for-else was available. Are there other constructs that I > may have missed? > Are you familiar with context managers? https://www.python.org/dev/peps/pep-0343/ ___

Re: [Tutor] dont understand part of a code

2016-07-05 Thread Michael Selik
On Sat, Jul 2, 2016 at 8:29 AM Alan Gauld via Tutor wrote: > There are arguably easier ways of doing this > I think you'll find that for-loops are preferable to while-loops. Here's an alternative implementation. https://gist.github.com/selik/d8e0a7622ceff0fe8984a7d19d44bfca import random

Re: [Tutor] help with exercise 15 of zed shaw's LPTHW

2016-07-06 Thread Michael Selik
On Tue, Jul 5, 2016 at 8:24 PM wrote: > I'm having trouble with most of the lines here. > It looks like you tried to attach a file. This mailing list does not allow attachments. Instead, could you paste the code into your email? > things that I don't understand: > 1. the need to put script int

Re: [Tutor] dont understand part of a code

2016-07-06 Thread Michael Selik
On Tue, Jul 5, 2016 at 5:36 PM Michael Selik wrote: > On Sat, Jul 2, 2016 at 8:29 AM Alan Gauld via Tutor > wrote: > >> There are arguably easier ways of doing this >> > > I think you'll find that for-loops are preferable to while-loops. Here's >

Re: [Tutor] help with exercise 15 of zed shaw's LPTHW

2016-07-06 Thread Michael Selik
On Wed, Jul 6, 2016 at 10:59 AM wrote: > why do I have to create a variable txt_again to assign it to the open > function and them print the file? > why is it that I can't only write something like open(file_again).read()? > Good insight. In fact you don't need to create the variable. The code `

Re: [Tutor] Counting and grouping dictionary values in Python 2.7

2016-07-14 Thread Michael Selik
On Fri, Jul 8, 2016 at 10:15 AM Bruce Dykes wrote: > I'm compiling application logs from a bunch of servers, reading the log > entries, parsing each log entry into a dictionary, and compiling all the > log entries into a single list of dictionaries. > Seems reasonable. Perhaps instead of having

Re: [Tutor] IDLE Subprocess Startup Error

2016-07-30 Thread Michael Selik
On Fri, Jul 29, 2016, 2:11 AM Darah via Tutor wrote: > "IDLE's subprocess didn't make connection. Either IDLE can't start a > subprocess or personal firewall software is blocking the connection.” > In the last few days, have you installed any other software? Perhaps something has changed your f

Re: [Tutor] Problem with graphics.py

2016-08-09 Thread Michael Selik
On Tue, Aug 9, 2016 at 12:51 PM Cyrus Parvereshi wrote: > Hi! I'm starting out with programming by self-studying python with a > textbook used at my university. I came to a chapter that introduced object > oriented programming with graphics tools like GraphWin and Point. However, > even though I

Re: [Tutor] need help

2016-08-11 Thread Michael Selik
On Thu, Aug 11, 2016 at 1:15 PM Pallab Amway wrote: > expected an indented block > if-statements must have an indented block of code. For example: ``` if age < 12: print('You are a child') ``` ___ Tutor maillist - Tutor@python.org To unsubscribe

[Tutor] Newbie Here -- Averaging & Adding Madness Over a Given (x) Range?!?!

2013-02-14 Thread Michael McConachie
Hello all, This is my first post here. I have tried to get answers from StackOverflow, but I realized quickly that I am too "green" for that environment. As such, I have purchased Beginning Python (2nd edition, Hetland) and also the $29.00 course available from learnpythonthehardway(dot)com.

[Tutor] Class-based generator

2013-02-17 Thread Michael O'Leary
I wrote some code to create tasks to be run in a queue based system last week. It consisted of a big monolithic function that consisted of two parts: 1) read data from a file and create dictionaries and lists to iterate through 2) iterate through the lists creating a job data file and a task for th

[Tutor] Setting log directory from a command line argument

2013-02-21 Thread Michael O'Leary
I have added logging to a Python program I have been working on by putting this in the module's __init__.py file: ## import logging logger = logging.getLogger('ranking_factors') formatter = logging.Formatter('[%(asctime)s] %(levelname)s in %(module)s:%(funcName)s@%(lineno)s => %(message)s'

Re: [Tutor] regex to promote Py 2 to Py 3?

2013-04-16 Thread Michael Weylandt
n spilled on just such a translation, but you may as well start with the 2to3 script and see if that suffices for your needs: http://docs.python.org/2/library/2to3.html Michael > > Jim > ___ > Tutor maillist - Tutor@python.org > To u

[Tutor] Python debugger/IDE that can be launched from a remote command line

2013-05-10 Thread Michael O'Leary
I am working on a project in which the code and data I am working with are all on an Amazon EC2 machine. So far I have been ssh'ing to the EC2 machine in two terminal windows, running emacs or vi in one of them to view and update the code and running the "python -m pdb ..." debugger in the other on

[Tutor] I think I found what I'm looking for.

2013-06-03 Thread Michael Sparks
speech.py is a Python module that provides a clean interface to Windows's voice recognition and text-to-speech capabilities. But it requires Windows XP or Vista, and Python 2.4 or 2.5. I use Windows 7. another one I found; Dragonfly is a speech recognition framework. It is a Python package which

[Tutor] How does formatted printing work?

2013-06-08 Thread Michael Sparks
You can explain it yourself or just drop me a link (or both). Right now I'm learning Python 2.x but I plan on learning Python 3.x as well. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailma

Re: [Tutor] How does formatted printing work?

2013-06-08 Thread Michael Sparks
I believe it's % string interpolation where % formats strings I'm reading Practical Programming and I'm stuck on page 35, question 6. b) where: "___" % 34.5 => "3.45e+01" On Sat, Jun 8, 2013 at 11:03 AM, Steven D'Aprano wrote: > On 09/06/13 01:58,

[Tutor] Trying to get mp3play-0.1.15 module to work on Windows 7

2013-06-10 Thread Michael Sparks
I read Practical Programming, chapter 4 and I know how to write and use my own modules on IDLE for Python 3.2 but now I switched to version 2.7 and I don't know how to use a downloaded module such as mp3play-0.1.15 written by Michael Gundlach. I got Python 2.5, 2.7 and 3.2 on my computer at

[Tutor] weird lambda expression -- can someone help me understand how this works

2013-12-13 Thread Michael Crawford
I found this piece of code on github https://gist.github.com/kljensen/5452382 def one_hot_dataframe(data, cols, replace=False): """ Takes a dataframe and a list of columns that need to be encoded. Returns a 3-tuple comprising the data, the vectorized data, and the fitted vecto

Re: [Tutor] weird lambda expression -- can someone help me understand how this works

2013-12-13 Thread Michael Crawford
Ah yes I see it. I forgot you can pass around functions in python. Thanks for the help, Mike On Dec 13, 2013, at 9:29 PM, Amit Saha wrote: > On Sat, Dec 14, 2013 at 12:14 PM, Michael Crawford wrote: >> I found this piece of code on github >> >> https://gist.github

Re: [Tutor] weird lambda expression -- can someone help me understand how this works

2013-12-13 Thread Michael Crawford
It answered it. I had forgotten that you could pass functions around in python. Thanks, Mike On Dec 13, 2013, at 9:31 PM, Amit Saha wrote: > On Sat, Dec 14, 2013 at 12:29 PM, Amit Saha wrote: >> On Sat, Dec 14, 2013 at 12:14 PM, Michael Crawford wrote: >>> I found thi

[Tutor] educational

2014-03-09 Thread MICHAEL BASHAGI
i wanted to use a .jpeg image file on a label in a small program that am building in Python, i use Window 7 professional OS, and Python 3.4here are my codes:- import sys from tkinter import * #Window mGui=Tk() mGui.geometry("1000x500") mGui.title("Kamusi") #Functions #Variables ment=StringV

[Tutor] ArcGIS Create a python script to generate north-facing aspect raster from digital elevation model

2015-03-21 Thread Michael Omohundro
Does anyone know how to create a python script to generate an aspect raster from the input elevation in a digital elevation model? I need to specify TWO variables as user parameters: input elevation and output north-facing aspect. I need to create an aspect raster from the input elevation from

[Tutor] Changing spatial reference of shapefiles in folder and exporting to new folder

2015-04-11 Thread Michael Omohundro
I want to assemble a script to: 1) input a folder with shapefiles with different coordinate systems, 2) allow the user through a toolbox script to choose a desired coordinate system, and then 3) export all the shapefiles with the new coordinate system to a new folder. So the problem is I don't kno

[Tutor] Press ESC to exit()

2017-05-01 Thread Michael C
Hi all, I am trying to write a script to exit itself when ESC is pressed. I have found several answers regarding it such as this: http://stackoverflow.com/questions/43709710/push-esc- to-terminate-python-script?noredirect=1#comment74464169_43709710 But those only work when the program goes to tha

[Tutor] Press ESC to exit()

2017-05-01 Thread Michael C
Hi all, I found out that one way to press ESC to kill the script was to use my previous script language, AutoHotKey and this is how it works: AutoHotKey code ## function that kills the window with title '*Python 3.6.1 Shell*' kill() { WinKill, *Python 3.6.1 Shell* } ## When ESC is pressed, run

Re: [Tutor] [ctypes-users] Press ESC to exit()

2017-05-02 Thread Michael C
holy cow On Mon, May 1, 2017 at 8:02 PM eryk sun wrote: > On Mon, May 1, 2017 at 6:28 PM, Michael C > wrote: > > Hi all, I found out that one way to press ESC to kill the script was to > use > > my previous > > script language, AutoHotKey and this is how it wor

[Tutor] Hi all: How do I save a file in a designated folder?

2017-05-02 Thread Michael C
from PIL import Image from PIL import ImageGrab # takes the screenshot screenshot = ImageGrab.grab() # display the screenshot screenshot.show() # save the screenshot screenshot.save("\test\missed.png") This is my current code, using Python Image Library! What I would like to get help with is:

[Tutor] how do i open picture files without knowing the file name?

2017-05-16 Thread Michael C
I am running this code so I can do some image manipulation with them. The thing is, I have a lot of pictures to go through, so I can't type the file names one by one in the code. However, the order of the files to be processed doesn't matter, so getting them in a random fashion is alright! How do

Re: [Tutor] how do i open picture files without knowing the file name?

2017-05-16 Thread Michael C
i ll look into it! thx for now! On Tue, May 16, 2017 at 12:51 PM, Alan Gauld via Tutor wrote: > On 16/05/17 19:49, Michael C wrote: > > I am running this code so I can do some image manipulation with them. > > The thing is, I have a lot of pictures to go through, so I can'

[Tutor] copy/paste/move files

2017-05-17 Thread Michael C
Hi all, How do I move files to a designated folder or copy/paste? thanks! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Image Library

2017-05-17 Thread Michael C
in fact, when I ran this: import os os.system("mspaint 1.bmp") It also opened a cmd.exe window and the script wouldn't continue until I closed the cmd window! On Wed, May 17, 2017 at 1:24 PM, Michael C wrote: > from PIL import Image > > > im = Image.open('p

[Tutor] Python Image Library

2017-05-17 Thread Michael C
from PIL import Image im = Image.open('pic.bmp') im.show() I ran this code and it not only opened the picture in paint, which is what I want, but it also opens a CMD.exe console window! how do I prevent that from happening? thanks! ___ Tutor maillist

[Tutor] How do I display a picture?

2017-05-17 Thread Michael C
Hi all, How do I display a picture? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Image Library

2017-05-17 Thread Michael C
Actually, that is the whole script! I didn't get used to have the cmd.exe window pop up at all, could it be something I did? Or, is there a way to suppress that from showing up? thanks! On Wed, May 17, 2017 at 3:30 PM, eryk sun wrote: > On Wed, May 17, 2017 at 8:24 PM, Michael C

Re: [Tutor] copy/paste/move files

2017-05-17 Thread Michael C
Ok! On Wed, May 17, 2017 at 4:11 PM, Alan Gauld via Tutor wrote: > On 17/05/17 20:09, Michael C wrote: > > > How do I move files to a designated folder or copy/paste? > > copy/paste is a UI specific thing, you don't do that in Python code. > What you do is eit

Re: [Tutor] How do I display a picture?

2017-05-17 Thread Michael C
es my script useless. so i am trying find either a way to prevent that from poping up or to close it automatically somehow or to find another way to display the picture without using python image library. On Wed, May 17, 2017 at 4:13 PM, Alan Gauld via Tutor wrote: > On 17/05/17 21:33, Mic

Re: [Tutor] How do I display a picture?

2017-05-18 Thread Michael C
via Tutor wrote: > On 18/05/17 00:24, Michael C wrote: > > > or to find another way to display the picture without using python image > > library. > > > There are lots of ways it depends on what you actually want > to do with the image. For example you can run your fa

Re: [Tutor] Python Image Library

2017-05-18 Thread Michael C
when I run this, while it's called test.pyw, this pops up from PIL import Image im = Image.open('1.bmp') im.show() [image: Inline image 1] On Wed, May 17, 2017 at 6:51 PM, eryk sun wrote: > On Wed, May 17, 2017 at 10:33 PM, Michael C > wrote: > > On Wed, May 17

Re: [Tutor] Python Image Library

2017-05-18 Thread Michael C
Oh I have been using Pillow 4.0 the whole time alright, sorry I forgot to mention it. On Thu, May 18, 2017 at 1:55 AM, Alan Gauld via Tutor wrote: > On 18/05/17 02:58, Michael C wrote: > > when I run this, while it's called test.pyw, this pops up > > > > from P

Re: [Tutor] Python Image Library

2017-05-18 Thread Michael C
Did you go into the source code of PIL/Pillow? Awesome!!! On Wed, May 17, 2017 at 7:52 PM, eryk sun wrote: > On Thu, May 18, 2017 at 1:58 AM, Michael C > wrote: > > when I run this, while it's called test.pyw, this pops up > > > > from PIL import Image &

Re: [Tutor] Python Image Library

2017-05-18 Thread Michael C
os.startfile('1.bmp') works like a charm! Now I need to figure out how to close this window once I finish with it! On Thu, May 18, 2017 at 8:14 AM, Michael C wrote: > Oh I have been using Pillow 4.0 the whole time alright, sorry I forgot to > mention it. > > On Thu, M

[Tutor] deleting elements of a dictionary

2017-05-18 Thread Michael C
I am trying to remove incorrect entries of my dictionary. I have multiple keys for the same value, ex, [111]:[5] [222]:[5] [333]:[5} and I have found out that some key:value pairs are incorrect, and the best thing to do is to delete all entries who value is 5. So this is what I am doing: import

Re: [Tutor] Python Image Library

2017-05-18 Thread Michael C
I'll use it when I get to it! Thanks! For now, I use this, as suggested by eryk sun: os.startfile('1.bmp') it doesn't pop the window. Thanks Alan! On Thu, May 18, 2017 at 10:06 AM, Alan Gauld via Tutor wrote: > On 18/05/17 16:43, Michael C wrote: > > os.sta

Re: [Tutor] deleting elements of a dictionary

2017-05-19 Thread Michael C
Thu, May 18, 2017 at 3:05 PM, Peter Otten <__pete...@web.de> wrote: > Michael C wrote: > > > I am trying to remove incorrect entries of my dictionary. > > I have multiple keys for the same value, > > > > ex, > > [111]:[5] > > [222]:[5] > > [333

Re: [Tutor] deleting elements of a dictionary

2017-05-19 Thread Michael C
list(read_dictionary) converts the dictionary into a list right? How can you save the list as a dictionary? Thanks! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] always on top

2017-05-19 Thread Michael C
Hi all: I am running a code to examine another window's activities, while I use that window to do stuff. However, the python shell keeps grabbing the Topmost position so what I do on the other window, the one that has to stay on top the whole time, keeps getting into the shell window. Is making m

[Tutor] always on top

2017-05-19 Thread Michael C
nvm, the problem went away on its own :) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] recursion

2017-05-22 Thread Michael C
hi all: I have a function to return (x,y) value, but sometimes it would naturally unable to return those 2 values properly. I know what recursion is, and I think all I got to do is to call this function a 2nd time and the problem would go away. How do I do recursion? The function basically look l

Re: [Tutor] recursion

2017-05-22 Thread Michael C
via Tutor wrote: > On 22/05/17 17:11, Michael C wrote: > > > I have a function to return (x,y) value, but sometimes it would naturally > > unable to return those 2 values properly. I know what recursion is, and I > > think all I got to do is to call this function a 2nd time

Re: [Tutor] recursion

2017-05-23 Thread Michael C
no i don't have a way, it just hasn't happened yet LOL On Mon, May 22, 2017 at 10:18 PM, Peter Otten <__pete...@web.de> wrote: > Michael C wrote: > > > oh ya, my function does in fact take no input and doesn't change > anything, > > and all i wanted t

[Tutor] real time response

2017-05-23 Thread Michael C
hi all: I have a code that takes about 20 seconds to complete, but I also need to response to events (the appearance of red dots on a canvas) so I could place a few lines to check for this condition like this def do_stuff: blah blah check() blah blah blah chec

[Tutor] threading tutorial

2017-05-25 Thread Michael C
Hi all: I tried to google for tutorials of threading, but they are all equally confusing. Does someone know of a good page or a book that talk about threading? thanks! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subsc

Re: [Tutor] threading tutorial

2017-05-25 Thread Michael C
to get the values from the thread, say x,y,d in order to restart the thread. loop. Therefore, how do I get a few values from a few variables from the thread and then close it? Threading is very new to me, so I have to be very diligent. Thanks! On Thu, May 25, 2017 at 11:06 AM Michael C wrote:

Re: [Tutor] threading tutorial

2017-05-26 Thread Michael C
message received, i ll take a look tomorrow asap. thanks for replying!!! On Thu, May 25, 2017 at 3:03 PM, Cameron Simpson wrote: > On 25May2017 11:52, Michael C wrote: > >> Right now all i need is to grab 3 values from 3 variables before killing a >> thread, like thi

Re: [Tutor] threading tutorial

2017-06-01 Thread Michael C
nds i need it. and so it's not responsive enough for this reason. Is there a way to pause/kill the thread? thanks! On Thu, May 25, 2017 at 7:47 PM, Michael C wrote: > message received, i ll take a look tomorrow asap. > > thanks for replying!!! > > On Thu, May 25, 2017 at 3:03 P

Re: [Tutor] threading tutorial

2017-06-01 Thread Michael C
let me try that! thanks! On Thu, Jun 1, 2017 at 10:52 AM, Jerry Hill wrote: > On Thu, Jun 1, 2017 at 11:30 AM, Michael C > wrote: > > Oh i get it alright, however in my code I have to push the W button like > > this: > > > > import pyautogui > > impo

Re: [Tutor] threading tutorial

2017-06-02 Thread Michael C
ihave to look at this tomorrow, thanks for the reply! On Thu, Jun 1, 2017 at 6:18 PM Alan Gauld via Tutor wrote: > On 01/06/17 16:30, Michael C wrote: > > Oh i get it alright, however in my code I have to push the W button like > > this: > > > > impor

[Tutor] tkinter actively maintained?

2017-06-12 Thread Michael C
Hi all: is tkinter still being actively maintained? I only had to ask about this because I have never looked stuff like this up before. Is it ok to develop using it, is it going to be dropped in the near future? thanks! ___ Tutor maillist - Tutor@pyt

[Tutor] class newbie

2017-07-23 Thread Michael C
class mahschool: def print(): print('Say something') a = mahschool() a.print() With this, I get this error: Traceback (most recent call last): File "test.py", line 8, in a.print() TypeError: print() takes 0 positional arguments but 1 was given What did I do wrong? Thank

Re: [Tutor] class newbie

2017-07-23 Thread Michael C
never mind, I forgot to put 'self' in the method definition! class mahschool: def print(self): print('Say something') a = mahschool() a.print() On Sun, Jul 23, 2017 at 1:24 PM, Michael C wrote: > class mahschool: > def print(): > p

Re: [Tutor] class newbie

2017-07-23 Thread Michael C
thanks! On Sun, Jul 23, 2017 at 5:35 PM, Danny Yoo wrote: > On Sun, Jul 23, 2017 at 1:24 PM, Michael C > wrote: > > class mahschool: > > def print(): > > print('Say something') > > > By the way, you've chosen a name for your method th

[Tutor] "Path tree"

2017-08-13 Thread Michael C
Hi all: I am trying to formulate a "path-finding" function, and I am stuck on this problem: Please look at the picture attached: Those dots are coordinates of (x,y), and this tree can be thought of as a list of tuples, with each tuple consisting of (x,y). Now I am trying to make a function go th

Re: [Tutor] "Path tree"

2017-08-14 Thread Michael C
http://imgur.com/a/CwA2G I don't know to do this with math :( On Sun, Aug 13, 2017 at 1:07 PM, Michael C wrote: > Hi all: > > I am trying to formulate a "path-finding" function, and I am stuck on this > problem: > > Please look at the picture attached: T

Re: [Tutor] Fwd: Re: "Path tree"

2017-08-14 Thread Michael C
; > > pic > > http://imgur.com/a/CwA2G > > > > On Mon, Aug 14, 2017 at 8:55 AM, Alan Gauld via Tutor > <mailto:tutor@python.org>> wrote: > > > > On 13/08/17 21:07, Michael C wrote: > > > > > Please look at the picture attached: &g

Re: [Tutor] "Path tree"

2017-08-17 Thread Michael C
r, > Mauritius > abdurrahmaanjanhangeer.wordpress.com > > On 14 Aug 2017 02:28, "Michael C" wrote: > > Hi all: > > I am trying to formulate a "path-finding" function, and I am stuck on this > problem: > > Please look at the picture atta

[Tutor] windows specific: read process memory

2017-09-25 Thread Michael C
Hi all, I have a few questions about memory scanning! The following code attempts to print out all addresses whose value is int(-143)! 1. I am using a for loop to go through all the addresses! Is this the right thing to do? 2. I feed the read process memory function with hex(i), correct? 3. I am

[Tutor] I want to learn how memory works!

2017-09-29 Thread Michael C
Hi all, after 1 week of on and off hacking, I realized I simply don't know enough about how memory works fundamentally! Could you point me to a source of information about all the things someone should know before he starts writing a memory scanner? Attached is my current code, which doesn't work

[Tutor] ctypes wintypes

2017-10-03 Thread Michael C
Hi all: I am trying to create SYSTEM_INFO structure and MEMORY_BASIC_INFORMATION structure I think there are modules for this purpose? Is it the ctypes.wintypes? if so, please point me to a documentation for it. Thanks! ___ Tutor maillist - Tutor@p

Re: [Tutor] ctypes wintypes

2017-10-03 Thread Michael C
i see i see. On Tue, Oct 3, 2017 at 4:50 PM, Alan Gauld via Tutor wrote: > On 03/10/17 22:30, Michael C wrote: > > > I am trying to create SYSTEM_INFO structure and MEMORY_BASIC_INFORMATION > > structure > > > > I think there are modules for this purp

Re: [Tutor] ctypes wintypes

2017-10-04 Thread Michael C
Is there a module that does this for me? If it exists, how do I find it? thanks On Tue, Oct 3, 2017 at 5:04 PM, Michael C wrote: > i see i see. > > On Tue, Oct 3, 2017 at 4:50 PM, Alan Gauld via Tutor > wrote: > >> On 03/10/17 22:30, Michael C wrote: >> >> &g

Re: [Tutor] ctypes wintypes

2017-10-05 Thread Michael C
Sorry about asking these super obvious little things, I am actually a 1st student, but I acing my programming 101 at the moment lol On Thu, Oct 5, 2017 at 12:27 PM, Michael C wrote: > First of all, thanks for the reply. > > > How do I see the values of each field? This doesn'

Re: [Tutor] ctypes wintypes

2017-10-05 Thread Michael C
First of all, thanks for the reply. How do I see the values of each field? This doesn't work. print(PMEMORY_BASIC_INFORMATION.Protect) thanks! On Thu, Oct 5, 2017 at 11:34 AM, eryk sun wrote: > On Tue, Oct 3, 2017 at 10:30 PM, Michael C > wrote: > > > > I am tryin

Re: [Tutor] ctypes wintypes

2017-10-06 Thread Michael C
= (LPVOID, PMEMORY_BASIC_INFORMATION, SIZE_T) thanks ! On Thu, Oct 5, 2017 at 1:13 PM, eryk sun wrote: > On Thu, Oct 5, 2017 at 8:27 PM, Michael C > wrote: > > > > How do I see the values of each field? This doesn't work. > > > > print(PMEMORY_BASIC_I

Re: [Tutor] ctypes wintypes

2017-10-06 Thread Michael C
FO.lpMinimumApplicationAddress) >code ends and then it says Traceback (most recent call last): File "C:/Users/AwesomeGuy/Google Drive/My life of hacking/SWTOR/mah scanner/with_eryk_sun_s_help_peace by peace.py", line 55, in Kernel32.GetSystemInfo(LPSYSTEM_INFO) ctypes.ArgumentError: arg

Re: [Tutor] ctypes wintypes

2017-10-06 Thread Michael C
Size, None): print('buffer is: ',buffer) else: print('something is wrong') On Fri, Oct 6, 2017 at 12:03 PM, eryk sun wrote: > On Fri, Oct 6, 2017 at 7:43 PM, Michael C > wrote: > > Sorry but I dont understand this line: > > > > m

Re: [Tutor] ctypes wintypes

2017-10-07 Thread Michael C
;buffer is: ',buffer) else: raise ctypes.WinError(ctypes.get_last_error()) On Fri, Oct 6, 2017 at 2:06 PM, Michael C wrote: > like this? > > buffer = ctypes.byref(ctypes.create_string_buffer(4)) > > On Fri, Oct 6, 2017 at 1:55 PM, eryk sun wrote: > >> On Fri, Oct

Re: [Tutor] ctypes wintypes

2017-10-07 Thread Michael C
like this? buffer = ctypes.byref(ctypes.create_string_buffer(4)) On Fri, Oct 6, 2017 at 1:55 PM, eryk sun wrote: > On Fri, Oct 6, 2017 at 9:12 PM, Michael C > wrote: > > > > How do I create a buffer, or rather, is a buffer just a variable? > > A buffer is a bl

Re: [Tutor] ctypes wintypes

2017-10-07 Thread Michael C
(mbi.BaseAddress) TypeError: byref() argument must be a ctypes instance, not 'int' On Fri, Oct 6, 2017 at 2:53 PM, eryk sun wrote: > On Fri, Oct 6, 2017 at 10:26 PM, Michael C > wrote: > > > > base = mbi.BaseAddress > > buffer = ctypes.c_int32() > &

Re: [Tutor] ctypes wintypes

2017-10-07 Thread Michael C
thing? # Don't do read memory yet. # make it traverse through all memory and print out when protect and state # are both true. ## ##MEM_COMMIT = 0x1000; ##PAGE_READWRITE = 0x04; ## ##current_address = sysinfo.lpMinimumApplicationAddress ##end_address = sysinfo.lpMaximumApplicationAddress ## ##wh

[Tutor] How do I scan memory for singles, doubles and so on?

2017-10-07 Thread Michael C
Hi all: I am working on a memory scanner, and the source code and output is as following: Now, I know why my buffer from read process memory looks like values such as "67108864" ; it's because I read into the buffer entire chunk of memory at a time, because I fed read process memory this: "mbi.R

Re: [Tutor] How do I scan memory for singles, doubles and so on?

2017-10-07 Thread Michael C
Or to put it better, I think, it's How do I set up ReadProcessMemory, so that it returns a double instead of 129819721. On Sat, Oct 7, 2017 at 2:00 PM, Michael C wrote: > Hi all: > > I am working on a memory scanner, and the source code and output is as > following: >

Re: [Tutor] How do I scan memory for singles, doubles and so on?

2017-10-08 Thread Michael C
you to look at: DWORD read = 0; LPVOID buffer = 0 (ReadProcessMemory(hackProcess, (void*)start, &buffer, sizeof(int), &read) So, what's the Python equivalent statements for sizeof(int) ? On Sat, Oct 7, 2017 at 7:38 PM, Michael C wrote: > Oh I am trying to write my ow

Re: [Tutor] How do I scan memory for singles, doubles and so on?

2017-10-08 Thread Michael C
t 7, 2017 at 6:58 PM, Mats Wichmann wrote: > it might help if you mention what you are trying to do. if it is > forensics, there a bunch of python tools in that area. your problem may > already have solutions you could use. > > On October 7, 2017 3:00:25 PM MDT, Michael C com> wrot

Re: [Tutor] How do I scan memory for singles, doubles and so on?

2017-10-08 Thread Michael C
update: I should have put down buffer = ctypes.c_double() instead of buffer = ctypes.c_double. Sorry all On Sat, Oct 7, 2017 at 8:18 PM, Michael C wrote: > I am following some examples online such as this one: > https://social.msdn.microsoft.com/Forums/vstudio/en-US/ > ce0cc398-2b96-

[Tutor] using while loop for read process memory

2017-10-08 Thread Michael C
Hi all: I have the following code, and somehow I must have fed the read process Memory incorrectly. what the code does is to check a region of memory to see whether or not it can be scanned. mbi.Protect == PAGE_READWRITE and mbi.State == MEM_COMMIT If this is true,then it proceeds to scan the me

Re: [Tutor] using while loop for read process memory

2017-10-08 Thread Michael C
lue comparison to be implemented. pass else: raise ctypes.WinError(ctypes.get_last_error()) index += 1 On Oct 8, 2017 12:16 PM, "Mats Wichmann" wrote: > On 10/08/2017 11:20 AM, Michael C wrote: > > Hi all: > >

Re: [Tutor] using while loop for read process memory

2017-10-08 Thread Michael C
I'll explain better when I get on a pc. On Oct 8, 2017 12:18 PM, "Michael C" wrote: > This is the red part > index = current_address > end = current_address + mbi.RegionSize > > while index < end: > if ReadProcessMemory

Re: [Tutor] using while loop for read process memory

2017-10-09 Thread Michael C
thank for replying, but I am toast, so I'll reply tomorrow, thanks! On Sun, Oct 8, 2017 at 4:46 PM, Alan Gauld via Tutor wrote: > On 08/10/17 20:18, Michael C wrote: > > This is the red part > > index = current_address > > end = current_address + mbi.Region

Re: [Tutor] using while loop for read process memory

2017-10-13 Thread Michael C
there is a better way to do it, for instance, a for loop. for(start,finish, 8) why 8? because double begins at exact 0 or multiple of 8 bytes, right? On Sun, Oct 8, 2017 at 4:46 PM, Alan Gauld via Tutor wrote: > On 08/10/17 20:18, Michael C wrote: > > This is the red part > >

Re: [Tutor] using while loop for read process memory

2017-10-13 Thread Michael C
ause I ran this in a while loop with start += 1 so in the last 7 bytes, I'd be reading past the end of this memory chunk. Is this right? On Thu, Oct 12, 2017 at 6:54 PM, Michael C wrote: > Here is my question about the memory: > > So I have a base address of a chunk o

Re: [Tutor] using while loop for read process memory

2017-10-13 Thread Michael C
to use increment by 1. Now, from what I have been reading, it seems there is a better way to do it, for instance, a for loop. for(start,finish, 8) why 8? because double begins at exact 0 or multiple of 8 bytes, right? On Thu, Oct 12, 2017 at 6:54 PM, Michael C wrote: > Here is my question ab

<    2   3   4   5   6   7   8   9   >