Python is a dynamic, high-level language. Its design focuses on clear syntax, an intuitive approach to object-oriented programming, and making the right way to do things obvious. Python supports modules, exceptions, had an extensive standard module library. Python can also be embedded in other ...
0
votes
1answer
44 views
Which window to choose? [on hold]
I'm making an astronomy observation record application through Python 2.7.5 (using Tkinter). And I want it to have multiple screens. I'm thinking logic like this:
if object is clicked:
#Go to this ...
1
vote
0answers
18 views
Restrictive routing best practices for Google App Engine with python?
Say I have a simple structure:
app = webapp2.WSGIApplication([
(r'/', 'pages.login'),
(r'/profile', 'pages.profile'),
(r'/dashboard', 'pages.dash'),
], debug=True)
Basically all pages ...
3
votes
1answer
76 views
How can I keep current with Python coding style?
I've been using Python since version 2.2. I do pick up new language constructs like for example with statement or dictionary/set comprehensions. However, I've realized that even though I'm being ...
2
votes
0answers
37 views
how to follow python polymorphism standards with math functions
So I am reading up on python in Mark Lutz's wonderful LEARNING PYTHON book. Mark makes a big deal about how part of the python development philosophy is polymorphism and that functions and code should ...
2
votes
0answers
32 views
Nested entities in Google App Engine. Do I do it right?
Trying to make most of the GAE Datastore entities concept, but some doubts drill my head.
Say I have the model:
class User(ndb.Model):
email = ndb.StringProperty(indexed=True)
password = ...
5
votes
1answer
196 views
How should I architect a personal schedule manager that runs 24/7?
I've developed an ADHD management system for myself that's attempting to change multiple habits at once. I know this is counter to conventional wisdom, but I've tried the conventional for years & ...
0
votes
0answers
24 views
Plugin based application with TUI
I am wery newb in Python :)
Can anyone share example of application whith co using packages "npyscreen" and "yapsy" ?
I hope to see a several plugins from several categories.
And in TUI(npyscreen ...
-2
votes
0answers
35 views
Udacity function valid_year(year) — Why is 1920 considered incorrect? [migrated]
I'm getting the correct output on IDLE but the submission says it's incorrect. Thank you in advance for any suggestions/resolutions.
Code:
def valid_year(year):
for i in range(1900,2021):
...
0
votes
0answers
43 views
How to run a python program in Textastic for iPad?
I have recently bought Textastic for my iPad Mini.
When it downloaded, I went on it and immediately made a Python "Hello World", but for some reason, it doesn't run the program. I clicked on the ...
0
votes
0answers
30 views
Need help with a weird bug [migrated]
So I am working on making a dictionary of subway stations in Boston and their neighbors for a bigger program. Each station belongs to a line, like blue or red, and these lines make up the whole entire ...
-5
votes
0answers
98 views
Learning two languages at once: Java and _____? [closed]
I'm currently re-enrolling in school for a second degree in Computer Science. Keeping both employability (I'd like to start working ASAP, even if to snag an internship) and long-term proficiency as a ...
2
votes
2answers
139 views
Executables and Python
I've started learning my first language recently, Python, and I became interested in how it differed from the myriad of other programming languages.
I've been able to find most of it out with some ...
7
votes
2answers
191 views
How to share control of links/domains on an open source project with many collaborators?
I'm trying to help the Rebol project re-engineer its web presence now that it is open source as Apache 2 — after nearly two decades of proprietary license!
The language's creator currently has ...
1
vote
4answers
274 views
Can I perform a code review although I am very inexperienced? [closed]
I have been teaching myself Python as a first language for 2 years now. So far I have done some online courses (NLP, Design of a Computer Program etc.) and solved some puzzles but never worked with ...
6
votes
1answer
170 views
Duck typing, data validation and assertive programming in Python
About duck typing:
Duck typing is aided by habitually not testing for the type of arguments in method and function bodies, relying on documentation, clear code and testing to ensure correct use.
...
5
votes
3answers
264 views
How to sync clocks over networking for game development?
I'm writing a game that has a lot of time based aspects. I use time to help estimate player positions when the network stalls and packets aren't going through (and the time between packet's being ...
2
votes
1answer
73 views
Tests for emptiness vs tests for nothingness
Is there any consensus between languages how tests for emptiness are distinct from tests for noneness? In python the following expression is false:
{} is {}
However this expression evaluates to True
...
-2
votes
0answers
29 views
python random number generator listing all out comes of 25 numbers in groups of three [closed]
I'm trying to write a random number generator from scratch, but I need it to follow these rules.
it needs randomly select 3 numbers from an array producing every possible outcome of groups of three ...
-2
votes
0answers
29 views
Python or java random number generator from array [closed]
I'm trying to write a random number generator from scratch, but I need it to follow these rules:
it needs randomly select 3 numbers from an array producing every possible outcome of groups of three ...
1
vote
0answers
52 views
Python Multiprocessing with Queue vs ZeroMQ IPC
I am busy writing a Python application using ZeroMQ and implementing a variation of the Majordomo pattern as described in the ZGuide.
I have a broker as an intermediary between a set of workers and ...
0
votes
0answers
193 views
Why is Ruby considered elegant language and Python not? [closed]
Can someone explain me what is elegant in ruby? Because these two languages have both good simplicity, readability, writability, maintainability. What makes ruby elegant and python not?
-2
votes
1answer
79 views
best way to learn python/php to implement my Idea [closed]
I am new to WebSite development.But I have great skills and experience in Java and C.I have gained sufficient knowledge in HTML,CSS and JavaScript.
I have an idea about creating a social website and ...
2
votes
3answers
174 views
Pros of start learning programming with Python if what I really want is Javascript?
A friend of mine seeks to learn Javascript programming but he never programmed before.
I've found Python as a quite nice language that takes most unneeded "strangeness" out of learning programming ...
14
votes
3answers
1k views
How to solve the problem of nested comments
It appears in not just one language that comments can't be nested. Do you have a good solution for this problem? One workaround in C/C++ and Java is to only use the single-line comment but it becomes ...
-2
votes
1answer
65 views
Can I run command-line commands within a python script? [closed]
Basically I've downloaded this package that deals with text files that is run from the terminal, but the command I need takes in two arguments. I also need to do this many times (5000+).
I need to ...
0
votes
0answers
56 views
Why complex is better than complicated? [duplicate]
In python, when you "import this", you can get The Zen of Python.
It says "Complex" is better than "Complicated". Why is that? What's the difference between complex and complicated in programming ...
0
votes
1answer
159 views
Should I use webKit or is there a better technology to make a browser in Windows [closed]
I create web applications most in RoR and PHP. About a year ago a company wanted to use my app but in a stand alone browser window in Linux, so I wrote one in python using webkit, locked it down to ...
0
votes
0answers
45 views
Watching file changes/additions/removal, but with an eye on partial transfer
I would like to monitor the filesystem in python, so that my application gets warned of the new file addition, file removal, or file change. Once the file is detected, the application starts ...
-1
votes
0answers
69 views
I need to use code to group matching words in 2 columns [closed]
Wondering if anyone can assist me with this,I'm a new python programmer.
If I have an excel (well I use LibreOffice. Ubuntu 12.04) file with 2 columns and need to specific words in rows with another, ...
-2
votes
0answers
24 views
serial data to print on window using python [closed]
This is the code to receive serial data and to print on the window.
Here the window will open and the serial data which is received at certain time periods will print on the window. the first ...
0
votes
2answers
210 views
How my website should use it's own API?
Im building small web-service which will provide my users with data through API.
Also, some data will be available right on my website.
The question is about how to use my own API? Should my website ...
0
votes
1answer
71 views
How to deal with database connections in a Python library module
I have created a library in Python that contains functions for accessing a database. This is a wrapper library around a third party application database, written due to the fact that the third party ...
-2
votes
0answers
23 views
Mapnik and tilecache performance issue [closed]
I am working on GIS based web application using Mapnik and Tilecache with backend python. To display map in the browser, openlayers is used. Maps are generated by calling tilecache cgi url. I am ...
-2
votes
0answers
38 views
Load testing my Django App [closed]
so i have a Django app that is not optimized yet and i am doing some load testing using Jmeter.
For now i am only doing a simple GET to my index.html.
I am trying to interpret the results, and from ...
6
votes
1answer
249 views
Object oriented vs vector based programming
I am torn between object oriented and vector based design. I love the abilities, structure and safety that objects give to the whole architecture. But at the same time, speed is very important to me, ...
0
votes
3answers
209 views
Object design where hard-coded values are used to instantiate objects?
I'm creating the design for a browser bookmark merging program and I've ran into a design problem that I've seen before yet I've never come up with a good solution for it. So lets say I have a ...
-2
votes
0answers
123 views
Learning django and Python GUI [closed]
Can anybody suggest me some good user-interactive sites like Codecademy, for learning Django.
And also some good resources for learning python GUI programming.
2
votes
2answers
176 views
How can I keep a production Python environment secure?
Most of my work is creating websites in Django (a Python web framework) and deploying them to my own or clients' servers. I work from a virtualenv to separate site from system packages and have ...
2
votes
2answers
196 views
Developing Python on Windows and deploying to Linux
I have a client who would prefer to host their application on Linux. However, my coworkers and I have very little experience with Linux. This is a short project with a low budget, so making choices ...
-1
votes
0answers
62 views
Key Logger Problems [closed]
So I'm fairly new to programming in python (only started half a year ago) and recently I wanted to put my skills on a test and decided to code together a simple key logger.
import pythoncom
import ...
-5
votes
0answers
52 views
For viewing in online how to handle a document? [closed]
Internet full of several documents like this.
http://files.swaroopch.com/python/byte_of_python.pdf
different type of document from online shows in different mode in different browser. Some browser ...
3
votes
3answers
189 views
How to rotate an array of bits
I currently have a PIL Image object which I store as an array of bits (1's and 0's). However I now would like to be able to rotate that image 45 degrees. One way to do it is take the original PIL ...
-5
votes
0answers
47 views
Multi-column layout handling with pdfminer pdf2txt.py module [closed]
So far I am using pdfminer pdf2txt.py module with success.
But a problem arises in pdf files formatted in two columns. The module retrieves text into a single column which results into many split ...
2
votes
5answers
260 views
The rationale behind Falsy values [closed]
I'm wondering what the arguments for/against Falsy values are. On what principles would you decide to add or exclude them from a language? Are there any problems you could see them causing off-hand?
...
-2
votes
0answers
37 views
Advantages of pdb vs IDLE debugger [closed]
What are the advantages to using the PDB module within a program, as opposed to IDLE's debugger? Does IDLE just provide a GUI while running PDB under the hood? Apologies if this is a blindingly ...
3
votes
2answers
202 views
What is the way to go to extract data from websites?
I've been thinking about a side project that envolves web data scraping.
Ok, I read the Getting data from a webpage in a stable and efficient way question and the discussion gave me some insights.
...
0
votes
1answer
118 views
Programming a telnet application
I'm very new to programming (I'm a network guy professionally) but lately the appeal of studying code has become more and more apparent to me. So I'd like to start by programming a telnet application ...
4
votes
4answers
396 views
How to create different paths for users to take through the pages in my site?
I have a website where users are directed to go through a sequence of pages to perform a sequence of work tasks (transcribe a paragraph, answer a survey, interact with another user, etc). For short, ...
2
votes
1answer
156 views
What's the best way to create a static utility class in python? Is using metaclasses code smell?
Ok so I need to create a bunch of utility classes in python. Normally I would just use a simple module for this but I need to be able to inherit in order to share common code between them. The common ...
-6
votes
1answer
92 views
Separating signal chunks, better algorithm desired [closed]
This is my current challenge. I am looking for a good algorithm.
http://i.stack.imgur.com/Q6b9z.gif
from 0 to about 1480 you have values below 100. My goal is to separate those two big areas of ...