ANN: magnitude 0.9.1

2007-10-16 Thread juan
I am happy to announce the first release of magnitude, a library for computing with physical quantities. It is released under the Apache v. 2 license. A physical quantity is a number with a unit, like 10 km/h. Units can be any of the SI units, plus a bunch of non-SI, bits, dollars, and any combina

Re: ANN: magnitude 0.9.1

2007-10-16 Thread juan
Ben Finney <[EMAIL PROTECTED]> writes: > Please don't ever recommend 'from foo import *' in end-user > documentation. It's generally a bad practice and should only be done > when the individual programmer understands the tradeoffs involved; > putting it in the documentation for a module is setting

Re: ANN: magnitude 0.9.1

2007-10-18 Thread juan
> A further issue, that requires a change of interface: Please comply > with PEP 8 http://www.python.org/dev/peps/pep-0008/> for your > module interface. In particular, please name classes with TitleCase, > and functions, methods, and instance names with > lower_case. Done, almost. I should have

Re: ANN: magnitude 0.9.2

2007-10-18 Thread juan
Thomas Heller <[EMAIL PROTECTED]> writes: > - "physical", not "phisical" ;-) I see a worrisome pattern starting to emerge :-). Thanks. > - you raise string exceptions in various places; these are > deprecated and should not be used. Also it is very > difficult to catch them. Yes, I believe it

Python LDAP

2008-08-26 Thread Juan
Hi I am trying to make a simple Python script using LDAP. The module is imported OK, but when I call the function open or initialize, I get this error: Traceback (most recent call last): File "/home/juan/workspace/amquare/src/nutum/amquare/amquare.py", line 122, in conn.connec

SQL package

2008-08-26 Thread Juan
Hi I am trying to write a little a script that can be configurable. This script should access to a database, that can be of any type (MySQL, Postgres, SQLite, MS, etc).It has only to perform 2 or 3 simple plain SQL queries. Hi have tested SQLAlchemy, and it is great, but too much for my requiremen

Re: Python LDAP

2008-08-26 Thread Juan
On 26 ago, 13:42, Michael Ströder <[EMAIL PROTECTED]> wrote: > Juan wrote: > >     self.conn = ldap.initialize(self.host, self.port) >  > [..] > > LDAPError: (2, 'No such file or directory') > > You have to pass in a LDAP URI as documented > he

PYTHONPATH and modules

2008-08-28 Thread Juan
/src/:workspace/sysinfo/src python -m nutum.sysinfo.sysinfo --config-file /home/juan/sysinfo.config.ini I get this output: Traceback (most recent call last): File "/usr/lib/python2.5/runpy.py", line 85, in run_module loader = get_loader(mod_name) File "/usr/lib/python2.5/pk

What does "shell introspection" mean?

2011-06-25 Thread Juan Kinunt
In the PyDev installation documentation you see this sentence: "The Forced builtin libs are the libraries that are built-in the interpreter, such as __builtin__, sha, etc or libraries that should forcefully analyzed through shell introspection (the other option to analyze modules with too much run

How to properly retrieve data using requests + bs4 from multiple pages in a site?

2016-12-01 Thread Juan C.
I'm a student and my university uses Moodle as their learning management system (LMS). They don't have Moodle Web Services enabled and won't be enabling it anytime soon, at least for students. The university programs have the following structure, for example: 1. Bachelor's Degree in Computer Scien

Re: How to properly retrieve data using requests + bs4 from multiple pages in a site?

2016-12-03 Thread Juan C.
On Thu, Dec 1, 2016 at 10:07 PM, Juan C. wrote: > It works, but it has a big issue: it gets all data from all units/courses/assignments at the same time, and this isn't very useful as I don't care about data from units from 1-2 years ago. How can I change the logic so it just gets th

The right way to 'call' a class attribute inside the same class

