0
votes
1answer
24 views

How to identify login form variables

I'm trying to login into website with requests module. Login form is in javascript I think. I need to identify the form names that contain the username and the password. I tried to sort it our with ...
0
votes
1answer
36 views

Where can I find the _sre.py python built-in module

I am studying the python regular expression (re.py) source code. In re.py they imported the module sre_compile: import sre_compile and I look at the module sre_compile there they imported the ...
0
votes
2answers
60 views

Running Python using HTML

I'm trying to get my html file to excecute python scource code using python-multitouch batch file. The file name is C:\Users\Alien\Desktop\PYMT\pymt.bat and i'm running from ...
1
vote
4answers
136 views

How to replace four spaces by one tab in a big python code?

I have downloaded a python code and would like to edit it. The problem is that I used to use tabs to make indents but file use four spaces instead and if a combination of spaces and tabs is used, ...
0
votes
0answers
73 views

looking for text format to generate c and python [closed]

For my project I need to generate a source code in python, C, fortran from a text file. For a file format I choose XML. This format should describe the work flow and variables declared (that GUI part ...
8
votes
1answer
110 views

Weird Integer Cache inside Python 2.6

after dive into python's source code, I find out that it maintains an array of PyInt_Objects ranging from int(-5) to int(256) (@src/Objects/intobject.c) A little experiment proves it: >>> a ...
1
vote
1answer
232 views

Why doesn't Python recognize my utf-8 encoded source file?

Here is a little tmp.py with a non ASCII character: if __name__ == "__main__": s = 'ß' print(s) Running it I get the following error: Traceback (most recent call last): File ".\tmp.py", ...
0
votes
1answer
72 views

Where is _ctypes._SimpleCData.__mul__() method implemented?

For example: >>> ctypes.c_char * 2 <type '_ctypes.SimpleType'> The type c_char_Array_2 is created on the fly by the __mul__() method in _ctypes._SimpleCData,I want to know how it did ...
0
votes
1answer
42 views

Error while downloading the source code from google app engine

I am using the following command : appcfg.py download_app -A <application-id> -V <application-version> <output-dir> It then asks me for googleusername and password. But after ...
0
votes
2answers
81 views

Apply patches to python libraries

I want to apply patches that the author of a Python library uploaded on his website. Is there any way to do this easily without resorting to doing it manually on each impacted line? Something like: ...
0
votes
1answer
48 views

Advantages of installing from source instead of installer for Python 2.7

I'm a complete beginner learning Python. I noticed the Windows installer for Python states "does not include source" and below it there's an option to install the source via tarball. ...
-5
votes
3answers
256 views

How to lock source code of terminal ran perl, obj c, c++, python, and ruby etc scripts?

I am looking to sell scripts I made in perl, obj c, c++, python, ruby, bash, php, etc etc etc They are all ran in the terminal. (Linux) How can I lock the source code, so my scripts can be ...
-4
votes
1answer
80 views

Source code parser(prefered Python) [closed]

I am looking a tool which take source code as a input and tokenize them as a operator, keyword, class, function, member variable, comments and parameter. Tool should take parsing logic from ...
1
vote
2answers
161 views

How to comment out python code using sed command

I want to comment out following line of code using the sed command. Actual Code: response = HttpResponse() response['Content-Disposition'] = 'attachment; filename=%s.zip' % ...
2
votes
3answers
260 views

SWT source code editor widget

Is there any source code editor widget for SWT? I looked for a long time and nothing found... I saw that question: SWT Syntax highlighting widget, but I don't want to use raw StyledText widget - I ...
2
votes
4answers
129 views

Is there a platform-agnostic Python widget that syntax highlights source code?

I'm writing a small GUI tool in Python that scans C/C++/Java source files for specific patterns (eg: "todo" inside a comment) and displays them as a treeview. I want to display the contents of the ...
3
votes
3answers
123 views

How to check source code of a python method?

To be short, suppose I have a string 'next', next = "123rpq" and I can apply a str method .isdigit() to 'next'. So my question is how to check the implementation of this method. Hence is there a ...
1
vote
1answer
130 views

pydoc-like program to browse content(code) of python files in browser?

pydoc allows you to view documentation of python modules and packages in directories added to your pythonpath in a browser. But is there a way to browse the complete code of those files? Edit: ...
0
votes
0answers
332 views

Saving web page's Source-code Python

I was trying to scrape a webpage, but when I organize the page's source code python misses some codes that I'll need. If I save the source code previously, by right clicking on the page, I have no ...
2
votes
2answers
183 views

source code of python inbuilt functions

I have used type() function in my program... I just want to know how does Python implement this? Or where could I find the source code file that implement this function?
0
votes
1answer
95 views

What are the best examples of well/properly/efficiently commented python projects [closed]

I, once again, am going to make a New Year's resolution to do a better job commenting my Python projects. I am asking the community for some examples they look to for best practices. What projects do ...
3
votes
5answers
309 views

Automated alignment of “tabular” Python code

I have some Python code that looks something like this: rates = {3: [((17500, 99999), Decimal('23425.00'), Decimal('7234.24'))], 4: [(( 0, 3510), Decimal( '4563.00'), ...
0
votes
3answers
116 views

Calculating Reciprocals: n**(-1) or (1/n)?

In random.py's source code, there is the following constant definition: BPF = 53 # Number of bits in a float RECIP_BPF = 2**-BPF I'm no math major, but isn't it more readable to invert BPF ...
0
votes
1answer
71 views

how to compile the python source code not using vs2005

i want to change some python source code , and then compile them , but i dot want to use vs2005 , because it is so big , i dont like it , so what can i do , thanks this is my code use my own ...
0
votes
2answers
79 views

Better way to test several functions for the same thing in python

Assuming a python file with a whole bunch of functions I want to write tests for the functions using doctest. For example every function takes a string and a connection object ...
3
votes
4answers
404 views

Compiling script files Lua or Python

I will seperate my bussiness code into a script language. it would be Lua or Python. My question is my bussiness code written in script file is viewable by others. Because of script file will not ...
1
vote
5answers
610 views

Python Coding Stlye…Is the code bug free/production quality

I recently had a technical phone interview with an internet company, and after the phone interview i was asked to solved a common information retrieval problem. My task was to code the solution for ...
4
votes
2answers
238 views

Explanation of python code snippet >>numpy.nonzero(row == max(row))[0][0]<< from a script using numpy

What does this peace of python code row = R[i,] j = numpy.nonzero(row == max(row))[0][0] do, assuming this output: command # output of python ---------------------------------- R.shape # (224, ...
0
votes
2answers
139 views

Issues with repeatedly executing .pyc script

I am trying to make an script that will every second read string from a file, and execute it. executer.pyc: import os, time f = open("/root/codename/execute","a") f.write("") f.close() ...
13
votes
3answers
916 views

Inspecting python's math functions

I am following along with MIT's python course, and there is a lecture that involves writing an algorithm for computing square roots. I got the idea that I would like to have a look at the way python ...
0
votes
6answers
731 views

how do you protect your source with python?

python has been used to develop commercial software, but how can you make money from your programs if the source is always available?
3
votes
3answers
493 views

How to parse code (in Python)?

I need to parse some special data structures. They are in some somewhat-like-C format that looks roughly like this: Group("GroupName") { /* C-Style comment */ Group("AnotherGroupName") { ...
0
votes
1answer
268 views

python application decompiler

so I know nothing about Python programming :D I have a website that offers files to people, this site is related to a sat decoder based on Linux. Some people developed "plugins" written in python ...
0
votes
2answers
273 views

How to create array of the certain type in python

How do you create an array of defined length of the certain type in python? To be precise I am trying to create an array of handles that is able to hold up to 1024 records. I figured out an analog to ...
0
votes
6answers
1k views

I need a stand alone python interpreter/compiler!

Ok so i am in need of a python compiler (from .py or .pyw to .exe). the only ones i have come across are: - cx_freeze (doesnt work) - py2exe (way too complicated) EDIT: both of the programs above ...
0
votes
2answers
146 views

is it possible to use batch scripts in a GUI made with Python?

Ok so i was wondering if it was possible to write a GUI in python, and then somehwere in the python script, insert a script switch to temporarily change the language to accomedate for the batch ...
4
votes
3answers
262 views

Can't understand a line in a “Collective intelligence” program

I'm working through "Programming collective intelligence". In chapter 4, Toby Segaran builds an artificial neural network. The following function appears on page of the book: def ...
0
votes
2answers
359 views

Python how to check if a module/class/methods has changed and log the changes

i have a problem of comparing two modules/classes/method and to find out if the class/method has have changed. This is because we allow users to change classes/methods, and after processing we make ...
3
votes
1answer
222 views

Analyse source code in Java using Python?

i would like to create a source code analyser for Java Project (like FindBugs and other static analysis programs) that would be able to detect certain method calls. I would prefer to do it using ...
0
votes
1answer
197 views

Sharing model between Camelot and non-Camelot apps

I would like to share my data model between different Elixir/SQLAlchemy applications, one of which would be a Camelot UI and the others stuff like web interfaces and so on. They would all connect to ...
1
vote
1answer
2k views

How do I apply a patch from gist to the Django source?

I want to try out a patch on gist that modifies the source code of Django: gist: 550436 How do I do it? I have never used git so a step by step instruction would be greatly appreciated. Thanks
2
votes
2answers
543 views

Is there a way to view the source code of a function, class, or module from the python interpreter?

Is there a way to view the source code of a function, class, or module from the python interpreter? (in addition to using help to view the docs and dir to view the attributes/methods)
6
votes
4answers
653 views

Where can I find a large body of *Python3* source code?

I'm testing a Python parser. I have Python 2.6/2.7 firmly under control, and some good (large) code samples on which I've tested it. I'm interested in testing my Python3 variant. I've been to ...
1
vote
1answer
110 views

has any gae-simple or gae source code achieve 'group' or 'bbs forum' on google-app-engine

i want to find some source code about 'group'(like group app in pinax) or 'bbs forum' on google-app-engine, has anyone know this ? thanks
4
votes
3answers
2k views

How to organize Python source code files?

I am developing a Python App Engine app, where I want to split the content of a source code file Models.py into separate files for each model, but I want to put it all in a folder called Models. The ...
1
vote
5answers
207 views

Python control structure utilisation

This code seems to smell: result = None for item in list: if result is None: result = item.foo(args) else: if ClassFred.objects.get(arg1=result) < ...
1
vote
2answers
462 views
4
votes
9answers
635 views

How can a total, complete beginner read source code?

I am a complete, total beginner in programming, although I do have knowledge of CSS and HTML. I would like to learn Python. I downloaded lots of source code but the amount of files and the complexity ...
0
votes
5answers
3k views

Script to remove python comments/docstrings

Is there a python script or tool available which can remove comments and docstrings from python source? it should take care of cases like """ aas """ def f(): m = { u'x': ...
2
votes
1answer
778 views

How can I strip comments and doc strings from python source code?

Is there a program which I can run like this: py2py.py < orig.py > smaller.py Where orig.py contains python source code with comments and doc strings, and smaller.py contains identical, ...

1 2
15 30 50 per page