Re: use Python to post image to Facebook
On Monday, 9 April 2012 20:24:54 UTC-7, CM wrote: > Shot in the dark here: has any who reads this group been successful > with getting Python to programmatically post an image to Facebook? > > I've tried using fbconsole[1] and facepy[2], both of which apparently > work fine for their authors and others and although I have an > authorization code, publish permissions, a Facebook app, I get back > these unhelpful errors when I try this (like "an unknown error > occurred"). > > If anyone has been able to do this, maybe you can help me figure out > what I am doing wrong. Hi, I am not sure, but have a similar question. How can I post (upload) an image to google images and return the resulting page..? In python? If you can help I would appreciate it ever so much, Dave:) -- http://mail.python.org/mailman/listinfo/python-list
RE: Jython and PYTHONSTARTUP
> Does Jython 2.5 honour the PYTHONSTARTUP environment variable? According > to my testing, it doesn't. > > There used to be a page describing the differences between Jython and > CPython here: > > http://www.jython.org/docs/differences.html > > but it appears to have been eaten by the 404 Monster. Maybe the outdated version will help: http://www.jython.org/archive/21/docs/differences.html For your specific question I see this in the docs, """ The Interactive Startup File When you use Python interactively, it is frequently handy to have some standard commands executed every time the interpreter is started. You can do this by setting an environment variable named PYTHONSTARTUP to the name of a file containing your start-up commands. This is similar to the .profile feature of the Unix shells. This file is only read in interactive sessions, not when Python reads commands from a script, and not when /dev/tty is given as the explicit source of commands (which otherwise behaves like an interactive session). It is executed in the same namespace where interactive commands are executed, so that objects that it defines or imports can be used without qualification in the interactive session. You can also change the prompts sys.ps1 and sys.ps2 in this file. If you want to read an additional start-up file from the current directory, you can program this in the global start-up file using code like if os.path.isfile('.pythonrc.py'): execfile('.pythonrc.py'). If you want to use the startup file in a script, you must do this explicitly in the script: import os filename = os.environ.get('PYTHONSTARTUP') if filename and os.path.isfile(filename): execfile(filename) """ http://www.jython.org/docs/tutorial/interpreter.html?highlight=pythonstartup Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 -- This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email. -- http://mail.python.org/mailman/listinfo/python-list
Re: bdist_wininst [was: Custom build of Python]
> > INFO: Can't locate Tcl/Tk libs and/or headers > install Tcl/Tk library -- http://mail.python.org/mailman/listinfo/python-list
Re: Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
In article , Kevin Walzer wrote: >On 6/11/12 8:01 AM, Wolfgang Keller wrote: >> Tkinter is imho honestly the very best "argument" if you want to make >> potential new users turn their backs away from Python for good. Just >> show them one GUI implemented with it and, hey, wait, where are you >> running to... > >Yes, Tkinter GUI's are very ugly. > >http://www.codebykevin.com/phynchronicity-running.png I looked it up. What you find ugly, I find unconfusing and clear. If I compare it to usual on the web, it is the difference between a waterfall side and an airport where the personell is on strike. (Oh the noise, the noise is unbearable!). I have not, nor intend to write gui things in Python, I just give an impression. [ I want my gui's to be functional, not beautiful. ] > >http://www.codebykevin.com/quickwho-main.png >-- >Kevin Walzer Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list
emded revision control in Python application?
Hello, I have an application that would benefit from collaborative working. Over time users construct a "data environment" which is a number of files in JSON format contained in a few directories (in the future I'll probably place these in a zip so the environment is contained within a single file). At the moment there is one individual constructing the data environment, and me occasionally applying corrections after being e-mailed the files. But in the future there might be several individuals in various locations. As a minimum requirement I need to embed some sort of version control, so that changes committed by one individual will be seen in the local environments of the others. Some of the work involves editing graphs which have restrictions on their structure. In this case it would be useful for edits to be committed / seen in real time. The users will not be particularly technical, so the version control will have to happen relatively quietly in the background. My immediate thoughts are to (somehow) embed Mercurial or Subversion. It would certainly be useful to be able to revert to a previous version of the data environment if an individual does something silly. But I'm not actually convinced that this is the whole solution for collaborative working. Any advice regarding the embedding of a version control system or alternative approaches would be appreciated. I haven't tried anything like this before. The desktop application is written in Python (2.6) with a wxPython (2.8) GUI. Given the nature of the application / data the machines involved might be locally networked but without web access (if this makes a difference). TIA. Duncan -- http://mail.python.org/mailman/listinfo/python-list
Re: emded revision control in Python application?
On 6/22/2012 8:58 AM duncan smith said... Hello, I have an application that would benefit from collaborative working. Over time users construct a "data environment" which is a number of files in JSON format contained in a few directories You don't say what your target platform is, but on linux I've done some testing with python-fuse that allows interception on file access to take whatever actions you like, in your case archive prior upon write. Might be worth a look. Emile -- http://mail.python.org/mailman/listinfo/python-list
RE: emded revision control in Python application?
>I have an application that would benefit from collaborative > working. Over time users construct a "data environment" which is a > number of files in JSON format contained in a few directories (in the > future I'll probably place these in a zip so the environment is > contained within a single file). At the moment there is one individual > constructing the data environment, and me occasionally applying > corrections after being e-mailed the files. But in the future there > might be several individuals in various locations. > > As a minimum requirement I need to embed some sort of version control, > so that changes committed by one individual will be seen in the local > environments of the others. Some of the work involves editing graphs > which have restrictions on their structure. In this case it would be > useful for edits to be committed / seen in real time. The users will not > be particularly technical, so the version control will have to happen > relatively quietly in the background. > > My immediate thoughts are to (somehow) embed Mercurial or Subversion. It > would certainly be useful to be able to revert to a previous version of > the data environment if an individual does something silly. But I'm not > actually convinced that this is the whole solution for collaborative > working. Any advice regarding the embedding of a version control system > or alternative approaches would be appreciated. I haven't tried anything > like this before. The desktop application is written in Python (2.6) > with a wxPython (2.8) GUI. Given the nature of the application / data > the machines involved might be locally networked but without web access > (if this makes a difference). TIA. Why not just stick the configs (binary blob or JSON string) in something like a sqlite database and store that database centrally accessible[1]? Something like subversion might be overkill. A table like the following would work if you want to track each file separately: table_name( revision_number, file/config name, data, username, timestamp ). Otherwise, if you want to track "environments" and not files: table_name( revision_number, data, username, timestamp ). Where revision number can be a sequence used to track / change current configuration. I recommend storing each file separately in the database. [1] http://www.sqlite.org/faq.html#q5 Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 -- This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email. -- http://mail.python.org/mailman/listinfo/python-list
A question on os.path.join in POSIX systems
Hi all, There is a comment on posixpath.join saying "Ignore the previous parts if a part is absolute." Is this defined in the POSIX spec ? If yes, then can someone please point me to a link where I can read about it ? Kushal -- http://fedoraproject.org http://kushaldas.in -- http://mail.python.org/mailman/listinfo/python-list
Re: emded revision control in Python application?
On 22/06/12 17:42, Emile van Sebille wrote: On 6/22/2012 8:58 AM duncan smith said... Hello, I have an application that would benefit from collaborative working. Over time users construct a "data environment" which is a number of files in JSON format contained in a few directories You don't say what your target platform is, but on linux I've done some testing with python-fuse that allows interception on file access to take whatever actions you like, in your case archive prior upon write. Might be worth a look. Emile I develop on Linux, but most users would be running some flavour of Windows. Initially I'd like to get something up and running that would allow me to collaborate from an Ubuntu box at home with someone using a Windows machine (not sure which version) in an office at the University of Manchester. The most likely end users would (probably) be running Windows machines on a local network with no internet access. I expect it would generally be possible to have an always-on server, but I'm also thinking about peer to peer style communication (information might not always be completely available, but it's better than being totally unaware of changes being made by others). I don't have much experience getting applications to communicate across a network, particularly in a reasonably secure fashion. Someone I know also suggested RabbitMQ. Any pointers that help me to reduce the options to a manageable number of candidates will be appreciated. A shallow learning curve would also be good (given that ATM this is an idea I want to try out rather than paid work). I am looking at fuse at the moment. Thanks. Duncan -- http://mail.python.org/mailman/listinfo/python-list
Re: A question on os.path.join in POSIX systems
Kushal Das writes: > There is a comment on posixpath.join saying "Ignore the previous parts > if a part is absolute." It means: "join(something, abspath) == abspath" whenever "abspath" is an absolute path. > Is this defined in the POSIX spec ? If yes, then can someone please > point me to a link where I can read about it ? It has nothing to do with POSIX. It just describes a senseful behavior of "join". -- http://mail.python.org/mailman/listinfo/python-list
Re: emded revision control in Python application?
On 6/22/2012 11:19 AM duncan smith said... On 22/06/12 17:42, Emile van Sebille wrote: On 6/22/2012 8:58 AM duncan smith said... Hello, I have an application that would benefit from collaborative working. Over time users construct a "data environment" which is a number of files in JSON format contained in a few directories So, will the users modify their local environment and you'd push the revisions to a known location for redistribution? How might peer-to-peer work? How would you know which peers get the change, or would all peers get the change? I've been working with rpyc (in as much spare time as I can manage) on some similar sounding issues and am now settling on a central system which provides convenient administration and potential relaying or pulling. See http://rpyc.sourceforge.net/ I just tested my in-process development status and find 64 remote machines up and 5 non-responsive which in my case are likely machines that are not yet configured properly. As this has been on the back burner the past two months I'm pleased with how it's fared in the face of neglect. At least with rpyc (which does have a low learning curve) you'll be fully in python. Emile You don't say what your target platform is, but on linux I've done some testing with python-fuse that allows interception on file access to take whatever actions you like, in your case archive prior upon write. Might be worth a look. Emile I develop on Linux, but most users would be running some flavour of Windows. Initially I'd like to get something up and running that would allow me to collaborate from an Ubuntu box at home with someone using a Windows machine (not sure which version) in an office at the University of Manchester. The most likely end users would (probably) be running Windows machines on a local network with no internet access. I expect it would generally be possible to have an always-on server, but I'm also thinking about peer to peer style communication (information might not always be completely available, but it's better than being totally unaware of changes being made by others). I don't have much experience getting applications to communicate across a network, particularly in a reasonably secure fashion. Someone I know also suggested RabbitMQ. Any pointers that help me to reduce the options to a manageable number of candidates will be appreciated. A shallow learning curve would also be good (given that ATM this is an idea I want to try out rather than paid work). I am looking at fuse at the moment. Thanks. Duncan -- http://mail.python.org/mailman/listinfo/python-list
Re: using SQLalchemy
On 21/06/2012 11:50, andrea crotti wrote: We have a very chaotic database (on MySql) at the moment, with for I'm trying to use SQLalchemy and it looks absolutely great, but in general as a policy we don't use external dependencies.. That's a very foolish general policy, a lot of the power of python is in the huge array of excellent third party libraries and frameworks, but each to their own... To try to do an exception in this case: - are there any problems with SQLalchemy on Windows? No. - are there any possibly drawbacks of using SQLalchemy instead of the MySqlDB interface? You won't be using it instead of mysqldb, you'll be using it as a layer over mysqldb. For the second point I guess that we might have a bit less fine tuning, Not so, any tuning you can do direct against the dbapi driver can still be done through SQLAalchemy. Any other possible issue? If you have problems, I'd suggest asking on the sqlalchemy mailing list: http://groups.google.com/group/sqlalchemy cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- http://mail.python.org/mailman/listinfo/python-list
RE: using SQLalchemy
> > We have a very chaotic database (on MySql) at the moment, with for > > I'm trying to use SQLalchemy and it looks absolutely great, but in > > general as a policy we don't use external dependencies.. > > That's a very foolish general policy, a lot of the power of python is in > the huge array of excellent third party libraries and frameworks, but > each to their own... That applies to Perl, Python, Java and probably most major languages. I do not know about you, but I do not want to be writing everything from scratch and language developers have better things to do than implementing a dozen (or more) major libraries like lxml and xlwt just to name a few. For that matter, I do not think mysqldb is a built-in Python package. :) Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 -- This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email. -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
On 6/22/2012 11:53 AM, Albert van der Horst wrote: In article , Kevin Walzer wrote: On 6/11/12 8:01 AM, Wolfgang Keller wrote: Tkinter is imho honestly the very best "argument" if you want to make potential new users turn their backs away from Python for good. Just show them one GUI implemented with it and, hey, wait, where are you running to... Yes, Tkinter GUI's are very ugly. http://www.codebykevin.com/phynchronicity-running.png I looked it up. What you find ugly, I find unconfusing and clear. Kevin Walzer is a tk expert. Perhaps you missing the sarcastic irony in what he intended to be a refutation of Wolfgang Keller's comment ;-). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list
Re: Jython and PYTHONSTARTUP
On 21/06/12 02:26:41, Steven D'Aprano wrote: > There used to be a page describing the differences between Jython and > CPython here: > > http://www.jython.org/docs/differences.html > > but it appears to have been eaten by the 404 Monster. It has been moved to: http://www.jython.org/archive/21/docs/differences.html Hope this helps, -- HansM -- http://mail.python.org/mailman/listinfo/python-list
Re: emded revision control in Python application?
On 22/06/12 21:34, Emile van Sebille wrote: On 6/22/2012 11:19 AM duncan smith said... On 22/06/12 17:42, Emile van Sebille wrote: On 6/22/2012 8:58 AM duncan smith said... Hello, I have an application that would benefit from collaborative working. Over time users construct a "data environment" which is a number of files in JSON format contained in a few directories So, will the users modify their local environment and you'd push the revisions to a known location for redistribution? Yes. My rough idea is that each time a user opens the application it will connect to a server and download the current data environment (or preferably just the changes made since the application was last connected). Thus the user can start with an up to date environment. As the application is used to make changes to the data environment any changes are uploaded to the server for immediate redistribution to other connected application instances. Part of the application involves the construction of directed acyclic graphs. If I add an edge to a graph I want anyone else editing the same graph to be able to see the edge in something approaching real time so that cycles are avoided. (Being able to lock the file so that only one user can edit it concurrently might be another solution to this specific issue.) How might peer-to-peer work? How would you know which peers get the change, or would all peers get the change? All peers. I'm not sure about the peer to peer thing though. It would be better if the user could be guaranteed that the environment they see is current, rather than having changes residing on someone else's machine that happens to be switched off. I suppose the alternative must be that the information is sat on a server somewhere. I've been working with rpyc (in as much spare time as I can manage) on some similar sounding issues and am now settling on a central system which provides convenient administration and potential relaying or pulling. See http://rpyc.sourceforge.net/ I just tested my in-process development status and find 64 remote machines up and 5 non-responsive which in my case are likely machines that are not yet configured properly. As this has been on the back burner the past two months I'm pleased with how it's fared in the face of neglect. At least with rpyc (which does have a low learning curve) you'll be fully in python. Yes, it looks very interesting. Cheers. Duncan -- http://mail.python.org/mailman/listinfo/python-list
Re: Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
Albert van der Horst於 2012年6月22日星期五UTC+8下午11時53分01秒寫道: > In article , > Kevin Walzer wrote: > >On 6/11/12 8:01 AM, Wolfgang Keller wrote: > >> Tkinter is imho honestly the very best "argument" if you want to make > >> potential new users turn their backs away from Python for good. Just > >> show them one GUI implemented with it and, hey, wait, where are you > >> running to... > > > >Yes, Tkinter GUI's are very ugly. > > > >http://www.codebykevin.com/phynchronicity-running.png > > I looked it up. > > What you find ugly, I find unconfusing and clear. > If I compare it to usual on the web, it is the difference > between a waterfall side and an airport where the personell > is on strike. (Oh the noise, the noise is unbearable!). > I have not, nor intend to write gui things in Python, > I just give an impression. > > [ I want my gui's to be functional, not beautiful. ] > > > > > >http://www.codebykevin.com/quickwho-main.png > > >-- > >Kevin Walzer > > Groetjes Albert > > > > -- > -- > Albert van der Horst, UTRECHT,THE NETHERLANDS > Economic growth -- being exponential -- ultimately falters. > albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst I suggest you can use Python with QT to build some GUI and C++ with QT for similar jobs of the commercial versions in order to test the tools. Nowadays the GUI part is so cheap to build with so manny code generation tools, it is not the same as in the years before 2000. -- http://mail.python.org/mailman/listinfo/python-list
Re: use Python to post image to Facebook
Try to use http://pycurl.sourceforge.net/ I don't test it, but there is no problem interact with google services. 22.06.12 17:27, davecotef...@gmail.com пишет: On Monday, 9 April 2012 20:24:54 UTC-7, CM wrote: Shot in the dark here: has any who reads this group been successful with getting Python to programmatically post an image to Facebook? I've tried using fbconsole[1] and facepy[2], both of which apparently work fine for their authors and others and although I have an authorization code, publish permissions, a Facebook app, I get back these unhelpful errors when I try this (like "an unknown error occurred"). If anyone has been able to do this, maybe you can help me figure out what I am doing wrong. Hi, I am not sure, but have a similar question. How can I post (upload) an image to google images and return the resulting page..? In python? If you can help I would appreciate it ever so much, Dave:) -- http://mail.python.org/mailman/listinfo/python-list
Re: emded revision control in Python application?
On Jun 22, 8:58 pm, duncan smith wrote: > Hello, > I have an application that would benefit from collaborative > working. Over time users construct a "data environment" which is a > number of files in JSON format contained in a few directories (in the > future I'll probably place these in a zip so the environment is > contained within a single file). At the moment there is one individual > constructing the data environment, and me occasionally applying > corrections after being e-mailed the files. But in the future there > might be several individuals in various locations. > > As a minimum requirement I need to embed some sort of version control, > so that changes committed by one individual will be seen in the local > environments of the others. Some of the work involves editing graphs > which have restrictions on their structure. In this case it would be > useful for edits to be committed / seen in real time. The users will not > be particularly technical, so the version control will have to happen > relatively quietly in the background. > > My immediate thoughts are to (somehow) embed Mercurial or Subversion. It > would certainly be useful to be able to revert to a previous version of > the data environment if an individual does something silly. But I'm not > actually convinced that this is the whole solution for collaborative > working. Any advice regarding the embedding of a version control system > or alternative approaches would be appreciated. I haven't tried anything > like this before. The desktop application is written in Python (2.6) > with a wxPython (2.8) GUI. Given the nature of the application / data > the machines involved might be locally networked but without web access > (if this makes a difference). TIA. > > Duncan If you are looking at mercurial and subversion you may want to look at git also. >From http://en.wikipedia.org/wiki/Git_%28software%29#Implementation (quoting Linus Torvalds) --- In many ways you can just see git as a filesystem — it's content- addressable, and it has a notion of versioning, but I really really designed it coming at the problem from the viewpoint of a filesystem person (hey, kernels is what I do), and I actually have absolutely zero interest in creating a traditional SCM system. More details https://git.wiki.kernel.org/index.php/Git#Design - Of course its good to say upfront that git is mostly C+shell ie its not python There is gitpython http://packages.python.org/GitPython/0.1/tutorial.html but I know nothing about it -- http://mail.python.org/mailman/listinfo/python-list