2016-12-11 Thread Juan C.
I'm watching a Python course and was presented a topic regarding classes. One of the examples were: box.py class Box: serial = 100 def __init__(self, from_addr, to_addr): self.from_addr = from_addr self.to_addr = to_addr self.serial = Box.serial Box.serial

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread Juan C.
On Sun, Dec 11, 2016 at 11:34 PM, Steve D'Aprano wrote: > So... in summary: > > > When *assigning* to an attribute: > > - use `self.attribute = ...` when you want an instance attribute; > > - use `Class.attribute = ...` when you want a class attribute in > the same class regardless of which sub

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread Juan C.
On Mon, Dec 12, 2016 at 12:34 PM, Thomas 'PointedEars' Lahn wrote: > First of all, the proper term for what you are doing there is _not_ “call”; > you are _accessing_ an attribute instead. Indeed, `accessing` seems better. I was looking for a better word but couldn't find at the moment. > To cal

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread Juan C.
On Mon, Dec 12, 2016 at 6:59 PM, Thomas 'PointedEars' Lahn wrote: > Using the Python official doc link you provided, it clearly states that `__new__` is the one called to "create a new instance of class [...]

Re: Python constructors have particular semantics, and ‘Foo.__init__’ doesn't qualify (was: The right way to 'call' a class attribute inside the same class)

2016-12-12 Thread Juan C.
I agree with you, I'll post here the same thing I said in there for another member: On Mon, Dec 12, 2016 at 6:59 PM, Thomas 'PointedEars' Lahn wrote: > > Using the Python official doc link you provided, it cl

Re: Choosing a Python IDE. what is your Pythonish recommendation? I do not know what to choose.

2017-01-02 Thread Juan C.
On Mon, Jan 2, 2017 at 9:38 AM, Antonio Caminero Garcia < tonycam...@gmail.com> wrote: > The thing with the from-the-scratch full featured IDEs (Eclipse, IntelliJ, Pycharm) is that they look like a space craft dashboard and that unwarranted resources consumption and the unnecessary icons. I want my

What are your opinions on .NET Core vs Python?

2017-01-28 Thread Juan C.
As you guys might know, .NET Core is up and running, promising a "cross-platform, unified, fast, lightweight, modern and open source experience" (source: .NET Core official site). What do you guys think about it? Do you think it will be able to compete with and overcome Python in the opensource med

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Juan C.
On Sun, Jan 29, 2017 at 1:06 AM, Juan C. wrote: > > As you guys might know, .NET Core is up and running, promising a > "cross-platform, unified, fast, lightweight, modern and open source > experience" (source: .NET Core official site). What do you guys think about > it

Re: What library/package to use for parsing XML?

2017-01-30 Thread Juan C.
On Mon, Jan 30, 2017 at 3:58 PM, Chris Green wrote: > I want to parse some XML data, it's the address book data from the > linux program osmo. The file I want to parse is like this:- Just like Irmen said, use the default xml.etree.ElementTree, it's amazing and very simple to use. -- https://mai

PLEASE HELP -- TOTALLY NEW TO PYTHON

2016-03-26 Thread Juan Dent
nge(len(subgraphs)-1, -1, -1): TypeError: object of type 'generator' has no len() Please, I know no python and am in a hurry to get this working… Please help Regards, Juan -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.4.1 and blitzdb issue

2014-10-22 Thread Juan Christian
new millennium.","birthday":"1944-05-14","deathday":"","homepage":"","id":1,"imdb_id":"nm184","name":"George Lucas","place_of_birth":"Modesto - California - USA&qu

Python 3.4.1 and blitzdb issue

2014-10-22 Thread Juan Christian
Testing code: CODE - #!/usr/bin/env import requests from blitzdb import Document, FileBackend API_URL = 'http://api.themoviedb.org/3' API_KEY = 'ddf30289' class Actor(Document): pass def get_actor(_id): r = requests.get('{}/person/{}?api_key={}'.format(A

Python 3.4.2 + PyQt4 + PyCharm 3.4.1

2014-10-28 Thread Juan Christian
Python 3.4.2 Windows x64 PyQt4 4.11.2 Py3.4 Qt4.8.6 (x64) PyCharm 3.4.1 Pro Edition So, PyCharm works 100% with everything here but PyQt. I have this folder structure: Disk C: > PyQt4 >> Lib/site-packages/PyQt4/(tons of files here) > Python34 (normal/default installation) --- I tried copying

Re: Python 3.4.2 + PyQt4 + PyCharm 3.4.1

2014-10-29 Thread Juan Christian
It only occurs whule using PyCharm I tried it via pure terminal and everything works... =/ On Tue, Oct 28, 2014 at 7:45 PM, Juan Christian wrote: > Python 3.4.2 Windows x64 > PyQt4 4.11.2 Py3.4 Qt4.8.6 (x64) > PyCharm 3.4.1 Pro Edition > > > So, PyCharm works 100% with everyt

Re: Python 3.4.2 + PyQt4 + PyCharm 3.4.1

2014-11-01 Thread Juan Christian
No one here uses PyCharm and Qt? =/ On Wed, Oct 29, 2014 at 8:45 PM, Juan Christian wrote: > It only occurs whule using PyCharm I tried it via pure terminal and > everything works... =/ > > On Tue, Oct 28, 2014 at 7:45 PM, Juan Christian > wrote: > >> Python 3.4.2 Win

Re: Python 3.4.2 + PyQt4 + PyCharm 3.4.1

2014-11-06 Thread Juan Christian
ov 6, 2014 at 12:50 farshad akbari wrote: > On Saturday, November 1, 2014 3:11:54 PM UTC+3:30, Juan Christian wrote: > > No one here uses PyCharm and Qt? =/ > > > > > > On Wed, Oct 29, 2014 at 8:45 PM, Juan Christian > wrote: > > > > It only occurs whule u

PySide 1.2.2 setMaxWidth and AeroSnap

2014-11-16 Thread Juan Christian
PySide 1.2.2 Python 3.4.2 Code: from PySide.QtGui import * class MainWindow(QWidget): def __init__(self): QWidget.__init__(self) self.setMinimumSize(600, 700) self.setMaximumWidth(600) self.setLayout(QVBoxLayout()) * Call to this module in another module * app = QApplication(sys.argv) window =

Re: PySide 1.2.2 setMaxWidth and AeroSnap

2014-11-16 Thread Juan Christian
On Sun Nov 16 2014 at 3:46:40 PM Vincent Vande Vyvre < vincent.vande.vy...@telenet.be> wrote: > > No probleme with PyQt but I think this is a window manager question. > Window, gnome, KDE, Mate, ... > > > If your widget is a QMainWindow or a QDialog add a size grip: > > self.setSizeGripEna

How to access Qt components loaded from file?

2014-11-18 Thread Juan Christian
I have this simple code that load any Qt Designer .UI file: from PySide.QtCore import QFile from PySide.QtGui import QApplication from PySide.QtUiTools import QUiLoader def loadui(file_name): loader = QUiLoader() uifile = QFile(file_name) uifile.open(QFile.ReadOnly) ui = loader.load(uifile) uifi

Re: How to access Qt components loaded from file?

2014-11-18 Thread Juan Christian
Many thanks, worked. The only problem now is that I don't have auto-complete for anything, because of this approach... I'll have to check the doc more regularly. ^^ On Tue Nov 18 2014 at 10:48:44 AM Vincent Vande Vyvre < vincent.vande.vy...@telenet.be> wrote: > Le 18/

Re: How to access Qt components loaded from file?

2014-11-18 Thread Juan Christian
syntax is correct, I don't know why it failed, the btn is in the Form too, it's a QPushButton. The test func is just a simple func that returns a random text. On Tue Nov 18 2014 at 11:08:48 AM Juan Christian wrote: > Many thanks, worked. The only problem now is that I don't have

Re: How to access Qt components loaded from file?

2014-11-18 Thread Juan Christian
> > You can't have a slot like this: > > MainWindow.btn.clicked.connect(MainWindow.txtbox.setText(test())) > > because that's mean: "connect to the return of > MainWindow.txtbox.setText(test())" and it's not possible at this stage > of your program. > > Use instead a function: > > MainWindow.btn.cl

Re: How to access Qt components loaded from file?

2014-11-19 Thread Juan Christian
app.exec_() loop, so I need to have a trigger configured that will be called in a defined interval, then inside this trigger I configure the "set_avatar", "set_text", "set_btn_link", etc, is that right? On Tue Nov 18 2014 at 9:37:21 PM Chris Angelico wrote: >

Re: How to access Qt components loaded from file?

2014-11-19 Thread Juan Christian
onents just for testing.This shouldn't be normal, right? Am I doing something wrong? On Wed Nov 19 2014 at 7:00:43 PM Rob Gaddi wrote: > On Wed, 19 Nov 2014 20:47:31 + > Juan Christian wrote: > > > Let's say that I want to call the site in a 5min interval. I'm cur

Re: How to access Qt components loaded from file?

2014-11-20 Thread Juan Christian
Thu Nov 20 2014 at 1:43:21 PM Michael Torrie wrote: > On 11/19/2014 07:53 PM, Juan Christian wrote: > > Thanks, it's working using QTimer. The thing is that whenever the program > > is going to do something, in my case, draw a new QGroupBox with some > > components inside a

Re: How to access Qt components loaded from file?

2014-11-20 Thread Juan Christian
10:57 AM, Juan Christian wrote: > > So, I need to study QThreads, do you know any book or video-course that > > talks about this matter? I've seen the tutorials that you pointed but I > > need a "wider" approach regarding QThreads to really understand it and > > a

Re: How to access Qt components loaded from file?

2014-11-20 Thread Juan Christian
Another problem is that this doc doesn't use Python. On Thu Nov 20 2014 at 5:36:37 PM Juan Christian wrote: > Yes, I read everything and saw that stackoverlfow on Google too. I'm > reading this doc: http://pyqt.sourceforge.net/Docs/PyQt4/classes.html > > I just asked for a

Re: How to access Qt components loaded from file?

2014-11-20 Thread Juan Christian
**Back to the list So, as I said the PyQt doc is using C o.0 Yes, I read the tutorials, I'll google for some books and things related. On Tue Nov 18 2014 at 10:48:44 AM Vincent Vande Vyvre < vincent.vande.vy...@telenet.be> wrote: > Le 18/11/2014 13:18, Juan Christian a écrit : &

Re: How to access Qt components loaded from file?

2014-11-20 Thread Juan Christian
On Thu Nov 20 2014 at 7:07:10 PM Mark Lawrence wrote: > > You also need to study the difference between top posting, interspersed > posting and bottom posting. The second and third are very much the > prefered styles here. > Yes I know, but I'm using the new Google Inbox, and I limited to what I

Re: How to access Qt components loaded from file?

2014-11-20 Thread Juan Christian
On Thu Nov 20 2014 at 8:20:29 PM alister wrote: > > Then either do the necessary work (you have just proven you can)or find a > better way of communicating with this news group(NNTP or the mailing > list), otherwise you may find a number of good people simply ignore your > posts. > > While you are

Re: How to access Qt components loaded from file?

2014-11-21 Thread Juan Christian
On Fri Nov 21 2014 at 8:05:30 AM alister wrote: > All of this VVV > [...] I'm sorry, I didn't know, but it seems there isn't any option to remove that in the Inbox (new Gmail), do you guys use any special program or client to use list? -- https://mail.python.org/mailman/listinfo/python-lis

Python Signal/Slot + QThred code analysis

2014-11-23 Thread Juan Christian
This is a continuation of my other topic "How to access Qt components loaded from file", it was getting big and the focus changed completely, the real question there was already answered, and we were talking about signal/slot, QThred and other things. So, I read on the web (didn't find books talki

Re: Python Signal/Slot + QThred code analysis

2014-11-24 Thread Juan Christian
Oh, and this code I made by myself, I didn't copy. That's why I want you guys to see if everything is ok. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Signal/Slot + QThred code analysis

2014-11-25 Thread Juan Christian
On Mon Nov 24 2014 at 11:56:31 PM Michael Torrie wrote: Looks alright. Does it work? Well, no =/ First I had to remove the multiple inheritance, because Qt doesn't allow that, so I removed the QObject. Second, just for testing I'm calling the module directly using: timer = QTimer() timer.start

Fwd: Python Signal/Slot + QThred code analysis

2014-11-25 Thread Juan Christian
On Tue Nov 25 2014 at 1:42:24 PM MRAB wrote: I think that the problem there is that strings don't have an __exit__ method. I don't understand what you said, what you mean by that? =/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-25 Thread Juan Christian
So guys, I had to change to approach, I read that using Qt I can't do multiple inheritance. So my Outpost class can't be like 'Outpost(QObject, QThred)'. I had to change the code a bit: from PySide.QtCore import QObject, QThread, Signal import requests import bs4 class Worker(QThread): def __ini

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-26 Thread Juan Christian
On Wed Nov 26 2014 at 1:16:11 AM Michael Torrie wrote: You're going to have to post a complete, but small, code example, I think. Working with fragments of code is very difficult if not impossible to assist with, resulting in obtuse, obvious replies from folks. As asked, here is all the code: ou

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Juan Christian
On Thu Nov 27 2014 at 2:12:40 AM Michael Torrie wrote: Hmm, I hit a wall. There's no main.ui file. Can you rework your code so that you have a single file (plus a separate ui file that's okay), that simulates the url request, that I can execute easily. As you asked, here it's, everything on one m

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Juan Christian
On Thu Nov 27 2014 at 8:53:16 PM Michael Torrie wrote: Hope this helps. Here's complete working code, minus the .ui file: http://pastebin.com/VhmSFX2t Thanks, I'll just repost the code on pastebin with a NEVER expire time and UNLISTED, so that it can be of some help for others here in the mailist

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Juan Christian
On Thu Nov 27 2014 at 9:16:38 PM Juan Christian wrote: I'll read the code thoroughly and reply to you if I find something strange, many thanks! So, instantly I found one issue, you said that this code won't block the GUI, only the thread event loop, but if we keep moving the window

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-28 Thread Juan Christian
On Fri Nov 28 2014 at 2:07:32 AM Michael Torrie wrote: Okay, here's a reworking of the code that invokes a new QThread instance each time. Note the QThread instance has to be bound to the MainWindow so that it won't be destroyed when it goes out of scope. Also the Worker thread sends a signal with

Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
I know about the schedule modules and such but they work in situations like 'run this in a X hours/minutes/seconds interval', I already have my code in a while loop with sleep (it's a bit ugly, I'l change to a scheduler soon). What I really want is, for example: 24/7/365 9:00 AM -> Start 11:59 PM

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
On Wed Dec 17 2014 at 5:45:31 PM John Gordon wrote: You could write a separate program whose only job is to send a STOP or CONTINUE signal to your main program, and then run that program from a scheduler. The standard system "kill" command would probably work for this purpose, assuming you have a

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
Ops, sorry. It's: 9:00 AM ~ 11:59 PM -> Running ... and not 9:00 AM ~ 11:50 PM -> Running -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
On Wed Dec 17 2014 at 6:25:39 PM John Gordon wrote: If you want to solve your problem entirely within Python, look at the "scheduler" module. (Although even this isn't a complete solution, as you still have to make sure the program is running in the first place...) My script is running fine, Win

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
On Wed Dec 17 2014 at 7:35:10 PM Chris Angelico wrote: time.time() % 86400 That's number of seconds since midnight UTC, ranging from 0 up to 86399. (I've no idea what 64562 would mean. That's an awfully big number for a single day.) If you offset that before calculating, you can get that in

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
On Wed Dec 17 2014 at 9:40:52 PM Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > Juan Christian wrote: > > > I know about the schedule modules and such but they work in situations > > like 'run this in a X hours/minutes/seconds interval'

Re: Is there a way to schedule my script?

2014-12-18 Thread Juan Christian
On Wed Dec 17 2014 at 11:04:16 PM Juan Christian wrote: Thanks. That was a great answer. I'll redo my code. It's running and will only run in my Docker container (Ubuntu Server 14.04.1) so I'll use cron. Indeed, currently I'm using something like that: while True: if 9 &

Re: Is there a way to schedule my script?

2014-12-18 Thread Juan Christian
Thanks, using cron here. -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to schedule my script?

2014-12-18 Thread Juan Christian
On Thu Dec 18 2014 at 2:24:46 PM Ian Kelly wrote: What kind of random distribution of the time between executions are you looking for? A random sleep lends itself easily to a uniform distribution. The latter approach that you describe would result in a geometric distribution. I'm looking for a ra

Re: Is there a way to schedule my script?

2014-12-18 Thread Juan Christian
On Thu Dec 18 2014 at 11:35:11 PM Chris Angelico wrote: Why does this matter to you? Why am I getting the feeling that I should not be helping you? Because that's what my project is all about, I need to fake some 'human actions' inside the network to do some benchmarks and test internal stuffs. T

smtplib not working as expected

2014-12-26 Thread Juan Christian
I have the following test code: import smtplib fromaddr = 'mksfjnsfji4433j4...@bk.ru' toaddrs = ['mksfjnsfji4433j4...@bk.ru'] msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromaddr, ", ".join(toaddrs))) msg = msg + 'test' print("Message length is " + repr(len(msg))) server = smtplib.SMTP('sm

Re: smtplib not working as expected

2014-12-26 Thread Juan Christian
On Fri Dec 26 2014 at 11:07:30 PM MRAB wrote: According to the docs, if you let the port parameter default to 0, it'll use port 465. I tested with my ISP. Using port 465, it failed. Using the default, it succeeded. So, I changed the code how you said, but still not working. Code: import smt

Re: smtplib not working as expected

2014-12-27 Thread Juan Christian
On Sat Dec 27 2014 at 1:23:12 AM Vincent Vande Vyvre < vincent.vande.vy...@telenet.be> wrote: Try with the TLS: Many thanks, working like a charm, code: server = smtplib.SMTP('smtp.mail.ru') server.starttls() server.ehlo() server.login('SENDER EMAIL GOES HERE', 'PASSWD GOES HERE') server.sendmail

Re: smtplib not working as expected

2014-12-27 Thread Juan Christian
Denis it was already resolved, check my message above. ^^ -- https://mail.python.org/mailman/listinfo/python-list

OpenID + Python 3.4

2015-03-24 Thread Juan C.
I was looking on the Internet regarding the use of OpenID in Python apps but I only found Flask/web related stuff. Is there any module that provides OpenID implementation for desktop level? I currently have a Python desktop script that needs to authenticate in a OpenID server, but I don't know ho

Save session Selenium PhantomJS

2015-03-26 Thread Juan C.
Objective: Save the browser session/cookies to share them in multiples script execution. I currently have this working using ChromeDriver: chrome_options = Options() chrome_options.add_argument("user-data-dir=" + os.path.dirname(sys.argv[0])) browser = webdriver.Chrome(chrome_options=chrome_optio

Re: Save session Selenium PhantomJS

2015-03-28 Thread Juan C.
Issue resolved. My code was working, the problem was PhantomJS 2.0, used 1.9.8 and now I have the 'cookies.txt' file as expected! -- https://mail.python.org/mailman/listinfo/python-list

Re: Best practices for writing jobs run through cron

2015-07-06 Thread Juan Gutierrez
Hi WU, It sounds like you want to add a lot of helpful transparency into your task runner which is awesome, however, have you taken a look at Celery? http://celery.readthedocs.org/en/latest/userguide/periodic-tasks.html Celery also comes with a monitoring tool (Flower - http://celery.readthedo

PySide 1.2.2 and Python 3.4.1 - "native Qt signal is not callable"

2014-08-30 Thread Juan Christian
Hello everyone, I have a question regarding PySide 1.2.2 and Python 3.4.1 I have this code that I made following a Python tutorial , mine is a bit different because the tutorial is a bit old, and I'm trying to use Python n

Re: PySide 1.2.2 and Python 3.4.1 - "native Qt signal is not callable"

2014-08-30 Thread Juan Christian
Yes, indeed, my code was a mess! I did a clear code here (http://pastebin.com/XsVLSVky) that's fully working, thanks! 2014-08-30 16:05 GMT-03:00 MRAB : > On 2014-08-30 14:35, Juan Christian wrote: > >> Hello everyone, I have a question regarding PySide 1.2.2 and Python 3.4.1

Error reading from 'urllib.request' and iterating over lines

2014-08-30 Thread Juan Christian
My code: http://pastebin.com/CBgVvT4n Line 25 returns the text correctly [1], but it seems not being parsed to line 27-28 correctly. This is just a training program that I'm doing following some books/tutorials/docs, nothing special. [1] Output from line 25: http://pastebin.com/HSbAtDHQ Python 3

Re: Python is going to be hard

2014-09-03 Thread Juan Christian
I'm learning Python using this mailist, and the Tutor mailist, reading the docs and watching this course, Python Fundamentals ( http://www.pluralsight.com/training/Courses/TableOfContents/python-fundamentals ). Python is really easy and useful, OP don't blame the language because you didn't unders

Re: My backwards logic

2014-09-05 Thread Juan Christian
I made this code just for fun and learning, it's working, but would this be a good approach? Thanks. import sys def prime_checker(start = 1, stop = 1): for number in range(start, stop + 1): divisors = [(number % x) for x in range(1, number + 1)] print("{n} prime? {r}".format(n = number, r = (div

Re: My backwards logic

2014-09-05 Thread Juan Christian
What's [snip] ?? On Fri, Sep 5, 2014 at 3:48 PM, MRAB wrote: > On 2014-09-05 18:35, Juan Christian wrote: > >> I made this code just for fun and learning, it's working, but would this >> be a good approach? Thanks. >> >> import sys >> >>

Re: My backwards logic

2014-09-05 Thread Juan Christian
@Mark Lawrence: Sorry to ask, but what do you mean by "don't top post here, thanks.", I'm not familiar with mailing lists, so I may be doing something wrong and I don't know. On Fri, Sep 5, 2014 at 4:54 PM, Mark Lawrence wrote: > On 05/09/2014 20:34, Juan Christ

Re: Posting style: interleaved responses (was: My backwards logic)

2014-09-05 Thread Juan Christian
On Fri, Sep 5, 2014 at 11:37 PM, Ben Finney wrote: > Juan Christian writes: > > > @Mark Lawrence: Sorry to ask, but what do you mean by "don't top post > > here, thanks.", I'm not familiar with mailing lists, so I may be doing > > something wrong and

Best approach to get data from web page continuously

2014-09-18 Thread Juan Christian
I'll write a python (Python 3.4.1) script to fetch for new data (topics) from this page (http://steamcommunity.com/app/440/tradingforum) continuously. All the topics follow this structure: http://steamcommunity.com/app/440/tradingforum/TOPIC_ID/";> It will work like that: I'll get the last topic

Class Inheritance from different module

2014-09-20 Thread Juan Christian
I have the following structure: Third-party API installed via pip: steamapi / app.py consts.py core.py users.py [...] My script: test.py In the API, the module users.py has a class 'SteamUser' and I want to mimic it's usage on my code, like this: import steamapi [...] class User(Inheritance

Flask and Python 3

2014-09-23 Thread Juan Christian
I'm following a tutorial about Flask using Python 3.4.1, but I'm getting an error with a dead simple example: generator.py: from flask import Flask, render_template app = Flask(__name__) @app.route('/') def index(): return 'Hello World' @app.route('/blog/post/') def post(): return render_tem

Re: Flask and Python 3

2014-09-23 Thread Juan Christian
On Tue, Sep 23, 2014 at 6:48 PM, John Gordon wrote: > > > @app.route('/') > > def index(): > > return 'Hello World' > > As posted, your code is not indented. Is this literally how your code > looks? > > The mail screwed the indentation, it's indented in the file. > > {% block content %}{% endlb

Re: Flask and Python 3

2014-09-23 Thread Juan Christian
On Tue, Sep 23, 2014 at 8:46 PM, Terry Reedy wrote: > > Did you use tabs? They are more likely to disappear than spaces. Yes, I use tabs. On Tue, Sep 23, 2014 at 9:33 PM, Jon Ribbens wrote: > > app.run(port=8000, debug=True) might've made the problem easier to find. > I didn't learn debug wit

Re: Flask and Python 3

2014-09-24 Thread Juan Christian
On Wednesday, September 24, 2014, Chris “Kwpolska” Warrick < kwpol...@gmail.com> wrote: > Learning from videos is the worst thing you can do. Use the official > flask documentation at http://flask.pocoo.org/docs/0.10/quickstart/ — > it’s much friendlier than a video. > > Also, there is nothing to

Re: Flask and Python 3

2014-09-25 Thread Juan Christian
On Thu, Sep 25, 2014 at 2:28 PM, Chris “Kwpolska” Warrick < kwpol...@gmail.com> wrote: > > It doesn’t matter. Here, have some wisdom, as provided by the top > Google hit for “video tutorials suck”: > https://news.ycombinator.com/item?id=4565615 > Using your link, the first comment from user 'aroc

Re: Flask and Python 3

2014-09-25 Thread Juan Christian
On Thu, Sep 25, 2014 at 3:23 PM, Chris Angelico wrote: > Actually, what most of the comments are agreeing on is that videos > need their transcripts. Without them, they suck. Most videos don't > have any sort of transcript. Ergo, most videos suck. I'm not talking about "360p 3min kid's tutorial

Re: Programming for Everybody (Python)

2014-10-02 Thread Juan Christian
I recommend to everyone. Already took one of his courses on Coursera and he's amazing as a teacher. On Thu, Oct 2, 2014 at 4:24 PM, Seymore4Head wrote: > Starts in 3 days > Coursera.org > > About the Course > This course is specifically designed to be a first programming course > using the popul

Flask and Django

2014-10-10 Thread Juan Christian
So, I'm already familiar with Flask and I fell comfortable using it, but I see that no one uses it in "real business", everywhere I look regarding jobs and web dev, people always talk about Django, no one mentions Flask, no one uses Flask. I'm coding a personal tool using Flask but I feel the need

Re: Flask and Django

2014-10-12 Thread Juan Christian
Anyone? On Fri, Oct 10, 2014 at 7:22 PM, Juan Christian wrote: > So, I'm already familiar with Flask and I fell comfortable using it, but I > see that no one uses it in "real business", everywhere I look regarding > jobs and web dev, people always talk about Django, no

Re: Is there an easy way to control indents in Python

2014-10-14 Thread Juan Christian
Using PyCharm is easy: File > Settings > (IDE Settings) Editor > Smart Keys > Reformat on paste > choose "Reformat Block" On Tue, Oct 14, 2014 at 11:13 PM, ryguy7272 wrote: > I'm just learning Python. It seems like indents are EXTREMELY important. > I guess, since there are no brackets, everyt

Re: Is there an easy way to control indents in Python

2014-10-20 Thread Juan Christian
Ok, new code using ?: import sqlite3 db = sqlite3.connect('db.sqlite') def create_db(): db.execute(''' CREATE TABLE TOPICS( ID INT PRIMARY KEY NOT NULL, URL VARCHAR NOT NULL, AUTHOR VARCHAR NOT NULL, MESSAGE VARCHAR NOT NULL ); ''') def insert_db(_id, url, auth

Re: Is there an easy way to control indents in Python

2014-10-20 Thread Juan Christian
Sorry guys, my post about SQL was not meant to be here!!! On Mon, Oct 20, 2014 at 5:43 PM, MRAB wrote: > On 2014-10-20 20:04, Juan Christian wrote: > >> Ok, new code using ?: >> >> import sqlite3 >> >> db = sqlite3.connect('db.sqlite') >> >

automate commands to an .exe console program through python

2011-12-12 Thread Juan Perez
7;t comunicate with the program and even i can't maintain it opened more than a few seconds. If I open a program like notepad.exe it remains opened but when I try to comunicate with the stdin pipe just don't write anything to the program. Someone has any idea about that, Thanks an

Re: automate commands to an .exe console program through python

2011-12-13 Thread Juan Perez
o a windows cmd console. Do you know if is that possible by piping standard input? I've tried but with no results. What I'd need is open a new windows console get the pid and send messages to it through stdin pipe. But I've been unable to do it so far. Thanks, Juan 2011/12/12 Chr

Re: automate commands to an .exe console program through python

2011-12-13 Thread Juan Perez
an get the focus on it? I'm worried that pexpect is a too dificult way... Thanks, Juan 2011/12/13 Tim Golden > On 13/12/2011 11:21, Juan Perez wrote: > >> Well, if developers have to change something to the code, I'd continue >> with autoit, since is closer to

Re: automate commands to an .exe console program through python

2011-12-14 Thread Juan Perez
mands Quite tricky stuff if it is possible to do something like that in Python I can struggle a bit more, if not better leave right now before wasting time with nonsenses... Thanks, Juan 2011/12/13 Chris Angelico > On Tue, Dec 13, 2011 at 11:35 PM, Juan Perez wrote: > > My problem

Re: merits of Lisp vs Python

2006-12-11 Thread Juan R.
[EMAIL PROTECTED] ha escrito: > - Lisp is hard to learn (because of all those parenthesis) I cannot understand why. It is like if you claim that packaging things in boxes is difficult to learn. HTML and XML have more brackets than LISP (usually double) for structuring data and everyone has learn

Re: merits of Lisp vs Python

2006-12-11 Thread Juan R.
[EMAIL PROTECTED] ha escrito: > Juan R. wrote: > > [EMAIL PROTECTED] ha escrito: > > > - Lisp is hard to learn (because of all those parenthesis) > > > > I cannot understand why. It is like if you claim that packaging things > > in boxes is difficult to l

Re: merits of Lisp vs Python

2006-12-11 Thread Juan R.
Kay Schluehr ha escrito: > Note also that a homogenous syntax is not that important when > analyzing parse trees ( on the contrary, the more different structures > the better ) but when synthesizing new ones by fitting different > fragments of them together. Interesting, could you provide some il

Re: merits of Lisp vs Python

2006-12-11 Thread Juan R.
Harry George ha escrito: > Really? Given its small base, the percentage increases in Ruby use > (for any reason) can look quite impressive. I've see data suggesting > Ruby is replacing Perl and maybe Java. But I've yet to see data which > shows people dropping Python and moving to Ruby. Where do

  1   2   >